@yuno-payments/sdk-web-types 3.3.0 → 3.5.1

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/dist/global.d.ts CHANGED
@@ -87,73 +87,10 @@ declare enum StatusEnrollment {
87
87
  ERROR = "ERROR",
88
88
  UNENROLLED = "UNENROLLED"
89
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
90
 
154
91
  type ApiClientPaymentArgs = {
155
92
  checkout_session?: string;
156
- country_code: CountryCode;
93
+ country_code: string;
157
94
  };
158
95
  type GenerateTokenArgs$1 = {
159
96
  checkout_session?: string;
@@ -184,7 +121,7 @@ type ApiClientPayment = (args: ApiClientPaymentArgs) => Promise<ApiClientPayment
184
121
 
185
122
  type ApiClientEnrollArgs = {
186
123
  customer_session: string;
187
- country_code: CountryCode;
124
+ country_code: string;
188
125
  };
189
126
  type ContinueEnrollmentArgs = {
190
127
  customer_session?: string;
@@ -206,6 +143,36 @@ type ApiClientEnrollReturn = {
206
143
  };
207
144
  type ApiClientEnroll = (args: ApiClientEnrollArgs) => Promise<ApiClientEnrollReturn>;
208
145
 
146
+ type DeviceFingerprint = {
147
+ providerId: string;
148
+ sessionId: string;
149
+ };
150
+ type ExecuteFraudCheckArgs = {
151
+ checkoutSession: string;
152
+ /**
153
+ * @default 'CARD'
154
+ */
155
+ paymentType?: string;
156
+ };
157
+ type ExecuteFraudCheckReturn<TStatus = 'success' | 'error'> = TStatus extends 'success' ? {
158
+ status: TStatus;
159
+ deviceFingerprints: DeviceFingerprint[];
160
+ } : {
161
+ status: TStatus;
162
+ error: Error;
163
+ deviceFingerprints: [];
164
+ };
165
+ type ExecuteFraudCheck = (args: ExecuteFraudCheckArgs) => Promise<ExecuteFraudCheckReturn>;
166
+
167
+ type CookieKey = 'deviceId';
168
+ type CookieConfig = {
169
+ name: string;
170
+ };
171
+ type CookiesConfig = Record<CookieKey, CookieConfig>;
172
+ type InitializeOptions = {
173
+ cookies: CookiesConfig | undefined;
174
+ };
175
+
209
176
  type Status = 'FAIL' | 'REJECT' | 'SUCCEEDED' | 'PROCESSING' | 'READY';
210
177
  type EnrollmentStatus = 'CREATED' | 'EXPIRED' | 'REJECTED' | 'READY_TO_ENROLL' | 'ENROLL_IN_PROCESS' | 'UNENROLL_IN_PROCESS' | 'ENROLLED' | 'DECLINED' | 'CANCELED' | 'ERROR' | 'UNENROLLED';
211
178
 
@@ -524,7 +491,7 @@ type ExternalPaymentButtons = {
524
491
  };
525
492
  };
526
493
  type LoadingType = 'DOCUMENT' | 'ONE_TIME_TOKEN';
527
- type Language = 'es' | 'en' | 'pt';
494
+ type Language = 'es' | 'en' | 'pt' | 'de' | 'fil' | 'fr' | 'id' | 'it' | 'ms' | 'nl' | 'pl' | 'po' | 'ru' | 'sv' | 'th' | 'tr' | 'vi' | 'zh-CN' | 'zh-TW';
528
495
  interface YunoConfig {
529
496
  publicApiKey: string;
530
497
  checkoutSession: string;
@@ -603,7 +570,7 @@ type CreateArgsSF = CreateArgs;
603
570
  interface MountStatusPaymentArgs {
604
571
  checkoutSession: string;
605
572
  language: Language;
606
- countryCode: CountryCode;
573
+ countryCode: string;
607
574
  yunoPaymentResult?: YunoConfig['yunoPaymentResult'];
608
575
  yunoError?: YunoConfig['yunoError'];
609
576
  }
@@ -645,9 +612,10 @@ interface YunoInstance {
645
612
  secureFields(args: SecureFieldsArgs): Promise<SecureFieldInstance>;
646
613
  apiClientPayment: ApiClientPayment;
647
614
  apiClientEnroll: ApiClientEnroll;
615
+ executeFraudCheck: ExecuteFraudCheck;
648
616
  }
649
617
  interface Yuno {
650
- initialize(publicApiKey: string): Promise<YunoInstance>;
618
+ initialize(publicApiKey: string, applicationSession?: string, options?: InitializeOptions): Promise<YunoInstance>;
651
619
  }
652
620
 
653
621
  declare const Yuno: Yuno;
package/dist/index.d.ts CHANGED
@@ -87,73 +87,10 @@ declare enum StatusEnrollment {
87
87
  ERROR = "ERROR",
88
88
  UNENROLLED = "UNENROLLED"
89
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
90
 
154
91
  type ApiClientPaymentArgs = {
155
92
  checkout_session?: string;
156
- country_code: CountryCode;
93
+ country_code: string;
157
94
  };
158
95
  type GenerateTokenArgs$1 = {
159
96
  checkout_session?: string;
@@ -184,7 +121,7 @@ type ApiClientPayment = (args: ApiClientPaymentArgs) => Promise<ApiClientPayment
184
121
 
185
122
  type ApiClientEnrollArgs = {
186
123
  customer_session: string;
187
- country_code: CountryCode;
124
+ country_code: string;
188
125
  };
189
126
  type ContinueEnrollmentArgs = {
190
127
  customer_session?: string;
@@ -206,6 +143,36 @@ type ApiClientEnrollReturn = {
206
143
  };
207
144
  type ApiClientEnroll = (args: ApiClientEnrollArgs) => Promise<ApiClientEnrollReturn>;
208
145
 
146
+ type DeviceFingerprint = {
147
+ providerId: string;
148
+ sessionId: string;
149
+ };
150
+ type ExecuteFraudCheckArgs = {
151
+ checkoutSession: string;
152
+ /**
153
+ * @default 'CARD'
154
+ */
155
+ paymentType?: string;
156
+ };
157
+ type ExecuteFraudCheckReturn<TStatus = 'success' | 'error'> = TStatus extends 'success' ? {
158
+ status: TStatus;
159
+ deviceFingerprints: DeviceFingerprint[];
160
+ } : {
161
+ status: TStatus;
162
+ error: Error;
163
+ deviceFingerprints: [];
164
+ };
165
+ type ExecuteFraudCheck = (args: ExecuteFraudCheckArgs) => Promise<ExecuteFraudCheckReturn>;
166
+
167
+ type CookieKey = 'deviceId';
168
+ type CookieConfig = {
169
+ name: string;
170
+ };
171
+ type CookiesConfig = Record<CookieKey, CookieConfig>;
172
+ type InitializeOptions = {
173
+ cookies: CookiesConfig | undefined;
174
+ };
175
+
209
176
  type Status = 'FAIL' | 'REJECT' | 'SUCCEEDED' | 'PROCESSING' | 'READY';
210
177
  type EnrollmentStatus = 'CREATED' | 'EXPIRED' | 'REJECTED' | 'READY_TO_ENROLL' | 'ENROLL_IN_PROCESS' | 'UNENROLL_IN_PROCESS' | 'ENROLLED' | 'DECLINED' | 'CANCELED' | 'ERROR' | 'UNENROLLED';
211
178
 
@@ -524,7 +491,7 @@ type ExternalPaymentButtons = {
524
491
  };
525
492
  };
526
493
  type LoadingType = 'DOCUMENT' | 'ONE_TIME_TOKEN';
527
- type Language = 'es' | 'en' | 'pt';
494
+ type Language = 'es' | 'en' | 'pt' | 'de' | 'fil' | 'fr' | 'id' | 'it' | 'ms' | 'nl' | 'pl' | 'po' | 'ru' | 'sv' | 'th' | 'tr' | 'vi' | 'zh-CN' | 'zh-TW';
528
495
  interface YunoConfig {
529
496
  publicApiKey: string;
530
497
  checkoutSession: string;
@@ -603,7 +570,7 @@ type CreateArgsSF = CreateArgs;
603
570
  interface MountStatusPaymentArgs {
604
571
  checkoutSession: string;
605
572
  language: Language;
606
- countryCode: CountryCode;
573
+ countryCode: string;
607
574
  yunoPaymentResult?: YunoConfig['yunoPaymentResult'];
608
575
  yunoError?: YunoConfig['yunoError'];
609
576
  }
@@ -645,9 +612,10 @@ interface YunoInstance {
645
612
  secureFields(args: SecureFieldsArgs): Promise<SecureFieldInstance>;
646
613
  apiClientPayment: ApiClientPayment;
647
614
  apiClientEnroll: ApiClientEnroll;
615
+ executeFraudCheck: ExecuteFraudCheck;
648
616
  }
649
617
  interface Yuno {
650
- initialize(publicApiKey: string): Promise<YunoInstance>;
618
+ initialize(publicApiKey: string, applicationSession?: string, options?: InitializeOptions): Promise<YunoInstance>;
651
619
  }
652
620
 
653
621
  export { type ButtonTextCard, type CardConfig, type ContinuePaymentArgs, type ContinuePaymentResponse, type CreateArgsSF, type ExternalPaymentButtons, ExternalPaymentButtonsTypes, type Font, type FormElementSelector, type Language, type LoadingType, type MountCheckoutArgs, type MountCheckoutLiteArgs, type MountEnrollmentLiteArgs, type MountSeamlessCheckoutArgs, type MountSeamlessCheckoutLiteArgs, type MountStatusPaymentArgs, type OnChangeDataSF, type RenderMode, type SecureFieldInstance, type SecureFieldsArgs, type StartCheckoutArgs, type StartSeamlessCheckoutArgs, type TextsCustom, type Yuno, type YunoConfig, type YunoInstance, type mountFraudArgs };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuno-payments/sdk-web-types",
3
- "version": "3.3.0",
3
+ "version": "3.5.1",
4
4
  "types": "dist/index.d.ts",
5
5
  "type": "module",
6
6
  "publishConfig": {