@paydock/client-sdk 1.104.1-beta → 1.104.6-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 (103) hide show
  1. package/README.md +732 -409
  2. package/bundles/index.cjs +1689 -1907
  3. package/bundles/index.cjs.d.ts +420 -377
  4. package/bundles/index.cjs.map +1 -1
  5. package/bundles/index.mjs +1689 -1907
  6. package/bundles/index.mjs.d.ts +420 -377
  7. package/bundles/index.mjs.map +1 -1
  8. package/bundles/types/api/api-service-internal.d.ts +2 -1
  9. package/bundles/types/api/api-service-internal.d.ts.map +1 -1
  10. package/bundles/types/api/api.d.ts +1 -1
  11. package/bundles/types/api/api.d.ts.map +1 -1
  12. package/bundles/types/canvas-3ds/canvas-3ds.d.ts +1 -1
  13. package/bundles/types/canvas-3ds/canvas-3ds.d.ts.map +1 -1
  14. package/bundles/types/checkout-button/afterpay/afterpay-checkout-button.d.ts +1 -1
  15. package/bundles/types/checkout-button/afterpay/afterpay-checkout-button.d.ts.map +1 -1
  16. package/bundles/types/checkout-button/checkout-button.d.ts +1 -1
  17. package/bundles/types/checkout-button/checkout-button.d.ts.map +1 -1
  18. package/bundles/types/checkout-button/paypal/paypal-checkout-button.d.ts +1 -1
  19. package/bundles/types/checkout-button/paypal/paypal-checkout-button.d.ts.map +1 -1
  20. package/bundles/types/checkout-button/zipmoney/zipmoney-checkout-button.d.ts +1 -1
  21. package/bundles/types/checkout-button/zipmoney/zipmoney-checkout-button.d.ts.map +1 -1
  22. package/bundles/types/components/container.d.ts +1 -0
  23. package/bundles/types/components/container.d.ts.map +1 -1
  24. package/bundles/types/components/{form-Interceptor.d.ts → form-interceptor.d.ts} +1 -1
  25. package/bundles/types/components/{form-Interceptor.d.ts.map → form-interceptor.d.ts.map} +1 -1
  26. package/bundles/types/components/iframe-event.d.ts +17 -11
  27. package/bundles/types/components/iframe-event.d.ts.map +1 -1
  28. package/bundles/types/components/link.d.ts +3 -2
  29. package/bundles/types/components/link.d.ts.map +1 -1
  30. package/bundles/types/components/param.d.ts +6 -8
  31. package/bundles/types/components/param.d.ts.map +1 -1
  32. package/bundles/types/components/wallet-background.d.ts +2 -1
  33. package/bundles/types/components/wallet-background.d.ts.map +1 -1
  34. package/bundles/types/constants/validators.d.ts +45 -0
  35. package/bundles/types/constants/validators.d.ts.map +1 -0
  36. package/bundles/types/payment-source-widget/html-payment-source-widget.d.ts +17 -13
  37. package/bundles/types/payment-source-widget/html-payment-source-widget.d.ts.map +1 -1
  38. package/bundles/types/payment-source-widget/payment-source-widget.d.ts +1 -1
  39. package/bundles/types/payment-source-widget/payment-source-widget.d.ts.map +1 -1
  40. package/bundles/types/secure-remote-commerce/index.d.ts +102 -1
  41. package/bundles/types/secure-remote-commerce/index.d.ts.map +1 -1
  42. package/bundles/types/secure-remote-commerce/interfaces.d.ts +109 -32
  43. package/bundles/types/secure-remote-commerce/interfaces.d.ts.map +1 -1
  44. package/bundles/types/secure-remote-commerce/mastercard-secure-remote-commerce.d.ts +31 -0
  45. package/bundles/types/secure-remote-commerce/mastercard-secure-remote-commerce.d.ts.map +1 -0
  46. package/bundles/types/secure-remote-commerce/providers/mastercard-src/index.d.ts +2 -0
  47. package/bundles/types/secure-remote-commerce/providers/mastercard-src/index.d.ts.map +1 -0
  48. package/bundles/types/secure-remote-commerce/providers/{visa-src/visa-src.d.ts → mastercard-src/mastercard-src.d.ts} +5 -8
  49. package/bundles/types/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts.map +1 -0
  50. package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts +13 -91
  51. package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts.map +1 -1
  52. package/bundles/types/vault-display-widget/vault-display-widget.d.ts +1 -1
  53. package/bundles/types/vault-display-widget/vault-display-widget.d.ts.map +1 -1
  54. package/bundles/types/wallet-buttons/apple.wallet-service.d.ts +2 -0
  55. package/bundles/types/wallet-buttons/apple.wallet-service.d.ts.map +1 -1
  56. package/bundles/types/wallet-buttons/flypay-v2.wallet-service.d.ts +8 -1
  57. package/bundles/types/wallet-buttons/flypay-v2.wallet-service.d.ts.map +1 -1
  58. package/bundles/types/wallet-buttons/google.wallet-service.d.ts +3 -0
  59. package/bundles/types/wallet-buttons/google.wallet-service.d.ts.map +1 -1
  60. package/bundles/types/wallet-buttons/helpers/flypay-v2.helper.d.ts +4 -0
  61. package/bundles/types/wallet-buttons/helpers/flypay-v2.helper.d.ts.map +1 -0
  62. package/bundles/types/wallet-buttons/index.d.ts +126 -0
  63. package/bundles/types/wallet-buttons/index.d.ts.map +1 -1
  64. package/bundles/types/wallet-buttons/interfaces.d.ts +3 -0
  65. package/bundles/types/wallet-buttons/interfaces.d.ts.map +1 -1
  66. package/bundles/types/wallet-buttons/paypal.wallet-service.d.ts.map +1 -1
  67. package/bundles/types/wallet-buttons/wallet-buttons.d.ts +63 -121
  68. package/bundles/types/wallet-buttons/wallet-buttons.d.ts.map +1 -1
  69. package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts +1 -1
  70. package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts.map +1 -1
  71. package/bundles/types/wallet-buttons/wallet-service.d.ts +7 -0
  72. package/bundles/types/wallet-buttons/wallet-service.d.ts.map +1 -1
  73. package/bundles/types/widget/configuration.d.ts +1 -1
  74. package/bundles/types/widget/configuration.d.ts.map +1 -1
  75. package/bundles/types/widget/html-multi-widget.d.ts +146 -75
  76. package/bundles/types/widget/html-multi-widget.d.ts.map +1 -1
  77. package/bundles/types/widget/html-widget.d.ts +1 -1
  78. package/bundles/types/widget/html-widget.d.ts.map +1 -1
  79. package/bundles/types/widget/multi-widget.d.ts.map +1 -1
  80. package/bundles/widget.umd.js +1689 -1907
  81. package/bundles/widget.umd.js.d.ts +420 -377
  82. package/bundles/widget.umd.js.map +1 -1
  83. package/bundles/widget.umd.js.min.d.ts +420 -377
  84. package/bundles/widget.umd.min.js +1 -1
  85. package/bundles/widget.umd.min.js.map +1 -1
  86. package/docs/api-ps-widget.md +12 -12
  87. package/docs/api-widget.md +211 -156
  88. package/docs/install/umd.content.md +3 -4
  89. package/docs/install.md +4 -14
  90. package/docs/license.md +1 -1
  91. package/docs/secure-remote-commerce-examples.md +75 -101
  92. package/docs/secure-remote-commerce.md +185 -114
  93. package/docs/wallet-buttons-examples.md +48 -19
  94. package/docs/wallet-buttons.md +197 -2
  95. package/package.json +1 -1
  96. package/slate.md +126 -124
  97. package/bundles/types/secure-remote-commerce/providers/visa-src/helper.d.ts +0 -8
  98. package/bundles/types/secure-remote-commerce/providers/visa-src/helper.d.ts.map +0 -1
  99. package/bundles/types/secure-remote-commerce/providers/visa-src/index.d.ts +0 -2
  100. package/bundles/types/secure-remote-commerce/providers/visa-src/index.d.ts.map +0 -1
  101. package/bundles/types/secure-remote-commerce/providers/visa-src/visa-src.d.ts.map +0 -1
  102. package/bundles/types/secure-remote-commerce/providers/visa-src/visa-src.styles.d.ts +0 -9
  103. package/bundles/types/secure-remote-commerce/providers/visa-src/visa-src.styles.d.ts.map +0 -1
