@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
@@ -0,0 +1,207 @@
1
+ /**
2
+ * Document information for customer/payer.
3
+ */
4
+ export interface Document {
5
+ /**
6
+ * Document type (e.g., 'CC', 'DNI', 'PASSPORT').
7
+ */
8
+ document_type?: string | null;
9
+
10
+ /**
11
+ * Document number.
12
+ */
13
+ document_number?: string | null;
14
+ }
15
+
16
+ /**
17
+ * Phone information for customer/payer.
18
+ */
19
+ export interface Phone {
20
+ /**
21
+ * Country code (e.g., '+57', '+1').
22
+ */
23
+ country_code?: string | null;
24
+
25
+ /**
26
+ * Phone number.
27
+ */
28
+ number?: string | null;
29
+ }
30
+
31
+ /**
32
+ * Address information for customer/payer.
33
+ */
34
+ export interface Address {
35
+ /**
36
+ * Street address line 1.
37
+ */
38
+ address_line_1?: string | null;
39
+
40
+ /**
41
+ * Street address line 2.
42
+ */
43
+ address_line_2?: string | null;
44
+
45
+ /**
46
+ * City.
47
+ */
48
+ city?: string | null;
49
+
50
+ /**
51
+ * State or province.
52
+ */
53
+ state?: string | null;
54
+
55
+ /**
56
+ * Country code (ISO 3166-1 alpha-2).
57
+ */
58
+ country?: string | null;
59
+
60
+ /**
61
+ * Postal/ZIP code.
62
+ */
63
+ zip_code?: string | null;
64
+ }
65
+
66
+ /**
67
+ * Customer/Payer information associated with the payment.
68
+ */
69
+ export interface CustomerPayerInformation {
70
+ /**
71
+ * Customer's first name.
72
+ */
73
+ first_name?: string | null;
74
+
75
+ /**
76
+ * Customer's last name.
77
+ */
78
+ last_name?: string | null;
79
+
80
+ /**
81
+ * Customer's email address.
82
+ */
83
+ email?: string | null;
84
+
85
+ /**
86
+ * Customer's document information.
87
+ */
88
+ document?: Document | null;
89
+
90
+ /**
91
+ * Customer's phone information.
92
+ */
93
+ phone?: Phone | null;
94
+
95
+ /**
96
+ * Customer's billing address.
97
+ */
98
+ billing_address?: Address | null;
99
+
100
+ /**
101
+ * Device fingerprint for fraud prevention.
102
+ */
103
+ device_fingerprint?: string | null;
104
+
105
+ /**
106
+ * Third-party session ID.
107
+ */
108
+ third_party_session_id?: string | null;
109
+ }
110
+
111
+ /**
112
+ * Card information model containing details about the payment card.
113
+ */
114
+ export interface CardInformation {
115
+ /**
116
+ * Cardholder's name.
117
+ */
118
+ holder_name?: string | null;
119
+
120
+ /**
121
+ * Issuer Identification Number (first 6-8 digits of card).
122
+ */
123
+ iin?: string | null;
124
+
125
+ /**
126
+ * Last four digits of the card number.
127
+ */
128
+ lfd?: string | null;
129
+
130
+ /**
131
+ * Total length of the card number.
132
+ */
133
+ number_length?: number | null;
134
+
135
+ /**
136
+ * Length of the security code (CVV/CVC).
137
+ */
138
+ security_code_length?: number | null;
139
+
140
+ /**
141
+ * Card brand (e.g., 'VISA', 'MASTERCARD', 'AMEX').
142
+ */
143
+ brand?: string | null;
144
+
145
+ /**
146
+ * Card type (e.g., 'CREDIT', 'DEBIT').
147
+ */
148
+ type?: string | null;
149
+
150
+ /**
151
+ * Card category (e.g., 'CLASSIC', 'PLATINUM', 'BLACK').
152
+ */
153
+ category?: string | null;
154
+
155
+ /**
156
+ * Name of the card issuer bank.
157
+ */
158
+ issuer_name?: string | null;
159
+
160
+ /**
161
+ * Code of the card issuer bank.
162
+ */
163
+ issuer_code?: string | null;
164
+
165
+ /**
166
+ * Country code where the card was issued (ISO 3166-1 alpha-2).
167
+ */
168
+ country_code?: string | null;
169
+ }
170
+
171
+ /**
172
+ * Extended information about a One-Time Token (OTT).
173
+ * This model is received from the callBackTokenWithInformation callback
174
+ * and contains additional details beyond just the token string.
175
+ */
176
+ export interface OneTimeTokenInfo {
177
+ /**
178
+ * The One-Time Token string.
179
+ */
180
+ token?: string | null;
181
+
182
+ /**
183
+ * Vaulted token if using a saved payment method.
184
+ */
185
+ vaultedToken?: string | null;
186
+
187
+ /**
188
+ * Whether to vault the payment method on successful payment.
189
+ */
190
+ vaultOnSuccess?: boolean | null;
191
+
192
+ /**
193
+ * Payment method type (e.g., 'CARD', 'PSE', etc.).
194
+ */
195
+ type?: string | null;
196
+
197
+ /**
198
+ * Card information if payment method is a card.
199
+ */
200
+ cardData?: CardInformation | null;
201
+
202
+ /**
203
+ * Customer/payer information associated with the payment.
204
+ */
205
+ customer?: CustomerPayerInformation | null;
206
+ }
207
+
@@ -0,0 +1,42 @@
1
+ import { MethodSelected } from './StartPayment';
2
+
3
+ /**
4
+ * Arguments for starting a seamless payment flow.
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * import { SeamlessArguments } from '@y.uno/yuno-sdk-react-native';
9
+ *
10
+ * const seamlessArgs: SeamlessArguments = {
11
+ * checkoutSession: 'checkout_session_token',
12
+ * methodSelected: {
13
+ * vaultedToken: 'token_12345',
14
+ * paymentMethodType: 'CARD',
15
+ * },
16
+ * showPaymentStatus: true,
17
+ * countryCode: 'US',
18
+ * };
19
+ * ```
20
+ */
21
+ export interface SeamlessArguments {
22
+ /**
23
+ * Checkout session token.
24
+ */
25
+ checkoutSession: string;
26
+
27
+ /**
28
+ * Selected payment method.
29
+ */
30
+ methodSelected: MethodSelected;
31
+
32
+ /**
33
+ * Whether to show payment status.
34
+ * @default true
35
+ */
36
+ showPaymentStatus?: boolean;
37
+
38
+ /**
39
+ * Country code for the payment.
40
+ */
41
+ countryCode?: string;
42
+ }
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Payment method selection for starting a payment.
3
+ *
4
+ * @example
5
+ * ```typescript
6
+ * import { MethodSelected } from '@y.uno/yuno-sdk-react-native';
7
+ *
8
+ * const method: MethodSelected = {
9
+ * vaultedToken: 'token_12345',
10
+ * paymentMethodType: 'CARD',
11
+ * };
12
+ * ```
13
+ */
14
+ export interface MethodSelected {
15
+ /**
16
+ * Vaulted token for the payment method.
17
+ */
18
+ vaultedToken: string;
19
+
20
+ /**
21
+ * Type of payment method.
22
+ */
23
+ paymentMethodType: string;
24
+ }
25
+
26
+ /**
27
+ * Arguments for starting a payment lite flow.
28
+ *
29
+ * @example
30
+ * ```typescript
31
+ * import { StartPayment } from '@y.uno/yuno-sdk-react-native';
32
+ *
33
+ * const paymentArgs: StartPayment = {
34
+ * checkoutSession: 'checkout_session_token',
35
+ * methodSelected: {
36
+ * vaultedToken: 'token_12345',
37
+ * paymentMethodType: 'CARD',
38
+ * },
39
+ * showPaymentStatus: true,
40
+ * };
41
+ * ```
42
+ */
43
+ export interface StartPayment {
44
+ /**
45
+ * Checkout session token.
46
+ */
47
+ checkoutSession: string;
48
+
49
+ /**
50
+ * Selected payment method.
51
+ */
52
+ methodSelected: MethodSelected;
53
+
54
+ /**
55
+ * Whether to show payment status.
56
+ * @default true
57
+ */
58
+ showPaymentStatus?: boolean;
59
+ }
@@ -0,0 +1,55 @@
1
+ import { CardFlow, YunoLanguage } from '../enums';
2
+
3
+ /**
4
+ * Configuration options for initializing the Yuno SDK.
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * import { YunoConfig, YunoLanguage, CardFlow } from '@y.uno/yuno-sdk-react-native';
9
+ *
10
+ * const config: YunoConfig = {
11
+ * lang: YunoLanguage.EN,
12
+ * cardFlow: CardFlow.STEP_BY_STEP,
13
+ * saveCardEnabled: true,
14
+ * keepLoader: true,
15
+ * isDynamicViewEnabled: true,
16
+ * };
17
+ * ```
18
+ */
19
+ export interface YunoConfig {
20
+ /**
21
+ * Language for the SDK UI.
22
+ * @default YunoLanguage.EN
23
+ */
24
+ lang?: YunoLanguage;
25
+
26
+ /**
27
+ * Card flow configuration.
28
+ * @default CardFlow.ONE_STEP
29
+ */
30
+ cardFlow?: CardFlow;
31
+
32
+ /**
33
+ * Enable or disable save card option.
34
+ * @default false
35
+ */
36
+ saveCardEnabled?: boolean;
37
+
38
+ /**
39
+ * Keep loader visible during operations.
40
+ * @default false
41
+ */
42
+ keepLoader?: boolean;
43
+
44
+ /**
45
+ * Enable dynamic view.
46
+ * @default false
47
+ */
48
+ isDynamicViewEnabled?: boolean;
49
+
50
+ /**
51
+ * Card form deployed state.
52
+ * @default false
53
+ */
54
+ cardFormDeployed?: boolean;
55
+ }
@@ -0,0 +1,7 @@
1
+ export type { YunoConfig } from './YunoConfig';
2
+ export type { IosConfig } from './IosConfig';
3
+ export type { AndroidConfig } from './AndroidConfig';
4
+ export type { EnrollmentArguments } from './EnrollmentArguments';
5
+ export type { StartPayment, MethodSelected } from './StartPayment';
6
+ export type { SeamlessArguments } from './SeamlessArguments';
7
+ export type { OneTimeTokenInfo } from './OneTimeTokenInfo';
package/src/index.ts ADDED
@@ -0,0 +1,17 @@
1
+ export { YunoSdk } from './YunoSdk';
2
+ export type { YunoPaymentState, YunoEnrollmentState } from './YunoSdk';
3
+ export { YunoPaymentMethods } from './YunoPaymentMethods';
4
+ export type {
5
+ YunoPaymentMethodsProps,
6
+ PaymentMethodSelectedEvent,
7
+ PaymentMethodErrorEvent,
8
+ } from './YunoPaymentMethods';
9
+ export * from './core';
10
+ export type {
11
+ OneTimeTokenInfo,
12
+ CardInformation,
13
+ CustomerPayerInformation,
14
+ Document,
15
+ Phone,
16
+ Address,
17
+ } from './core/types/OneTimeTokenInfo';