@tonder.io/ionic-lite-sdk 0.0.42-beta.1 → 0.0.42-beta.3

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 (55) hide show
  1. package/.gitlab-ci.yml +28 -28
  2. package/README.md +532 -532
  3. package/dist/classes/BaseInlineCheckout.d.ts +1 -1
  4. package/dist/classes/liteCheckout.d.ts +1 -1
  5. package/dist/data/cardApi.d.ts +3 -3
  6. package/dist/index.js +1 -1
  7. package/dist/types/liteInlineCheckout.d.ts +1 -1
  8. package/jest.config.ts +14 -14
  9. package/package.json +41 -41
  10. package/rollup.config.js +16 -16
  11. package/src/classes/3dsHandler.ts +347 -347
  12. package/src/classes/BaseInlineCheckout.ts +424 -424
  13. package/src/classes/errorResponse.ts +16 -16
  14. package/src/classes/liteCheckout.ts +589 -591
  15. package/src/data/api.ts +20 -20
  16. package/src/data/businessApi.ts +18 -18
  17. package/src/data/cardApi.ts +91 -87
  18. package/src/data/checkoutApi.ts +84 -84
  19. package/src/data/customerApi.ts +31 -31
  20. package/src/data/openPayApi.ts +12 -12
  21. package/src/data/paymentMethodApi.ts +37 -37
  22. package/src/data/skyflowApi.ts +20 -20
  23. package/src/helpers/constants.ts +63 -63
  24. package/src/helpers/mercadopago.ts +15 -15
  25. package/src/helpers/skyflow.ts +91 -91
  26. package/src/helpers/utils.ts +120 -120
  27. package/src/helpers/validations.ts +55 -55
  28. package/src/index.ts +12 -12
  29. package/src/shared/catalog/paymentMethodsCatalog.ts +247 -247
  30. package/src/shared/constants/messages.ts +10 -10
  31. package/src/shared/constants/paymentMethodAPM.ts +63 -63
  32. package/src/shared/constants/tonderUrl.ts +8 -8
  33. package/src/types/card.ts +35 -35
  34. package/src/types/checkout.ts +123 -123
  35. package/src/types/commons.ts +143 -143
  36. package/src/types/customer.ts +22 -22
  37. package/src/types/liteInlineCheckout.ts +216 -216
  38. package/src/types/paymentMethod.ts +23 -23
  39. package/src/types/requests.ts +114 -114
  40. package/src/types/responses.ts +192 -192
  41. package/src/types/skyflow.ts +17 -17
  42. package/src/types/transaction.ts +101 -101
  43. package/src/types/validations.d.ts +11 -11
  44. package/tests/classes/liteCheckout.test.ts +57 -57
  45. package/tests/methods/createOrder.test.ts +141 -141
  46. package/tests/methods/createPayment.test.ts +121 -121
  47. package/tests/methods/customerRegister.test.ts +118 -118
  48. package/tests/methods/getBusiness.test.ts +114 -114
  49. package/tests/methods/getCustomerCards.test.ts +112 -112
  50. package/tests/methods/registerCustomerCard.test.ts +117 -117
  51. package/tests/methods/startCheckoutRouter.test.ts +119 -119
  52. package/tests/methods/startCheckoutRouterFull.test.ts +138 -138
  53. package/tests/utils/defaultMock.ts +21 -21
  54. package/tests/utils/mockClasses.ts +659 -659
  55. package/tsconfig.json +18 -18
