@paydock/client-sdk 1.111.1 → 1.113.2-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 +39 -0
- package/bundles/index.cjs +345 -307
- package/bundles/index.cjs.d.ts +4 -0
- package/bundles/index.mjs +345 -307
- package/bundles/index.mjs.d.ts +4 -0
- package/bundles/types/api/api-base.d.ts.map +1 -1
- package/bundles/types/api/api-checkout-internal.d.ts +1 -0
- package/bundles/types/api/api-checkout-internal.d.ts.map +1 -1
- package/bundles/types/checkout/checkout.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.apple_pay_form.show.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.canvas_3ds.show.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.google_pay_form.show.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.paypal_form.show.d.ts.map +1 -1
- package/bundles/types/checkout/layout-widgets/additionals.d.ts +1 -1
- package/bundles/types/checkout/layout-widgets/additionals.d.ts.map +1 -1
- package/bundles/types/checkout/layout-widgets/payment-methods-template.d.ts +3 -0
- package/bundles/types/checkout/layout-widgets/payment-methods-template.d.ts.map +1 -1
- package/bundles/types/checkout/layout-widgets/payment-template.d.ts +1 -1
- package/bundles/types/components/iframe-event.d.ts +2 -0
- package/bundles/types/components/iframe-event.d.ts.map +1 -1
- package/bundles/types/index-cba.d.ts +1 -0
- package/bundles/types/index-cba.d.ts.map +1 -1
- package/bundles/types/secure-remote-commerce/index.d.ts +1 -0
- package/bundles/types/secure-remote-commerce/index.d.ts.map +1 -1
- package/bundles/types/secure-remote-commerce/interfaces.d.ts +12 -2
- package/bundles/types/secure-remote-commerce/interfaces.d.ts.map +1 -1
- package/bundles/types/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts.map +1 -1
- package/bundles/widget.umd.js +345 -307
- package/bundles/widget.umd.js.d.ts +4 -0
- package/bundles/widget.umd.js.min.d.ts +4 -0
- package/bundles/widget.umd.min.js +7 -7
- package/docs/click-to-pay-examples.md +36 -0
- package/docs/click-to-pay.md +3 -0
- package/package.json +66 -66
- package/slate.md +36 -0
package/README.md
CHANGED
|
@@ -7627,6 +7627,42 @@ src.setStyles({
|
|
|
7627
7627
|
});
|
|
7628
7628
|
```
|
|
7629
7629
|
|
|
7630
|
+
## Recognition token
|
|
7631
|
+
|
|
7632
|
+
In order to store user information for further payments, click to pay provides a recognition token that is used to load user information.
|
|
7633
|
+
If you already have a recognitionToken stored, you can use it in meta to load the user information.
|
|
7634
|
+
|
|
7635
|
+
### Storage suggestions
|
|
7636
|
+
Merchant can store the tokens by dropping the token as a 1st party cookie in the browser, and must ensure to manage all the security aspects around dropping/storing the cookie by following the security standards:
|
|
7637
|
+
|
|
7638
|
+
- `Expiration Date=` cookie should be set to expire at a max 180 days
|
|
7639
|
+
- `Secure` flag
|
|
7640
|
+
- `httpOnly` flag
|
|
7641
|
+
- `sameSite=` strict
|
|
7642
|
+
- `Value=` recognition token JWT
|
|
7643
|
+
|
|
7644
|
+
### Example code
|
|
7645
|
+
|
|
7646
|
+
```javascript
|
|
7647
|
+
var src = new paydock.ClickToPay(
|
|
7648
|
+
"#checkoutIframe",
|
|
7649
|
+
"service_id",
|
|
7650
|
+
"paydock_public_key",
|
|
7651
|
+
{
|
|
7652
|
+
"recognition_token": "eyJraWQiOiIy...",
|
|
7653
|
+
},
|
|
7654
|
+
);
|
|
7655
|
+
src.on('recognitionTokenRequested', (data) => {
|
|
7656
|
+
console.log('Recognition token was found: ' + data.data.recognitionToken);
|
|
7657
|
+
// Add recognition token to your store
|
|
7658
|
+
});
|
|
7659
|
+
|
|
7660
|
+
src.on('recognitionTokenDropped', () => {
|
|
7661
|
+
console.log('Recognition token was droped');
|
|
7662
|
+
// Delete recognition token from your store
|
|
7663
|
+
});
|
|
7664
|
+
```
|
|
7665
|
+
|
|
7630
7666
|
## Classes
|
|
7631
7667
|
|
|
7632
7668
|
<dl>
|
|
@@ -7707,6 +7743,7 @@ Interface of data used for the Mastercard Checkout. For further information refe
|
|
|
7707
7743
|
| [customer.phone.country_code] | <code>string</code> | Customer phone country code (example "1" for US). |
|
|
7708
7744
|
| [customer.phone.phone] | <code>string</code> | Customer phone number. |
|
|
7709
7745
|
| [unaccepted_card_type] | <code>string</code> | Used to block a specific card type. Options are 'CREDIT', 'DEBIT'. |
|
|
7746
|
+
| [recognition_token] | <code>string</code> | Used for Click to Pay to load user information and preferences. |
|
|
7710
7747
|
|
|
7711
7748
|
<a name="EventData" id="EventData" href="#EventData"> </a>
|
|
7712
7749
|
|
|
@@ -7949,6 +7986,8 @@ List of available event's name in the Click To Pay checkout lifecycle
|
|
|
7949
7986
|
| CHECKOUT_POPUP_CLOSE | <code>string</code> | <code>"checkoutPopupClose"</code> | Event sent when Click To Pay checkout flow is closed, regardless of embedded or windowed mode. |
|
|
7950
7987
|
| CHECKOUT_COMPLETED | <code>string</code> | <code>"checkoutCompleted"</code> | Event sent on successful checkout by customer. Check [data](#EventDataCheckoutCompletedData) for more information. |
|
|
7951
7988
|
| CHECKOUT_ERROR | <code>string</code> | <code>"checkoutError"</code> | Event sent on error checkout by customer. Check [data](#EventData) for more information. |
|
|
7989
|
+
| RECOGNITION_TOKEN_REQUESTED | <code>string</code> | <code>"recognitionTokenRequested"</code> | Event sent when a recognition token was found on the mastercard SDK response. |
|
|
7990
|
+
| RECOGNITION_TOKEN_DROPPED | <code>string</code> | <code>"recognitionTokenDropped"</code> | Event sent when a recognition token needs to be dropped for user be no longer remembered. |
|
|
7952
7991
|
|
|
7953
7992
|
<a name="EVENT_DATA_TYPE" id="EVENT_DATA_TYPE" href="#EVENT_DATA_TYPE"> </a>
|
|
7954
7993
|
|