@yuno-payments/yuno-sdk-react-native 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +621 -0
- package/android/build.gradle +131 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/com/yunosdkreactnative/YunoPaymentMethodsViewManager.kt +194 -0
- package/android/src/main/java/com/yunosdkreactnative/YunoSdkModule.kt +777 -0
- package/android/src/main/java/com/yunosdkreactnative/YunoSdkPackage.kt +24 -0
- package/ios/YunoSdk.m +65 -0
- package/ios/YunoSdk.podspec +48 -0
- package/ios/YunoSdk.swift +442 -0
- package/lib/commonjs/YunoPaymentMethods.js +145 -0
- package/lib/commonjs/YunoPaymentMethods.js.map +1 -0
- package/lib/commonjs/YunoSdk.js +455 -0
- package/lib/commonjs/YunoSdk.js.map +1 -0
- package/lib/commonjs/core/enums/CardFlow.js +26 -0
- package/lib/commonjs/core/enums/CardFlow.js.map +1 -0
- package/lib/commonjs/core/enums/YunoLanguage.js +58 -0
- package/lib/commonjs/core/enums/YunoLanguage.js.map +1 -0
- package/lib/commonjs/core/enums/YunoStatus.js +40 -0
- package/lib/commonjs/core/enums/YunoStatus.js.map +1 -0
- package/lib/commonjs/core/enums/index.js +27 -0
- package/lib/commonjs/core/enums/index.js.map +1 -0
- package/lib/commonjs/core/index.js +28 -0
- package/lib/commonjs/core/index.js.map +1 -0
- package/lib/commonjs/core/types/AndroidConfig.js +2 -0
- package/lib/commonjs/core/types/AndroidConfig.js.map +1 -0
- package/lib/commonjs/core/types/EnrollmentArguments.js +2 -0
- package/lib/commonjs/core/types/EnrollmentArguments.js.map +1 -0
- package/lib/commonjs/core/types/IosConfig.js +2 -0
- package/lib/commonjs/core/types/IosConfig.js.map +1 -0
- package/lib/commonjs/core/types/OneTimeTokenInfo.js +2 -0
- package/lib/commonjs/core/types/OneTimeTokenInfo.js.map +1 -0
- package/lib/commonjs/core/types/SeamlessArguments.js +6 -0
- package/lib/commonjs/core/types/SeamlessArguments.js.map +1 -0
- package/lib/commonjs/core/types/StartPayment.js +2 -0
- package/lib/commonjs/core/types/StartPayment.js.map +1 -0
- package/lib/commonjs/core/types/YunoConfig.js +6 -0
- package/lib/commonjs/core/types/YunoConfig.js.map +1 -0
- package/lib/commonjs/core/types/index.js +2 -0
- package/lib/commonjs/core/types/index.js.map +1 -0
- package/lib/commonjs/index.js +36 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/YunoPaymentMethods.js +138 -0
- package/lib/module/YunoPaymentMethods.js.map +1 -0
- package/lib/module/YunoSdk.js +448 -0
- package/lib/module/YunoSdk.js.map +1 -0
- package/lib/module/core/enums/CardFlow.js +20 -0
- package/lib/module/core/enums/CardFlow.js.map +1 -0
- package/lib/module/core/enums/YunoLanguage.js +52 -0
- package/lib/module/core/enums/YunoLanguage.js.map +1 -0
- package/lib/module/core/enums/YunoStatus.js +34 -0
- package/lib/module/core/enums/YunoStatus.js.map +1 -0
- package/lib/module/core/enums/index.js +4 -0
- package/lib/module/core/enums/index.js.map +1 -0
- package/lib/module/core/index.js +3 -0
- package/lib/module/core/index.js.map +1 -0
- package/lib/module/core/types/AndroidConfig.js +2 -0
- package/lib/module/core/types/AndroidConfig.js.map +1 -0
- package/lib/module/core/types/EnrollmentArguments.js +2 -0
- package/lib/module/core/types/EnrollmentArguments.js.map +1 -0
- package/lib/module/core/types/IosConfig.js +2 -0
- package/lib/module/core/types/IosConfig.js.map +1 -0
- package/lib/module/core/types/OneTimeTokenInfo.js +2 -0
- package/lib/module/core/types/OneTimeTokenInfo.js.map +1 -0
- package/lib/module/core/types/SeamlessArguments.js +2 -0
- package/lib/module/core/types/SeamlessArguments.js.map +1 -0
- package/lib/module/core/types/StartPayment.js +2 -0
- package/lib/module/core/types/StartPayment.js.map +1 -0
- package/lib/module/core/types/YunoConfig.js +2 -0
- package/lib/module/core/types/YunoConfig.js.map +1 -0
- package/lib/module/core/types/index.js +2 -0
- package/lib/module/core/types/index.js.map +1 -0
- package/lib/module/index.js +4 -0
- package/lib/module/index.js.map +1 -0
- package/package.json +142 -0
- package/src/YunoPaymentMethods.tsx +196 -0
- package/src/YunoSdk.ts +518 -0
- package/src/core/enums/CardFlow.ts +18 -0
- package/src/core/enums/YunoLanguage.ts +50 -0
- package/src/core/enums/YunoStatus.ts +32 -0
- package/src/core/enums/index.ts +3 -0
- package/src/core/index.ts +2 -0
- package/src/core/types/AndroidConfig.ts +17 -0
- package/src/core/types/EnrollmentArguments.ts +32 -0
- package/src/core/types/IosConfig.ts +17 -0
- package/src/core/types/OneTimeTokenInfo.ts +207 -0
- package/src/core/types/SeamlessArguments.ts +42 -0
- package/src/core/types/StartPayment.ts +59 -0
- package/src/core/types/YunoConfig.ts +55 -0
- package/src/core/types/index.ts +7 -0
- package/src/index.ts +17 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.YunoPaymentMethods = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
10
|
+
/**
|
|
11
|
+
* Event emitted when a payment method is selected or deselected.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Event emitted when an error occurs in the payment methods view.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Props for the YunoPaymentMethods component.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
// Native component interface
|
|
23
|
+
|
|
24
|
+
const LINKING_ERROR = `The package '@yuno/yuno-sdk-react-native' doesn't seem to be linked correctly for native views. Make sure:\n\n` + _reactNative.Platform.select({
|
|
25
|
+
ios: "- Run 'pod install'\n",
|
|
26
|
+
default: ''
|
|
27
|
+
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n' + '- The Yuno SDK is properly initialized\n';
|
|
28
|
+
|
|
29
|
+
// Get native module for event emitter
|
|
30
|
+
const YunoSdkNative = _reactNative.NativeModules.YunoSdk;
|
|
31
|
+
|
|
32
|
+
// Create event emitter
|
|
33
|
+
let eventEmitter = null;
|
|
34
|
+
if (YunoSdkNative) {
|
|
35
|
+
eventEmitter = new _reactNative.NativeEventEmitter(YunoSdkNative);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Require the native component
|
|
39
|
+
const NativeYunoPaymentMethodsView = (0, _reactNative.requireNativeComponent)('YunoPaymentMethodsView');
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* YunoPaymentMethods Component
|
|
43
|
+
*
|
|
44
|
+
* A React Native component that displays available payment methods using the native Yuno SDK.
|
|
45
|
+
* This component embeds the native `PaymentMethodListViewComponent` from the Yuno Android SDK.
|
|
46
|
+
*
|
|
47
|
+
* **Platform Support:**
|
|
48
|
+
* - ✅ Android (using Jetpack Compose)
|
|
49
|
+
* - ⚠️ iOS (coming soon)
|
|
50
|
+
*
|
|
51
|
+
* **Important:**
|
|
52
|
+
* - The Yuno SDK must be initialized before using this component
|
|
53
|
+
* - Requires a valid `checkoutSession` from the Yuno API
|
|
54
|
+
* - The component will automatically update the checkout session in the native SDK
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```tsx
|
|
58
|
+
* import { YunoPaymentMethods } from '@yuno/yuno-sdk-react-native';
|
|
59
|
+
*
|
|
60
|
+
* function MyPaymentScreen() {
|
|
61
|
+
* const [checkoutSession, setCheckoutSession] = useState('your_checkout_session_id');
|
|
62
|
+
* const [isMethodSelected, setIsMethodSelected] = useState(false);
|
|
63
|
+
*
|
|
64
|
+
* return (
|
|
65
|
+
* <YunoPaymentMethods
|
|
66
|
+
* checkoutSession={checkoutSession}
|
|
67
|
+
* countryCode="BR"
|
|
68
|
+
* onPaymentMethodSelected={(event) => {
|
|
69
|
+
* setIsMethodSelected(event.isSelected);
|
|
70
|
+
* }}
|
|
71
|
+
* onPaymentMethodError={(event) => {
|
|
72
|
+
* console.error('Error loading payment methods:', event.message);
|
|
73
|
+
* }}
|
|
74
|
+
* style={{ height: 400 }}
|
|
75
|
+
* />
|
|
76
|
+
* );
|
|
77
|
+
* }
|
|
78
|
+
* ```
|
|
79
|
+
*
|
|
80
|
+
* @remarks
|
|
81
|
+
* This component is similar to Flutter's `YunoPaymentMethods` widget.
|
|
82
|
+
* It provides a native UI experience consistent with apps that use the Yuno SDK directly.
|
|
83
|
+
*
|
|
84
|
+
* The native component handles:
|
|
85
|
+
* - Loading available payment methods
|
|
86
|
+
* - Displaying saved payment methods
|
|
87
|
+
* - User interactions and selections
|
|
88
|
+
* - Error states and loading indicators
|
|
89
|
+
*
|
|
90
|
+
* @public
|
|
91
|
+
*/
|
|
92
|
+
const YunoPaymentMethods = ({
|
|
93
|
+
checkoutSession,
|
|
94
|
+
countryCode,
|
|
95
|
+
onPaymentMethodSelected,
|
|
96
|
+
onPaymentMethodError,
|
|
97
|
+
style
|
|
98
|
+
}) => {
|
|
99
|
+
// Set up event listeners
|
|
100
|
+
(0, _react.useEffect)(() => {
|
|
101
|
+
if (!eventEmitter) {
|
|
102
|
+
console.warn(LINKING_ERROR);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const subscriptions = [];
|
|
106
|
+
|
|
107
|
+
// Listen for payment method selection events
|
|
108
|
+
if (onPaymentMethodSelected) {
|
|
109
|
+
const selectionListener = eventEmitter.addListener('onPaymentMethodSelected', event => {
|
|
110
|
+
onPaymentMethodSelected(event);
|
|
111
|
+
});
|
|
112
|
+
subscriptions.push(selectionListener);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Listen for error events
|
|
116
|
+
if (onPaymentMethodError) {
|
|
117
|
+
const errorListener = eventEmitter.addListener('onPaymentMethodError', event => {
|
|
118
|
+
onPaymentMethodError(event);
|
|
119
|
+
});
|
|
120
|
+
subscriptions.push(errorListener);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Cleanup listeners on unmount
|
|
124
|
+
return () => {
|
|
125
|
+
subscriptions.forEach(sub => {
|
|
126
|
+
if (sub && sub.remove) {
|
|
127
|
+
sub.remove();
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
}, [onPaymentMethodSelected, onPaymentMethodError]);
|
|
132
|
+
|
|
133
|
+
// Platform check
|
|
134
|
+
if (_reactNative.Platform.OS !== 'android') {
|
|
135
|
+
console.warn('YunoPaymentMethods: This component is currently only supported on Android. iOS support coming soon.');
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
return /*#__PURE__*/_react.default.createElement(NativeYunoPaymentMethodsView, {
|
|
139
|
+
checkoutSession: checkoutSession,
|
|
140
|
+
countryCode: countryCode,
|
|
141
|
+
style: style
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
exports.YunoPaymentMethods = YunoPaymentMethods;
|
|
145
|
+
//# sourceMappingURL=YunoPaymentMethods.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","LINKING_ERROR","Platform","select","ios","YunoSdkNative","NativeModules","YunoSdk","eventEmitter","NativeEventEmitter","NativeYunoPaymentMethodsView","requireNativeComponent","YunoPaymentMethods","checkoutSession","countryCode","onPaymentMethodSelected","onPaymentMethodError","style","useEffect","console","warn","subscriptions","selectionListener","addListener","event","push","errorListener","forEach","sub","remove","OS","createElement","exports"],"sourceRoot":"../../src","sources":["YunoPaymentMethods.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOsB,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,E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;;IAEA;IACA,IAAIN,oBAAoB,EAAE;MACxB,MAAMU,aAAa,GAAGlB,YAAY,CAACe,WAAW,CAC5C,sBAAsB,EACrBC,KAA8B,IAAK;QAClCR,oBAAoB,CAACQ,KAAK,CAAC;MAC7B,CACF,CAAC;MACDH,aAAa,CAACI,IAAI,CAACC,aAAa,CAAC;IACnC;;IAEA;IACA,OAAO,MAAM;MACXL,aAAa,CAACM,OAAO,CAAEC,GAAG,IAAK;QAC7B,IAAIA,GAAG,IAAIA,GAAG,CAACC,MAAM,EAAE;UACrBD,GAAG,CAACC,MAAM,CAAC,CAAC;QACd;MACF,CAAC,CAAC;IACJ,CAAC;EACH,CAAC,EAAE,CAACd,uBAAuB,EAAEC,oBAAoB,CAAC,CAAC;;EAEnD;EACA,IAAId,qBAAQ,CAAC4B,EAAE,KAAK,SAAS,EAAE;IAC7BX,OAAO,CAACC,IAAI,CACV,qGACF,CAAC;IACD,OAAO,IAAI;EACb;EAEA,oBACE1C,MAAA,CAAAc,OAAA,CAAAuC,aAAA,CAACrB,4BAA4B;IAC3BG,eAAe,EAAEA,eAAgB;IACjCC,WAAW,EAAEA,WAAY;IACzBG,KAAK,EAAEA;EAAM,CACd,CAAC;AAEN,CAAC;AAACe,OAAA,CAAApB,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.YunoSdk = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _enums = require("./core/enums");
|
|
9
|
+
const LINKING_ERROR = `The package '@y.uno/yuno-sdk-react-native' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
|
10
|
+
ios: "- Run 'pod install'\n",
|
|
11
|
+
default: ''
|
|
12
|
+
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
|
13
|
+
const YunoSdkNative = _reactNative.NativeModules.YunoSdk ? _reactNative.NativeModules.YunoSdk : new Proxy({}, {
|
|
14
|
+
get() {
|
|
15
|
+
throw new Error(LINKING_ERROR);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Event emitter for Yuno SDK events.
|
|
21
|
+
*/
|
|
22
|
+
const eventEmitter = new _reactNative.NativeEventEmitter(YunoSdkNative);
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Payment state event data.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Enrollment state event data.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Yuno SDK class for React Native.
|
|
34
|
+
*
|
|
35
|
+
* This class provides methods to initialize and interact with the Yuno payment SDK.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* import { YunoSdk, YunoLanguage, CardFlow } from '@y.uno/yuno-sdk-react-native';
|
|
40
|
+
*
|
|
41
|
+
* // Initialize the SDK
|
|
42
|
+
* await YunoSdk.initialize({
|
|
43
|
+
* apiKey: 'your_api_key',
|
|
44
|
+
* countryCode: 'US',
|
|
45
|
+
* yunoConfig: {
|
|
46
|
+
* lang: YunoLanguage.EN,
|
|
47
|
+
* cardFlow: CardFlow.STEP_BY_STEP,
|
|
48
|
+
* saveCardEnabled: true,
|
|
49
|
+
* },
|
|
50
|
+
* });
|
|
51
|
+
*
|
|
52
|
+
* // Listen to payment events
|
|
53
|
+
* YunoSdk.onPaymentStatus((state) => {
|
|
54
|
+
* if (state.token) {
|
|
55
|
+
* }
|
|
56
|
+
* });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
class YunoSdk {
|
|
60
|
+
static countryCode = null;
|
|
61
|
+
static language = null;
|
|
62
|
+
static isInitialized = false;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Marks the SDK as initialized without calling the native initialize method.
|
|
66
|
+
* This is useful when the SDK has been initialized from the native side (e.g., in MainActivity/YunoActivity).
|
|
67
|
+
*
|
|
68
|
+
* @param countryCode - ISO country code (e.g., 'US', 'BR', 'CO')
|
|
69
|
+
* @param language - Optional language setting (defaults to EN)
|
|
70
|
+
*
|
|
71
|
+
* @internal
|
|
72
|
+
*/
|
|
73
|
+
static markAsInitialized(countryCode = 'CO', language = _enums.YunoLanguage.EN) {
|
|
74
|
+
this.countryCode = countryCode;
|
|
75
|
+
this.language = language;
|
|
76
|
+
this.isInitialized = true;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Initializes the Yuno SDK with the required configuration.
|
|
81
|
+
*
|
|
82
|
+
* This method must be called before any other SDK operations.
|
|
83
|
+
*
|
|
84
|
+
* @param params - Configuration parameters for SDK initialization
|
|
85
|
+
* @param params.apiKey - Your Yuno API key
|
|
86
|
+
* @param params.countryCode - ISO country code (e.g., 'US', 'BR', 'CO')
|
|
87
|
+
* @param params.yunoConfig - Optional Yuno SDK configuration
|
|
88
|
+
* @param params.iosConfig - Optional iOS-specific configuration
|
|
89
|
+
* @param params.androidConfig - Optional Android-specific configuration
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```typescript
|
|
93
|
+
* await YunoSdk.initialize({
|
|
94
|
+
* apiKey: 'your_api_key_here',
|
|
95
|
+
* countryCode: 'CO',
|
|
96
|
+
* yunoConfig: {
|
|
97
|
+
* lang: YunoLanguage.ES,
|
|
98
|
+
* cardFlow: CardFlow.ONE_STEP,
|
|
99
|
+
* saveCardEnabled: true,
|
|
100
|
+
* keepLoader: false,
|
|
101
|
+
* isDynamicViewEnabled: true,
|
|
102
|
+
* },
|
|
103
|
+
* });
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
static async initialize(params) {
|
|
107
|
+
const {
|
|
108
|
+
apiKey,
|
|
109
|
+
countryCode,
|
|
110
|
+
yunoConfig = {},
|
|
111
|
+
iosConfig = {},
|
|
112
|
+
androidConfig = {}
|
|
113
|
+
} = params;
|
|
114
|
+
|
|
115
|
+
// Set default values
|
|
116
|
+
const config = {
|
|
117
|
+
lang: yunoConfig.lang ?? _enums.YunoLanguage.EN,
|
|
118
|
+
cardFlow: yunoConfig.cardFlow ?? _enums.CardFlow.ONE_STEP,
|
|
119
|
+
saveCardEnabled: yunoConfig.saveCardEnabled ?? false,
|
|
120
|
+
keepLoader: yunoConfig.keepLoader ?? false,
|
|
121
|
+
isDynamicViewEnabled: yunoConfig.isDynamicViewEnabled ?? false,
|
|
122
|
+
cardFormDeployed: yunoConfig.cardFormDeployed ?? false
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
// Store country code and language
|
|
126
|
+
this.countryCode = countryCode;
|
|
127
|
+
this.language = config.lang;
|
|
128
|
+
await YunoSdkNative.initialize(apiKey, countryCode, config, iosConfig, androidConfig);
|
|
129
|
+
this.isInitialized = true;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Starts an enrollment payment flow.
|
|
134
|
+
*
|
|
135
|
+
* @param params - Enrollment configuration
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```typescript
|
|
139
|
+
* await YunoSdk.enrollmentPayment({
|
|
140
|
+
* customerSession: 'customer_session_token',
|
|
141
|
+
* showPaymentStatus: true,
|
|
142
|
+
* countryCode: 'US',
|
|
143
|
+
* });
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
static async enrollmentPayment(params) {
|
|
147
|
+
this.checkInitialized();
|
|
148
|
+
const args = {
|
|
149
|
+
...params,
|
|
150
|
+
countryCode: params.countryCode ?? this.getCountryCode()
|
|
151
|
+
};
|
|
152
|
+
return YunoSdkNative.enrollmentPayment(args);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Starts a payment lite flow.
|
|
157
|
+
*
|
|
158
|
+
* @param params - Payment configuration
|
|
159
|
+
* @param countryCode - Optional country code override
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* ```typescript
|
|
163
|
+
* await YunoSdk.startPaymentLite({
|
|
164
|
+
* checkoutSession: 'checkout_session_token',
|
|
165
|
+
* methodSelected: {
|
|
166
|
+
* vaultedToken: 'token_12345',
|
|
167
|
+
* paymentMethodType: 'CARD',
|
|
168
|
+
* },
|
|
169
|
+
* showPaymentStatus: true,
|
|
170
|
+
* });
|
|
171
|
+
* ```
|
|
172
|
+
*/
|
|
173
|
+
static async startPaymentLite(params, countryCode) {
|
|
174
|
+
this.checkInitialized();
|
|
175
|
+
const code = countryCode ?? this.getCountryCode();
|
|
176
|
+
return YunoSdkNative.startPaymentLite(params, code);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Starts a full payment flow.
|
|
181
|
+
*
|
|
182
|
+
* @param showPaymentStatus - Whether to show payment status screen
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* ```typescript
|
|
186
|
+
* await YunoSdk.startPayment(true);
|
|
187
|
+
* ```
|
|
188
|
+
*/
|
|
189
|
+
static async startPayment(showPaymentStatus = true) {
|
|
190
|
+
this.checkInitialized();
|
|
191
|
+
return YunoSdkNative.startPayment(showPaymentStatus);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Continues a previously started payment.
|
|
196
|
+
*
|
|
197
|
+
* @param checkoutSession - The checkout session token
|
|
198
|
+
* @param countryCode - Optional country code (uses initialized country code if not provided)
|
|
199
|
+
* @param showPaymentStatus - Whether to show payment status screen
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```typescript
|
|
203
|
+
* await YunoSdk.continuePayment('checkout_session_token', 'CO', true);
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
static async continuePayment(checkoutSession, countryCode, showPaymentStatus = true) {
|
|
207
|
+
this.checkInitialized();
|
|
208
|
+
const code = countryCode ?? this.getCountryCode();
|
|
209
|
+
return YunoSdkNative.continuePayment(checkoutSession, code, showPaymentStatus);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Starts a seamless payment lite flow.
|
|
214
|
+
*
|
|
215
|
+
* @param params - Seamless payment configuration
|
|
216
|
+
* @returns Promise resolving to the payment status
|
|
217
|
+
*
|
|
218
|
+
* @example
|
|
219
|
+
* ```typescript
|
|
220
|
+
* const status = await YunoSdk.startPaymentSeamlessLite({
|
|
221
|
+
* checkoutSession: 'checkout_session_token',
|
|
222
|
+
* methodSelected: {
|
|
223
|
+
* vaultedToken: 'token_12345',
|
|
224
|
+
* paymentMethodType: 'CARD',
|
|
225
|
+
* },
|
|
226
|
+
* showPaymentStatus: true,
|
|
227
|
+
* countryCode: 'US',
|
|
228
|
+
* });
|
|
229
|
+
*
|
|
230
|
+
* ```
|
|
231
|
+
*/
|
|
232
|
+
static async startPaymentSeamlessLite(params) {
|
|
233
|
+
this.checkInitialized();
|
|
234
|
+
const args = {
|
|
235
|
+
...params,
|
|
236
|
+
countryCode: params.countryCode ?? this.getCountryCode()
|
|
237
|
+
};
|
|
238
|
+
const statusString = await YunoSdkNative.startPaymentSeamlessLite(args, this.getLanguage());
|
|
239
|
+
return statusString;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Hides the loading indicator.
|
|
244
|
+
*
|
|
245
|
+
* @example
|
|
246
|
+
* ```typescript
|
|
247
|
+
* await YunoSdk.hideLoader();
|
|
248
|
+
* ```
|
|
249
|
+
*/
|
|
250
|
+
static async hideLoader() {
|
|
251
|
+
this.checkInitialized();
|
|
252
|
+
return YunoSdkNative.hideLoader();
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Handles a deep link for payment resumption (iOS only).
|
|
257
|
+
*
|
|
258
|
+
* @param url - Deep link URL
|
|
259
|
+
*
|
|
260
|
+
* @example
|
|
261
|
+
* ```typescript
|
|
262
|
+
* import { Linking } from 'react-native';
|
|
263
|
+
*
|
|
264
|
+
* Linking.addEventListener('url', async (event) => {
|
|
265
|
+
* await YunoSdk.receiveDeeplink(event.url);
|
|
266
|
+
* });
|
|
267
|
+
* ```
|
|
268
|
+
*/
|
|
269
|
+
static async receiveDeeplink(url) {
|
|
270
|
+
if (_reactNative.Platform.OS !== 'ios') {
|
|
271
|
+
console.warn('receiveDeeplink is only available on iOS');
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
this.checkInitialized();
|
|
275
|
+
return YunoSdkNative.receiveDeeplink(url);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Gets the last One Time Token (OTT) that was generated.
|
|
280
|
+
* This is useful when the OTT event was emitted while React Native was paused
|
|
281
|
+
* (e.g., during a payment flow in a native activity).
|
|
282
|
+
*
|
|
283
|
+
* @returns Promise resolving to the last OTT token, or null if none exists
|
|
284
|
+
*
|
|
285
|
+
* @example
|
|
286
|
+
* ```typescript
|
|
287
|
+
* // After returning from a payment flow
|
|
288
|
+
* const lastOtt = await YunoSdk.getLastOneTimeToken();
|
|
289
|
+
* if (lastOtt) {
|
|
290
|
+
* // Use the token for payment processing
|
|
291
|
+
* }
|
|
292
|
+
* ```
|
|
293
|
+
*/
|
|
294
|
+
static async getLastOneTimeToken() {
|
|
295
|
+
return YunoSdkNative.getLastOneTimeToken();
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Gets the last OneTimeTokenInfo object stored by the SDK.
|
|
300
|
+
* This is useful for recovering token information after the app returns from the native payment UI.
|
|
301
|
+
*
|
|
302
|
+
* @returns Promise resolving to OneTimeTokenInfo or null if no token info is stored
|
|
303
|
+
*
|
|
304
|
+
* @example
|
|
305
|
+
* ```typescript
|
|
306
|
+
* const tokenInfo = await YunoSdk.getLastOneTimeTokenInfo();
|
|
307
|
+
* if (tokenInfo) {
|
|
308
|
+
* }
|
|
309
|
+
* ```
|
|
310
|
+
*/
|
|
311
|
+
static async getLastOneTimeTokenInfo() {
|
|
312
|
+
return YunoSdkNative.getLastOneTimeTokenInfo();
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Clears the last OTT tokens stored by the SDK.
|
|
317
|
+
* This is useful to ensure clean state before starting a new payment flow.
|
|
318
|
+
*
|
|
319
|
+
* Note: This is automatically called at the start of each payment/enrollment flow,
|
|
320
|
+
* but you can call it manually if needed.
|
|
321
|
+
*
|
|
322
|
+
* @example
|
|
323
|
+
* ```typescript
|
|
324
|
+
* // Clear OTT before starting a new payment
|
|
325
|
+
* await YunoSdk.clearLastOneTimeToken();
|
|
326
|
+
* ```
|
|
327
|
+
*/
|
|
328
|
+
static async clearLastOneTimeToken() {
|
|
329
|
+
return YunoSdkNative.clearLastOneTimeToken();
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Subscribes to payment status events.
|
|
334
|
+
*
|
|
335
|
+
* @param listener - Callback function to handle payment state changes
|
|
336
|
+
* @returns Subscription object with remove() method
|
|
337
|
+
*
|
|
338
|
+
* @example
|
|
339
|
+
* ```typescript
|
|
340
|
+
* const subscription = YunoSdk.onPaymentStatus((state) => {
|
|
341
|
+
* switch (state.status) {
|
|
342
|
+
* case YunoStatus.SUCCEEDED:
|
|
343
|
+
* break;
|
|
344
|
+
* case YunoStatus.FAILED:
|
|
345
|
+
* break;
|
|
346
|
+
* // ... handle other cases
|
|
347
|
+
* }
|
|
348
|
+
* });
|
|
349
|
+
*
|
|
350
|
+
* // Later, remove the listener
|
|
351
|
+
* subscription.remove();
|
|
352
|
+
* ```
|
|
353
|
+
*/
|
|
354
|
+
static onPaymentStatus(listener) {
|
|
355
|
+
const subscription = eventEmitter.addListener('YunoPaymentStatus', listener);
|
|
356
|
+
return {
|
|
357
|
+
remove: () => subscription.remove()
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Subscribes to enrollment status events.
|
|
363
|
+
*
|
|
364
|
+
* @param listener - Callback function to handle enrollment state changes
|
|
365
|
+
* @returns Subscription object with remove() method
|
|
366
|
+
*
|
|
367
|
+
* @example
|
|
368
|
+
* ```typescript
|
|
369
|
+
* const subscription = YunoSdk.onEnrollmentStatus((state) => {
|
|
370
|
+
* switch (state.status) {
|
|
371
|
+
* case YunoStatus.SUCCEEDED:
|
|
372
|
+
* break;
|
|
373
|
+
* case YunoStatus.FAILED:
|
|
374
|
+
* break;
|
|
375
|
+
* // ... handle other cases
|
|
376
|
+
* }
|
|
377
|
+
* });
|
|
378
|
+
*
|
|
379
|
+
* // Later, remove the listener
|
|
380
|
+
* subscription.remove();
|
|
381
|
+
* ```
|
|
382
|
+
*/
|
|
383
|
+
static onEnrollmentStatus(listener) {
|
|
384
|
+
const subscription = eventEmitter.addListener('YunoEnrollmentStatus', listener);
|
|
385
|
+
return {
|
|
386
|
+
remove: () => subscription.remove()
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Subscribes to one-time token (OTT) events.
|
|
392
|
+
*
|
|
393
|
+
* @param listener - Callback function to handle OTT generation
|
|
394
|
+
* @returns Subscription object with remove() method
|
|
395
|
+
*
|
|
396
|
+
* @example
|
|
397
|
+
* ```typescript
|
|
398
|
+
* const subscription = YunoSdk.onOneTimeToken((token) => {
|
|
399
|
+
* // Use token for payment processing
|
|
400
|
+
* });
|
|
401
|
+
*
|
|
402
|
+
* // Later, remove the listener
|
|
403
|
+
* subscription.remove();
|
|
404
|
+
* ```
|
|
405
|
+
*/
|
|
406
|
+
static onOneTimeToken(listener) {
|
|
407
|
+
const subscription = eventEmitter.addListener('YunoOneTimeToken', listener);
|
|
408
|
+
return {
|
|
409
|
+
remove: () => subscription.remove()
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* Subscribes to one-time token info events with extended information.
|
|
415
|
+
* This event provides additional details beyond just the token string,
|
|
416
|
+
* including card data and customer information.
|
|
417
|
+
*
|
|
418
|
+
* @param listener - Callback function to handle OTT info
|
|
419
|
+
* @returns Subscription object with remove() method
|
|
420
|
+
*
|
|
421
|
+
* @example
|
|
422
|
+
* ```typescript
|
|
423
|
+
* const subscription = YunoSdk.onOneTimeTokenInfo((tokenInfo) => {
|
|
424
|
+
* });
|
|
425
|
+
*
|
|
426
|
+
* // Later, remove the listener
|
|
427
|
+
* subscription.remove();
|
|
428
|
+
* ```
|
|
429
|
+
*/
|
|
430
|
+
static onOneTimeTokenInfo(listener) {
|
|
431
|
+
const subscription = eventEmitter.addListener('YunoOneTimeTokenInfo', listener);
|
|
432
|
+
return {
|
|
433
|
+
remove: () => subscription.remove()
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
static checkInitialized() {
|
|
437
|
+
if (!this.isInitialized) {
|
|
438
|
+
throw new Error('YunoSdk is not initialized. Call YunoSdk.initialize() first.');
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
static getCountryCode() {
|
|
442
|
+
if (!this.countryCode) {
|
|
443
|
+
throw new Error('Country code not set. Call YunoSdk.initialize() first.');
|
|
444
|
+
}
|
|
445
|
+
return this.countryCode;
|
|
446
|
+
}
|
|
447
|
+
static getLanguage() {
|
|
448
|
+
if (!this.language) {
|
|
449
|
+
throw new Error('Language not set. Call YunoSdk.initialize() first.');
|
|
450
|
+
}
|
|
451
|
+
return this.language;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
exports.YunoSdk = YunoSdk;
|
|
455
|
+
//# sourceMappingURL=YunoSdk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_enums","LINKING_ERROR","Platform","select","ios","default","YunoSdkNative","NativeModules","YunoSdk","Proxy","get","Error","eventEmitter","NativeEventEmitter","countryCode","language","isInitialized","markAsInitialized","YunoLanguage","EN","initialize","params","apiKey","yunoConfig","iosConfig","androidConfig","config","lang","cardFlow","CardFlow","ONE_STEP","saveCardEnabled","keepLoader","isDynamicViewEnabled","cardFormDeployed","enrollmentPayment","checkInitialized","args","getCountryCode","startPaymentLite","code","startPayment","showPaymentStatus","continuePayment","checkoutSession","startPaymentSeamlessLite","statusString","getLanguage","hideLoader","receiveDeeplink","url","OS","console","warn","getLastOneTimeToken","getLastOneTimeTokenInfo","clearLastOneTimeToken","onPaymentStatus","listener","subscription","addListener","remove","onEnrollmentStatus","onOneTimeToken","onOneTimeTokenInfo","exports"],"sourceRoot":"../../src","sources":["YunoSdk.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAUA,IAAAC,MAAA,GAAAD,OAAA;AAEA,MAAME,aAAa,GACjB,uFAAuF,GACvFC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,uBAAuB;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GAC9D,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,aAAa,GAAGC,0BAAa,CAACC,OAAO,GACvCD,0BAAa,CAACC,OAAO,GACrB,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACV,aAAa,CAAC;EAChC;AACF,CACF,CAAC;;AAEL;AACA;AACA;AACA,MAAMW,YAAY,GAAG,IAAIC,+BAAkB,CAACP,aAAa,CAAC;;AAE1D;AACA;AACA;;AAQA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,OAAO,CAAC;EACnB,OAAeM,WAAW,GAAkB,IAAI;EAChD,OAAeC,QAAQ,GAAwB,IAAI;EACnD,OAAeC,aAAa,GAAY,KAAK;;EAE7C;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAOC,iBAAiBA,CAACH,W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AAY,CAACE,MAAM,CAAC;IAAE,CAAC;EAChD;EAEA,OAAezB,gBAAgBA,CAAA,EAAS;IACtC,IAAI,CAAC,IAAI,CAACpB,aAAa,EAAE;MACvB,MAAM,IAAIL,KAAK,CACb,8DACF,CAAC;IACH;EACF;EAEA,OAAe2B,cAAcA,CAAA,EAAW;IACtC,IAAI,CAAC,IAAI,CAACxB,WAAW,EAAE;MACrB,MAAM,IAAIH,KAAK,CAAC,wDAAwD,CAAC;IAC3E;IACA,OAAO,IAAI,CAACG,WAAW;EACzB;EAEA,OAAeiC,WAAWA,CAAA,EAAiB;IACzC,IAAI,CAAC,IAAI,CAAChC,QAAQ,EAAE;MAClB,MAAM,IAAIJ,KAAK,CAAC,oDAAoD,CAAC;IACvE;IACA,OAAO,IAAI,CAACI,QAAQ;EACtB;AACF;AAACkD,OAAA,CAAAzD,OAAA,GAAAA,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CardFlow = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Enum representing the card flow type for payment processing.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { CardFlow } from '@y.uno/yuno-sdk-react-native';
|
|
13
|
+
*
|
|
14
|
+
* const config = {
|
|
15
|
+
* cardFlow: CardFlow.ONE_STEP,
|
|
16
|
+
* };
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
let CardFlow = exports.CardFlow = /*#__PURE__*/function (CardFlow) {
|
|
20
|
+
/** One-step card flow */
|
|
21
|
+
CardFlow["ONE_STEP"] = "ONE_STEP";
|
|
22
|
+
/** Step-by-step card flow */
|
|
23
|
+
CardFlow["STEP_BY_STEP"] = "STEP_BY_STEP";
|
|
24
|
+
return CardFlow;
|
|
25
|
+
}({});
|
|
26
|
+
//# sourceMappingURL=CardFlow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CardFlow","exports"],"sourceRoot":"../../../../src","sources":["core/enums/CardFlow.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAXA,IAYYA,QAAQ,GAAAC,OAAA,CAAAD,QAAA,0BAARA,QAAQ;EAClB;EADUA,QAAQ;EAGlB;EAHUA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}
|