@paydock/client-sdk 1.105.1 → 1.106.1

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 (54) hide show
  1. package/README.md +255 -246
  2. package/bundles/widget.umd.js +1197 -1724
  3. package/bundles/widget.umd.min.js +1 -1
  4. package/lib/api/api-service-internal.d.ts +2 -1
  5. package/lib/api/api-service-internal.js +1 -0
  6. package/lib/api/api-service-internal.js.map +1 -1
  7. package/lib/components/iframe-event.d.ts +2 -0
  8. package/lib/components/iframe-event.js +2 -0
  9. package/lib/components/iframe-event.js.map +1 -1
  10. package/lib/components/link.d.ts +3 -2
  11. package/lib/components/link.js +1 -0
  12. package/lib/components/link.js.map +1 -1
  13. package/lib/components/param.d.ts +2 -2
  14. package/lib/components/param.js.map +1 -1
  15. package/lib/components/wallet-background.js +12 -0
  16. package/lib/components/wallet-background.js.map +1 -1
  17. package/lib/configs/sdk.js +1 -1
  18. package/lib/secure-remote-commerce/index.d.ts +102 -1
  19. package/lib/secure-remote-commerce/index.js +102 -1
  20. package/lib/secure-remote-commerce/index.js.map +1 -1
  21. package/lib/secure-remote-commerce/interfaces.d.ts +109 -32
  22. package/lib/secure-remote-commerce/interfaces.js +31 -11
  23. package/lib/secure-remote-commerce/interfaces.js.map +1 -1
  24. package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.d.ts +30 -0
  25. package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.js +40 -0
  26. package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.js.map +1 -0
  27. package/lib/secure-remote-commerce/providers/mastercard-src/index.d.ts +1 -0
  28. package/lib/secure-remote-commerce/providers/mastercard-src/index.js +2 -0
  29. package/lib/secure-remote-commerce/providers/mastercard-src/index.js.map +1 -0
  30. package/lib/secure-remote-commerce/providers/{visa-src/visa-src.d.ts → mastercard-src/mastercard-src.d.ts} +4 -7
  31. package/lib/secure-remote-commerce/providers/mastercard-src/mastercard-src.js +89 -0
  32. package/lib/secure-remote-commerce/providers/mastercard-src/mastercard-src.js.map +1 -0
  33. package/lib/secure-remote-commerce/secure-remote-commerce.d.ts +13 -91
  34. package/lib/secure-remote-commerce/secure-remote-commerce.js +15 -99
  35. package/lib/secure-remote-commerce/secure-remote-commerce.js.map +1 -1
  36. package/lib/wallet-buttons/flypay-v2.wallet-service.d.ts +0 -1
  37. package/lib/wallet-buttons/flypay-v2.wallet-service.js +28 -30
  38. package/lib/wallet-buttons/flypay-v2.wallet-service.js.map +1 -1
  39. package/package.json +2 -2
  40. package/slate.md +69 -131
  41. package/typings/index.d.ts +0 -1
  42. package/vendors/zipmoney.js +1 -2
  43. package/lib/secure-remote-commerce/providers/visa-src/helper.d.ts +0 -7
  44. package/lib/secure-remote-commerce/providers/visa-src/helper.js +0 -36
  45. package/lib/secure-remote-commerce/providers/visa-src/helper.js.map +0 -1
  46. package/lib/secure-remote-commerce/providers/visa-src/index.d.ts +0 -1
  47. package/lib/secure-remote-commerce/providers/visa-src/index.js +0 -2
  48. package/lib/secure-remote-commerce/providers/visa-src/index.js.map +0 -1
  49. package/lib/secure-remote-commerce/providers/visa-src/visa-src.js +0 -113
  50. package/lib/secure-remote-commerce/providers/visa-src/visa-src.js.map +0 -1
  51. package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.d.ts +0 -8
  52. package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.js +0 -10
  53. package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.js.map +0 -1
  54. package/typings/globals/@auspayplus/open-payments-checkout/index.d.ts +0 -43
@@ -1,12 +1,3 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
1
  import { Checkout } from '@auspayplus/open-payments-checkout';
