@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.
Files changed (92) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +621 -0
  3. package/android/build.gradle +131 -0
  4. package/android/gradle.properties +5 -0
  5. package/android/src/main/AndroidManifest.xml +4 -0
  6. package/android/src/main/java/com/yunosdkreactnative/YunoPaymentMethodsViewManager.kt +194 -0
  7. package/android/src/main/java/com/yunosdkreactnative/YunoSdkModule.kt +777 -0
  8. package/android/src/main/java/com/yunosdkreactnative/YunoSdkPackage.kt +24 -0
  9. package/ios/YunoSdk.m +65 -0
  10. package/ios/YunoSdk.podspec +48 -0
  11. package/ios/YunoSdk.swift +442 -0
  12. package/lib/commonjs/YunoPaymentMethods.js +145 -0
  13. package/lib/commonjs/YunoPaymentMethods.js.map +1 -0
  14. package/lib/commonjs/YunoSdk.js +455 -0
  15. package/lib/commonjs/YunoSdk.js.map +1 -0
  16. package/lib/commonjs/core/enums/CardFlow.js +26 -0
  17. package/lib/commonjs/core/enums/CardFlow.js.map +1 -0
  18. package/lib/commonjs/core/enums/YunoLanguage.js +58 -0
  19. package/lib/commonjs/core/enums/YunoLanguage.js.map +1 -0
  20. package/lib/commonjs/core/enums/YunoStatus.js +40 -0
  21. package/lib/commonjs/core/enums/YunoStatus.js.map +1 -0
  22. package/lib/commonjs/core/enums/index.js +27 -0
  23. package/lib/commonjs/core/enums/index.js.map +1 -0
  24. package/lib/commonjs/core/index.js +28 -0
  25. package/lib/commonjs/core/index.js.map +1 -0
  26. package/lib/commonjs/core/types/AndroidConfig.js +2 -0
  27. package/lib/commonjs/core/types/AndroidConfig.js.map +1 -0
  28. package/lib/commonjs/core/types/EnrollmentArguments.js +2 -0
  29. package/lib/commonjs/core/types/EnrollmentArguments.js.map +1 -0
  30. package/lib/commonjs/core/types/IosConfig.js +2 -0
  31. package/lib/commonjs/core/types/IosConfig.js.map +1 -0
  32. package/lib/commonjs/core/types/OneTimeTokenInfo.js +2 -0
  33. package/lib/commonjs/core/types/OneTimeTokenInfo.js.map +1 -0
  34. package/lib/commonjs/core/types/SeamlessArguments.js +6 -0
  35. package/lib/commonjs/core/types/SeamlessArguments.js.map +1 -0
  36. package/lib/commonjs/core/types/StartPayment.js +2 -0
  37. package/lib/commonjs/core/types/StartPayment.js.map +1 -0
  38. package/lib/commonjs/core/types/YunoConfig.js +6 -0
  39. package/lib/commonjs/core/types/YunoConfig.js.map +1 -0
  40. package/lib/commonjs/core/types/index.js +2 -0
  41. package/lib/commonjs/core/types/index.js.map +1 -0
  42. package/lib/commonjs/index.js +36 -0
  43. package/lib/commonjs/index.js.map +1 -0
  44. package/lib/module/YunoPaymentMethods.js +138 -0
  45. package/lib/module/YunoPaymentMethods.js.map +1 -0
  46. package/lib/module/YunoSdk.js +448 -0
  47. package/lib/module/YunoSdk.js.map +1 -0
  48. package/lib/module/core/enums/CardFlow.js +20 -0
  49. package/lib/module/core/enums/CardFlow.js.map +1 -0
  50. package/lib/module/core/enums/YunoLanguage.js +52 -0
  51. package/lib/module/core/enums/YunoLanguage.js.map +1 -0
  52. package/lib/module/core/enums/YunoStatus.js +34 -0
  53. package/lib/module/core/enums/YunoStatus.js.map +1 -0
  54. package/lib/module/core/enums/index.js +4 -0
  55. package/lib/module/core/enums/index.js.map +1 -0
  56. package/lib/module/core/index.js +3 -0
  57. package/lib/module/core/index.js.map +1 -0
  58. package/lib/module/core/types/AndroidConfig.js +2 -0
  59. package/lib/module/core/types/AndroidConfig.js.map +1 -0
  60. package/lib/module/core/types/EnrollmentArguments.js +2 -0
  61. package/lib/module/core/types/EnrollmentArguments.js.map +1 -0
  62. package/lib/module/core/types/IosConfig.js +2 -0
  63. package/lib/module/core/types/IosConfig.js.map +1 -0
  64. package/lib/module/core/types/OneTimeTokenInfo.js +2 -0
  65. package/lib/module/core/types/OneTimeTokenInfo.js.map +1 -0
  66. package/lib/module/core/types/SeamlessArguments.js +2 -0
  67. package/lib/module/core/types/SeamlessArguments.js.map +1 -0
  68. package/lib/module/core/types/StartPayment.js +2 -0
  69. package/lib/module/core/types/StartPayment.js.map +1 -0
  70. package/lib/module/core/types/YunoConfig.js +2 -0
  71. package/lib/module/core/types/YunoConfig.js.map +1 -0
  72. package/lib/module/core/types/index.js +2 -0
  73. package/lib/module/core/types/index.js.map +1 -0
  74. package/lib/module/index.js +4 -0
  75. package/lib/module/index.js.map +1 -0
  76. package/package.json +142 -0
  77. package/src/YunoPaymentMethods.tsx +196 -0
  78. package/src/YunoSdk.ts +518 -0
  79. package/src/core/enums/CardFlow.ts +18 -0
  80. package/src/core/enums/YunoLanguage.ts +50 -0
  81. package/src/core/enums/YunoStatus.ts +32 -0
  82. package/src/core/enums/index.ts +3 -0
  83. package/src/core/index.ts +2 -0
  84. package/src/core/types/AndroidConfig.ts +17 -0
  85. package/src/core/types/EnrollmentArguments.ts +32 -0
  86. package/src/core/types/IosConfig.ts +17 -0
  87. package/src/core/types/OneTimeTokenInfo.ts +207 -0
  88. package/src/core/types/SeamlessArguments.ts +42 -0
  89. package/src/core/types/StartPayment.ts +59 -0
  90. package/src/core/types/YunoConfig.ts +55 -0
  91. package/src/core/types/index.ts +7 -0
  92. package/src/index.ts +17 -0
