@tonder.io/ionic-full-sdk 0.0.26-beta → 0.0.28-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/package.json
CHANGED
|
@@ -19,7 +19,7 @@ export type InlineCheckoutConstructor = {
|
|
|
19
19
|
apiKey: string,
|
|
20
20
|
successUrl?: string,
|
|
21
21
|
renderPaymentButton: boolean,
|
|
22
|
-
renderSaveCardButton
|
|
22
|
+
renderSaveCardButton?: boolean,
|
|
23
23
|
callBack?: (params: any) => void,
|
|
24
24
|
styles?: any,
|
|
25
25
|
containerId?: string,
|
|
@@ -38,7 +38,7 @@ export class InlineCheckout {
|
|
|
38
38
|
returnUrl?: string
|
|
39
39
|
successUrl?: string
|
|
40
40
|
renderPaymentButton: boolean
|
|
41
|
-
renderSaveCardButton
|
|
41
|
+
renderSaveCardButton?: boolean
|
|
42
42
|
callBack: (params: any) => void
|
|
43
43
|
customStyles: any
|
|
44
44
|
abortController: AbortController
|
|
@@ -82,7 +82,7 @@ export class InlineCheckout {
|
|
|
82
82
|
collectorIds,
|
|
83
83
|
isOpenPaySandbox,
|
|
84
84
|
isEnrollmentCard,
|
|
85
|
-
renderSaveCardButton
|
|
85
|
+
renderSaveCardButton,
|
|
86
86
|
}: InlineCheckoutConstructor) {
|
|
87
87
|
this.apiKeyTonder = apiKey;
|
|
88
88
|
this.returnUrl = returnUrl;
|
|
@@ -520,7 +520,7 @@ export class InlineCheckout {
|
|
|
520
520
|
if(this.email){
|
|
521
521
|
try{
|
|
522
522
|
if(this.merchantData && "openpay_keys" in this.merchantData) {
|
|
523
|
-
const cardTokensSkyflowTonder: any = await this.#getCardTokens(this.collectorIds.tonderSaveCardButton);
|
|
523
|
+
const cardTokensSkyflowTonder: any = await this.#getCardTokens(this.collectorIds.tonderSaveCardButton!);
|
|
524
524
|
const customerResponse : CustomerRegisterResponse | ErrorResponse = await this.getCustomer(this.email);
|
|
525
525
|
|
|
526
526
|
if("auth_token" in customerResponse) {
|
|
@@ -530,11 +530,11 @@ export class InlineCheckout {
|
|
|
530
530
|
showMessage("Tarjeta registrada con éxito", this.collectorIds.msgNotification);
|
|
531
531
|
}
|
|
532
532
|
}else{
|
|
533
|
-
showError("No se han configurado los datos del proveedor de servicio", this.collectorIds.msgError, this.collectorIds.tonderSaveCardButton)
|
|
533
|
+
showError("No se han configurado los datos del proveedor de servicio", this.collectorIds.msgError, this.collectorIds.tonderSaveCardButton!)
|
|
534
534
|
}
|
|
535
535
|
} catch (error) {
|
|
536
536
|
console.log(error);
|
|
537
|
-
showError("Ha ocurrido un error", this.collectorIds.msgError, this.collectorIds.tonderSaveCardButton)
|
|
537
|
+
showError("Ha ocurrido un error", this.collectorIds.msgError, this.collectorIds.tonderSaveCardButton!)
|
|
538
538
|
throw error;
|
|
539
539
|
} finally {}
|
|
540
540
|
}
|
package/src/helpers/template.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type CollectorIds = {
|
|
|
7
7
|
expirationYear: string,
|
|
8
8
|
cvv: string,
|
|
9
9
|
tonderPayButton: string,
|
|
10
|
-
tonderSaveCardButton
|
|
10
|
+
tonderSaveCardButton?: string,
|
|
11
11
|
msgError: string,
|
|
12
12
|
msgNotification: string,
|
|
13
13
|
cardsListContainer: string
|
|
@@ -54,7 +54,7 @@ export const cardTemplate = (external: boolean, collectorIds: CollectorIds, isEn
|
|
|
54
54
|
<div id="${collectorIds.msgNotification}"></div>
|
|
55
55
|
</div>
|
|
56
56
|
<button id="${collectorIds.tonderPayButton}" class="pay-button">Pagar</button>
|
|
57
|
-
<button id="${collectorIds.tonderSaveCardButton}" class="save-card-button">Guardar</button>
|
|
57
|
+
<button id="${collectorIds.tonderSaveCardButton ? collectorIds.tonderSaveCardButton:''}" class="save-card-button">Guardar</button>
|
|
58
58
|
</div>
|
|
59
59
|
|
|
60
60
|
${external ? `` : `<style>
|