package/slate.md CHANGED
@@ -31,10 +31,9 @@ we exemplify how to import each format.
31
31
 
32
32
 
33
33
  For browser environments, you can import the Client SDK directly from our CDN to
34
- your project's HTML. To accomplish this being by including the Client SDK
35
- in your page using one and only of the two script tags below. After this step
36
- you will be able to access the Client SDK features via the global
37
- variable `paydock`.
34
+ your project's HTML. To accomplish this, include the Client SDK in your page
35
+ using one and only of the two script tags below. After this step you will be
36
+ able to access the Client SDK features via the global variable `paydock`.
38
37
 
39
38
  For production we recommend using the compressed version (`.min.js`) since
40
39
  it will result in faster loading times for your end users.
@@ -1207,6 +1206,14 @@ In some situations you may want to forcibly close the checkout so that your user
1207
1206
  button.close();
1208
1207
  ```
1209
1208
 
1209
+ ### Performing actions when the wallet button is clicked
1210
+
1211
+ In some situations you may want to perform some validations or actions when the user clicks on the wallet button, for which you can use this method. Currently supported by Paypal, ApplePay and GooglePay wallets.
1212
+
1213
+ ```javascript
1214
+ button.onClick(() => console.log("Perform actions on button click"));
1215
+ ```
1216
+
1210
1217
  ### Performing actions when shipping info is updated
1211
1218
 
1212
1219
  In Flypay, Paypal, ApplePay via MPGS and GooglePay via MPGS integrations after each shipping info update the `onUpdate(data)` will be called with the selected shipping address information, plus selected shipping method when applicable for Paypal, ApplePay and GooglePay. Merchants should handle this callback, recalculate shipping costs in their server by analyzing the new data, and submit a backend to backend request to `POST charges/:id` with the new total amount and shipping amount (you can find the documentation of this call in the PayDock API documentation).
@@ -1334,30 +1341,51 @@ _(Required `meta` fields: - . Optional `meta` fields: `request_shipping`, `pay_l
1334
1341
  <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