package/src/YunoSdk.ts ADDED
@@ -0,0 +1,518 @@
1
+ import { NativeModules, NativeEventEmitter, Platform } from 'react-native';
2
+ import type {
3
+ YunoConfig,
4
+ IosConfig,
5
+ AndroidConfig,
6
+ EnrollmentArguments,
7
+ StartPayment,
8
+ SeamlessArguments,
9
+ OneTimeTokenInfo,
10
+ } from './core/types';
11
+ import { YunoStatus, YunoLanguage, CardFlow } from './core/enums';
12
+
13
+ const LINKING_ERROR =
14
+ `The package '@y.uno/yuno-sdk-react-native' doesn't seem to be linked. Make sure: \n\n` +
15
+ Platform.select({ ios: "- Run 'pod install'\n", default: '' }) +
16
+ '- You rebuilt the app after installing the package\n' +
17
+ '- You are not using Expo Go\n';
18
+
19
+ const YunoSdkNative = NativeModules.YunoSdk
20
+ ? NativeModules.YunoSdk
21
+ : new Proxy(
22
+ {},
23
+ {
24
+ get() {
25
+ throw new Error(LINKING_ERROR);
26
+ },
27
+ }
28
+ );
29
+
30
+ /**
31
+ * Event emitter for Yuno SDK events.
32
+ */
33
+ const eventEmitter = new NativeEventEmitter(YunoSdkNative);
34
+
35
+ /**
36
+ * Payment state event data.
37
+ */
38
+ export interface YunoPaymentState {
39
+ /** One-time token generated for the payment */
40
+ token?: string;
41
+ /** Payment status */
42
+ status: YunoStatus;
43
+ }
44
+
45
+ /**
46
+ * Enrollment state event data.
47
+ */
48
+ export interface YunoEnrollmentState {
49
+ /** Enrollment status */
50
+ status: YunoStatus;
51
+ }
52
+
53
+ /**
54
+ * Yuno SDK class for React Native.
55
+ *
56
+ * This class provides methods to initialize and interact with the Yuno payment SDK.
57
+ *
58
+ * @example
59
+ * ```typescript
60
+ * import { YunoSdk, YunoLanguage, CardFlow } from '@y.uno/yuno-sdk-react-native';
61
+ *
62
+ * // Initialize the SDK
63
+ * await YunoSdk.initialize({
64
+ * apiKey: 'your_api_key',
65
+ * countryCode: 'US',
66
+ * yunoConfig: {
67
+ * lang: YunoLanguage.EN,
68
+ * cardFlow: CardFlow.STEP_BY_STEP,
69
+ * saveCardEnabled: true,
70
+ * },
71
+ * });
72
+ *
73
+ * // Listen to payment events
74
+ * YunoSdk.onPaymentStatus((state) => {
75
+ * if (state.token) {
76
+ * }
77
+ * });
78
+ * ```
79
+ */
80
+ export class YunoSdk {
81
+ private static countryCode: string | null = null;
82
+ private static language: YunoLanguage | null = null;
83
+ private static isInitialized: boolean = false;
84
+
85
+ /**
86
+ * Marks the SDK as initialized without calling the native initialize method.
87
+ * This is useful when the SDK has been initialized from the native side (e.g., in MainActivity/YunoActivity).
88
+ *
89
+ * @param countryCode - ISO country code (e.g., 'US', 'BR', 'CO')
90
+ * @param language - Optional language setting (defaults to EN)
91
+ *
92
+ * @internal
93
+ */
94
+ static markAsInitialized(countryCode: string = 'CO', language: YunoLanguage = YunoLanguage.EN): void {
95
+ this.countryCode = countryCode;
96
+ this.language = language;
97
+ this.isInitialized = true;
98
+ }
99
+
100
+ /**
101
+ * Initializes the Yuno SDK with the required configuration.
102
+ *
103
+ * This method must be called before any other SDK operations.
104
+ *
105
+ * @param params - Configuration parameters for SDK initialization
106
+ * @param params.apiKey - Your Yuno API key
107
+ * @param params.countryCode - ISO country code (e.g., 'US', 'BR', 'CO')
108
+ * @param params.yunoConfig - Optional Yuno SDK configuration
109
+ * @param params.iosConfig - Optional iOS-specific configuration
110
+ * @param params.androidConfig - Optional Android-specific configuration
111
+ *
112
+ * @example
113
+ * ```typescript
114
+ * await YunoSdk.initialize({
115
+ * apiKey: 'your_api_key_here',
116
+ * countryCode: 'CO',
117
+ * yunoConfig: {
118
+ * lang: YunoLanguage.ES,
119
+ * cardFlow: CardFlow.ONE_STEP,
120
+ * saveCardEnabled: true,
121
+ * keepLoader: false,
122
+ * isDynamicViewEnabled: true,
123
+ * },
124
+ * });
125
+ * ```
126
+ */
127
+ static async initialize(params: {
128
+ apiKey: string;
129
+ countryCode: string;
130
+ yunoConfig?: YunoConfig;
131
+ iosConfig?: IosConfig;
132
+ androidConfig?: AndroidConfig;
133
+ }): Promise<void> {
134
+ const {
135
+ apiKey,
136
+ countryCode,
137
+ yunoConfig = {},
138
+ iosConfig = {},
139
+ androidConfig = {},
140
+ } = params;
141
+
142
+ // Set default values
143
+ const config: YunoConfig = {
144
+ lang: yunoConfig.lang ?? YunoLanguage.EN,
145
+ cardFlow: yunoConfig.cardFlow ?? CardFlow.ONE_STEP,
146
+ saveCardEnabled: yunoConfig.saveCardEnabled ?? false,
147
+ keepLoader: yunoConfig.keepLoader ?? false,
148
+ isDynamicViewEnabled: yunoConfig.isDynamicViewEnabled ?? false,
149
+ cardFormDeployed: yunoConfig.cardFormDeployed ?? false,
150
+ };
151
+
152
+ // Store country code and language
153
+ this.countryCode = countryCode;
154
+ this.language = config.lang!;
155
+
156
+ await YunoSdkNative.initialize(
157
+ apiKey,
158
+ countryCode,
159
+ config,
160
+ iosConfig,
161
+ androidConfig
162
+ );
163
+
164
+ this.isInitialized = true;
165
+ }
166
+
167
+ /**
168
+ * Starts an enrollment payment flow.
169
+ *
170
+ * @param params - Enrollment configuration
171
+ *
172
+ * @example
173
+ * ```typescript
174
+ * await YunoSdk.enrollmentPayment({
175
+ * customerSession: 'customer_session_token',
176
+ * showPaymentStatus: true,
177
+ * countryCode: 'US',
178
+ * });
179
+ * ```
180
+ */
181
+ static async enrollmentPayment(params: EnrollmentArguments): Promise<void> {
182
+ this.checkInitialized();
183
+
184
+ const args = {
185
+ ...params,
186
+ countryCode: params.countryCode ?? this.getCountryCode(),
187
+ };
188
+
189
+ return YunoSdkNative.enrollmentPayment(args);
190
+ }
191
+
192
+ /**
193
+ * Starts a payment lite flow.
194
+ *
195
+ * @param params - Payment configuration
196
+ * @param countryCode - Optional country code override
197
+ *
198
+ * @example
199
+ * ```typescript
200
+ * await YunoSdk.startPaymentLite({
201
+ * checkoutSession: 'checkout_session_token',
202
+ * methodSelected: {
203
+ * vaultedToken: 'token_12345',
204
+ * paymentMethodType: 'CARD',
205
+ * },
206
+ * showPaymentStatus: true,
207
+ * });
208
+ * ```
209
+ */
210
+ static async startPaymentLite(
211
+ params: StartPayment,
212
+ countryCode?: string
213
+ ): Promise<void> {
214
+ this.checkInitialized();
215
+
216
+ const code = countryCode ?? this.getCountryCode();
217
+ return YunoSdkNative.startPaymentLite(params, code);
218
+ }
219
+
220
+ /**
221
+ * Starts a full payment flow.
222
+ *
223
+ * @param showPaymentStatus - Whether to show payment status screen
224
+ *
225
+ * @example
226
+ * ```typescript
227
+ * await YunoSdk.startPayment(true);
228
+ * ```
229
+ */
230
+ static async startPayment(showPaymentStatus: boolean = true): Promise<void> {
231
+ this.checkInitialized();
232
+ return YunoSdkNative.startPayment(showPaymentStatus);
233
+ }
234
+
235
+ /**
236
+ * Continues a previously started payment.
237
+ *
238
+ * @param checkoutSession - The checkout session token
239
+ * @param countryCode - Optional country code (uses initialized country code if not provided)
240
+ * @param showPaymentStatus - Whether to show payment status screen
241
+ *
242
+ * @example
243
+ * ```typescript
244
+ * await YunoSdk.continuePayment('checkout_session_token', 'CO', true);
245
+ * ```
246
+ */
247
+ static async continuePayment(
248
+ checkoutSession: string,
249
+ countryCode?: string,
250
+ showPaymentStatus: boolean = true
251
+ ): Promise<void> {
252
+ this.checkInitialized();
253
+ const code = countryCode ?? this.getCountryCode();
254
+ return YunoSdkNative.continuePayment(checkoutSession, code, showPaymentStatus);
255
+ }
256
+
257
+ /**
258
+ * Starts a seamless payment lite flow.
259
+ *
260
+ * @param params - Seamless payment configuration
261
+ * @returns Promise resolving to the payment status
262
+ *
263
+ * @example
264
+ * ```typescript
265
+ * const status = await YunoSdk.startPaymentSeamlessLite({
266
+ * checkoutSession: 'checkout_session_token',
267
+ * methodSelected: {
268
+ * vaultedToken: 'token_12345',
269
+ * paymentMethodType: 'CARD',
270
+ * },
271
+ * showPaymentStatus: true,
272
+ * countryCode: 'US',
273
+ * });
274
+ *
275
+ * ```
276
+ */
277
+ static async startPaymentSeamlessLite(
278
+ params: SeamlessArguments
279
+ ): Promise<YunoStatus> {
280
+ this.checkInitialized();
281
+
282
+ const args = {
283
+ ...params,
284
+ countryCode: params.countryCode ?? this.getCountryCode(),
285
+ };
286
+
287
+ const statusString = await YunoSdkNative.startPaymentSeamlessLite(
288
+ args,
289
+ this.getLanguage()
290
+ );
291
+
292
+ return statusString as YunoStatus;
293
+ }
294
+
295
+ /**
296
+ * Hides the loading indicator.
297
+ *
298
+ * @example
299
+ * ```typescript
300
+ * await YunoSdk.hideLoader();
301
+ * ```
302
+ */
303
+ static async hideLoader(): Promise<void> {
304
+ this.checkInitialized();
305
+ return YunoSdkNative.hideLoader();
306
+ }
307
+
308
+ /**
309
+ * Handles a deep link for payment resumption (iOS only).
310
+ *
311
+ * @param url - Deep link URL
312
+ *
313
+ * @example
314
+ * ```typescript
315
+ * import { Linking } from 'react-native';
316
+ *
317
+ * Linking.addEventListener('url', async (event) => {
318
+ * await YunoSdk.receiveDeeplink(event.url);
319
+ * });
320
+ * ```
321
+ */
322
+ static async receiveDeeplink(url: string): Promise<void> {
323
+ if (Platform.OS !== 'ios') {
324
+ console.warn('receiveDeeplink is only available on iOS');
325
+ return;
326
+ }
327
+
328
+ this.checkInitialized();
329
+ return YunoSdkNative.receiveDeeplink(url);
330
+ }
331
+
332
+ /**
333
+ * Gets the last One Time Token (OTT) that was generated.
334
+ * This is useful when the OTT event was emitted while React Native was paused
335
+ * (e.g., during a payment flow in a native activity).
336
+ *
337
+ * @returns Promise resolving to the last OTT token, or null if none exists
338
+ *
339
+ * @example
340
+ * ```typescript
341
+ * // After returning from a payment flow
342
+ * const lastOtt = await YunoSdk.getLastOneTimeToken();
343
+ * if (lastOtt) {
344
+ * // Use the token for payment processing
345
+ * }
346
+ * ```
347
+ */
348
+ static async getLastOneTimeToken(): Promise<string | null> {
349
+ return YunoSdkNative.getLastOneTimeToken();
350
+ }
351
+
352
+ /**
353
+ * Gets the last OneTimeTokenInfo object stored by the SDK.
354
+ * This is useful for recovering token information after the app returns from the native payment UI.
355
+ *
356
+ * @returns Promise resolving to OneTimeTokenInfo or null if no token info is stored
357
+ *
358
+ * @example
359
+ * ```typescript
360
+ * const tokenInfo = await YunoSdk.getLastOneTimeTokenInfo();
361
+ * if (tokenInfo) {
362
+ * }
363
+ * ```
364
+ */
365
+ static async getLastOneTimeTokenInfo(): Promise<OneTimeTokenInfo | null> {
366
+ return YunoSdkNative.getLastOneTimeTokenInfo();
367
+ }
368
+
369
+ /**
370
+ * Clears the last OTT tokens stored by the SDK.
371
+ * This is useful to ensure clean state before starting a new payment flow.
372
+ *
373
+ * Note: This is automatically called at the start of each payment/enrollment flow,
374
+ * but you can call it manually if needed.
375
+ *
376
+ * @example
377
+ * ```typescript
378
+ * // Clear OTT before starting a new payment
379
+ * await YunoSdk.clearLastOneTimeToken();
380
+ * ```
381
+ */
382
+ static async clearLastOneTimeToken(): Promise<void> {
383
+ return YunoSdkNative.clearLastOneTimeToken();
384
+ }
385
+
386
+ /**
387
+ * Subscribes to payment status events.
388
+ *
389
+ * @param listener - Callback function to handle payment state changes
390
+ * @returns Subscription object with remove() method
391
+ *
392
+ * @example
393
+ * ```typescript
394
+ * const subscription = YunoSdk.onPaymentStatus((state) => {
395
+ * switch (state.status) {
396
+ * case YunoStatus.SUCCEEDED:
397
+ * break;
398
+ * case YunoStatus.FAILED:
399
+ * break;
400
+ * // ... handle other cases
401
+ * }
402
+ * });
403
+ *
404
+ * // Later, remove the listener
405
+ * subscription.remove();
406
+ * ```
407
+ */
408
+ static onPaymentStatus(listener: (state: YunoPaymentState) => void): {
409
+ remove: () => void;
410
+ } {
411
+ const subscription = eventEmitter.addListener(
412
+ 'YunoPaymentStatus',
413
+ listener
414
+ );
415
+ return { remove: () => subscription.remove() };
416
+ }
417
+
418
+ /**
419
+ * Subscribes to enrollment status events.
420
+ *
421
+ * @param listener - Callback function to handle enrollment state changes
422
+ * @returns Subscription object with remove() method
423
+ *
424
+ * @example
425
+ * ```typescript
426
+ * const subscription = YunoSdk.onEnrollmentStatus((state) => {
427
+ * switch (state.status) {
428
+ * case YunoStatus.SUCCEEDED:
429
+ * break;
430
+ * case YunoStatus.FAILED:
431
+ * break;
432
+ * // ... handle other cases
433
+ * }
434
+ * });
435
+ *
436
+ * // Later, remove the listener
437
+ * subscription.remove();
438
+ * ```
439
+ */
440
+ static onEnrollmentStatus(listener: (state: YunoEnrollmentState) => void): {
441
+ remove: () => void;
442
+ } {
443
+ const subscription = eventEmitter.addListener(
444
+ 'YunoEnrollmentStatus',
445
+ listener
446
+ );
447
+ return { remove: () => subscription.remove() };
448
+ }
449
+
450
+ /**
451
+ * Subscribes to one-time token (OTT) events.
452
+ *
453
+ * @param listener - Callback function to handle OTT generation
454
+ * @returns Subscription object with remove() method
455
+ *
456
+ * @example
457
+ * ```typescript
458
+ * const subscription = YunoSdk.onOneTimeToken((token) => {
459
+ * // Use token for payment processing
460
+ * });
461
+ *
462
+ * // Later, remove the listener
463
+ * subscription.remove();
464
+ * ```
465
+ */
466
+ static onOneTimeToken(listener: (token: string) => void): {
467
+ remove: () => void;
468
+ } {
469
+ const subscription = eventEmitter.addListener('YunoOneTimeToken', listener);
470
+ return { remove: () => subscription.remove() };
471
+ }
472
+
473
+ /**
474
+ * Subscribes to one-time token info events with extended information.
475
+ * This event provides additional details beyond just the token string,
476
+ * including card data and customer information.
477
+ *
478
+ * @param listener - Callback function to handle OTT info
479
+ * @returns Subscription object with remove() method
480
+ *
481
+ * @example
482
+ * ```typescript
483
+ * const subscription = YunoSdk.onOneTimeTokenInfo((tokenInfo) => {
484
+ * });
485
+ *
486
+ * // Later, remove the listener
487
+ * subscription.remove();
488
+ * ```
489
+ */
490
+ static onOneTimeTokenInfo(listener: (tokenInfo: OneTimeTokenInfo) => void): {
491
+ remove: () => void;
492
+ } {
493
+ const subscription = eventEmitter.addListener('YunoOneTimeTokenInfo', listener);
494
+ return { remove: () => subscription.remove() };
495
+ }
496
+
497
+ private static checkInitialized(): void {
498
+ if (!this.isInitialized) {
499
+ throw new Error(
500
+ 'YunoSdk is not initialized. Call YunoSdk.initialize() first.'
501
+ );
502
+ }
503
+ }
504
+
505
+ private static getCountryCode(): string {
506
+ if (!this.countryCode) {
507
+ throw new Error('Country code not set. Call YunoSdk.initialize() first.');
508
+ }
509
+ return this.countryCode;
510
+ }
511
+
512
+ private static getLanguage(): YunoLanguage {
513
+ if (!this.language) {
514
+ throw new Error('Language not set. Call YunoSdk.initialize() first.');
515
+ }
516
+ return this.language;
517
+ }
518
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Enum representing the card flow type for payment processing.
3
+ *
4
+ * @example
5
+ * ```typescript
6
+ * import { CardFlow } from '@y.uno/yuno-sdk-react-native';
7
+ *
8
+ * const config = {
9
+ * cardFlow: CardFlow.ONE_STEP,
10
+ * };
11
+ * ```
12
+ */
13
+ export enum CardFlow {
14
+ /** One-step card flow */
15
+ ONE_STEP = 'ONE_STEP',
16
+ /** Step-by-step card flow */
17
+ STEP_BY_STEP = 'STEP_BY_STEP',
18
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Enum representing the languages supported by the Yuno SDK.
3
+ *
4
+ * @example
5
+ * ```typescript
6
+ * import { YunoLanguage } from '@y.uno/yuno-sdk-react-native';
7
+ *
8
+ * const language = YunoLanguage.ES;
9
+ * ```
10
+ */
11
+ export enum YunoLanguage {
12
+ /** English language */
13
+ EN = 'EN',
14
+ /** Spanish language */
15
+ ES = 'ES',
16
+ /** Portuguese language */
17
+ PT = 'PT',
18
+ /** Indonesian language */
19
+ ID = 'ID',
20
+ /** Malay language */
21
+ MY = 'MY',
22
+ /** Malaysian language */
23
+ MS = 'MS',
24
+ /** French language */
25
+ FR = 'FR',
26
+ /** Polish language */
27
+ PL = 'PL',
28
+ /** Italian language */
29
+ IT = 'IT',
30
+ /** German language */
31
+ DE = 'DE',
32
+ /** Russian language */
33
+ RU = 'RU',
34
+ /** Turkish language */
35
+ TR = 'TR',
36
+ /** Dutch language */
37
+ NL = 'NL',
38
+ /** Swedish language */
39
+ SV = 'SV',
40
+ /** Thai language */
41
+ TH = 'TH',
42
+ /** Filipino language */
43
+ FIL = 'FIL',
44
+ /** Vietnamese language */
45
+ VI = 'VI',
46
+ /** Chinese Simplified language */
47
+ ZH_CN = 'ZH-CN',
48
+ /** Chinese Traditional language */
49
+ ZH_TW = 'ZH-TW',
50
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Enum representing the possible statuses of a Yuno payment or enrollment operation.
3
+ *
4
+ * @example
5
+ * ```typescript
6
+ * import { YunoStatus } from '@y.uno/yuno-sdk-react-native';
7
+ *
8
+ * function handlePaymentStatus(status: YunoStatus) {
9
+ * switch (status) {
10
+ * case YunoStatus.SUCCEEDED:
11
+ * break;
12
+ * case YunoStatus.REJECTED:
13
+ * break;
14
+ * // ... handle other cases
15
+ * }
16
+ * }
17
+ * ```
18
+ */
19
+ export enum YunoStatus {
20
+ /** Payment/operation was rejected */
21
+ REJECTED = 'REJECTED',
22
+ /** Payment/operation succeeded */
23
+ SUCCEEDED = 'SUCCEEDED',
24
+ /** Payment/operation failed */
25
+ FAILED = 'FAILED',
26
+ /** Payment/operation is being processed */
27
+ PROCESSING = 'PROCESSING',
28
+ /** An internal error occurred */
29
+ INTERNAL_ERROR = 'INTERNAL_ERROR',
30
+ /** Operation was cancelled by the user */
31
+ CANCELLED_BY_USER = 'CANCELLED_BY_USER',
32
+ }
@@ -0,0 +1,3 @@
1
+ export { YunoLanguage } from './YunoLanguage';
2
+ export { YunoStatus } from './YunoStatus';
3
+ export { CardFlow } from './CardFlow';
@@ -0,0 +1,2 @@
1
+ export * from './enums';
2
+ export * from './types';
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Android-specific configuration for the Yuno SDK.
3
+ *
4
+ * @example
5
+ * ```typescript
6
+ * import { AndroidConfig } from '@y.uno/yuno-sdk-react-native';
7
+ *
8
+ * const androidConfig: AndroidConfig = {
9
+ * // Add Android-specific configurations here
10
+ * };
11
+ * ```
12
+ */
13
+ export interface AndroidConfig {
14
+ // Android-specific configuration properties
15
+ // Can be extended based on native SDK requirements
16
+ [key: string]: any;
17
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Arguments for enrollment payment operations.
3
+ *
4
+ * @example
5
+ * ```typescript
6
+ * import { EnrollmentArguments } from '@y.uno/yuno-sdk-react-native';
7
+ *
8
+ * const enrollmentArgs: EnrollmentArguments = {
9
+ * customerSession: 'customer_session_token',
10
+ * showPaymentStatus: true,
11
+ * countryCode: 'US',
12
+ * };
13
+ * ```
14
+ */
15
+ export interface EnrollmentArguments {
16
+ /**
17
+ * Customer session token.
18
+ */
19
+ customerSession: string;
20
+
21
+ /**
22
+ * Whether to show payment status.
23
+ * @default true
24
+ */
25
+ showPaymentStatus?: boolean;
26
+
27
+ /**
28
+ * Country code for the payment.
29
+ * If not provided, uses the default country code from initialization.
30
+ */
31
+ countryCode?: string;
32
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * iOS-specific configuration for the Yuno SDK.
3
+ *
4
+ * @example
5
+ * ```typescript
6
+ * import { IosConfig } from '@y.uno/yuno-sdk-react-native';
7
+ *
8
+ * const iosConfig: IosConfig = {
9
+ * // Add iOS-specific configurations here
10
+ * };
11
+ * ```
12
+ */
13
+ export interface IosConfig {
14
+ // iOS-specific configuration properties
15
+ // Can be extended based on native SDK requirements
16
+ [key: string]: any;
17
+ }