@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.
- package/README.md +732 -409
- package/bundles/index.cjs +1689 -1907
- package/bundles/index.cjs.d.ts +420 -377
- package/bundles/index.cjs.map +1 -1
- package/bundles/index.mjs +1689 -1907
- package/bundles/index.mjs.d.ts +420 -377
- package/bundles/index.mjs.map +1 -1
- package/bundles/types/api/api-service-internal.d.ts +2 -1
- package/bundles/types/api/api-service-internal.d.ts.map +1 -1
- package/bundles/types/api/api.d.ts +1 -1
- package/bundles/types/api/api.d.ts.map +1 -1
- package/bundles/types/canvas-3ds/canvas-3ds.d.ts +1 -1
- package/bundles/types/canvas-3ds/canvas-3ds.d.ts.map +1 -1
- package/bundles/types/checkout-button/afterpay/afterpay-checkout-button.d.ts +1 -1
- package/bundles/types/checkout-button/afterpay/afterpay-checkout-button.d.ts.map +1 -1
- package/bundles/types/checkout-button/checkout-button.d.ts +1 -1
- package/bundles/types/checkout-button/checkout-button.d.ts.map +1 -1
- package/bundles/types/checkout-button/paypal/paypal-checkout-button.d.ts +1 -1
- package/bundles/types/checkout-button/paypal/paypal-checkout-button.d.ts.map +1 -1
- package/bundles/types/checkout-button/zipmoney/zipmoney-checkout-button.d.ts +1 -1
- package/bundles/types/checkout-button/zipmoney/zipmoney-checkout-button.d.ts.map +1 -1
- package/bundles/types/components/container.d.ts +1 -0
- package/bundles/types/components/container.d.ts.map +1 -1
- package/bundles/types/components/{form-Interceptor.d.ts → form-interceptor.d.ts} +1 -1
- package/bundles/types/components/{form-Interceptor.d.ts.map → form-interceptor.d.ts.map} +1 -1
- package/bundles/types/components/iframe-event.d.ts +17 -11
- package/bundles/types/components/iframe-event.d.ts.map +1 -1
- package/bundles/types/components/link.d.ts +3 -2
- package/bundles/types/components/link.d.ts.map +1 -1
- package/bundles/types/components/param.d.ts +6 -8
- package/bundles/types/components/param.d.ts.map +1 -1
- package/bundles/types/components/wallet-background.d.ts +2 -1
- package/bundles/types/components/wallet-background.d.ts.map +1 -1
- package/bundles/types/constants/validators.d.ts +45 -0
- package/bundles/types/constants/validators.d.ts.map +1 -0
- package/bundles/types/payment-source-widget/html-payment-source-widget.d.ts +17 -13
- package/bundles/types/payment-source-widget/html-payment-source-widget.d.ts.map +1 -1
- package/bundles/types/payment-source-widget/payment-source-widget.d.ts +1 -1
- package/bundles/types/payment-source-widget/payment-source-widget.d.ts.map +1 -1
- package/bundles/types/secure-remote-commerce/index.d.ts +102 -1
- package/bundles/types/secure-remote-commerce/index.d.ts.map +1 -1
- package/bundles/types/secure-remote-commerce/interfaces.d.ts +109 -32
- package/bundles/types/secure-remote-commerce/interfaces.d.ts.map +1 -1
- package/bundles/types/secure-remote-commerce/mastercard-secure-remote-commerce.d.ts +31 -0
- package/bundles/types/secure-remote-commerce/mastercard-secure-remote-commerce.d.ts.map +1 -0
- package/bundles/types/secure-remote-commerce/providers/mastercard-src/index.d.ts +2 -0
- package/bundles/types/secure-remote-commerce/providers/mastercard-src/index.d.ts.map +1 -0
- package/bundles/types/secure-remote-commerce/providers/{visa-src/visa-src.d.ts → mastercard-src/mastercard-src.d.ts} +5 -8
- package/bundles/types/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts.map +1 -0
- package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts +13 -91
- package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts.map +1 -1
- package/bundles/types/vault-display-widget/vault-display-widget.d.ts +1 -1
- package/bundles/types/vault-display-widget/vault-display-widget.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/apple.wallet-service.d.ts +2 -0
- package/bundles/types/wallet-buttons/apple.wallet-service.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/flypay-v2.wallet-service.d.ts +8 -1
- package/bundles/types/wallet-buttons/flypay-v2.wallet-service.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/google.wallet-service.d.ts +3 -0
- package/bundles/types/wallet-buttons/google.wallet-service.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/helpers/flypay-v2.helper.d.ts +4 -0
- package/bundles/types/wallet-buttons/helpers/flypay-v2.helper.d.ts.map +1 -0
- package/bundles/types/wallet-buttons/index.d.ts +126 -0
- package/bundles/types/wallet-buttons/index.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/interfaces.d.ts +3 -0
- package/bundles/types/wallet-buttons/interfaces.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/paypal.wallet-service.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/wallet-buttons.d.ts +63 -121
- package/bundles/types/wallet-buttons/wallet-buttons.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts +1 -1
- package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/wallet-service.d.ts +7 -0
- package/bundles/types/wallet-buttons/wallet-service.d.ts.map +1 -1
- package/bundles/types/widget/configuration.d.ts +1 -1
- package/bundles/types/widget/configuration.d.ts.map +1 -1
- package/bundles/types/widget/html-multi-widget.d.ts +146 -75
- package/bundles/types/widget/html-multi-widget.d.ts.map +1 -1
- package/bundles/types/widget/html-widget.d.ts +1 -1
- package/bundles/types/widget/html-widget.d.ts.map +1 -1
- package/bundles/types/widget/multi-widget.d.ts.map +1 -1
- package/bundles/widget.umd.js +1689 -1907
- package/bundles/widget.umd.js.d.ts +420 -377
- package/bundles/widget.umd.js.map +1 -1
- package/bundles/widget.umd.js.min.d.ts +420 -377
- package/bundles/widget.umd.min.js +1 -1
- package/bundles/widget.umd.min.js.map +1 -1
- package/docs/api-ps-widget.md +12 -12
- package/docs/api-widget.md +211 -156
- package/docs/install/umd.content.md +3 -4
- package/docs/install.md +4 -14
- package/docs/license.md +1 -1
- package/docs/secure-remote-commerce-examples.md +75 -101
- package/docs/secure-remote-commerce.md +185 -114
- package/docs/wallet-buttons-examples.md +48 -19
- package/docs/wallet-buttons.md +197 -2
- package/package.json +1 -1
- package/slate.md +126 -124
- package/bundles/types/secure-remote-commerce/providers/visa-src/helper.d.ts +0 -8
- package/bundles/types/secure-remote-commerce/providers/visa-src/helper.d.ts.map +0 -1
- package/bundles/types/secure-remote-commerce/providers/visa-src/index.d.ts +0 -2
- package/bundles/types/secure-remote-commerce/providers/visa-src/index.d.ts.map +0 -1
- package/bundles/types/secure-remote-commerce/providers/visa-src/visa-src.d.ts.map +0 -1
- package/bundles/types/secure-remote-commerce/providers/visa-src/visa-src.styles.d.ts +0 -9
- 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
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
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
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
1659
|
-
"#checkoutButton",
|
|
1691
|
+
var src = new paydock.MastercardSRCClickToPay(
|
|
1660
1692
|
"#checkoutIframe",
|
|
1661
|
-
"
|
|
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
|
-
|
|
1672
|
-
|
|
1673
|
-
var src = new SRC(
|
|
1674
|
-
"#checkoutButton",
|
|
1702
|
+
import { MastercardSRCClickToPay } from '@paydock/client-sdk';
|
|
1703
|
+
var src = new MastercardSRCClickToPay(
|
|
1675
1704
|
"#checkoutIframe",
|
|
1676
|
-
"
|
|
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:*
|
|
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.
|
|
1701
|
-
"#checkoutButton",
|
|
1730
|
+
var src = new paydock.MastercardSRCClickToPay(
|
|
1702
1731
|
"#checkoutIframe",
|
|
1703
|
-
"
|
|
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
|
-
|
|
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.
|
|
1773
|
-
"#checkoutButton",
|
|
1780
|
+
var src = new paydock.MastercardSRCClickToPay(
|
|
1774
1781
|
"#checkoutIframe",
|
|
1775
|
-
"
|
|
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
|
-
##
|
|
1794
|
-
### Shipping address:
|
|
1804
|
+
## Customize your billing address fields
|
|
1795
1805
|
|
|
1796
|
-
To customize
|
|
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.
|
|
1800
|
-
"#checkoutButton",
|
|
1810
|
+
var src = new paydock.MastercardSRCClickToPay(
|
|
1801
1811
|
"#checkoutIframe",
|
|
1802
|
-
"
|
|
1812
|
+
"service_id",
|
|
1803
1813
|
"paydock_public_key_or_access_token",
|
|
1804
1814
|
{
|
|
1805
1815
|
"dpa_transaction_options": {
|
|
1806
|
-
"
|
|
1816
|
+
"dpa_billing_preference": "FULL"
|
|
1807
1817
|
}
|
|
1808
1818
|
},
|
|
1809
1819
|
);
|
|
1810
1820
|
```
|
|
1811
1821
|
|
|
1812
|
-
|
|
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
|
-
|
|
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": "
|
|
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
|
-
|
|
1858
|
+
## How to customize accepted cards
|
|
1841
1859
|
|
|
1842
|
-
|
|
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.
|
|
1846
|
-
"#checkoutButton",
|
|
1867
|
+
var src = new paydock.MastercardSRCClickToPay(
|
|
1847
1868
|
"#checkoutIframe",
|
|
1848
|
-
"
|
|
1849
|
-
"
|
|
1869
|
+
"service_id",
|
|
1870
|
+
"paydock_public_key",
|
|
1850
1871
|
{
|
|
1851
|
-
|
|
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
|
-
##
|
|
1877
|
+
## Personalize the Style
|
|
1873
1878
|
|
|
1874
|
-
|
|
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.
|
|
1880
|
-
"#checkoutButton",
|
|
1884
|
+
var src = new paydock.MastercardSRCClickToPay(
|
|
1881
1885
|
"#checkoutIframe",
|
|
1882
|
-
"
|
|
1886
|
+
"service_id",
|
|
1883
1887
|
"paydock_public_key",
|
|
1888
|
+
{},
|
|
1884
1889
|
);
|
|
1885
|
-
|
|
1886
|
-
|
|
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 +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 +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"}
|