@@ -1,347 +1,347 @@
1
- import { CustomizationOptions } from "../types/commons"
2
-
3
- type ThreeDSHandlerContructor = {
4
- payload?: any,
5
- apiKey?: string,
6
- baseUrl?: string,
7
- customization?: CustomizationOptions,
8
- tdsIframeId?: string,
9
- tonderPayButtonId?: string,
10
- callBack?: (params: any) => any
11
- }
12
-
13
- export class ThreeDSHandler {
14
-
15
- callBack?: (params: any) => any
16
- baseUrl?: string
17
- apiKey?: string
18
- payload?: any
19
- localStorageKey: string = "verify_transaction_status_url"
20
- customization: CustomizationOptions = {
21
- saveCards: {
22
- showSaveCardOption: true,
23
- showSaved: true,
24
- autoSave: false
25
- },
26
- redirectOnComplete: true
27
- }
28
- tdsIframeId?: string
29
- tonderPayButtonId?: string
30
-
31
- constructor({
32
- payload = null,
33
- apiKey,
34
- baseUrl,
35
- customization,
36
- tdsIframeId,
37
- tonderPayButtonId,
38
- callBack
39
- }: ThreeDSHandlerContructor) {
40
- this.baseUrl = baseUrl,
41
- this.apiKey = apiKey,
42
- this.payload = payload
43
- this.tdsIframeId = tdsIframeId
44
- this.tonderPayButtonId = tonderPayButtonId
45
- this.customization = {
46
- ...this.customization,
47
- ...(customization || {}),
48
- saveCards: {
49
- ...this.customization.saveCards,
50
- ...(customization?.saveCards || {}),
51
- },
52
- }
53
- this.callBack = callBack
54
- }
55
-
56
- setStorageItem (data: any) {
57
- return localStorage.setItem(this.localStorageKey, JSON.stringify(data))
58
- }
59
-
60
- getStorageItem () {
61
- return localStorage.getItem(this.localStorageKey)
62
- }
63
-
64
- removeStorageItem () {
65
- return localStorage.removeItem(this.localStorageKey)
66
- }
67
-
68
- saveVerifyTransactionUrl() {
69
- const url = this.payload?.next_action?.redirect_to_url?.verify_transaction_status_url
70
- if (url) {
71
- this.saveUrlWithExpiration(url)
72
- } else {
73
- const url = this.payload?.next_action?.iframe_resources?.verify_transaction_status_url
74
- if (url) {
75
- this.saveUrlWithExpiration(url)
76
- } else {
77
- console.log('No verify_transaction_status_url found');
78
- }
79
- }
80
- }
81
-
82
- saveUrlWithExpiration(url: string) {
83
- try {
84
- const now = new Date()
85
- const item = {
86
- url: url,
87
- // Expires after 20 minutes
88
- expires: now.getTime() + 20 * 60 * 1000
89
- }
90
- this.setStorageItem(item)
91
- } catch (error) {
92
- console.log('error: ', error)
93
- }
94
- }
95
-
96
- getUrlWithExpiration() {
97
- const status = this.getStorageItem();
98
- if(status) {
99
- const item = JSON.parse(status)
100
- if (!item) return
101
- const now = new Date()
102
- if (now.getTime() > item.expires) {
103
- this.removeVerifyTransactionUrl()
104
- return null
105
- } else {
106
- return item.url
107
- }
108
- } else {
109
- return null
110
- }
111
- }
112
-
113
- removeVerifyTransactionUrl() {
114
- return this.removeStorageItem()
115
- }
116
-
117
- getVerifyTransactionUrl() {
118
- return this.getStorageItem()
119
- }
120
-
121
- loadIframe() {
122
- const iframe = this.payload?.next_action?.iframe_resources?.iframe
123
-
124
- if (iframe) {
125
- return new Promise((resolve, reject) => {
126
- const iframe = this.payload?.next_action?.iframe_resources?.iframe
127
-
128
- if (iframe) {
129
- this.saveVerifyTransactionUrl()
130
- const container = document.createElement('div')
131
- container.innerHTML = iframe
132
- document.body.appendChild(container)
133
-
134
- // Create and append the script tag manually
135
- const script = document.createElement('script')
136
- script.textContent = 'document.getElementById("tdsMmethodForm").submit();'
137
- container.appendChild(script)
138
-
139
- // Resolve the promise when the iframe is loaded
140
- const iframeElement = document.getElementById('tdsMmethodTgtFrame')
141
- if(iframeElement) {
142
- iframeElement.onload = () => resolve(true)
143
- } else {
144
- console.log('No redirection found');
145
- reject(false)
146
- }
147
- } else {
148
- console.log('No redirection found');
149
- reject(false)
150
- }
151
- })
152
- }
153
- }
154
-
155
- getRedirectUrl() {
156
- return this.payload?.next_action?.redirect_to_url?.url
157
- }
158
-
159
- redirectToChallenge() {
160
- const url = this.getRedirectUrl()
161
- if (url) {
162
- this.saveVerifyTransactionUrl()
163
- if(this.customization) {
164
- if(this.customization?.redirectOnComplete) {
165
- window.location = url;
166
- } else {
167
- const iframe = document.querySelector(`#${this.tdsIframeId}`)
168
- if(iframe) {
169
-
170
- iframe.setAttribute("src", url);
171
- iframe.setAttribute("style", "display: block");
172
-
173
- const self = this;
174
-
175
- const listenerHandler = async (event: any) => {
176
-
177
- const checkStatus = (result: any) => result?.transaction_status !== "Pending";
178
-
179
- const executeAction = () => {
180
- try {
181
- const selector: any = document.querySelector(`#${this.tonderPayButtonId}`);
182
- if(selector) {
183
- selector.disabled = false;
184
- }
185
- } catch {}
186
- if(iframe) {
187
- iframe.setAttribute("style", "display: none");
188
- }
189
- if(self.callBack) self.callBack(self.payload);
190
- iframe.removeEventListener("load", listenerHandler);
191
- }
192
-
193
- const chainPromises = async (promise: Promise<any>) => {
194
- const result = await new Promise((resolve, reject) => resolve(promise))
195
- if(result) {
196
- if(checkStatus(result)) {
197
- return executeAction()
198
- } else {
199
- const timer = setTimeout(async () => {
200
- clearTimeout(timer);
201
- await chainPromises(self.requestTransactionStatus());
202
- }, 7000)
203
- }
204
- }
205
- }
206
-
207
- await chainPromises(self.requestTransactionStatus())
208
- }
209
-
210
- iframe.addEventListener("load", listenerHandler)
211
-
212
- } else {
213
- console.log('No iframe found');
214
- }
215
- }
216
- } else {
217
- window.location = url;
218
- }
219
- } else {
220
- if (this.callBack) this.callBack!(this.payload);
221
- }
222
- }
223
-
224
- async requestTransactionStatus() {
225
-
226
- const verifyUrl = this.getUrlWithExpiration();
227
- const url = `${this.baseUrl}${verifyUrl}`;
228
- const response = await fetch(url, {
229
- method: "GET",
230
- headers: {
231
- "Content-Type": "application/json",
232
- Authorization: `Token ${this.apiKey}`,
233
- },
234
- // body: JSON.stringify(data),
235
- });
236
-
237
- if (response.status !== 200) {
238
- console.error('La verificación de la transacción falló.');
239
- return null;
240
- } else {
241
- const response_json = await response.json();
242
- return response_json;
243
- }
244
-
245
- }
246
-
247
- // Returns an object
248
- // https://example.com/?name=John&age=30&city=NewYork
249
- // { name: "John", age: "30", city: "NewYork" }
250
- getURLParameters() {
251
- const parameters: any = {};
252
- const urlParams: any = new URLSearchParams(window.location.search);
253
-
254
- for (const [key, value] of urlParams) {
255
- parameters[key] = value;
256
- }
257
-
258
- return parameters;
259
- }
260
-
261
- handleSuccessTransaction(response: any) {
262
- this.removeVerifyTransactionUrl();
263
- console.log('Transacción autorizada.');
264
- return response;
265
- }
266
-
267
- handleDeclinedTransaction(response: any) {
268
- this.removeVerifyTransactionUrl();
269
- return response;
270
- }
271
-
272
- // TODO: the method below needs to be tested with a real 3DS challenge
273
- // since we couldn't get a test card that works with this feature
274
- async handle3dsChallenge(response_json: any) {
275
- // Create the form element:
276
- const form = document.createElement('form');
277
- form.name = 'frm';
278
- form.method = 'POST';
279
- form.action = response_json.redirect_post_url;
280
-
281
- // Add hidden fields:
282
- const creqInput = document.createElement('input');
283
- creqInput.type = 'hidden';
284
- creqInput.name = response_json.creq;
285
- creqInput.value = response_json.creq;
286
- form.appendChild(creqInput);
287
-
288
- const termUrlInput = document.createElement('input');
289
- termUrlInput.type = 'hidden';
290
- termUrlInput.name = response_json.term_url;
291
- termUrlInput.value = response_json.TermUrl;
292
- form.appendChild(termUrlInput);
293
-
294
- // Append the form to the body:
295
- document.body.appendChild(form);
296
- form.submit();
297
-
298
- await this.verifyTransactionStatus();
299
- }
300
-
301
- // TODO: This method could be removed
302
- async handleTransactionResponse(response: any) {
303
- const response_json = await response.json();
304
- if (response_json.status === "Pending" && response_json.redirect_post_url) {
305
- return await this.handle3dsChallenge(response_json);
306
- } else if (["Success", "Authorized"].includes(response_json.status)) {
307
- return this.handleSuccessTransaction(response_json);
308
- } else {
309
- this.handleDeclinedTransaction(response);
310
- return response_json
311
- }
312
- }
313
-
314
- async verifyTransactionStatus() {
315
- const verifyUrl = this.getUrlWithExpiration();
316
- if (verifyUrl) {
317
- const url = `${this.baseUrl}${verifyUrl}`;
318
- try {
319
- const response = await fetch(url, {
320
- method: "GET",
321
- headers: {
322
- "Content-Type": "application/json",
323
- Authorization: `Token ${this.apiKey}`,
324
- },
325
- // body: JSON.stringify(data),
326
- });
327
-
328
- if (response.status !== 200) {
329
- console.error('La verificación de la transacción falló.');
330
- this.removeVerifyTransactionUrl();
331
- return response
332
- }
333
-
334
- return await this.handleTransactionResponse(response);
335
- } catch (error) {
336
- console.error('Error al verificar la transacción:', error);
337
- this.removeVerifyTransactionUrl();
338
- }
339
- } else {
340
- console.log('No verify_transaction_status_url found');
341
- }
342
- }
343
-
344
- setPayload = (payload: any) => {
345
- this.payload = payload
346
- }
347
- }
1
+ import { CustomizationOptions } from "../types/commons"
2
+
3
+ type ThreeDSHandlerContructor = {
4
+ payload?: any,
5
+ apiKey?: string,
6
+ baseUrl?: string,
7
+ customization?: CustomizationOptions,
8
+ tdsIframeId?: string,
9
+ tonderPayButtonId?: string,
10
+ callBack?: (params: any) => any
11
+ }
12
+
13
+ export class ThreeDSHandler {
14
+
15
+ callBack?: (params: any) => any
16
+ baseUrl?: string
17
+ apiKey?: string
18
+ payload?: any
19
+ localStorageKey: string = "verify_transaction_status_url"
20
+ customization: CustomizationOptions = {
21
+ saveCards: {
22
+ showSaveCardOption: true,
23
+ showSaved: true,
24
+ autoSave: false
25
+ },
26
+ redirectOnComplete: true
27
+ }
28
+ tdsIframeId?: string
29
+ tonderPayButtonId?: string
30
+
31
+ constructor({
32
+ payload = null,
33
+ apiKey,
34
+ baseUrl,
35
+ customization,
36
+ tdsIframeId,
37
+ tonderPayButtonId,
38
+ callBack
39
+ }: ThreeDSHandlerContructor) {
40
+ this.baseUrl = baseUrl,
41
+ this.apiKey = apiKey,
42
+ this.payload = payload
43
+ this.tdsIframeId = tdsIframeId
44
+ this.tonderPayButtonId = tonderPayButtonId
45
+ this.customization = {
46
+ ...this.customization,
47
+ ...(customization || {}),
48
+ saveCards: {
49
+ ...this.customization.saveCards,
50
+ ...(customization?.saveCards || {}),
51
+ },
52
+ }
53
+ this.callBack = callBack
54
+ }
55
+
56
+ setStorageItem (data: any) {
57
+ return localStorage.setItem(this.localStorageKey, JSON.stringify(data))
58
+ }
59
+
60
+ getStorageItem () {
61
+ return localStorage.getItem(this.localStorageKey)
62
+ }
63
+
64
+ removeStorageItem () {
65
+ return localStorage.removeItem(this.localStorageKey)
66
+ }
67
+
68
+ saveVerifyTransactionUrl() {
69
+ const url = this.payload?.next_action?.redirect_to_url?.verify_transaction_status_url
70
+ if (url) {
71
+ this.saveUrlWithExpiration(url)
72
+ } else {
73
+ const url = this.payload?.next_action?.iframe_resources?.verify_transaction_status_url
74
+ if (url) {
75
+ this.saveUrlWithExpiration(url)
76
+ } else {
77
+ console.log('No verify_transaction_status_url found');
78
+ }
79
+ }
80
+ }
81
+
82
+ saveUrlWithExpiration(url: string) {
83
+ try {
84
+ const now = new Date()
85
+ const item = {
86
+ url: url,
87
+ // Expires after 20 minutes
88
+ expires: now.getTime() + 20 * 60 * 1000
89
+ }
90
+ this.setStorageItem(item)
91
+ } catch (error) {
92
+ console.log('error: ', error)
93
+ }
94
+ }
95
+
96
+ getUrlWithExpiration() {
97
+ const status = this.getStorageItem();
98
+ if(status) {
99
+ const item = JSON.parse(status)
100
+ if (!item) return
101
+ const now = new Date()
102
+ if (now.getTime() > item.expires) {
103
+ this.removeVerifyTransactionUrl()
104
+ return null
105
+ } else {
106
+ return item.url
107
+ }
108
+ } else {
109
+ return null
110
+ }
111
+ }
112
+
113
+ removeVerifyTransactionUrl() {
114
+ return this.removeStorageItem()
115
+ }
116
+
117
+ getVerifyTransactionUrl() {
118
+ return this.getStorageItem()
119
+ }
120
+
121
+ loadIframe() {
122
+ const iframe = this.payload?.next_action?.iframe_resources?.iframe
123
+
124
+ if (iframe) {
125
+ return new Promise((resolve, reject) => {
126
+ const iframe = this.payload?.next_action?.iframe_resources?.iframe
127
+
128
+ if (iframe) {
129
+ this.saveVerifyTransactionUrl()
130
+ const container = document.createElement('div')
131
+ container.innerHTML = iframe
132
+ document.body.appendChild(container)
133
+
134
+ // Create and append the script tag manually
135
+ const script = document.createElement('script')
136
+ script.textContent = 'document.getElementById("tdsMmethodForm").submit();'
137
+ container.appendChild(script)
138
+
139
+ // Resolve the promise when the iframe is loaded
140
+ const iframeElement = document.getElementById('tdsMmethodTgtFrame')
141
+ if(iframeElement) {
142
+ iframeElement.onload = () => resolve(true)
143
+ } else {
144
+ console.log('No redirection found');
145
+ reject(false)
146
+ }
147
+ } else {
148
+ console.log('No redirection found');
149
+ reject(false)
150
+ }
151
+ })
152
+ }
153
+ }
154
+
155
+ getRedirectUrl() {
156
+ return this.payload?.next_action?.redirect_to_url?.url
157
+ }
158
+
159
+ redirectToChallenge() {
160
+ const url = this.getRedirectUrl()
161
+ if (url) {
162
+ this.saveVerifyTransactionUrl()
163
+ if(this.customization) {
164
+ if(this.customization?.redirectOnComplete) {
165
+ window.location = url;
166
+ } else {
167
+ const iframe = document.querySelector(`#${this.tdsIframeId}`)
168
+ if(iframe) {
169
+
170
+ iframe.setAttribute("src", url);
171
+ iframe.setAttribute("style", "display: block");
172
+
173
+ const self = this;
174
+
175
+ const listenerHandler = async (event: any) => {
176
+
177
+ const checkStatus = (result: any) => result?.transaction_status !== "Pending";
178
+
179
+ const executeAction = () => {
180
+ try {
181
+ const selector: any = document.querySelector(`#${this.tonderPayButtonId}`);
182
+ if(selector) {
183
+ selector.disabled = false;
184
+ }
185
+ } catch {}
186
+ if(iframe) {
187
+ iframe.setAttribute("style", "display: none");
188
+ }
189
+ if(self.callBack) self.callBack(self.payload);
190
+ iframe.removeEventListener("load", listenerHandler);
191
+ }
192
+
193
+ const chainPromises = async (promise: Promise<any>) => {
194
+ const result = await new Promise((resolve, reject) => resolve(promise))
195
+ if(result) {
196
+ if(checkStatus(result)) {
197
+ return executeAction()
198
+ } else {
199
+ const timer = setTimeout(async () => {
200
+ clearTimeout(timer);
201
+ await chainPromises(self.requestTransactionStatus());
202
+ }, 7000)
203
+ }
204
+ }
205
+ }
206
+
207
+ await chainPromises(self.requestTransactionStatus())
208
+ }
209
+
210
+ iframe.addEventListener("load", listenerHandler)
211
+
212
+ } else {
213
+ console.log('No iframe found');
214
+ }
215
+ }
216
+ } else {
217
+ window.location = url;
218
+ }
219
+ } else {
220
+ if (this.callBack) this.callBack!(this.payload);
221
+ }
222
+ }
223
+
224
+ async requestTransactionStatus() {
225
+
226
+ const verifyUrl = this.getUrlWithExpiration();
227
+ const url = `${this.baseUrl}${verifyUrl}`;
228
+ const response = await fetch(url, {
229
+ method: "GET",
230
+ headers: {
231
+ "Content-Type": "application/json",
232
+ Authorization: `Token ${this.apiKey}`,
233
+ },
234
+ // body: JSON.stringify(data),
235
+ });
236
+
237
+ if (response.status !== 200) {
238
+ console.error('La verificación de la transacción falló.');
239
+ return null;
240
+ } else {
241
+ const response_json = await response.json();
242
+ return response_json;
243
+ }
244
+
245
+ }
246
+
247
+ // Returns an object
248
+ // https://example.com/?name=John&age=30&city=NewYork
249
+ // { name: "John", age: "30", city: "NewYork" }
250
+ getURLParameters() {
251
+ const parameters: any = {};
252
+ const urlParams: any = new URLSearchParams(window.location.search);
253
+
254
+ for (const [key, value] of urlParams) {
255
+ parameters[key] = value;
256
+ }
257
+
258
+ return parameters;
259
+ }
260
+
261
+ handleSuccessTransaction(response: any) {
262
+ this.removeVerifyTransactionUrl();
263
+ console.log('Transacción autorizada.');
264
+ return response;
265
+ }
266
+
267
+ handleDeclinedTransaction(response: any) {
268
+ this.removeVerifyTransactionUrl();
269
+ return response;
270
+ }
271
+
272
+ // TODO: the method below needs to be tested with a real 3DS challenge
273
+ // since we couldn't get a test card that works with this feature
274
+ async handle3dsChallenge(response_json: any) {
275
+ // Create the form element:
276
+ const form = document.createElement('form');
277
+ form.name = 'frm';
278
+ form.method = 'POST';
279
+ form.action = response_json.redirect_post_url;
280
+
281
+ // Add hidden fields:
282
+ const creqInput = document.createElement('input');
283
+ creqInput.type = 'hidden';
284
+ creqInput.name = response_json.creq;
285
+ creqInput.value = response_json.creq;
286
+ form.appendChild(creqInput);
287
+
288
+ const termUrlInput = document.createElement('input');
289
+ termUrlInput.type = 'hidden';
290
+ termUrlInput.name = response_json.term_url;
291
+ termUrlInput.value = response_json.TermUrl;
292
+ form.appendChild(termUrlInput);
293
+
294
+ // Append the form to the body:
295
+ document.body.appendChild(form);
296
+ form.submit();
297
+
298
+ await this.verifyTransactionStatus();
299
+ }
300
+
301
+ // TODO: This method could be removed
302
+ async handleTransactionResponse(response: any) {
303
+ const response_json = await response.json();
304
+ if (response_json.status === "Pending" && response_json.redirect_post_url) {
305
+ return await this.handle3dsChallenge(response_json);
306
+ } else if (["Success", "Authorized"].includes(response_json.status)) {
307
+ return this.handleSuccessTransaction(response_json);
308
+ } else {
309
+ this.handleDeclinedTransaction(response);
310
+ return response_json
311
+ }
312
+ }
313
+
314
+ async verifyTransactionStatus() {
315
+ const verifyUrl = this.getUrlWithExpiration();
316
+ if (verifyUrl) {
317
+ const url = `${this.baseUrl}${verifyUrl}`;
318
+ try {
319
+ const response = await fetch(url, {
320
+ method: "GET",
321
+ headers: {
322
+ "Content-Type": "application/json",
323
+ Authorization: `Token ${this.apiKey}`,
324
+ },
325
+ // body: JSON.stringify(data),
326
+ });
327
+
328
+ if (response.status !== 200) {
329
+ console.error('La verificación de la transacción falló.');
330
+ this.removeVerifyTransactionUrl();
331
+ return response
332
+ }
333
+
334
+ return await this.handleTransactionResponse(response);
335
+ } catch (error) {
336
+ console.error('Error al verificar la transacción:', error);
337
+ this.removeVerifyTransactionUrl();
338
+ }
339
+ } else {
340
+ console.log('No verify_transaction_status_url found');
341
+ }
342
+ }
343
+
344
+ setPayload = (payload: any) => {
345
+ this.payload = payload
346
+ }
347
+ }