1335
1342
  <script>
1336
1343
  let button = new paydock.WalletButtons(
1337
- "#widget",
1338
- charge_token,
1339
- {
1340
- request_shipping: true,
1341
- pay_later: true,
1342
- standalone: false,
1343
- style: {
1344
- layout: 'horizontal',
1345
- color: 'blue',
1346
- shape: 'rect',
1347
- label: 'paypal',
1348
- },
1349
- }
1350
- );
1344
+ "#widget",
1345
+ charge_token,
1346
+ {
1347
+ request_shipping: true,
1348
+ pay_later: true,
1349
+ standalone: false,
1350
+ style: {
1351
+ layout: 'horizontal',
1352
+ color: 'blue',
1353
+ shape: 'rect',
1354
+ label: 'paypal',
1355
+ },
1356
+ }
1357
+ );
1351
1358
  button.setEnv('sandbox');
1352
1359
  button.onUnavailable(() => console.log("No wallet buttons available"));
1353
1360
  button.onUpdate((data) => {
1354
- console.log("Updating amount via a backend to backend call to POST charges/:id");
1355
- // call `POST charges/:id` to modify charge
1356
- button.update({ success: true });
1357
- });
1361
+ console.log("Updating amount via a backend to backend call to POST charges/:id");
1362
+ // call `POST charges/:id` to modify charge
1363
+ button.update({ success: true });
1364
+ });
1358
1365
  button.onPaymentSuccessful((data) => console.log("The payment was successful"));