11
2
  import { WALLET_EVENT, WalletService } from './wallet-service';
12
3
  import { FLYPAY_LOGO_LINK, Link } from '../components/link';
@@ -16,8 +7,7 @@ import { createFlypayV2ButtonStyle, getDisabledFlypayV2Button, getFlypayV2Button
16
7
  export class FlypayV2WalletService extends WalletService {
17
8
  constructor(publicKey, meta) {
18
9
  super(publicKey, meta);
19
- this.processingButtonClick = false;
20
- this.onFlypayV2ButtonClick = () => __awaiter(this, void 0, void 0, function* () {
10
+ this.onFlypayV2ButtonClick = () => {
21
11
  const setLoadingOverlayDisplay = (displayStyle) => {
22
12
  const loadingOverlay = document.getElementById('loading-overlay');
23
13
  if (loadingOverlay)
@@ -25,15 +15,9 @@ export class FlypayV2WalletService extends WalletService {
25
15
  };
26
16
  this.disable();
27
17
  setLoadingOverlayDisplay('flex');
28
- if (this.processingButtonClick)
29
- return;
30
- this.processingButtonClick = true;
31
- this.handleMerchantOnButtonClickEvent().then(() => __awaiter(this, void 0, void 0, function* () {
32
- var _a, _b;
33
- try {
34
- this.processingButtonClick = false;
35
- if (!this.orderId)
36
- this.orderId = yield this.getOrderId();
18
+ this.handleMerchantOnButtonClickEvent().then(() => {
19
+ const processButtonClick = (orderId) => {
20
+ var _a;
37
21
  setLoadingOverlayDisplay('none');
38
22
  this.background = this.initBackground();
39
23
  if (this.orderId) {
@@ -43,19 +27,30 @@ export class FlypayV2WalletService extends WalletService {
43
27
  else {
44
28
  this.eventEmitter.emit(WALLET_EVENT.UNAVAILABLE);
45
29
  }
46
- }
47
- catch (err) {
48
- (_b = this.background) === null || _b === void 0 ? void 0 : _b.clear();
30
+ };
31
+ const processFailure = (err) => {
32
+ var _a;
33
+ (_a = this.background) === null || _a === void 0 ? void 0 : _a.clear();
49
34
  setLoadingOverlayDisplay('none');
50
35
  this.enable();
51
36
  this.eventEmitter.emit(WALLET_EVENT.UNAVAILABLE, { err });
37
+ };
38
+ if (this.orderId) {
39
+ processButtonClick(this.orderId);
40
+ }
41
+ else {
42
+ this.getOrderId().then((orderId) => {
43
+ this.orderId = orderId;
44
+ processButtonClick(orderId);
45
+ }).catch((err) => {
46
+ processFailure(err);
47
+ });
52
48
  }
53
- })).catch((err) => {
54
- this.processingButtonClick = false;
49
+ }).catch((err) => {
55
50
  setLoadingOverlayDisplay('none');
56
51
  this.enable();
57
52
  });
58
- });
53
+ };
59
54
  this.accessToken = meta === null || meta === void 0 ? void 0 : meta.access_token;
60
55
  this.refreshToken = meta === null || meta === void 0 ? void 0 : meta.refresh_token;
61
56
  this.link = new Link('');
@@ -131,8 +126,11 @@ export class FlypayV2WalletService extends WalletService {
131
126
  }
132
127
  flypayV2Checkout(orderId) {
133
128
  var _a, _b;
134
- this.checkout = new Checkout(Object.assign(Object.assign({ orderId }, ((this.accessToken || this.refreshToken) && {
135
- auth: Object.assign(Object.assign({}, (this.accessToken && { access_token: this.accessToken })), (this.refreshToken && { refresh_token: this.refreshToken })),
129
+ this.checkout = new Checkout(Object.assign(Object.assign({ orderId }, ((this.accessToken && this.refreshToken) && {
130
+ auth: {
131
+ access_token: this.accessToken,
132
+ refresh_token: this.refreshToken,
133
+ },
136
134
  mode: 'express',
137
135
  })), { clientId: ((_a = this.meta) === null || _a === void 0 ? void 0 : _a.gateway_mode) === 'live' ? 'dbbd114e-3583-4db5-915e-59f1b3dcd08b' : '924ac1ce-00f4-44e4-8277-06cae751ef1a', url: ((_b = this.meta) === null || _b === void 0 ? void 0 : _b.gateway_mode) === 'live' ? 'https://checkout.cxbflypay.com.au' : 'https://checkout.sandbox.cxbflypay.com.au', onCheckoutClosed: () => {
138
136
  var _a;
@@ -150,14 +148,14 @@ export class FlypayV2WalletService extends WalletService {
150
148
  this.checkout.listenMessage();
151
149
  }
152
150
  initBackground() {
153
- const hideCloseButton = true;
154
- const bg = new WalletBackground(this.link.getNetUrl() + FLYPAY_LOGO_LINK, hideCloseButton);
151
+ const bg = new WalletBackground(this.link.getNetUrl() + FLYPAY_LOGO_LINK);
155
152
  bg.setBackdropTitle("");
156
153
  bg.setBackdropDescription("");
157
154
  bg.onTrigger(BACKGROUND_TRIGGER.CLOSE, () => {
158
155
  var _a;
159
156
  this.checkout.close();
160
157
  (_a = this.background) === null || _a === void 0 ? void 0 : _a.clear();
158
+ this.enable();
161
159
  });
162
160
  return bg;
163
161
  }
@@ -1 +1 @@
1
- {"version":3,"file":"flypay-v2.wallet-service.js","sourceRoot":"","sources":["../../wallet-buttons/flypay-v2.wallet-service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAE9D,OAAO,EAAsC,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAErH,MAAM,OAAO,qBAAsB,SAAQ,aAAa;IAWpD,YAAY,SAAiB,EAAE,IAAwB;QACnD,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAHjB,0BAAqB,GAAG,KAAK,CAAC;QA2DhC,0BAAqB,GAAG,GAAS,EAAE;YACvC,MAAM,wBAAwB,GAAG,CAAC,YAAY,EAAE,EAAE;gBAC9C,MAAM,cAAc,GAAG,QAAQ,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;gBAClE,IAAI,cAAc;oBAAE,cAAc,CAAC,KAAK,CAAC,OAAO,GAAG,YAAY,CAAC;YACpE,CAAC,CAAC;YAEF,IAAI,CAAC,OAAO,EAAE,CAA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AAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;YACtB,MAAA,IAAI,CAAC,UAAU,0CAAE,KAAK,GAAG;YACzB,IAAI,CAAC,MAAM,EAAE,CAAC;QAClB,CAAC,CAAC,CAAC;QACH,OAAO,EAAE,CAAC;IACd,CAAC;CACJ"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@paydock/client-sdk",
3
3
  "description": "Paydock client sdk",
4
- "version": "1.105.1",
4
+ "version": "1.106.1",
5
5
  "homepage": "https://paydock.com",
6
6
  "author": {},
7
7
  "bugs": {
@@ -71,7 +71,7 @@
71
71
  "typescript": "3.9.7"
72
72
  },
73
73
  "dependencies": {
74
- "@auspayplus/open-payments-checkout": "1.7.3",
74
+ "@auspayplus/open-payments-checkout": "1.7.6",
75
75
  "@stripe/stripe-js": "^1.11.0",
76
76
  "@types/applepayjs": "^3.0.1",
77
77
  "@types/googlepay": "^0.6.3"
package/slate.md CHANGED
@@ -1664,54 +1664,42 @@ Similarly, for **GooglePay via MPGS** you can initialize the `PaymentMethodSpeci
1664
1664
  </html>
1665
1665
  ```
1666
1666
 
1667
- ## Secure Remote Commerce
1668
- You can find description of all methods and parameters [here](https://www.npmjs.com/package/@paydock/client-sdk#SRC).
1669
-
1670
- This widget provides you with the ability to easily integrate with SRC providers. Currently Visa SRC is supported.
1671
-
1667
+ # Secure Remote Commerce
1668
+ ## Overview
1669
+ Integrate with Mastercard SRC using Paydock's Mastercard SRC widget.
1670
+ For a full description of the methods and parameters, reference the [README file](https://www.npmjs.com/package/@paydock/client-sdk#SRC).
1672
1671
  ## SRC simple example
1673
-
1674
- ### Container
1675
-
1672
+ The following section provides an example use case and integration for the widget.
1673
+ ### Create a Container
1674
+ To integrate the SRC checkout iFrame, create a container in your HTML code. This container serves as the placeholder for the iFrame.
1676
1675
  ```html
1677
- <div id="checkoutButton"></div>
1678
1676
  <div id="checkoutIframe"></div>
1679
1677
  ```
1680
-
1681
- 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.
1682
-
1683
-
1684
- ### Initialization
1678
+ ### Initialize the Widget
1679
+ Use the following code to initialize your widget:
1685
1680
  ```javascript
1686
- var src = new paydock.SRC(
1687
- "#checkoutButton",
1681
+ var src = new paydock.MastercardSRCClickToPay(
1688
1682
  "#checkoutIframe",
1689
- "scheme_service_id",
1683
+ "service_id",
1690
1684
  "paydock_public_key_or_access_token",
1691
1685
  {}, // meta
1692
1686
  );
1693
1687
  src.load();
1694
1688
  ```
1695
-
1696
1689
  ```javascript--es2015
1697
1690
  // ES2015 | TypeScript
1698
-
1699
- import { SRC } from '@paydock/client-sdk';
1700
-
1701
- var src = new SRC(
1702
- "#checkoutButton",
1691
+ import { MastercardSRCClickToPay } from '@paydock/client-sdk';
1692
+ var src = new MastercardSRCClickToPay(
1703
1693
  "#checkoutIframe",
1704
- "scheme_service_id",
1694
+ "service_id",
1705
1695
  "paydock_public_key_or_access_token",
1706
1696
  {}, // meta
1707
1697
  );
1708
1698
  src.load();
1709
1699
  ```
1710
-
1711
- *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
-
1700
+ *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.
1713
1701
  ### Full example
1714
-
1702
+ A full example of the container and the initialized widget is as follows:
1715
1703
  ```html
1716
1704
  <!DOCTYPE html>
1717
1705
  <html lang="en">
@@ -1721,14 +1709,12 @@ src.load();
1721
1709
  <style>iframe {border: 0;width: 40%;height: 300px;}</style>
1722
1710
  </head>
1723
1711
  <body>
1724
- <div id="checkoutButton"></div>
1725
1712
  <div id="checkoutIframe"></div>
1726
1713
  <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
1727
1714
  <script>
1728
- var src = new paydock.SRC(
1729
- "#checkoutButton",
1715
+ var src = new paydock.MastercardSRCClickToPay(
1730
1716
  "#checkoutIframe",
1731
- "scheme_service_id",
1717
+ "service_id",
1732
1718
  "paydock_public_key_or_access_token",
1733
1719
  {},
1734
1720
  );
@@ -1737,53 +1723,27 @@ src.load();
1737
1723
  </body>
1738
1724
  </html>
1739
1725
  ```
1740
-
1741
-
1742
- ## SRC advanced example
1743
-
1726
+ ## Customize your SRC Checkout
1727
+ The following is an advanced example that includes customization. You can use these methods to enhance your checkout experience.
1744
1728
  ### Settings
1745
-
1746
1729
  ```javascript
1747
-
1748
- src.setEnv('sandbox'); // set enviroment
1749
-
1750
- src.hideButton(); // hide button
1751
-
1752
- src.showButton(); // show button
1753
-
1730
+ src.setEnv('sandbox'); // set environment
1754
1731
  src.hideCheckout(); // hide checkout iframe
1755
-
1756
1732
  src.showCheckout(); // show checkout iframe
1757
-
1758
- src.on('checkoutButtonLoaded', () => {
1759
- console.log("Button loaded");
1760
- });
1761
-
1762
- src.on('checkoutButtonClicked', () => {
1763
- console.log("Button clicked");
1764
- });
1765
-
1766
1733
  src.on('iframeLoaded', () => {
1767
1734
  console.log("Initial iframe loaded");
1768
1735
  });
1769
-
1770
1736
  src.on('checkoutReady', () => {
1771
1737
  console.log("Checkout ready to be used");
1772
1738
  });
1773
-
1774
1739
  src.on('checkoutCompleted', (token) => {
1775
1740
  console.log(token);
1776
1741
  });
1777
-
1778
1742
  src.on('checkoutError', (error) => {
1779
1743
  console.log(error);
1780
1744
  });
1781
1745
  ```
1782
-
1783
- Here you can see how you can use this methods to customize your checkout experience
1784
-
1785
1746
  ### Full example
1786
-
1787
1747
  ```html
1788
1748
  <!DOCTYPE html>
1789
1749
  <html lang="en">
@@ -1793,64 +1753,67 @@ Here you can see how you can use this methods to customize your checkout experie
1793
1753
  <style>iframe {border: 0;width: 40%;height: 450px;}</style>
1794
1754
  </head>
1795
1755
  <body>
1796
- <div id="checkoutButton"></div>
1797
1756
  <div id="checkoutIframe"></div>
1798
1757
  <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
1799
1758
  <script>
1800
- var src = new paydock.SRC(
1801
- "#checkoutButton",
1759
+ var src = new paydock.MastercardSRCClickToPay(
1802
1760
  "#checkoutIframe",
1803
- "scheme_service_id",
1761
+ "service_id",
1804
1762
  "paydock_public_key_or_access_token",
1805
1763
  {},
1806
1764
  );
1807
-
1765
+ src.on('iframeLoaded', () => {
1766
+ console.log("Initial iframe loaded");
1767
+ });
1808
1768
  src.on('checkoutReady', () => {
1809
1769
  console.log("Checkout ready to be used");
1810
1770
  });
1811
-
1812
1771
  src.on('checkoutCompleted', (token) => {
1813
1772
  console.log(token);
1814
1773
  });
1774
+ src.on('checkoutError', (error) => {
1775
+ console.log(error);
1776
+ });
1815
1777
  src.load();
1816
1778
  </script>
1817
1779
  </body>
1818
1780
  </html>
1819
1781
  ```
1820
-
1821
- ## Customization options for address fields
1822
- ### Shipping address:
1823
-
1824
- 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.
1825
-
1782
+ ## Customize your billing address fields
1783
+ To customize your billing address experience, Paydock uses a flag that manages whether a customer's billing address is mandatory.
1784
+ The options for this customization are NONE (default option), and POSTAL_COUNTRY or FULL.
1826
1785
  ```
1827
- var src = new paydock.SRC(
1828
- "#checkoutButton",
1786
+ var src = new paydock.MastercardSRCClickToPay(
1829
1787
  "#checkoutIframe",
1830
- "scheme_service_id",
1788
+ "service_id",
1831
1789
  "paydock_public_key_or_access_token",
1832
1790
  {
1833
1791
  "dpa_transaction_options": {
1834
- "dpa_shipping_preference": "ALL"
1792
+ "dpa_billing_preference": "FULL"
1835
1793
  }
1836
1794
  },
1837
1795
  );
1838
1796
  ```
1839
-
1840
- With this the Visa popup requires the shipping address from consumer, and these information will be stored in the Paydock charge.
1841
-
1842
- 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:
1843
-
1797
+ 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.
1798
+ 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:
1799
+ 1. Disable the billing address in Paydock's SRC widget.
1800
+ 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.
1801
+ 3. Send the billing address when creating the charge.
1844
1802
  ```
1845
1803
  POST v1/charges
1846
-
1847
1804
  {
1848
1805
  "amount": "10.00",
1849
1806
  "currency": "AUD",
1850
- "token": "token",
1807
+ "token": "one_time_token",
1851
1808
  "customer": {
1852
1809
  "payment_source": {
1853
- "gateway_id": "gateway_id"
1810
+ "gateway_id": "gateway_id",
1811
+ "address_line1": "address_line1",
1812
+ "address_line2": "address_line2",
1813
+ "address_city": "address_city",
1814
+ "address_postcode": "address_postcode",
1815
+ "address_state": "address_state",
1816
+ "address_country": "address_country"
1854
1817
  }
1855
1818
  },
1856
1819
  "shipping": {
@@ -1864,61 +1827,36 @@ POST v1/charges
1864
1827
  }
1865
1828
  }
1866
1829
  ```
1867
-
1868
- - Billing address:
1869
-
1870
- 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:
1871
-
1830
+ ## How to customize accepted cards
1831
+ You can send a flag `unaccepted_card_type` to block the usage of a specific card type. The available options are 'DEBIT' and 'CREDIT'.
1832
+ ### Example code
1833
+ The following example demonstrates how to block the card:
1872
1834
  ```
1873
- var src = new paydock.SRC(
1874
- "#checkoutButton",
1835
+ var src = new paydock.MastercardSRCClickToPay(
1875
1836
  "#checkoutIframe",
1876
- "scheme_service_id",
1877
- "paydock_public_key_or_access_token",
1837
+ "service_id",
1838
+ "paydock_public_key",
1878
1839
  {
1879
- "customer": {
1880
- "email": "test@email.com",
1881
- "first_name": "Name",
1882
- "last_name": "Surname",
1883
- "phone": {
1884
- "country_code": "1",
1885
- "phone": "2124567890"
1886
- },
1887
- "payment_source": {
1888
- "address_line1": "Line 1",
1889
- "address_line2": "Line 2",
1890
- "address_city": "Miami",
1891
- "address_postcode": "33126",
1892
- "address_state": "FL",
1893
- "address_country": "US"
1894
- }
1895
- }
1840
+ unaccepted_card_type: 'DEBIT'
1896
1841
  },
1897
1842
  );
1898
1843
  ```
1899
-
1900
- ## Personalization Styling
1901
-
1902
- To improve the experience in the use of the widget, it is allowed to send props that customize the UI.
1903
-
1844
+ ## Personalize the Style
1845
+ Customize the look and feel of your UI. The following example demonstrates changes in the styling of the buttons.
1904
1846
  ### Example code
1905
-
1906
1847
  ```
1907
- var src = new paydock.SRC(
1908
- "#checkoutButton",
1848
+ var src = new paydock.MastercardSRCClickToPay(
1909
1849
  "#checkoutIframe",
1910
- "scheme_service_id",
1850
+ "service_id",
1911
1851
  "paydock_public_key",
1852
+ {},
1912
1853
  );
1913
-
1914
- button.setStyles({"primary_color":"#a83232","button_text_color":"#171e9c","font_family":"sans-serif"})
1915
-
1854
+ src.setStyles({
1855
+ enable_src_popup: true,
1856
+ primary_button_color: 'red',
1857
+ secondary_button_color: 'red',
1858
+ primary_button_text_color: 'red',
1859
+ secondary_button_text_color: 'red',
1860
+ font_family: 'Arial',
1861
+ });
1916
1862
  ```
1917
- ## Event and Values
1918
-
1919
- | Event Value | Type | Description |
1920
- | ------------------- | ------------------- | -------------------------------------------------------------- |
1921
- | primary_color | <code>string</code> | HEX color for the principal buttons, example : #32a852 |
1922
- | button_text_color | <code>string</code> | HEX color for the text of the buttons, example : #32a852|
1923
- | font_family | <code>string</code> | Look more [mozilla.org/color](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family)|
1924
- | card_schemes | <code>[string] - array of string</code> | Possible values "visa", "mastercard", "amex" and "discover" - Default show all logos
@@ -1,4 +1,3 @@
1
1
  /// <reference path="globals/jasmine-ajax/index.d.ts" />
2
2
  /// <reference path="globals/jasmine/index.d.ts" />
3
3
  /// <reference path="globals/jquery/index.d.ts" />
4
- /// <reference path="globals/@auspayplus/open-payments-checkout/index.d.ts" />