@tonder.io/ionic-full-sdk 0.0.35-beta → 0.0.36-beta
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/classes/3dsHandler.d.ts +0 -3
- package/dist/classes/inlineCheckout.d.ts +4 -2
- package/dist/helpers/constants.d.ts +62 -0
- package/dist/helpers/template.d.ts +1 -1
- package/dist/helpers/utils.d.ts +4 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/classes/3dsHandler.ts +0 -13
- package/src/classes/inlineCheckout.ts +25 -13
- package/src/helpers/constants.ts +64 -0
- package/src/helpers/template.ts +26 -21
- package/src/helpers/utils.ts +251 -0
package/package.json
CHANGED
|
@@ -65,19 +65,6 @@ export class ThreeDSHandler {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
saveCheckoutId(checkoutId: any) {
|
|
69
|
-
localStorage.setItem('checkout_id', JSON.stringify(checkoutId))
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
removeCheckoutId() {
|
|
73
|
-
localStorage.removeItem("checkout_id")
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
getCurrentCheckoutId() {
|
|
77
|
-
const checkout_id = localStorage.getItem("checkout_id")
|
|
78
|
-
return checkout_id ? JSON.parse(checkout_id):null; // TODO: JSON.parse de una string?
|
|
79
|
-
}
|
|
80
|
-
|
|
81
68
|
getUrlWithExpiration() {
|
|
82
69
|
const status = this.getStorageItem();
|
|
83
70
|
if(status) {
|
|
@@ -13,7 +13,7 @@ import { Business, Customer, PaymentData, OrderItem } from '@tonder.io/ionic-lit
|
|
|
13
13
|
import { CustomerRegisterResponse, StartCheckoutResponse } from '@tonder.io/ionic-lite-sdk/dist/types/responses';
|
|
14
14
|
import { StartCheckoutRequest, CreatePaymentRequest, CreateOrderRequest } from '@tonder.io/ionic-lite-sdk/dist/types/requests';
|
|
15
15
|
import { InCollectorContainer } from '../helpers/skyflow';
|
|
16
|
-
import { APM } from '
|
|
16
|
+
import { APM } from '@tonder.io/ionic-lite-sdk/dist/types/commons';
|
|
17
17
|
|
|
18
18
|
export type InlineCheckoutConstructor = {
|
|
19
19
|
returnUrl: string,
|
|
@@ -26,7 +26,8 @@ export type InlineCheckoutConstructor = {
|
|
|
26
26
|
containerId?: string,
|
|
27
27
|
collectorIds?: CollectorIds,
|
|
28
28
|
isOpenPaySandbox?: boolean,
|
|
29
|
-
isEnrollmentCard?: boolean
|
|
29
|
+
isEnrollmentCard?: boolean,
|
|
30
|
+
mode?: 'production' | 'stage' | 'sandbox' | 'development',
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
export class InlineCheckout {
|
|
@@ -73,6 +74,7 @@ export class InlineCheckout {
|
|
|
73
74
|
card = {}
|
|
74
75
|
currency: string = ""
|
|
75
76
|
isEnrollmentCard: boolean = false
|
|
77
|
+
mode: 'production' | 'stage' | 'sandbox' | 'development' = "stage"
|
|
76
78
|
|
|
77
79
|
constructor ({
|
|
78
80
|
apiKey,
|
|
@@ -86,7 +88,9 @@ export class InlineCheckout {
|
|
|
86
88
|
isOpenPaySandbox,
|
|
87
89
|
isEnrollmentCard,
|
|
88
90
|
renderSaveCardButton,
|
|
91
|
+
mode = 'stage',
|
|
89
92
|
}: InlineCheckoutConstructor) {
|
|
93
|
+
this.mode = mode
|
|
90
94
|
this.apiKeyTonder = apiKey;
|
|
91
95
|
this.returnUrl = returnUrl;
|
|
92
96
|
this.successUrl = successUrl;
|
|
@@ -94,7 +98,7 @@ export class InlineCheckout {
|
|
|
94
98
|
this.renderSaveCardButton = renderSaveCardButton;
|
|
95
99
|
this.callBack = callBack;
|
|
96
100
|
this.customStyles = styles
|
|
97
|
-
|
|
101
|
+
this.baseUrl = this.#getBaseUrl()
|
|
98
102
|
this.abortController = new AbortController()
|
|
99
103
|
|
|
100
104
|
this.liteCheckout = new LiteCheckout({
|
|
@@ -134,6 +138,17 @@ export class InlineCheckout {
|
|
|
134
138
|
this.isEnrollmentCard = isEnrollmentCard === undefined ? false : isEnrollmentCard
|
|
135
139
|
}
|
|
136
140
|
|
|
141
|
+
#getBaseUrl() {
|
|
142
|
+
const modeUrls = {
|
|
143
|
+
'production': 'https://app.tonder.io',
|
|
144
|
+
'sandbox': 'https://sandbox.tonder.io',
|
|
145
|
+
'stage': 'https://stage.tonder.io',
|
|
146
|
+
'development': 'http://localhost:8000',
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
return modeUrls[this.mode] || modeUrls['stage']
|
|
150
|
+
}
|
|
151
|
+
|
|
137
152
|
#mountPayButton() {
|
|
138
153
|
if (!this.renderPaymentButton) return;
|
|
139
154
|
|
|
@@ -176,7 +191,7 @@ export class InlineCheckout {
|
|
|
176
191
|
if (!this.renderSaveCardButton) return;
|
|
177
192
|
|
|
178
193
|
const saveButton: HTMLElement | null = document.querySelector(`#${this.collectorIds.tonderSaveCardButton}`);
|
|
179
|
-
|
|
194
|
+
|
|
180
195
|
if (!saveButton) {
|
|
181
196
|
console.error("Save button not found");
|
|
182
197
|
return;
|
|
@@ -184,9 +199,9 @@ export class InlineCheckout {
|
|
|
184
199
|
|
|
185
200
|
|
|
186
201
|
saveButton.style.display = "block";
|
|
187
|
-
|
|
202
|
+
|
|
188
203
|
saveButton.textContent = `Guardar`;
|
|
189
|
-
|
|
204
|
+
|
|
190
205
|
saveButton.onclick = async (event) => {
|
|
191
206
|
event.preventDefault();
|
|
192
207
|
await this.#handleSaveCardClick(saveButton);
|
|
@@ -255,7 +270,6 @@ export class InlineCheckout {
|
|
|
255
270
|
this.#handleCard(data)
|
|
256
271
|
const response: ErrorResponse | StartCheckoutResponse | false | undefined = await this.#checkout()
|
|
257
272
|
this.process3ds.setPayload(response)
|
|
258
|
-
this.process3ds.saveCheckoutId(response && 'checkout_id' in response ? response.checkout_id:"")
|
|
259
273
|
this.callBack(response);
|
|
260
274
|
const payload = await this.handle3dsRedirect(response)
|
|
261
275
|
if (payload) {
|
|
@@ -386,8 +400,7 @@ export class InlineCheckout {
|
|
|
386
400
|
async resumeCheckout(response: any) {
|
|
387
401
|
if (["Failed", "Declined", "Cancelled"].includes(response?.status)) {
|
|
388
402
|
const routerItems = {
|
|
389
|
-
|
|
390
|
-
checkout_id: this.process3ds.getCurrentCheckoutId(),
|
|
403
|
+
checkout_id: response.checkout?.id,
|
|
391
404
|
};
|
|
392
405
|
const routerResponse = await this.liteCheckout.handleCheckoutRouter(
|
|
393
406
|
routerItems
|
|
@@ -478,7 +491,6 @@ export class InlineCheckout {
|
|
|
478
491
|
}
|
|
479
492
|
|
|
480
493
|
}
|
|
481
|
-
|
|
482
494
|
await this.#mountAPMs();
|
|
483
495
|
|
|
484
496
|
this.collectContainer = await initSkyflow(
|
|
@@ -545,6 +557,7 @@ export class InlineCheckout {
|
|
|
545
557
|
}
|
|
546
558
|
|
|
547
559
|
async #getCardTokens(tonderButton: string){
|
|
560
|
+
console.log("this.collectContainer: ", this.collectContainer)
|
|
548
561
|
if(this.collectContainer && "container" in this.collectContainer && "collect" in this.collectContainer.container) {
|
|
549
562
|
try {
|
|
550
563
|
const collectResponseSkyflowTonder: any = await this.collectContainer?.container.collect();
|
|
@@ -561,7 +574,7 @@ export class InlineCheckout {
|
|
|
561
574
|
try {
|
|
562
575
|
|
|
563
576
|
const selector: any = document.querySelector(`#${this.collectorIds.tonderSaveCardButton}`);
|
|
564
|
-
|
|
577
|
+
|
|
565
578
|
if(selector){
|
|
566
579
|
selector.disabled = disabled;
|
|
567
580
|
selector.innerHTML = text
|
|
@@ -576,10 +589,9 @@ export class InlineCheckout {
|
|
|
576
589
|
if(this.merchantData && "openpay_keys" in this.merchantData) {
|
|
577
590
|
const cardTokensSkyflowTonder: any = await this.#getCardTokens(this.collectorIds.tonderSaveCardButton!);
|
|
578
591
|
const customerResponse : CustomerRegisterResponse | ErrorResponse = await this.getCustomer(this.email);
|
|
579
|
-
|
|
592
|
+
|
|
580
593
|
if("auth_token" in customerResponse) {
|
|
581
594
|
const { auth_token, id: cutomerId } = customerResponse;
|
|
582
|
-
console.log("cardTokensSkyflowTonder: ", cardTokensSkyflowTonder)
|
|
583
595
|
await this.liteCheckout.registerCustomerCard(auth_token, { skyflow_id: cardTokensSkyflowTonder.skyflow_id });
|
|
584
596
|
showMessage("Tarjeta registrada con éxito", this.collectorIds.msgNotification);
|
|
585
597
|
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
enum PAYMENT_METHOD {
|
|
2
|
+
SORIANA = "SORIANA",
|
|
3
|
+
OXXO = "OXXO",
|
|
4
|
+
SPEI= "SPEI",
|
|
5
|
+
CODI= "CODI",
|
|
6
|
+
MERCADOPAGO= "MERCADOPAGO",
|
|
7
|
+
PAYPAL= "PAYPAL",
|
|
8
|
+
COMERCIALMEXICANA= "COMERCIALMEXICANA",
|
|
9
|
+
BANCOMER= "BANCOMER",
|
|
10
|
+
WALMART= "WALMART",
|
|
11
|
+
BODEGA= "BODEGA",
|
|
12
|
+
SAMSCLUB= "SAMSCLUB",
|
|
13
|
+
SUPERAMA= "SUPERAMA",
|
|
14
|
+
CALIMAX= "CALIMAX",
|
|
15
|
+
EXTRA= "EXTRA",
|
|
16
|
+
CIRCULOK= "CIRCULOK",
|
|
17
|
+
SEVEN11= "7ELEVEN",
|
|
18
|
+
TELECOMM= "TELECOMM",
|
|
19
|
+
BANORTE= "BANORTE",
|
|
20
|
+
BENAVIDES= "BENAVIDES",
|
|
21
|
+
DELAHORRO= "DELAHORRO",
|
|
22
|
+
ELASTURIANO= "ELASTURIANO",
|
|
23
|
+
WALDOS= "WALDOS",
|
|
24
|
+
ALSUPER= "ALSUPER",
|
|
25
|
+
KIOSKO= "KIOSKO",
|
|
26
|
+
STAMARIA= "STAMARIA",
|
|
27
|
+
LAMASBARATA= "LAMASBARATA",
|
|
28
|
+
FARMROMA= "FARMROMA",
|
|
29
|
+
FARMUNION= "FARMUNION",
|
|
30
|
+
FARMATODO= "FARMATODO",
|
|
31
|
+
SFDEASIS= "SFDEASIS",
|
|
32
|
+
FARM911= "FARM911",
|
|
33
|
+
FARMECONOMICAS= "FARMECONOMICAS",
|
|
34
|
+
FARMMEDICITY= "FARMMEDICITY",
|
|
35
|
+
RIANXEIRA= "RIANXEIRA",
|
|
36
|
+
WESTERNUNION= "WESTERNUNION",
|
|
37
|
+
ZONAPAGO= "ZONAPAGO",
|
|
38
|
+
CAJALOSANDES= "CAJALOSANDES",
|
|
39
|
+
CAJAPAITA= "CAJAPAITA",
|
|
40
|
+
CAJASANTA= "CAJASANTA",
|
|
41
|
+
CAJASULLANA= "CAJASULLANA",
|
|
42
|
+
CAJATRUJILLO= "CAJATRUJILLO",
|
|
43
|
+
EDPYME= "EDPYME",
|
|
44
|
+
KASNET= "KASNET",
|
|
45
|
+
NORANDINO= "NORANDINO",
|
|
46
|
+
QAPAQ= "QAPAQ",
|
|
47
|
+
RAIZ= "RAIZ",
|
|
48
|
+
PAYSER= "PAYSER",
|
|
49
|
+
WUNION= "WUNION",
|
|
50
|
+
BANCOCONTINENTAL= "BANCOCONTINENTAL",
|
|
51
|
+
GMONEY= "GMONEY",
|
|
52
|
+
GOPAY= "GOPAY",
|
|
53
|
+
WU= "WU",
|
|
54
|
+
PUNTOSHEY= "PUNTOSHEY",
|
|
55
|
+
AMPM= "AMPM",
|
|
56
|
+
JUMBOMARKET= "JUMBOMARKET",
|
|
57
|
+
SMELPUEBLO= "SMELPUEBLO",
|
|
58
|
+
BAM= "BAM",
|
|
59
|
+
REFACIL= "REFACIL",
|
|
60
|
+
ACYVALORES= "ACYVALORES"
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { PAYMENT_METHOD }
|
|
64
|
+
|
package/src/helpers/template.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { APM } from '
|
|
2
|
-
import { getCardType } from './utils';
|
|
3
|
-
import { getPaymentMethodDetails } from '@tonder.io/ionic-lite-sdk/dist/helpers/utils';
|
|
1
|
+
import { APM } from '@tonder.io/ionic-lite-sdk/dist/types/commons';
|
|
2
|
+
import { getCardType, getPaymentMethodDetails } from './utils';
|
|
4
3
|
|
|
5
4
|
export type CollectorIds = {
|
|
6
5
|
holderName: string,
|
|
@@ -78,6 +77,10 @@ ${external ? `` : `<style>
|
|
|
78
77
|
font-family: "Inter", sans-serif !important;
|
|
79
78
|
}
|
|
80
79
|
|
|
80
|
+
.container-form {
|
|
81
|
+
padding: 25px 21px 0px 21px;
|
|
82
|
+
}
|
|
83
|
+
|
|
81
84
|
.expiration-year .error-custom-inputs-tonder {
|
|
82
85
|
background-color: white;
|
|
83
86
|
position: absolute;
|
|
@@ -92,7 +95,7 @@ ${external ? `` : `<style>
|
|
|
92
95
|
.container-tonder {
|
|
93
96
|
background-color: #F9F9F9;
|
|
94
97
|
margin: 0 auto !important;
|
|
95
|
-
padding: 30px
|
|
98
|
+
padding: 30px 0px 30px 0px;
|
|
96
99
|
overflow: hidden;
|
|
97
100
|
transition: max-height 0.5s ease-out;
|
|
98
101
|
max-width: 600px;
|
|
@@ -100,7 +103,7 @@ ${external ? `` : `<style>
|
|
|
100
103
|
}
|
|
101
104
|
|
|
102
105
|
.container-pay-button{
|
|
103
|
-
padding: ${!!data['renderPaymentButton'] ? '30px
|
|
106
|
+
padding: ${!!data['renderPaymentButton'] ? '30px 30px':''};
|
|
104
107
|
}
|
|
105
108
|
|
|
106
109
|
.collect-row {
|
|
@@ -230,7 +233,7 @@ ${external ? `` : `<style>
|
|
|
230
233
|
.cards-list-container {
|
|
231
234
|
display: flex;
|
|
232
235
|
flex-direction: column;
|
|
233
|
-
padding: 0px
|
|
236
|
+
padding: 0px;
|
|
234
237
|
gap: 33% 20px;
|
|
235
238
|
}
|
|
236
239
|
|
|
@@ -253,6 +256,8 @@ ${external ? `` : `<style>
|
|
|
253
256
|
.checkbox {
|
|
254
257
|
margin-top: 10px;
|
|
255
258
|
margin-bottom: 20px;
|
|
259
|
+
margin-left: 10px !important;
|
|
260
|
+
margin-right: 10px !important;
|
|
256
261
|
width: 100%;
|
|
257
262
|
text-align: left;
|
|
258
263
|
}
|
|
@@ -262,12 +267,12 @@ ${external ? `` : `<style>
|
|
|
262
267
|
justify-content: start;
|
|
263
268
|
align-items: center;
|
|
264
269
|
color: #1D1D1D;
|
|
265
|
-
gap: 33%
|
|
270
|
+
gap: 33% 15px;
|
|
266
271
|
margin-top: 10px;
|
|
267
272
|
margin-bottom: 10px;
|
|
268
|
-
padding
|
|
269
|
-
|
|
270
|
-
|
|
273
|
+
padding: 0px 30px;
|
|
274
|
+
width: 100%;
|
|
275
|
+
position: relative;
|
|
271
276
|
}
|
|
272
277
|
|
|
273
278
|
.pay-new-card .card-number {
|
|
@@ -289,9 +294,7 @@ ${external ? `` : `<style>
|
|
|
289
294
|
gap: 33% 20px;
|
|
290
295
|
margin-top: 10px;
|
|
291
296
|
margin-bottom: 10px;
|
|
292
|
-
|
|
293
|
-
padding-right: 10px;
|
|
294
|
-
width: 90%;
|
|
297
|
+
width: 100%;
|
|
295
298
|
}
|
|
296
299
|
|
|
297
300
|
.card_selected {
|
|
@@ -409,18 +412,19 @@ export const cardItemsTemplate = (external: boolean, cards: Card[]) => {
|
|
|
409
412
|
align-items: center;
|
|
410
413
|
color: #1D1D1D;
|
|
411
414
|
gap: 33% 20px;
|
|
412
|
-
margin-top:
|
|
413
|
-
margin-bottom:
|
|
414
|
-
|
|
415
|
-
padding-right: 10px;
|
|
416
|
-
width: 90%;
|
|
415
|
+
margin-top: 15px;
|
|
416
|
+
margin-bottom: 15px;
|
|
417
|
+
width: 100%;
|
|
417
418
|
}
|
|
418
419
|
|
|
419
420
|
.card-item {
|
|
421
|
+
position: relative;
|
|
420
422
|
display: flex;
|
|
421
423
|
justify-content: start;
|
|
422
424
|
align-items: center;
|
|
423
|
-
gap: 33%
|
|
425
|
+
gap: 33% 15px;
|
|
426
|
+
border-bottom: 1px solid #e2e8f0;
|
|
427
|
+
padding: 0px 30px;
|
|
424
428
|
}
|
|
425
429
|
|
|
426
430
|
.card-item .card-number {
|
|
@@ -539,10 +543,11 @@ export const cardItemsTemplate = (external: boolean, cards: Card[]) => {
|
|
|
539
543
|
}
|
|
540
544
|
|
|
541
545
|
export const apmItemsTemplate = (external: boolean, apms: APM[]) => {
|
|
542
|
-
|
|
543
|
-
const apmItemsHTML = apms.reduce((
|
|
546
|
+
console.log("apms here****: ", apms)
|
|
547
|
+
const apmItemsHTML = apms.reduce((total, apm) => {
|
|
544
548
|
const apm_data = getPaymentMethodDetails(apm.payment_method);
|
|
545
549
|
return `
|
|
550
|
+
${total}
|
|
546
551
|
<div class="apm-item" id="card_container-${apm.id}">
|
|
547
552
|
<input id="${apm.id}" class="card_selected" name="card_selected" type="radio"/>
|
|
548
553
|
<label class="apm-item-label" for="${apm.id}">
|
package/src/helpers/utils.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PAYMENT_METHOD } from "./constants";
|
|
1
2
|
import { Card } from "./template";
|
|
2
3
|
import { GetCustomerCardsResponse } from "@tonder.io/ionic-lite-sdk/dist/types/responses"
|
|
3
4
|
|
|
@@ -146,4 +147,254 @@ export const getBrowserInfo = () => {
|
|
|
146
147
|
user_agent: navigator.userAgent,
|
|
147
148
|
};
|
|
148
149
|
return browserInfo;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export const getPaymentMethodDetails = (scheme_data: string): {icon: string; label: string} => {
|
|
153
|
+
const scheme: PAYMENT_METHOD = clearSpace(scheme_data.toUpperCase()) as PAYMENT_METHOD;
|
|
154
|
+
|
|
155
|
+
const PAYMENT_METHODS_CATALOG: Partial<Record<PAYMENT_METHOD, { icon: string, label: string }>> = {
|
|
156
|
+
[PAYMENT_METHOD.SORIANA]: {
|
|
157
|
+
label: "Soriana",
|
|
158
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/soriana.png",
|
|
159
|
+
},
|
|
160
|
+
[PAYMENT_METHOD.OXXO]: {
|
|
161
|
+
label: "Oxxo",
|
|
162
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/oxxo.png",
|
|
163
|
+
},
|
|
164
|
+
[PAYMENT_METHOD.CODI]: {
|
|
165
|
+
label: "CoDi",
|
|
166
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/codi.png",
|
|
167
|
+
},
|
|
168
|
+
[PAYMENT_METHOD.SPEI]: {
|
|
169
|
+
label: "SPEI",
|
|
170
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/spei.png",
|
|
171
|
+
},
|
|
172
|
+
[PAYMENT_METHOD.PAYPAL]: {
|
|
173
|
+
label: "Paypal",
|
|
174
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/paypal.png",
|
|
175
|
+
},
|
|
176
|
+
[PAYMENT_METHOD.COMERCIALMEXICANA]: {
|
|
177
|
+
label: "Comercial Mexicana",
|
|
178
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/comercial_exicana.png",
|
|
179
|
+
},
|
|
180
|
+
[PAYMENT_METHOD.BANCOMER]: {
|
|
181
|
+
label: "Bancomer",
|
|
182
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/bancomer.png",
|
|
183
|
+
},
|
|
184
|
+
[PAYMENT_METHOD.WALMART]: {
|
|
185
|
+
label: "Walmart",
|
|
186
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/walmart.png",
|
|
187
|
+
},
|
|
188
|
+
[PAYMENT_METHOD.BODEGA]: {
|
|
189
|
+
label: "Bodega Aurrera",
|
|
190
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/bodega_aurrera.png",
|
|
191
|
+
},
|
|
192
|
+
[PAYMENT_METHOD.SAMSCLUB]: {
|
|
193
|
+
label: "Sam´s Club",
|
|
194
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/sams_club.png",
|
|
195
|
+
},
|
|
196
|
+
[PAYMENT_METHOD.SUPERAMA]: {
|
|
197
|
+
label: "Superama",
|
|
198
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/superama.png",
|
|
199
|
+
},
|
|
200
|
+
[PAYMENT_METHOD.CALIMAX]: {
|
|
201
|
+
label: "Calimax",
|
|
202
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/calimax.png",
|
|
203
|
+
},
|
|
204
|
+
[PAYMENT_METHOD.EXTRA]: {
|
|
205
|
+
label: "Tiendas Extra",
|
|
206
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/tiendas_extra.png",
|
|
207
|
+
},
|
|
208
|
+
[PAYMENT_METHOD.CIRCULOK]: {
|
|
209
|
+
label: "Círculo K",
|
|
210
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/circulo_k.png",
|
|
211
|
+
},
|
|
212
|
+
[PAYMENT_METHOD.SEVEN11]: {
|
|
213
|
+
label: "7 Eleven",
|
|
214
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/7_eleven.png",
|
|
215
|
+
},
|
|
216
|
+
[PAYMENT_METHOD.TELECOMM]: {
|
|
217
|
+
label: "Telecomm",
|
|
218
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/telecomm.png",
|
|
219
|
+
},
|
|
220
|
+
[PAYMENT_METHOD.BANORTE]: {
|
|
221
|
+
label: "Banorte",
|
|
222
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/banorte.png",
|
|
223
|
+
},
|
|
224
|
+
[PAYMENT_METHOD.BENAVIDES]: {
|
|
225
|
+
label: "Farmacias Benavides",
|
|
226
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/farmacias_benavides.png",
|
|
227
|
+
},
|
|
228
|
+
[PAYMENT_METHOD.DELAHORRO]: {
|
|
229
|
+
label: "Farmacias del Ahorro",
|
|
230
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/farmacias_ahorro.png",
|
|
231
|
+
},
|
|
232
|
+
[PAYMENT_METHOD.ELASTURIANO]: {
|
|
233
|
+
label: "El Asturiano",
|
|
234
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/asturiano.png",
|
|
235
|
+
},
|
|
236
|
+
[PAYMENT_METHOD.WALDOS]: {
|
|
237
|
+
label: "Waldos",
|
|
238
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/waldos.png",
|
|
239
|
+
},
|
|
240
|
+
[PAYMENT_METHOD.ALSUPER]: {
|
|
241
|
+
label: "Alsuper",
|
|
242
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/al_super.png",
|
|
243
|
+
},
|
|
244
|
+
[PAYMENT_METHOD.KIOSKO]: {
|
|
245
|
+
label: "Kiosko",
|
|
246
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/kiosko.png",
|
|
247
|
+
},
|
|
248
|
+
[PAYMENT_METHOD.STAMARIA]: {
|
|
249
|
+
label: "Farmacias Santa María",
|
|
250
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/farmacias_santa_maria.png",
|
|
251
|
+
},
|
|
252
|
+
[PAYMENT_METHOD.LAMASBARATA]: {
|
|
253
|
+
label: "Farmacias la más barata",
|
|
254
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/farmacias_barata.png",
|
|
255
|
+
},
|
|
256
|
+
[PAYMENT_METHOD.FARMROMA]: {
|
|
257
|
+
label: "Farmacias Roma",
|
|
258
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/farmacias_roma.png",
|
|
259
|
+
},
|
|
260
|
+
[PAYMENT_METHOD.FARMUNION]: {
|
|
261
|
+
label: "Pago en Farmacias Unión",
|
|
262
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/farmacias_union.png",
|
|
263
|
+
},
|
|
264
|
+
[PAYMENT_METHOD.FARMATODO]: {
|
|
265
|
+
label: "Pago en Farmacias Farmatodo",
|
|
266
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/farmacias_farmatodo.png ",
|
|
267
|
+
},
|
|
268
|
+
[PAYMENT_METHOD.SFDEASIS]: {
|
|
269
|
+
label: "Pago en Farmacias San Francisco de Asís",
|
|
270
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/farmacias_san_francisco.png",
|
|
271
|
+
},
|
|
272
|
+
[PAYMENT_METHOD.FARM911]: {
|
|
273
|
+
label: "Farmacias 911",
|
|
274
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
275
|
+
},
|
|
276
|
+
[PAYMENT_METHOD.FARMECONOMICAS]: {
|
|
277
|
+
label: "Farmacias Economicas",
|
|
278
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
279
|
+
},
|
|
280
|
+
[PAYMENT_METHOD.FARMMEDICITY]: {
|
|
281
|
+
label: "Farmacias Medicity",
|
|
282
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
283
|
+
},
|
|
284
|
+
[PAYMENT_METHOD.RIANXEIRA]: {
|
|
285
|
+
label: "Rianxeira",
|
|
286
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
287
|
+
},
|
|
288
|
+
[PAYMENT_METHOD.WESTERNUNION]: {
|
|
289
|
+
label: "Western Union",
|
|
290
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
291
|
+
},
|
|
292
|
+
[PAYMENT_METHOD.ZONAPAGO]: {
|
|
293
|
+
label: "Zona Pago",
|
|
294
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
295
|
+
},
|
|
296
|
+
[PAYMENT_METHOD.CAJALOSANDES]: {
|
|
297
|
+
label: "Caja Los Andes",
|
|
298
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
299
|
+
},
|
|
300
|
+
[PAYMENT_METHOD.CAJAPAITA]: {
|
|
301
|
+
label: "Caja Paita",
|
|
302
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
303
|
+
},
|
|
304
|
+
[PAYMENT_METHOD.CAJASANTA]: {
|
|
305
|
+
label: "Caja Santa",
|
|
306
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
307
|
+
},
|
|
308
|
+
[PAYMENT_METHOD.CAJASULLANA]: {
|
|
309
|
+
label: "Caja Sullana",
|
|
310
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
311
|
+
},
|
|
312
|
+
[PAYMENT_METHOD.CAJATRUJILLO]: {
|
|
313
|
+
label: "Caja Trujillo",
|
|
314
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
315
|
+
},
|
|
316
|
+
[PAYMENT_METHOD.EDPYME]: {
|
|
317
|
+
label: "Edpyme",
|
|
318
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
319
|
+
},
|
|
320
|
+
[PAYMENT_METHOD.KASNET]: {
|
|
321
|
+
label: "KasNet",
|
|
322
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
323
|
+
},
|
|
324
|
+
[PAYMENT_METHOD.NORANDINO]: {
|
|
325
|
+
label: "Norandino",
|
|
326
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
327
|
+
},
|
|
328
|
+
[PAYMENT_METHOD.QAPAQ]: {
|
|
329
|
+
label: "Qapaq",
|
|
330
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
331
|
+
},
|
|
332
|
+
[PAYMENT_METHOD.RAIZ]: {
|
|
333
|
+
label: "Raiz",
|
|
334
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
335
|
+
},
|
|
336
|
+
[PAYMENT_METHOD.PAYSER]: {
|
|
337
|
+
label: "Paysera",
|
|
338
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
339
|
+
},
|
|
340
|
+
[PAYMENT_METHOD.WUNION]: {
|
|
341
|
+
label: "Western Union",
|
|
342
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
343
|
+
},
|
|
344
|
+
[PAYMENT_METHOD.BANCOCONTINENTAL]: {
|
|
345
|
+
label: "Banco Continental",
|
|
346
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
347
|
+
},
|
|
348
|
+
[PAYMENT_METHOD.GMONEY]: {
|
|
349
|
+
label: "Go money",
|
|
350
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
351
|
+
},
|
|
352
|
+
[PAYMENT_METHOD.GOPAY]: {
|
|
353
|
+
label: "Go pay",
|
|
354
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
355
|
+
},
|
|
356
|
+
[PAYMENT_METHOD.WU]: {
|
|
357
|
+
label: "Western Union",
|
|
358
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
359
|
+
},
|
|
360
|
+
[PAYMENT_METHOD.PUNTOSHEY]: {
|
|
361
|
+
label: "Puntoshey",
|
|
362
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
363
|
+
},
|
|
364
|
+
[PAYMENT_METHOD.AMPM]: {
|
|
365
|
+
label: "Ampm",
|
|
366
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
367
|
+
},
|
|
368
|
+
[PAYMENT_METHOD.JUMBOMARKET]: {
|
|
369
|
+
label: "Jumbomarket",
|
|
370
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
371
|
+
},
|
|
372
|
+
[PAYMENT_METHOD.SMELPUEBLO]: {
|
|
373
|
+
label: "Smelpueblo",
|
|
374
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
375
|
+
},
|
|
376
|
+
[PAYMENT_METHOD.BAM]: {
|
|
377
|
+
label: "Bam",
|
|
378
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
379
|
+
},
|
|
380
|
+
[PAYMENT_METHOD.REFACIL]: {
|
|
381
|
+
label: "Refacil",
|
|
382
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
383
|
+
},
|
|
384
|
+
[PAYMENT_METHOD.ACYVALORES]: {
|
|
385
|
+
label: "Acyvalores",
|
|
386
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
387
|
+
},
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
const _default = {
|
|
391
|
+
icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
|
|
392
|
+
label: ""
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
return PAYMENT_METHODS_CATALOG[scheme] || _default;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
const clearSpace = (text: string) => {
|
|
399
|
+
return text.trim().replace(/\s+/g, '');
|
|
149
400
|
}
|