@paydock/client-sdk 1.112.0 → 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.
Files changed (35) hide show
  1. package/README.md +39 -0
  2. package/bundles/index.cjs +161 -87
  3. package/bundles/index.cjs.d.ts +4 -0
  4. package/bundles/index.mjs +161 -87
  5. package/bundles/index.mjs.d.ts +4 -0
  6. package/bundles/types/api/api-base.d.ts.map +1 -1
  7. package/bundles/types/api/api-checkout-internal.d.ts +1 -0
  8. package/bundles/types/api/api-checkout-internal.d.ts.map +1 -1
  9. package/bundles/types/checkout/checkout.d.ts.map +1 -1
  10. package/bundles/types/checkout/instructions/v1/instruction.apple_pay_form.show.d.ts.map +1 -1
  11. package/bundles/types/checkout/instructions/v1/instruction.canvas_3ds.show.d.ts.map +1 -1
  12. package/bundles/types/checkout/instructions/v1/instruction.google_pay_form.show.d.ts.map +1 -1
  13. package/bundles/types/checkout/instructions/v1/instruction.paypal_form.show.d.ts.map +1 -1
  14. package/bundles/types/checkout/layout-widgets/additionals.d.ts +1 -1
  15. package/bundles/types/checkout/layout-widgets/additionals.d.ts.map +1 -1
  16. package/bundles/types/checkout/layout-widgets/payment-methods-template.d.ts +3 -0
  17. package/bundles/types/checkout/layout-widgets/payment-methods-template.d.ts.map +1 -1
  18. package/bundles/types/checkout/layout-widgets/payment-template.d.ts +1 -1
  19. package/bundles/types/components/iframe-event.d.ts +2 -0
  20. package/bundles/types/components/iframe-event.d.ts.map +1 -1
  21. package/bundles/types/index-cba.d.ts +1 -0
  22. package/bundles/types/index-cba.d.ts.map +1 -1
  23. package/bundles/types/secure-remote-commerce/index.d.ts +1 -0
  24. package/bundles/types/secure-remote-commerce/index.d.ts.map +1 -1
  25. package/bundles/types/secure-remote-commerce/interfaces.d.ts +12 -2
  26. package/bundles/types/secure-remote-commerce/interfaces.d.ts.map +1 -1
  27. package/bundles/types/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts.map +1 -1
  28. package/bundles/widget.umd.js +161 -87
  29. package/bundles/widget.umd.js.d.ts +4 -0
  30. package/bundles/widget.umd.js.min.d.ts +4 -0
  31. package/bundles/widget.umd.min.js +7 -7
  32. package/docs/click-to-pay-examples.md +36 -0
  33. package/docs/click-to-pay.md +3 -0
  34. package/package.json +1 -1
  35. package/slate.md +36 -0
@@ -229,3 +229,39 @@ src.setStyles({
229
229
  font_family: 'Arial',
230
230
  });
