@tonder.io/ionic-lite-sdk 0.0.28-beta → 0.0.29-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/README.md +78 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -437,6 +437,84 @@ const jsonResponseRouter = await liteCheckout.startCheckoutRouter(
|
|
|
437
437
|
|
|
438
438
|
## Take actions on base to the checkout router response
|
|
439
439
|
|
|
440
|
+
# Checkout router full
|
|
441
|
+
|
|
442
|
+
<font size="4">This method integrate the create order, create payment and checkout router methods into one method, the info required to this method is:</font>
|
|
443
|
+
|
|
444
|
+
```typescript
|
|
445
|
+
|
|
446
|
+
const returnUrl = "http://localhost:8100/payment/success";
|
|
447
|
+
|
|
448
|
+
let checkoutData = {
|
|
449
|
+
customer: {
|
|
450
|
+
name: "Jhon",
|
|
451
|
+
lastname: "Doe",
|
|
452
|
+
email: "john.c.calhoun@examplepetstore.com",
|
|
453
|
+
phone: "+58452258525"
|
|
454
|
+
},
|
|
455
|
+
order: {
|
|
456
|
+
items: [
|
|
457
|
+
{
|
|
458
|
+
description: "Test product description",
|
|
459
|
+
quantity: 1,
|
|
460
|
+
price_unit: 25,
|
|
461
|
+
discount: 1,
|
|
462
|
+
taxes: 12,
|
|
463
|
+
product_reference: 89456123,
|
|
464
|
+
name: "Test product",
|
|
465
|
+
amount_total: 25
|
|
466
|
+
}
|
|
467
|
+
]
|
|
468
|
+
},
|
|
469
|
+
return_url: returnUrl,
|
|
470
|
+
total: 25,
|
|
471
|
+
isSandbox: true,
|
|
472
|
+
metadata: {},
|
|
473
|
+
currency: "MXN",
|
|
474
|
+
skyflowTokens: {
|
|
475
|
+
cardholder_name: "",
|
|
476
|
+
card_number: "",
|
|
477
|
+
expiration_year: "",
|
|
478
|
+
expiration_month: "",
|
|
479
|
+
cvv: "",
|
|
480
|
+
skyflow_id: ""
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
<font size="4">It is required get the skyflow tokens to add it to the checkout router method, the values of the variable skyflowFields come from your html form</font>
|
|
487
|
+
|
|
488
|
+
```typescript
|
|
489
|
+
|
|
490
|
+
const merchantData: any = await liteCheckout.getBusiness();
|
|
491
|
+
|
|
492
|
+
const { vault_id, vault_url } = merchantData;
|
|
493
|
+
|
|
494
|
+
const skyflowFields = {
|
|
495
|
+
card_number: this.paymentForm.value.cardNumber,
|
|
496
|
+
cvv: this.paymentForm.value.cvv,
|
|
497
|
+
expiration_month: this.paymentForm.value.month,
|
|
498
|
+
expiration_year: this.paymentForm.value.expirationYear,
|
|
499
|
+
cardholder_name: this.paymentForm.value.name
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
const skyflowTokens = await liteCheckout.getSkyflowTokens({
|
|
503
|
+
vault_id: vault_id,
|
|
504
|
+
vault_url: vault_url,
|
|
505
|
+
data: skyflowFields
|
|
506
|
+
})
|
|
507
|
+
|
|
508
|
+
checkoutData.skyflowTokens = skyflowTokens;
|
|
509
|
+
|
|
510
|
+
const jsonResponseRouter: any = await liteCheckout.startCheckoutRouterFull(
|
|
511
|
+
checkoutData
|
|
512
|
+
);
|
|
513
|
+
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
<font size="4">The response is the same to the startCheckoutRouter method. Take actions on base to the checkout router response</font>
|
|
517
|
+
|
|
440
518
|
# Customer Cards(Register)
|
|
441
519
|
|
|
442
520
|
## Register customer card
|