@paydock/client-sdk 1.106.2 → 1.106.11
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 +68 -58
- package/bundles/widget.umd.js +30 -37
- package/bundles/widget.umd.min.js +1 -1
- package/lib/api/api-service-internal.d.ts +1 -1
- package/lib/api/api-service-internal.js +1 -1
- package/lib/api/api-service-internal.js.map +1 -1
- package/lib/components/wallet-background.d.ts +1 -2
- package/lib/components/wallet-background.js +1 -26
- package/lib/components/wallet-background.js.map +1 -1
- package/lib/configs/sdk.js +1 -1
- package/lib/secure-remote-commerce/click-to-pay-secure-remote-commerce.d.ts +30 -0
- package/lib/secure-remote-commerce/{mastercard-secure-remote-commerce.js → click-to-pay-secure-remote-commerce.js} +10 -10
- package/lib/secure-remote-commerce/click-to-pay-secure-remote-commerce.js.map +1 -0
- package/lib/secure-remote-commerce/index.d.ts +4 -4
- package/lib/secure-remote-commerce/index.js +4 -4
- package/lib/secure-remote-commerce/index.js.map +1 -1
- package/lib/secure-remote-commerce/interfaces.d.ts +4 -4
- package/lib/secure-remote-commerce/interfaces.js +3 -3
- package/lib/secure-remote-commerce/providers/mastercard-src/index.d.ts +1 -1
- package/lib/secure-remote-commerce/providers/mastercard-src/index.js +1 -1
- package/lib/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts +4 -4
- package/lib/secure-remote-commerce/providers/mastercard-src/mastercard-src.js +3 -2
- package/lib/secure-remote-commerce/providers/mastercard-src/mastercard-src.js.map +1 -1
- package/lib/secure-remote-commerce/secure-remote-commerce.d.ts +3 -3
- package/lib/secure-remote-commerce/secure-remote-commerce.js +2 -2
- package/lib/secure-remote-commerce/secure-remote-commerce.js.map +1 -1
- package/lib/wallet-buttons/flypay-v2.wallet-service.js +1 -4
- package/lib/wallet-buttons/flypay-v2.wallet-service.js.map +1 -1
- package/package.json +1 -1
- package/slate.md +28 -18
- package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.d.ts +0 -30
- package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.js.map +0 -1
package/slate.md
CHANGED
|
@@ -1664,21 +1664,28 @@ Similarly, for **GooglePay via MPGS** you can initialize the `PaymentMethodSpeci
|
|
|
1664
1664
|
</html>
|
|
1665
1665
|
```
|
|
1666
1666
|
|
|
1667
|
-
#
|
|
1667
|
+
# Click To Pay
|
|
1668
|
+
|
|
1668
1669
|
## Overview
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1670
|
+
|
|
1671
|
+
Integrate with Click To Pay using Paydock's Click To Pay widget.
|
|
1672
|
+
For a full description of the methods and parameters, reference the [README file](https://www.npmjs.com/package/@paydock/client-sdk#ClickToPay).
|
|
1673
|
+
|
|
1674
|
+
## Click To Pay simple example
|
|
1675
|
+
|
|
1672
1676
|
The following section provides an example use case and integration for the widget.
|
|
1677
|
+
|
|
1673
1678
|
### Create a Container
|
|
1674
|
-
|
|
1679
|
+
|
|
1680
|
+
To integrate the Click To Pay checkout iFrame, create a container in your HTML code. This container serves as the placeholder for the iFrame.
|
|
1681
|
+
|
|
1675
1682
|
```html
|
|
1676
1683
|
<div id="checkoutIframe"></div>
|
|
1677
1684
|
```
|
|
1678
1685
|
### Initialize the Widget
|
|
1679
1686
|
Use the following code to initialize your widget:
|
|
1680
1687
|
```javascript
|
|
1681
|
-
var src = new paydock.
|
|
1688
|
+
var src = new paydock.ClickToPay(
|
|
1682
1689
|
"#checkoutIframe",
|
|
1683
1690
|
"service_id",
|
|
1684
1691
|
"paydock_public_key_or_access_token",
|
|
@@ -1688,8 +1695,8 @@ src.load();
|
|
|
1688
1695
|
```
|
|
1689
1696
|
```javascript--es2015
|
|
1690
1697
|
// ES2015 | TypeScript
|
|
1691
|
-
import {
|
|
1692
|
-
var src = new
|
|
1698
|
+
import { ClickToPay } from '@paydock/client-sdk';
|
|
1699
|
+
var src = new ClickToPay(
|
|
1693
1700
|
"#checkoutIframe",
|
|
1694
1701
|
"service_id",
|
|
1695
1702
|
"paydock_public_key_or_access_token",
|
|
@@ -1712,7 +1719,7 @@ A full example of the container and the initialized widget is as follows:
|
|
|
1712
1719
|
<div id="checkoutIframe"></div>
|
|
1713
1720
|
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
1714
1721
|
<script>
|
|
1715
|
-
var src = new paydock.
|
|
1722
|
+
var src = new paydock.ClickToPay(
|
|
1716
1723
|
"#checkoutIframe",
|
|
1717
1724
|
"service_id",
|
|
1718
1725
|
"paydock_public_key_or_access_token",
|
|
@@ -1723,7 +1730,9 @@ A full example of the container and the initialized widget is as follows:
|
|
|
1723
1730
|
</body>
|
|
1724
1731
|
</html>
|
|
1725
1732
|
```
|
|
1726
|
-
|
|
1733
|
+
|
|
1734
|
+
## Customize your Click To Pay Checkout
|
|
1735
|
+
|
|
1727
1736
|
The following is an advanced example that includes customization. You can use these methods to enhance your checkout experience.
|
|
1728
1737
|
### Settings
|
|
1729
1738
|
```javascript
|
|
@@ -1756,7 +1765,7 @@ src.on('checkoutError', (error) => {
|
|
|
1756
1765
|
<div id="checkoutIframe"></div>
|
|
1757
1766
|
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
1758
1767
|
<script>
|
|
1759
|
-
var src = new paydock.
|
|
1768
|
+
var src = new paydock.ClickToPay(
|
|
1760
1769
|
"#checkoutIframe",
|
|
1761
1770
|
"service_id",
|
|
1762
1771
|
"paydock_public_key_or_access_token",
|
|
@@ -1783,7 +1792,7 @@ src.on('checkoutError', (error) => {
|
|
|
1783
1792
|
To customize your billing address experience, Paydock uses a flag that manages whether a customer's billing address is mandatory.
|
|
1784
1793
|
The options for this customization are NONE (default option), and POSTAL_COUNTRY or FULL.
|
|
1785
1794
|
```
|
|
1786
|
-
var src = new paydock.
|
|
1795
|
+
var src = new paydock.ClickToPay(
|
|
1787
1796
|
"#checkoutIframe",
|
|
1788
1797
|
"service_id",
|
|
1789
1798
|
"paydock_public_key_or_access_token",
|
|
@@ -1794,10 +1803,11 @@ var src = new paydock.MastercardSRCClickToPay(
|
|
|
1794
1803
|
},
|
|
1795
1804
|
);
|
|
1796
1805
|
```
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1806
|
+
|
|
1807
|
+
The Click To Pay 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.
|
|
1808
|
+
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 Click To Pay checkout, you can provide it alongside other information at the charge creation step:
|
|
1809
|
+
1. Disable the billing address in Paydock's Click To Pay widget.
|
|
1810
|
+
2. Get your One Time Token from the Click To Pay widget alongside other details that may have been collected outside the Click To Pay checkout as the shipping address.
|
|
1801
1811
|
3. Send the billing address when creating the charge.
|
|
1802
1812
|
```
|
|
1803
1813
|
POST v1/charges
|
|
@@ -1832,7 +1842,7 @@ You can send a flag `unaccepted_card_type` to block the usage of a specific card
|
|
|
1832
1842
|
### Example code
|
|
1833
1843
|
The following example demonstrates how to block the card:
|
|
1834
1844
|
```
|
|
1835
|
-
var src = new paydock.
|
|
1845
|
+
var src = new paydock.ClickToPay(
|
|
1836
1846
|
"#checkoutIframe",
|
|
1837
1847
|
"service_id",
|
|
1838
1848
|
"paydock_public_key",
|
|
@@ -1845,7 +1855,7 @@ var src = new paydock.MastercardSRCClickToPay(
|
|
|
1845
1855
|
Customize the look and feel of your UI. The following example demonstrates changes in the styling of the buttons.
|
|
1846
1856
|
### Example code
|
|
1847
1857
|
```
|
|
1848
|
-
var src = new paydock.
|
|
1858
|
+
var src = new paydock.ClickToPay(
|
|
1849
1859
|
"#checkoutIframe",
|
|
1850
1860
|
"service_id",
|
|
1851
1861
|
"paydock_public_key",
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { IMastercardSRCMeta } from './interfaces';
|
|
2
|
-
import { SRC } from './secure-remote-commerce';
|
|
3
|
-
/**
|
|
4
|
-
* Class MastercardSRCClickToPay include methods for interacting with the MastercardSRC checkout and Manual Card option
|
|
5
|
-
*
|
|
6
|
-
* @extends SRC
|
|
7
|
-
*
|
|
8
|
-
* @constructor
|
|
9
|
-
*
|
|
10
|
-
* @param {string} iframe_selector - Selector of html element. Container for SRC checkout iFrame.
|
|
11
|
-
* @param {string} service_id - Card Scheme Service ID
|
|
12
|
-
* @param {string} public_key_or_access_token - Paydock public key or Access Token
|
|
13
|
-
* @param {IMastercardSRCMeta} meta - Data that configures the SRC checkout
|
|
14
|
-
* @example
|
|
15
|
-
* var mastercardSRC = new MastercardSRCClickToPay('#checkoutIframe', 'service_id', 'public_key', {});
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
declare class MastercardSRCClickToPay extends SRC {
|
|
19
|
-
protected iframe_selector: string;
|
|
20
|
-
protected service_id: string;
|
|
21
|
-
protected public_key_or_access_token: string;
|
|
22
|
-
protected meta: IMastercardSRCMeta;
|
|
23
|
-
/** @constructs */ constructor(iframe_selector: string, service_id: string, public_key_or_access_token: string, meta: IMastercardSRCMeta);
|
|
24
|
-
/**
|
|
25
|
-
* The final method after configuring the SRC to start the load process of SRC checkout
|
|
26
|
-
*
|
|
27
|
-
*/
|
|
28
|
-
load(): void;
|
|
29
|
-
}
|
|
30
|
-
export { MastercardSRCClickToPay };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mastercard-secure-remote-commerce.js","sourceRoot":"","sources":["../../secure-remote-commerce/mastercard-secure-remote-commerce.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C;;;;;;;;;;;;;;GAcG;AACH,MAAM,uBAAwB,SAAQ,GAAG;IACrC,kBAAkB,CAAC,sDAAsD;IACzE,YAAsB,eAAuB,EAAY,UAAkB,EAAY,0BAAkC,EAAY,IAAwB;QACzJ,KAAK,CAAC,eAAe,EAAE,UAAU,EAAE,0BAA0B,EAAE,IAAI,CAAC,CAAC;QADnD,oBAAe,GAAf,eAAe,CAAQ;QAAY,eAAU,GAAV,UAAU,CAAQ;QAAY,+BAA0B,GAA1B,0BAA0B,CAAQ;QAAY,SAAI,GAAJ,IAAI,CAAoB;IAE7J,CAAC;IAED;;;OAGG;IACI,IAAI;QACP,IAAI,IAAI,CAAC,QAAQ;YACb,OAAO;QAEX,IAAI,CAAC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC;QAEtC,IAAI,CAAC,QAAQ,GAAG,IAAI,aAAa,CAC7B,IAAI,CAAC,eAAe,EACpB,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,0BAA0B,EAC/B,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,GAAG,EACR,IAAI,CAAC,KAAK,CACb,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;CACJ;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|