231
231
  ```
232
+
233
+ ## Recognition token
234
+
235
+ In order to store user information for further payments, click to pay provides a recognition token that is used to load user information.
236
+ If you already have a recognitionToken stored, you can use it in meta to load the user information.
237
+
238
+ ### Storage suggestions
239
+ 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:
240
+
241
+ - `Expiration Date=` cookie should be set to expire at a max 180 days
242
+ - `Secure` flag
243
+ - `httpOnly` flag
244
+ - `sameSite=` strict
245
+ - `Value=` recognition token JWT
246
+
247
+ ### Example code
248
+
249
+ ```javascript
250
+ var src = new paydock.ClickToPay(
251
+ "#checkoutIframe",
252
+ "service_id",
253
+ "paydock_public_key",
254
+ {
255
+ "recognition_token": "eyJraWQiOiIy...",
256
+ },
257
+ );
258
+ src.on('recognitionTokenRequested', (data) => {
259
+ console.log('Recognition token was found: ' + data.data.recognitionToken);
260
+ // Add recognition token to your store
261
+ });
262
+
263
+ src.on('recognitionTokenDropped', () => {
264
+ console.log('Recognition token was droped');
265
+ // Delete recognition token from your store
266
+ });
267
+ ```
@@ -78,6 +78,7 @@ Interface of data used for the Mastercard Checkout. For further information refe
78
78
  | [customer.phone.country_code] | <code>string</code> | Customer phone country code (example "1" for US). |
79
79
  | [customer.phone.phone] | <code>string</code> | Customer phone number. |
80
80
  | [unaccepted_card_type] | <code>string</code> | Used to block a specific card type. Options are 'CREDIT', 'DEBIT'. |
81
+ | [recognition_token] | <code>string</code> | Used for Click to Pay to load user information and preferences. |
81
82
 
82
83
  <a name="EventData" id="EventData" href="#EventData">&nbsp;</a>
83
84
 
@@ -320,6 +321,8 @@ List of available event's name in the Click To Pay checkout lifecycle
320
321
  | CHECKOUT_POPUP_CLOSE | <code>string</code> | <code>&quot;checkoutPopupClose&quot;</code> | Event sent when Click To Pay checkout flow is closed, regardless of embedded or windowed mode. |
321
322
  | CHECKOUT_COMPLETED | <code>string</code> | <code>&quot;checkoutCompleted&quot;</code> | Event sent on successful checkout by customer. Check [data](#EventDataCheckoutCompletedData) for more information. |
322
323
  | CHECKOUT_ERROR | <code>string</code> | <code>&quot;checkoutError&quot;</code> | Event sent on error checkout by customer. Check [data](#EventData) for more information. |
324
+ | RECOGNITION_TOKEN_REQUESTED | <code>string</code> | <code>&quot;recognitionTokenRequested&quot;</code> | Event sent when a recognition token was found on the mastercard SDK response. |
325
+ | RECOGNITION_TOKEN_DROPPED | <code>string</code> | <code>&quot;recognitionTokenDropped&quot;</code> | Event sent when a recognition token needs to be dropped for user be no longer remembered. |
323
326
 
324
327
  <a name="EVENT_DATA_TYPE" id="EVENT_DATA_TYPE" href="#EVENT_DATA_TYPE">&nbsp;</a>
325
328
 
package/package.json CHANGED
@@ -104,7 +104,7 @@
104
104
  }
105
105
  },
106
106
  "name": "@paydock/client-sdk",
107
- "version": "1.112.0",
107
+ "version": "1.113.2-beta",
108
108
  "scripts": {
109
109
  "build:doc": "node docs/html/marked.js",
110
110
  "build:js": "rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
package/slate.md CHANGED
@@ -1922,3 +1922,39 @@ src.setStyles({
1922
1922
  font_family: 'Arial',
1923
1923
  });
1924
1924
  ```
1925
+
1926
+ ## Recognition token
1927
+
1928
+ In order to store user information for further payments, click to pay provides a recognition token that is used to load user information.
1929
+ If you already have a recognitionToken stored, you can use it in meta to load the user information.
1930
+
1931
+ ### Storage suggestions
1932
+ 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:
1933
+
1934
+ - `Expiration Date=` cookie should be set to expire at a max 180 days
1935
+ - `Secure` flag
1936
+ - `httpOnly` flag
1937
+ - `sameSite=` strict
1938
+ - `Value=` recognition token JWT
1939
+
1940
+ ### Example code
1941
+
1942
+ ```javascript
1943
+ var src = new paydock.ClickToPay(
1944
+ "#checkoutIframe",
1945
+ "service_id",
1946
+ "paydock_public_key",
1947
+ {
1948
+ "recognition_token": "eyJraWQiOiIy...",
1949
+ },
1950
+ );
1951
+ src.on('recognitionTokenRequested', (data) => {
1952
+ console.log('Recognition token was found: ' + data.data.recognitionToken);
1953
+ // Add recognition token to your store
1954
+ });
1955
+
1956
+ src.on('recognitionTokenDropped', () => {
1957
+ console.log('Recognition token was droped');
1958
+ // Delete recognition token from your store
1959
+ });
1960
+ ```