1359
1366
  button.onPaymentError((data) => console.log("The payment was not successful"));
1360
1367
  button.onPaymentInReview((data) => console.log("The payment is on fraud review"));
1368
+
1369
+ // Example 1: Asynchronous onClick handler
1370
+ const asyncLogic = async () => {
1371
+ // Perform asynchronous logic. Expectation is that a Promise is returned and attached to response via `attachResult`,
1372
+ // and resolve or reject of it will dictate how wallet behaves.
1373
+ }
1374
+
1375
+ button.onClick(({ data: { attachResult } }) => {
1376
+ // Promise is attached to the result. On Paypal, when promise is resolved, the user Journey will continue.
1377
+ // If no promise is attached then the Paypal journey will not depend on the promise being resolved or rejected
1378
+ attachResult(asyncLogic());
1379
+ });
1380
+
1381
+ // Example 2: Synchronous onClick handler
1382
+ // button.onClick(({ data: { attachResult } }) => {
1383
+ // // Perform synchronous logic
1384
+ // console.log("Synchronous onClick: Button clicked");
1385
+ // // Optionally return a boolean flag to halt the operation
1386
+ // attachResult(false);
1387
+ // });
1388
+
1361
1389
  button.load();
1362
1390
  </script>
1363
1391
  </html>
