@yuno-payments/sdk-web-types 1.3.0 → 1.5.0

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/README.md CHANGED
@@ -8,4 +8,4 @@
8
8
  import { YunoInstance } from '@yuno-payments/sdk-web-types/dist/types'
9
9
 
10
10
  const yunoInstance: YunoInstance = Yuno.initialize('publickAPikey')
11
- ```
11
+ ```
package/dist/index.d.ts CHANGED
@@ -1,49 +1,205 @@
1
1
  interface Customer {
2
- first_name: string;
3
- last_name: string;
4
- email: string;
5
- gender?: string;
2
+ first_name?: string | null;
3
+ last_name?: string | null;
4
+ email?: string | null;
5
+ gender?: string | null;
6
6
  device_fingerprint?: string | null;
7
7
  third_party_session_id?: string | null;
8
- document: {
8
+ document?: {
9
9
  document_number: string;
10
10
  document_type: string;
11
- };
12
- phone: {
11
+ } | null;
12
+ phone?: {
13
13
  country_code: string;
14
14
  number: string;
15
- };
16
- billing_address: {
15
+ } | null;
16
+ billing_address?: {
17
17
  address_line_1: string;
18
18
  address_line_2: string;
19
19
  city: string;
20
20
  country: string;
21
21
  state: string;
22
22
  zip_code: string;
23
- };
24
- shipping_address: {
23
+ } | null;
24
+ shipping_address?: {
25
25
  address_line_1: string;
26
26
  address_line_2: string;
27
27
  country: string;
28
28
  state: string;
29
29
  city: string;
30
30
  zip_code: string;
31
+ } | null;
32
+ }
33
+
34
+ interface Card {
35
+ number: string | null;
36
+ expiration_month: number | null;
37
+ expiration_year: number | null;
38
+ security_code: string | null;
39
+ holder_name: string | null;
40
+ type: string | null;
41
+ }
42
+ interface OneTimeToken$1 {
43
+ token: string;
44
+ vaulted_token: string | null;
45
+ vault_on_success: boolean;
46
+ type: string;
47
+ card_data?: {
48
+ holder_name: string;
49
+ iin: string;
50
+ lfd: string;
51
+ number_length: number;
52
+ security_code_length: number;
53
+ brand: string;
54
+ issuer_name: string;
55
+ issuer_code: string | null;
56
+ category: string | null;
57
+ type: string;
31
58
  };
32
- browser_info?: Partial<{
33
- accept_browser: string | null;
34
- accept_content: string | null;
35
- accept_header: string | null;
36
- color_depth: string | null;
37
- javascript_enabled: boolean | null;
38
- language: string | null;
39
- screen_height: string | null;
40
- screen_width: string | null;
41
- user_agent: string | null;
42
- java_enabled: boolean | null;
43
- browser_time_difference: string | null;
44
- }>;
45
- merchant_customer_id?: string;
59
+ customer: Customer;
46
60
  }
61
+ type ApiClientCard = {
62
+ save?: boolean;
63
+ detail?: Partial<Card>;
64
+ three_d_secure?: {
65
+ three_d_secure_setup_id?: string | null;
66
+ };
67
+ installment?: {
68
+ id: string;
69
+ value: number;
70
+ amount?: {
71
+ currency: string;
72
+ value: string;
73
+ total_value: string;
74
+ } | null;
75
+ };
76
+ };
77
+ declare enum StatusEnrollment {
78
+ CREATED = "CREATED",
79
+ EXPIRED = "EXPIRED",
80
+ REJECTED = "REJECTED",
81
+ READY_TO_ENROLL = "READY_TO_ENROLL",
82
+ ENROLL_IN_PROCESS = "ENROLL_IN_PROCESS",
83
+ UNENROLL_IN_PROCESS = "UNENROLL_IN_PROCESS",
84
+ ENROLLED = "ENROLLED",
85
+ DECLINED = "DECLINED",
86
+ CANCELED = "CANCELED",
87
+ ERROR = "ERROR",
88
+ UNENROLLED = "UNENROLLED"
89
+ }
90
+ declare enum CountryCode {
91
+ ANGUILLA = "AI",
92
+ ANTIGUA_AND_BARBUDA = "AG",
93
+ ARGENTINA = "AR",
94
+ ARUBA = "AW",
95
+ BAHAMAS = "BS",
96
+ BARBADOS = "BB",
97
+ BELIZE = "BZ",
98
+ BERMUDA = "BM",
99
+ BOLIVIA = "BO",
100
+ BONAIRE = "BQ",
101
+ BOTSWANA = "BW",
102
+ BRAZIL = "BR",
103
+ CANADA = "CA",
104
+ CAYMAN_ISLANDS = "KY",
105
+ CHILE = "CL",
106
+ COLOMBIA = "CO",
107
+ COSTA_RICA = "CR",
108
+ CUBA = "CU",
109
+ CURAÇAO = "CW",
110
+ DOMINICA = "DM",
111
+ DOMINICAN_REPUBLIC = "DO",
112
+ ECUADOR = "EC",
113
+ EL_SALVADOR = "SV",
114
+ FALKLAND_ISLANDS = "FK",
115
+ PHILIPPINES = "PH",
116
+ FRENCH_GUIANA = "GF",
117
+ GREENLAND = "GL",
118
+ GRENADA = "GD",
119
+ GUADELOUPE = "GP",
120
+ GUATEMALA = "GT",
121
+ GUYANA = "GY",
122
+ HAITI = "HT",
123
+ HONDURAS = "HN",
124
+ INDONESIA = "ID",
125
+ JAMAICA = "JM",
126
+ MALAYSIA = "MY",
127
+ MARTINIQUE = "MQ",
128
+ MEXICO = "MX",
129
+ MONTSERRAT = "MS",
130
+ NICARAGUA = "NI",
131
+ PANAMA = "PA",
132
+ PARAGUAY = "PY",
133
+ PERU = "PE",
134
+ PUERTO_RICO = "PR",
135
+ SAINT_BARTHÉLEMY = "BL",
136
+ SAINT_KITTS_AND_NEVIS = "KN",
137
+ SAINT_LUCIA = "LC",
138
+ SAINT_MARTIN = "MF",
139
+ SAINT_PIERRE_AND_MIQUELON = "PM",
140
+ SAINT_VINCENT_AND_THE_GRENADINES = "VC",
141
+ SINT_MAARTEN = "SX",
142
+ SURINAME = "SR",
143
+ THAILAND = "TH",
144
+ TRINIDAD_AND_TOBAGO = "TT",
145
+ TURKS_AND_CAICOS_ISLANDS = "TC",
146
+ UNITED_STATES = "US",
147
+ URUGUAY = "UY",
148
+ VENEZUELA = "VE",
149
+ VIRGIN_ISLANDS_BRITISH = "VG",
150
+ VIRGIN_ISLANDS_US = "VI",
151
+ ZIMBABWE = "ZW"
152
+ }
153
+
154
+ type ApiClientPaymentArgs = {
155
+ checkout_session: string;
156
+ country_code: CountryCode;
157
+ };
158
+ type GenerateTokenArgs$1 = {
159
+ checkout_session?: string;
160
+ payment_method: {
161
+ type: string;
162
+ vaulted_token?: string | null;
163
+ card?: ApiClientCard;
164
+ customer?: Customer;
165
+ device_fingerprint?: string | null;
166
+ third_party_session_id?: string | null;
167
+ };
168
+ };
169
+ type GetThreeDSecureChallengeReturn = {
170
+ url: string;
171
+ };
172
+ type GenerateToken = (args: GenerateTokenArgs$1) => Promise<OneTimeToken$1>;
173
+ type GetThreeDSecureChallenge = (checkoutSession?: string) => Promise<GetThreeDSecureChallengeReturn>;
174
+ type ApiClientPaymentReturn = {
175
+ generateToken: GenerateToken;
176
+ getThreeDSecureChallenge: GetThreeDSecureChallenge;
177
+ };
178
+ type ApiClientPayment = (args: ApiClientPaymentArgs) => ApiClientPaymentReturn;
179
+
180
+ type ApiClientEnrollArgs = {
181
+ customer_session: string;
182
+ country_code: CountryCode;
183
+ };
184
+ type ContinueEnrollmentArgs = {
185
+ customer_session?: string;
186
+ payment_method: {
187
+ type: string;
188
+ card?: ApiClientCard;
189
+ customer?: Customer;
190
+ };
191
+ };
192
+ type ContinueEnrollmentReturn = {
193
+ vaulted_token: string;
194
+ status: string;
195
+ customer: {
196
+ session: StatusEnrollment;
197
+ };
198
+ };
199
+ type ApiClientEnrollReturn = {
200
+ continueEnrollment: (args: ContinueEnrollmentArgs) => Promise<ContinueEnrollmentReturn>;
201
+ };
202
+ type ApiClientEnroll = (args: ApiClientEnrollArgs) => ApiClientEnrollReturn;
47
203
 
48
204
  type Status = 'FAIL' | 'REJECT' | 'SUCCEEDED' | 'PROCESSING' | 'READY';
49
205
  type EnrollmentStatus = 'CREATED' | 'EXPIRED' | 'REJECTED' | 'READY_TO_ENROLL' | 'ENROLL_IN_PROCESS' | 'UNENROLL_IN_PROCESS' | 'ENROLLED' | 'DECLINED' | 'CANCELED' | 'ERROR' | 'UNENROLLED';
@@ -125,8 +281,10 @@ interface GenerateTokenArgs {
125
281
  cardType?: string;
126
282
  }
127
283
  interface GenerateVaultedToken {
284
+ customerSession?: string;
128
285
  cardHolderName: string;
129
286
  customer?: Partial<Customer>;
287
+ cardType?: string;
130
288
  }
131
289
  interface OneTimeToken {
132
290
  token: string;
@@ -317,6 +475,8 @@ interface YunoInstance {
317
475
  updateCheckoutSession(checkoutSession: string): void;
318
476
  mountFraud(args: mountFraudArgs): void;
319
477
  secureFields({ countryCode, checkoutSession, installmentEnable, customerSession }: SecureFieldsArgs): SecureFields;
478
+ apiClientPayment: ApiClientPayment;
479
+ apiClientEnroll: ApiClientEnroll;
320
480
  }
321
481
  interface Yuno {
322
482
  initialize(publicApiKey: string): YunoInstance;
package/dist/types.ts CHANGED
@@ -1,49 +1,205 @@
1
1
  interface Customer {
2
- first_name: string;
3
- last_name: string;
4
- email: string;
5
- gender?: string;
2
+ first_name?: string | null;
3
+ last_name?: string | null;
4
+ email?: string | null;
5
+ gender?: string | null;
6
6
  device_fingerprint?: string | null;
7
7
  third_party_session_id?: string | null;
8
- document: {
8
+ document?: {
9
9
  document_number: string;
10
10
  document_type: string;
11
- };
12
- phone: {
11
+ } | null;
12
+ phone?: {
13
13
  country_code: string;
14
14
  number: string;
15
- };
16
- billing_address: {
15
+ } | null;
16
+ billing_address?: {
17
17
  address_line_1: string;
18
18
  address_line_2: string;
19
19
  city: string;
20
20
  country: string;
21
21
  state: string;
22
22
  zip_code: string;
23
- };
24
- shipping_address: {
23
+ } | null;
24
+ shipping_address?: {
25
25
  address_line_1: string;
26
26
  address_line_2: string;
27
27
  country: string;
28
28
  state: string;
29
29
  city: string;
30
30
  zip_code: string;
31
+ } | null;
32
+ }
33
+
34
+ interface Card {
35
+ number: string | null;
36
+ expiration_month: number | null;
37
+ expiration_year: number | null;
38
+ security_code: string | null;
39
+ holder_name: string | null;
40
+ type: string | null;
41
+ }
42
+ interface OneTimeToken$1 {
43
+ token: string;
44
+ vaulted_token: string | null;
45
+ vault_on_success: boolean;
46
+ type: string;
47
+ card_data?: {
48
+ holder_name: string;
49
+ iin: string;
50
+ lfd: string;
51
+ number_length: number;
52
+ security_code_length: number;
53
+ brand: string;
54
+ issuer_name: string;
55
+ issuer_code: string | null;
56
+ category: string | null;
57
+ type: string;
31
58
  };
32
- browser_info?: Partial<{
33
- accept_browser: string | null;
34
- accept_content: string | null;
35
- accept_header: string | null;
36
- color_depth: string | null;
37
- javascript_enabled: boolean | null;
38
- language: string | null;
39
- screen_height: string | null;
40
- screen_width: string | null;
41
- user_agent: string | null;
42
- java_enabled: boolean | null;
43
- browser_time_difference: string | null;
44
- }>;
45
- merchant_customer_id?: string;
59
+ customer: Customer;
46
60
  }
61
+ type ApiClientCard = {
62
+ save?: boolean;
63
+ detail?: Partial<Card>;
64
+ three_d_secure?: {
65
+ three_d_secure_setup_id?: string | null;
66
+ };
67
+ installment?: {
68
+ id: string;
69
+ value: number;
70
+ amount?: {
71
+ currency: string;
72
+ value: string;
73
+ total_value: string;
74
+ } | null;
75
+ };
76
+ };
77
+ declare enum StatusEnrollment {
78
+ CREATED = "CREATED",
79
+ EXPIRED = "EXPIRED",
80
+ REJECTED = "REJECTED",
81
+ READY_TO_ENROLL = "READY_TO_ENROLL",
82
+ ENROLL_IN_PROCESS = "ENROLL_IN_PROCESS",
83
+ UNENROLL_IN_PROCESS = "UNENROLL_IN_PROCESS",
84
+ ENROLLED = "ENROLLED",
85
+ DECLINED = "DECLINED",
86
+ CANCELED = "CANCELED",
87
+ ERROR = "ERROR",
88
+ UNENROLLED = "UNENROLLED"
89
+ }
90
+ declare enum CountryCode {
91
+ ANGUILLA = "AI",
92
+ ANTIGUA_AND_BARBUDA = "AG",
93
+ ARGENTINA = "AR",
94
+ ARUBA = "AW",
95
+ BAHAMAS = "BS",
96
+ BARBADOS = "BB",
97
+ BELIZE = "BZ",
98
+ BERMUDA = "BM",
99
+ BOLIVIA = "BO",
100
+ BONAIRE = "BQ",
101
+ BOTSWANA = "BW",
102
+ BRAZIL = "BR",
103
+ CANADA = "CA",
104
+ CAYMAN_ISLANDS = "KY",
105
+ CHILE = "CL",
106
+ COLOMBIA = "CO",
107
+ COSTA_RICA = "CR",
108
+ CUBA = "CU",
109
+ CURAÇAO = "CW",
110
+ DOMINICA = "DM",
111
+ DOMINICAN_REPUBLIC = "DO",
112
+ ECUADOR = "EC",
113
+ EL_SALVADOR = "SV",
114
+ FALKLAND_ISLANDS = "FK",
115
+ PHILIPPINES = "PH",
116
+ FRENCH_GUIANA = "GF",
117
+ GREENLAND = "GL",
118
+ GRENADA = "GD",
119
+ GUADELOUPE = "GP",
120
+ GUATEMALA = "GT",
121
+ GUYANA = "GY",
122
+ HAITI = "HT",
123
+ HONDURAS = "HN",
124
+ INDONESIA = "ID",
125
+ JAMAICA = "JM",
126
+ MALAYSIA = "MY",
127
+ MARTINIQUE = "MQ",
128
+ MEXICO = "MX",
129
+ MONTSERRAT = "MS",
130
+ NICARAGUA = "NI",
131
+ PANAMA = "PA",
132
+ PARAGUAY = "PY",
133
+ PERU = "PE",
134
+ PUERTO_RICO = "PR",
135
+ SAINT_BARTHÉLEMY = "BL",
136
+ SAINT_KITTS_AND_NEVIS = "KN",
137
+ SAINT_LUCIA = "LC",
138
+ SAINT_MARTIN = "MF",
139
+ SAINT_PIERRE_AND_MIQUELON = "PM",
140
+ SAINT_VINCENT_AND_THE_GRENADINES = "VC",
141
+ SINT_MAARTEN = "SX",
142
+ SURINAME = "SR",
143
+ THAILAND = "TH",
144
+ TRINIDAD_AND_TOBAGO = "TT",
145
+ TURKS_AND_CAICOS_ISLANDS = "TC",
146
+ UNITED_STATES = "US",
147
+ URUGUAY = "UY",
148
+ VENEZUELA = "VE",
149
+ VIRGIN_ISLANDS_BRITISH = "VG",
150
+ VIRGIN_ISLANDS_US = "VI",
151
+ ZIMBABWE = "ZW"
152
+ }
153
+
154
+ type ApiClientPaymentArgs = {
155
+ checkout_session: string;
156
+ country_code: CountryCode;
157
+ };
158
+ type GenerateTokenArgs$1 = {
159
+ checkout_session?: string;
160
+ payment_method: {
161
+ type: string;
162
+ vaulted_token?: string | null;
163
+ card?: ApiClientCard;
164
+ customer?: Customer;
165
+ device_fingerprint?: string | null;
166
+ third_party_session_id?: string | null;
167
+ };
168
+ };
169
+ type GetThreeDSecureChallengeReturn = {
170
+ url: string;
171
+ };
172
+ type GenerateToken = (args: GenerateTokenArgs$1) => Promise<OneTimeToken$1>;
173
+ type GetThreeDSecureChallenge = (checkoutSession?: string) => Promise<GetThreeDSecureChallengeReturn>;
174
+ type ApiClientPaymentReturn = {
175
+ generateToken: GenerateToken;
176
+ getThreeDSecureChallenge: GetThreeDSecureChallenge;
177
+ };
178
+ type ApiClientPayment = (args: ApiClientPaymentArgs) => ApiClientPaymentReturn;
179
+
180
+ type ApiClientEnrollArgs = {
181
+ customer_session: string;
182
+ country_code: CountryCode;
183
+ };
184
+ type ContinueEnrollmentArgs = {
185
+ customer_session?: string;
186
+ payment_method: {
187
+ type: string;
188
+ card?: ApiClientCard;
189
+ customer?: Customer;
190
+ };
191
+ };
192
+ type ContinueEnrollmentReturn = {
193
+ vaulted_token: string;
194
+ status: string;
195
+ customer: {
196
+ session: StatusEnrollment;
197
+ };
198
+ };
199
+ type ApiClientEnrollReturn = {
200
+ continueEnrollment: (args: ContinueEnrollmentArgs) => Promise<ContinueEnrollmentReturn>;
201
+ };
202
+ type ApiClientEnroll = (args: ApiClientEnrollArgs) => ApiClientEnrollReturn;
47
203
 
48
204
  type Status = 'FAIL' | 'REJECT' | 'SUCCEEDED' | 'PROCESSING' | 'READY';
49
205
  type EnrollmentStatus = 'CREATED' | 'EXPIRED' | 'REJECTED' | 'READY_TO_ENROLL' | 'ENROLL_IN_PROCESS' | 'UNENROLL_IN_PROCESS' | 'ENROLLED' | 'DECLINED' | 'CANCELED' | 'ERROR' | 'UNENROLLED';
@@ -125,8 +281,10 @@ interface GenerateTokenArgs {
125
281
  cardType?: string;
126
282
  }
127
283
  interface GenerateVaultedToken {
284
+ customerSession?: string;
128
285
  cardHolderName: string;
129
286
  customer?: Partial<Customer>;
287
+ cardType?: string;
130
288
  }
131
289
  interface OneTimeToken {
132
290
  token: string;
@@ -317,6 +475,8 @@ interface YunoInstance {
317
475
  updateCheckoutSession(checkoutSession: string): void;
318
476
  mountFraud(args: mountFraudArgs): void;
319
477
  secureFields({ countryCode, checkoutSession, installmentEnable, customerSession }: SecureFieldsArgs): SecureFields;
478
+ apiClientPayment: ApiClientPayment;
479
+ apiClientEnroll: ApiClientEnroll;
320
480
  }
321
481
  interface Yuno {
322
482
  initialize(publicApiKey: string): YunoInstance;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuno-payments/sdk-web-types",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/types.ts",
6
6
  "type": "commonjs",