@@ -1491,6 +1519,7 @@ _(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `ra
1491
1519
  button.onUnavailable(() => console.log("No wallet buttons available"));
1492
1520
  button.onPaymentSuccessful((data) => console.log("The payment was successful"));
1493
1521
  button.onPaymentError((data) => console.log("The payment was not successful"));
1522
+ button.onClick(() => console.log("On WalletButton Click"));
1494
1523
  button.onUpdate((data) => {
1495
1524
  console.log("Updating amount via a backend to backend call to POST charges/:id");
1496
1525
  // call `POST charges/:id` to modify charge
@@ -1523,7 +1552,6 @@ _(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `ra
1523
1552
  Also, for **ApplePay via MPGS** you can initialize the `ApplePayPaymentRequest` with your own values instead of using the default ones. Below you can see an example on how to initialize the `ApplePayPaymentRequest` with the `raw_data_initialization` meta field.
1524
1553
 
1525
1554
  Similarly, for **GooglePay via MPGS** you can initialize the `PaymentMethodSpecification` with your own values instead of using the default ones. Below you can see an example on how to initialize the `PaymentMethodSpecification` with the `raw_data_initialization` meta field.
1526
-
1527
1555
  ### ApplePay and GooglePay via MPGS Raw data initialization example
1528
1556
 
1529
1557
  ```html
@@ -1636,29 +1664,33 @@ Similarly, for **GooglePay via MPGS** you can initialize the `PaymentMethodSpeci
1636
1664
  </html>
1637
1665
  ```
1638
1666
 
1639
- ## Secure Remote Commerce
1640
- You can find description of all methods and parameters [here](https://www.npmjs.com/package/@paydock/client-sdk#SRC).
1667
+ # Secure Remote Commerce
1641
1668
 
1642
- This widget provides you with the ability to easily integrate with SRC providers. Currently Visa SRC is supported.
1669
+ ## Overview
1670
+
1671
+ Integrate with Mastercard SRC using Paydock's Mastercard SRC widget.
1672
+ For a full description of the methods and parameters, reference the [README file](https://www.npmjs.com/package/@paydock/client-sdk#SRC).
1643
1673
 
1644
1674
  ## SRC simple example
1645
1675
 
1646
- ### Container
1676
+ The following section provides an example use case and integration for the widget.
1677
+
1678
+ ### Create a Container
1679
+
1680
+ To integrate the SRC checkout iFrame, create a container in your HTML code. This container serves as the placeholder for the iFrame.
1647
1681
 
1648
1682
  ```html
1649
- <div id="checkoutButton"></div>
1650
1683
  <div id="checkoutIframe"></div>
1651
1684
  ```
1652
1685
 
1653
- You must create a container for the initial checkout button, and a different one for the checkout iFrame. Inside the first tag the button will be initialized, and inside the second one the iFrame will be loaded once the button is clicked.
1686
+ ### Initialize the Widget
1654
1687
 
1688
+ Use the following code to initialize your widget:
1655
1689
 
1656
- ### Initialization
1657
1690
  ```javascript
1658
- var src = new paydock.SRC(
1659
- "#checkoutButton",
1691
+ var src = new paydock.MastercardSRCClickToPay(
1660
1692
  "#checkoutIframe",
1661
- "scheme_service_id",
1693
+ "service_id",
1662
1694
  "paydock_public_key_or_access_token",
1663
1695
  {}, // meta
1664
1696
  );
@@ -1667,23 +1699,22 @@ src.load();
1667
1699
 
1668
1700
  ```javascript
1669
1701
  // ES2015 | TypeScript
1670
-
1671
- import { SRC } from '@paydock/client-sdk';
1672
-
1673
- var src = new SRC(
1674
- "#checkoutButton",
1702
+ import { MastercardSRCClickToPay } from '@paydock/client-sdk';
1703
+ var src = new MastercardSRCClickToPay(
1675
1704
  "#checkoutIframe",
1676
- "scheme_service_id",
1705
+ "service_id",
1677
1706
  "paydock_public_key_or_access_token",
1678
1707
  {}, // meta
1679
1708
  );
1680
1709
  src.load();
1681
1710
  ```
1682
1711
 
1683
- *NOTE:* it's highly recommended to use a Paydock Access Token instead of the public key for security reasons. When creating it, you will need to enable the `Secure Remote Commerce` and add a whiteliste for the domain of your checkout screen.
1712
+ *NOTE:* Paydock recommends that you use a Paydock Access Token instead of a public key for security reasons in production environments. When creating your access token, you must enable the `Secure Remote Commerce` and add a whitelist for the domain of your checkout screen.
1684
1713
 
1685
1714
  ### Full example
1686
1715
 
1716
+ A full example of the container and the initialized widget is as follows:
1717
+
1687
1718
  ```html
1688
1719
  <!DOCTYPE html>
1689
1720
  <html lang="en">
@@ -1693,14 +1724,12 @@ src.load();
1693
1724
  <style>iframe {border: 0;width: 40%;height: 300px;}</style>
1694
1725
  </head>
1695
1726
  <body>
1696
- <div id="checkoutButton"></div>
1697
1727
  <div id="checkoutIframe"></div>
1698
1728
  <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
1699
1729
  <script>
1700
- var src = new paydock.SRC(
1701
- "#checkoutButton",
1730
+ var src = new paydock.MastercardSRCClickToPay(
1702
1731
  "#checkoutIframe",
1703
- "scheme_service_id",
1732
+ "service_id",
1704
1733
  "paydock_public_key_or_access_token",
1705
1734
  {},
1706
1735
  );
@@ -1710,50 +1739,30 @@ src.load();
1710
1739
  </html>
1711
1740
  ```
1712
1741
 
1742
+ ## Customize your SRC Checkout
1713
1743
 
1714
- ## SRC advanced example
1744
+ The following is an advanced example that includes customization. You can use these methods to enhance your checkout experience.
1715
1745
 
1716
1746
  ### Settings
1717
1747
 
1718
1748
  ```javascript
1719
-
1720
- src.setEnv('sandbox'); // set enviroment
1721
-
1722
- src.hideButton(); // hide button
1723
-
1724
- src.showButton(); // show button
1725
-
1749
+ src.setEnv('sandbox'); // set environment
1726
1750
  src.hideCheckout(); // hide checkout iframe
1727
-
1728
1751
  src.showCheckout(); // show checkout iframe
1729
-
1730
- src.on('checkoutButtonLoaded', () => {
1731
- console.log("Button loaded");
1732
- });
1733
-
1734
- src.on('checkoutButtonClicked', () => {
1735
- console.log("Button clicked");
1736
- });
1737
-
1738
1752
  src.on('iframeLoaded', () => {
1739
1753
  console.log("Initial iframe loaded");
1740
1754
  });
1741
-
1742
1755
  src.on('checkoutReady', () => {
1743
1756
  console.log("Checkout ready to be used");
1744
1757
  });
1745
-
1746
1758
  src.on('checkoutCompleted', (token) => {
1747
1759
  console.log(token);
1748
1760
  });
1749
-
1750
1761
  src.on('checkoutError', (error) => {
1751
1762
  console.log(error);
1752
1763
  });
1753
1764
  ```
1754
1765
 
1755
- Here you can see how you can use this methods to customize your checkout experience
1756
-
1757
1766
  ### Full example
1758
1767
 
1759
1768
  ```html
@@ -1765,64 +1774,73 @@ Here you can see how you can use this methods to customize your checkout experie
1765
1774
  <style>iframe {border: 0;width: 40%;height: 450px;}</style>
1766
1775
  </head>
1767
1776
  <body>
1768
- <div id="checkoutButton"></div>
1769
1777
  <div id="checkoutIframe"></div>
1770
1778
  <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
1771
1779
  <script>
1772
- var src = new paydock.SRC(
1773
- "#checkoutButton",
1780
+ var src = new paydock.MastercardSRCClickToPay(
1774
1781
  "#checkoutIframe",
1775
- "scheme_service_id",
1782
+ "service_id",
1776
1783
  "paydock_public_key_or_access_token",
1777
1784
  {},
1778
1785
  );
1779
-
1786
+ src.on('iframeLoaded', () => {
1787
+ console.log("Initial iframe loaded");
1788
+ });
1780
1789
  src.on('checkoutReady', () => {
1781
1790
  console.log("Checkout ready to be used");
1782
1791
  });
1783
-
1784
1792
  src.on('checkoutCompleted', (token) => {
1785
1793
  console.log(token);
1786
1794
  });
1795
+ src.on('checkoutError', (error) => {
1796
+ console.log(error);
1797
+ });
1787
1798
  src.load();
1788
1799
  </script>
1789
1800
  </body>
1790
1801
  </html>
1791
1802
  ```
1792
1803
 
1793
- ## Customization options for address fields
1794
- ### Shipping address:
1804
+ ## Customize your billing address fields
1795
1805
 
1796
- To customize shipping address experience we use a flag that manages how VisaSRC requires or not shipping address to the customer. Options are NONE (default option), POSTAL_COUNTRY or ALL.
1806
+ To customize your billing address experience, Paydock uses a flag that manages whether a customer's billing address is mandatory.
1807
+ The options for this customization are NONE (default option), and POSTAL_COUNTRY or FULL.
1797
1808
 
1798
1809
  ```
1799
- var src = new paydock.SRC(
1800
- "#checkoutButton",
1810
+ var src = new paydock.MastercardSRCClickToPay(
1801
1811
  "#checkoutIframe",
1802
- "scheme_service_id",
1812
+ "service_id",
1803
1813
  "paydock_public_key_or_access_token",
1804
1814
  {
1805
1815
  "dpa_transaction_options": {
1806
- "dpa_shipping_preference": "ALL"
1816
+ "dpa_billing_preference": "FULL"
1807
1817
  }
1808
1818
  },
1809
1819
  );
1810
1820
  ```
1811
1821
 
1812
- With this the Visa popup requires the shipping address from consumer, and these information will be stored in the Paydock charge.
1822
+ The SRC checkout in the example requires the billing address from the customer, which is then returned as a part of the checkout data. The data is then stored and leveraged in the Paydock charge.
1823
+ You can also provide the billing address at the time of creating the charge. For example, if you have a different method for collecting the billing address, such as outside of the SRC checkout, you can provide it alongside other information at the charge creation step:
1813
1824
 
1814
- Another option is at time of creating the charge. Say that you have a different way of collecting the shipping address (outside Paydock checkout), you can then disable the shipping address on our SRC widget and send it when creating the charge creation after getting the One Time Token out of the SRC widget:
1825
+ 1. Disable the billing address in Paydock's SRC widget.
1826
+ 2. Get your One Time Token from the SRC widget alongside other details that may have been collected outside the SRC checkout as the shipping address.
1827
+ 3. Send the billing address when creating the charge.
1815
1828
 
1816
1829
  ```
1817
1830
  POST v1/charges
1818
-
1819
1831
  {
1820
1832
  "amount": "10.00",
1821
1833
  "currency": "AUD",
1822
- "token": "token",
1834
+ "token": "one_time_token",
1823
1835
  "customer": {
1824
1836
  "payment_source": {
1825
- "gateway_id": "gateway_id"
1837
+ "gateway_id": "gateway_id",
1838
+ "address_line1": "address_line1",
1839
+ "address_line2": "address_line2",
1840
+ "address_city": "address_city",
1841
+ "address_postcode": "address_postcode",
1842
+ "address_state": "address_state",
1843
+ "address_country": "address_country"
1826
1844
  }
1827
1845
  },
1828
1846
  "shipping": {
@@ -1837,60 +1855,44 @@ POST v1/charges
1837
1855
  }
1838
1856
  ```
1839
1857
 
1840
- - Billing address:
1858
+ ## How to customize accepted cards
1841
1859
 
1842
- Billing address fields are always present on the checkout and required when adding a new credit card (or for new consumer checkout). You can send billing fields on the meta data to pre-fill these fields inside the customer object:
1860
+ You can send a flag `unaccepted_card_type` to block the usage of a specific card type. The available options are 'DEBIT' and 'CREDIT'.
1861
+
1862
+ ### Example code
1863
+
1864
+ The following example demonstrates how to block the card:
1843
1865
 
1844
1866
  ```
1845
- var src = new paydock.SRC(
1846
- "#checkoutButton",
1867
+ var src = new paydock.MastercardSRCClickToPay(
1847
1868
  "#checkoutIframe",
1848
- "scheme_service_id",
1849
- "paydock_public_key_or_access_token",
1869
+ "service_id",
1870
+ "paydock_public_key",
1850
1871
  {
1851
- "customer": {
1852
- "email": "test@email.com",
1853
- "first_name": "Name",
1854
- "last_name": "Surname",
1855
- "phone": {
1856
- "country_code": "1",
1857
- "phone": "2124567890"
1858
- },
1859
- "payment_source": {
1860
- "address_line1": "Line 1",
1861
- "address_line2": "Line 2",
1862
- "address_city": "Miami",
1863
- "address_postcode": "33126",
1864
- "address_state": "FL",
1865
- "address_country": "US"
1866
- }
1867
- }
1872
+ unaccepted_card_type: 'DEBIT'
1868
1873
  },
1869
1874
  );
1870
1875
  ```
1871
1876
 
1872
- ## Personalization Styling
1877
+ ## Personalize the Style
1873
1878
 
1874
- To improve the experience in the use of the widget, it is allowed to send props that customize the UI.
1879
+ Customize the look and feel of your UI. The following example demonstrates changes in the styling of the buttons.
1875
1880
 
1876
1881
  ### Example code
1877
1882
 
1878
1883
  ```
1879
- var src = new paydock.SRC(
1880
- "#checkoutButton",
1884
+ var src = new paydock.MastercardSRCClickToPay(
1881
1885
  "#checkoutIframe",
1882
- "scheme_service_id",
1886
+ "service_id",
1883
1887
  "paydock_public_key",
1888
+ {},
1884
1889
  );
1885
-
1886
- button.setStyles({"primary_color":"#a83232","button_text_color":"#171e9c","font_family":"sans-serif"})
1887
-
1890
+ src.setStyles({
1891
+ enable_src_popup: true,
1892
+ primary_button_color: 'red',
1893
+ secondary_button_color: 'red',
1894
+ primary_button_text_color: 'red',
1895
+ secondary_button_text_color: 'red',
1896
+ font_family: 'Arial',
1897
+ });
1888
1898
  ```
1889
- ## Event and Values
1890
-
1891
- | Event Value | Type | Description |
1892
- | ------------------- | ------------------- | -------------------------------------------------------------- |
1893
- | primary_color | <code>string</code> | HEX color for the principal buttons, example : #32a852 |
1894
- | button_text_color | <code>string</code> | HEX color for the text of the buttons, example : #32a852|
1895
- | font_family | <code>string</code> | Look more [mozilla.org/color](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family)|
1896
- | card_schemes | <code>[string] - array of string</code> | Possible values "visa", "mastercard", "amex" and "discover" - Default show all logos
@@ -1,8 +0,0 @@
1
- export declare const CARD_SCHEME: {
2
- VISA: string;
3
- MASTERCARD: string;
4
- AMEX: string;
5
- DISCOVER: string;
6
- };
7
- export declare const GenerateCardSchemesLogo: (card_scheme: string[], chevron?: boolean) => string;
8
- //# sourceMappingURL=helper.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../../src/secure-remote-commerce/providers/visa-src/helper.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;;;CAKvB,CAAC;AAgBF,eAAO,MAAM,uBAAuB,gBAAiB,MAAM,EAAE,YAAW,OAAO,KAAW,MAsBzF,CAAC"}
@@ -1,2 +0,0 @@
1
- export { VisaSRC } from './visa-src';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/secure-remote-commerce/providers/visa-src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"visa-src.d.ts","sourceRoot":"","sources":["../../../../src/secure-remote-commerce/providers/visa-src/visa-src.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAY,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAc,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAS,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIvD,qBAAa,OAAQ,YAAW,WAAW;IAO+D,SAAS,CAAC,IAAI,EAAE,YAAY;IAAE,SAAS,CAAC,YAAY,EAAE,YAAY;IAAE,SAAS,CAAC,UAAU;IAN9L,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC;IACrB,SAAS,CAAC,eAAe,EAAE,SAAS,CAAC;IACrC,SAAS,CAAC,eAAe,EAAE,SAAS,CAAC;IACrC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,WAAW,EAAE,WAAW,CAAC;gBAEvB,eAAe,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAY,IAAI,EAAE,YAAY,EAAY,YAAY,EAAE,YAAY,EAAY,UAAU,KAAA,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAwB1N,OAAO,CAAC,iBAAiB;IAmBlB,IAAI,IAAI,IAAI;IAyCZ,MAAM,IAAI,MAAM;IAIhB,UAAU,CAAC,SAAS,EAAE,OAAO;IAK7B,UAAU;IAKV,YAAY,CAAC,QAAQ,EAAE,OAAO;IAK9B,YAAY;IAKZ,MAAM;IAKN,aAAa,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI;CAa9C"}
@@ -1,9 +0,0 @@
1
- export declare class VisaSRCStyles {
2
- static buttonContainerStyles: string;
3
- static buttonStyles: string;
4
- static footerContainerStyles: string;
5
- static footerTextStyles: string;
6
- static verticalLineStyle: string;
7
- static clickToPayAllCardsStyle: string;
8
- }
9
- //# sourceMappingURL=visa-src.styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"visa-src.styles.d.ts","sourceRoot":"","sources":["../../../../src/secure-remote-commerce/providers/visa-src/visa-src.styles.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAa;IACtB,OAAc,qBAAqB,SAA0F;IAE7H,OAAc,YAAY,SAA8P;IAExR,OAAc,qBAAqB,SAAuE;IAE1G,OAAc,gBAAgB,SAAwD;IAEtF,OAAc,iBAAiB,SAAqF;IAEpH,OAAc,uBAAuB,SAA+E;CACvH"}