@paydock/client-sdk 1.104.3-beta → 1.104.7-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 +729 -405
- package/bundles/index.cjs +29624 -8753
- package/bundles/index.cjs.d.ts +484 -381
- package/bundles/index.cjs.map +1 -1
- package/bundles/index.mjs +29624 -8753
- package/bundles/index.mjs.d.ts +484 -381
- package/bundles/index.mjs.map +1 -1
- package/bundles/types/api/api-base.d.ts +14 -6
- package/bundles/types/api/api-base.d.ts.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/canvas-3ds/services/gpayments-service.d.ts +3 -3
- package/bundles/types/canvas-3ds/services/gpayments-service.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/runner/popup.runner.d.ts +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/http-core.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/configs/env/environment.cba.d.ts +1 -1
- package/bundles/types/configs/env/environment.cba.d.ts.map +1 -1
- package/bundles/types/configs/env/environment.paydock.d.ts +1 -1
- package/bundles/types/configs/env/environment.paydock.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/shared/http/http-request.d.ts +14 -0
- package/bundles/types/shared/http/http-request.d.ts.map +1 -0
- package/bundles/types/shared/http/index.d.ts +2 -0
- package/bundles/types/shared/http/index.d.ts.map +1 -0
- package/bundles/types/shared/services/instrumentation/instrumentation.agent.d.ts +15 -0
- package/bundles/types/shared/services/instrumentation/instrumentation.agent.d.ts.map +1 -0
- package/bundles/types/shared/services/instrumentation/instrumentation.config.d.ts +66 -0
- package/bundles/types/shared/services/instrumentation/instrumentation.config.d.ts.map +1 -0
- package/bundles/types/shared/services/instrumentation/instrumentation.types.d.ts +14 -0
- package/bundles/types/shared/services/instrumentation/instrumentation.types.d.ts.map +1 -0
- package/bundles/types/shared/services/instrumentation/repositories/action.repository.d.ts +15 -0
- package/bundles/types/shared/services/instrumentation/repositories/action.repository.d.ts.map +1 -0
- package/bundles/types/shared/services/instrumentation/repositories/error.repository.d.ts +23 -0
- package/bundles/types/shared/services/instrumentation/repositories/error.repository.d.ts.map +1 -0
- package/bundles/types/shared/services/instrumentation/repositories/event.repository.d.ts +15 -0
- package/bundles/types/shared/services/instrumentation/repositories/event.repository.d.ts.map +1 -0
- package/bundles/types/shared/services/instrumentation/repositories/index.d.ts +4 -0
- package/bundles/types/shared/services/instrumentation/repositories/index.d.ts.map +1 -0
- 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 +7 -4
- 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 +147 -76
- 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 +29624 -8753
- package/bundles/widget.umd.js.d.ts +484 -381
- package/bundles/widget.umd.js.map +1 -1
- package/bundles/widget.umd.js.min.d.ts +484 -381
- package/bundles/widget.umd.min.js +62 -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/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/examples/multi-html-widget/simple.html +2 -1
- package/package.json +18 -15
- package/slate.md +123 -120
- 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
|
@@ -1206,6 +1206,14 @@ In some situations you may want to forcibly close the checkout so that your user
|
|
|
1206
1206
|
button.close();
|
|
1207
1207
|
```
|
|
1208
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
|
+
|
|
1209
1217
|
### Performing actions when shipping info is updated
|
|
1210
1218
|
|
|
1211
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).
|
|
@@ -1333,30 +1341,51 @@ _(Required `meta` fields: - . Optional `meta` fields: `request_shipping`, `pay_l
|
|
|
1333
1341
|
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
1334
1342
|
<script>
|
|
1335
1343
|
let button = new paydock.WalletButtons(
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
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
|
+
);
|
|
1350
1358
|
button.setEnv('sandbox');
|
|
1351
1359
|
button.onUnavailable(() => console.log("No wallet buttons available"));
|
|
1352
1360
|
button.onUpdate((data) => {
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
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
|
+
});
|
|
1357
1365
|
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
1358
1366
|
button.onPaymentError((data) => console.log("The payment was not successful"));
|
|
1359
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
|
+
|
|
1360
1389
|
button.load();
|
|
1361
1390
|
</script>
|
|
1362
1391
|
</html>
|
|
@@ -1490,6 +1519,7 @@ _(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `ra
|
|
|
1490
1519
|
button.onUnavailable(() => console.log("No wallet buttons available"));
|
|
1491
1520
|
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
1492
1521
|
button.onPaymentError((data) => console.log("The payment was not successful"));
|
|
1522
|
+
button.onClick(() => console.log("On WalletButton Click"));
|
|
1493
1523
|
button.onUpdate((data) => {
|
|
1494
1524
|
console.log("Updating amount via a backend to backend call to POST charges/:id");
|
|
1495
1525
|
// call `POST charges/:id` to modify charge
|
|
@@ -1522,7 +1552,6 @@ _(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `ra
|
|
|
1522
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.
|
|
1523
1553
|
|
|
1524
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.
|
|
1525
|
-
|
|
1526
1555
|
### ApplePay and GooglePay via MPGS Raw data initialization example
|
|
1527
1556
|
|
|
1528
1557
|
```html
|
|
@@ -1635,29 +1664,33 @@ Similarly, for **GooglePay via MPGS** you can initialize the `PaymentMethodSpeci
|
|
|
1635
1664
|
</html>
|
|
1636
1665
|
```
|
|
1637
1666
|
|
|
1638
|
-
|
|
1639
|
-
You can find description of all methods and parameters [here](https://www.npmjs.com/package/@paydock/client-sdk#SRC).
|
|
1667
|
+
# Secure Remote Commerce
|
|
1640
1668
|
|
|
1641
|
-
|
|
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).
|
|
1642
1673
|
|
|
1643
1674
|
## SRC simple example
|
|
1644
1675
|
|
|
1645
|
-
|
|
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.
|
|
1646
1681
|
|
|
1647
1682
|
```html
|
|
1648
|
-
<div id="checkoutButton"></div>
|
|
1649
1683
|
<div id="checkoutIframe"></div>
|
|
1650
1684
|
```
|
|
1651
1685
|
|
|
1652
|
-
|
|
1686
|
+
### Initialize the Widget
|
|
1653
1687
|
|
|
1688
|
+
Use the following code to initialize your widget:
|
|
1654
1689
|
|
|
1655
|
-
### Initialization
|
|
1656
1690
|
```javascript
|
|
1657
|
-
var src = new paydock.
|
|
1658
|
-
"#checkoutButton",
|
|
1691
|
+
var src = new paydock.MastercardSRCClickToPay(
|
|
1659
1692
|
"#checkoutIframe",
|
|
1660
|
-
"
|
|
1693
|
+
"service_id",
|
|
1661
1694
|
"paydock_public_key_or_access_token",
|
|
1662
1695
|
{}, // meta
|
|
1663
1696
|
);
|
|
@@ -1666,23 +1699,22 @@ src.load();
|
|
|
1666
1699
|
|
|
1667
1700
|
```javascript
|
|
1668
1701
|
// ES2015 | TypeScript
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
var src = new SRC(
|
|
1673
|
-
"#checkoutButton",
|
|
1702
|
+
import { MastercardSRCClickToPay } from '@paydock/client-sdk';
|
|
1703
|
+
var src = new MastercardSRCClickToPay(
|
|
1674
1704
|
"#checkoutIframe",
|
|
1675
|
-
"
|
|
1705
|
+
"service_id",
|
|
1676
1706
|
"paydock_public_key_or_access_token",
|
|
1677
1707
|
{}, // meta
|
|
1678
1708
|
);
|
|
1679
1709
|
src.load();
|
|
1680
1710
|
```
|
|
1681
1711
|
|
|
1682
|
-
*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.
|
|
1683
1713
|
|
|
1684
1714
|
### Full example
|
|
1685
1715
|
|
|
1716
|
+
A full example of the container and the initialized widget is as follows:
|
|
1717
|
+
|
|
1686
1718
|
```html
|
|
1687
1719
|
<!DOCTYPE html>
|
|
1688
1720
|
<html lang="en">
|
|
@@ -1692,14 +1724,12 @@ src.load();
|
|
|
1692
1724
|
<style>iframe {border: 0;width: 40%;height: 300px;}</style>
|
|
1693
1725
|
</head>
|
|
1694
1726
|
<body>
|
|
1695
|
-
<div id="checkoutButton"></div>
|
|
1696
1727
|
<div id="checkoutIframe"></div>
|
|
1697
1728
|
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
1698
1729
|
<script>
|
|
1699
|
-
var src = new paydock.
|
|
1700
|
-
"#checkoutButton",
|
|
1730
|
+
var src = new paydock.MastercardSRCClickToPay(
|
|
1701
1731
|
"#checkoutIframe",
|
|
1702
|
-
"
|
|
1732
|
+
"service_id",
|
|
1703
1733
|
"paydock_public_key_or_access_token",
|
|
1704
1734
|
{},
|
|
1705
1735
|
);
|
|
@@ -1709,50 +1739,30 @@ src.load();
|
|
|
1709
1739
|
</html>
|
|
1710
1740
|
```
|
|
1711
1741
|
|
|
1742
|
+
## Customize your SRC Checkout
|
|
1712
1743
|
|
|
1713
|
-
|
|
1744
|
+
The following is an advanced example that includes customization. You can use these methods to enhance your checkout experience.
|
|
1714
1745
|
|
|
1715
1746
|
### Settings
|
|
1716
1747
|
|
|
1717
1748
|
```javascript
|
|
1718
|
-
|
|
1719
|
-
src.setEnv('sandbox'); // set enviroment
|
|
1720
|
-
|
|
1721
|
-
src.hideButton(); // hide button
|
|
1722
|
-
|
|
1723
|
-
src.showButton(); // show button
|
|
1724
|
-
|
|
1749
|
+
src.setEnv('sandbox'); // set environment
|
|
1725
1750
|
src.hideCheckout(); // hide checkout iframe
|
|
1726
|
-
|
|
1727
1751
|
src.showCheckout(); // show checkout iframe
|
|
1728
|
-
|
|
1729
|
-
src.on('checkoutButtonLoaded', () => {
|
|
1730
|
-
console.log("Button loaded");
|
|
1731
|
-
});
|
|
1732
|
-
|
|
1733
|
-
src.on('checkoutButtonClicked', () => {
|
|
1734
|
-
console.log("Button clicked");
|
|
1735
|
-
});
|
|
1736
|
-
|
|
1737
1752
|
src.on('iframeLoaded', () => {
|
|
1738
1753
|
console.log("Initial iframe loaded");
|
|
1739
1754
|
});
|
|
1740
|
-
|
|
1741
1755
|
src.on('checkoutReady', () => {
|
|
1742
1756
|
console.log("Checkout ready to be used");
|
|
1743
1757
|
});
|
|
1744
|
-
|
|
1745
1758
|
src.on('checkoutCompleted', (token) => {
|
|
1746
1759
|
console.log(token);
|
|
1747
1760
|
});
|
|
1748
|
-
|
|
1749
1761
|
src.on('checkoutError', (error) => {
|
|
1750
1762
|
console.log(error);
|
|
1751
1763
|
});
|
|
1752
1764
|
```
|
|
1753
1765
|
|
|
1754
|
-
Here you can see how you can use this methods to customize your checkout experience
|
|
1755
|
-
|
|
1756
1766
|
### Full example
|
|
1757
1767
|
|
|
1758
1768
|
```html
|
|
@@ -1764,64 +1774,73 @@ Here you can see how you can use this methods to customize your checkout experie
|
|
|
1764
1774
|
<style>iframe {border: 0;width: 40%;height: 450px;}</style>
|
|
1765
1775
|
</head>
|
|
1766
1776
|
<body>
|
|
1767
|
-
<div id="checkoutButton"></div>
|
|
1768
1777
|
<div id="checkoutIframe"></div>
|
|
1769
1778
|
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
1770
1779
|
<script>
|
|
1771
|
-
var src = new paydock.
|
|
1772
|
-
"#checkoutButton",
|
|
1780
|
+
var src = new paydock.MastercardSRCClickToPay(
|
|
1773
1781
|
"#checkoutIframe",
|
|
1774
|
-
"
|
|
1782
|
+
"service_id",
|
|
1775
1783
|
"paydock_public_key_or_access_token",
|
|
1776
1784
|
{},
|
|
1777
1785
|
);
|
|
1778
|
-
|
|
1786
|
+
src.on('iframeLoaded', () => {
|
|
1787
|
+
console.log("Initial iframe loaded");
|
|
1788
|
+
});
|
|
1779
1789
|
src.on('checkoutReady', () => {
|
|
1780
1790
|
console.log("Checkout ready to be used");
|
|
1781
1791
|
});
|
|
1782
|
-
|
|
1783
1792
|
src.on('checkoutCompleted', (token) => {
|
|
1784
1793
|
console.log(token);
|
|
1785
1794
|
});
|
|
1795
|
+
src.on('checkoutError', (error) => {
|
|
1796
|
+
console.log(error);
|
|
1797
|
+
});
|
|
1786
1798
|
src.load();
|
|
1787
1799
|
</script>
|
|
1788
1800
|
</body>
|
|
1789
1801
|
</html>
|
|
1790
1802
|
```
|
|
1791
1803
|
|
|
1792
|
-
##
|
|
1793
|
-
### Shipping address:
|
|
1804
|
+
## Customize your billing address fields
|
|
1794
1805
|
|
|
1795
|
-
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.
|
|
1796
1808
|
|
|
1797
1809
|
```
|
|
1798
|
-
var src = new paydock.
|
|
1799
|
-
"#checkoutButton",
|
|
1810
|
+
var src = new paydock.MastercardSRCClickToPay(
|
|
1800
1811
|
"#checkoutIframe",
|
|
1801
|
-
"
|
|
1812
|
+
"service_id",
|
|
1802
1813
|
"paydock_public_key_or_access_token",
|
|
1803
1814
|
{
|
|
1804
1815
|
"dpa_transaction_options": {
|
|
1805
|
-
"
|
|
1816
|
+
"dpa_billing_preference": "FULL"
|
|
1806
1817
|
}
|
|
1807
1818
|
},
|
|
1808
1819
|
);
|
|
1809
1820
|
```
|
|
1810
1821
|
|
|
1811
|
-
|
|
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:
|
|
1812
1824
|
|
|
1813
|
-
|
|
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.
|
|
1814
1828
|
|
|
1815
1829
|
```
|
|
1816
1830
|
POST v1/charges
|
|
1817
|
-
|
|
1818
1831
|
{
|
|
1819
1832
|
"amount": "10.00",
|
|
1820
1833
|
"currency": "AUD",
|
|
1821
|
-
"token": "
|
|
1834
|
+
"token": "one_time_token",
|
|
1822
1835
|
"customer": {
|
|
1823
1836
|
"payment_source": {
|
|
1824
|
-
"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"
|
|
1825
1844
|
}
|
|
1826
1845
|
},
|
|
1827
1846
|
"shipping": {
|
|
@@ -1836,60 +1855,44 @@ POST v1/charges
|
|
|
1836
1855
|
}
|
|
1837
1856
|
```
|
|
1838
1857
|
|
|
1839
|
-
|
|
1858
|
+
## How to customize accepted cards
|
|
1840
1859
|
|
|
1841
|
-
|
|
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:
|
|
1842
1865
|
|
|
1843
1866
|
```
|
|
1844
|
-
var src = new paydock.
|
|
1845
|
-
"#checkoutButton",
|
|
1867
|
+
var src = new paydock.MastercardSRCClickToPay(
|
|
1846
1868
|
"#checkoutIframe",
|
|
1847
|
-
"
|
|
1848
|
-
"
|
|
1869
|
+
"service_id",
|
|
1870
|
+
"paydock_public_key",
|
|
1849
1871
|
{
|
|
1850
|
-
|
|
1851
|
-
"email": "test@email.com",
|
|
1852
|
-
"first_name": "Name",
|
|
1853
|
-
"last_name": "Surname",
|
|
1854
|
-
"phone": {
|
|
1855
|
-
"country_code": "1",
|
|
1856
|
-
"phone": "2124567890"
|
|
1857
|
-
},
|
|
1858
|
-
"payment_source": {
|
|
1859
|
-
"address_line1": "Line 1",
|
|
1860
|
-
"address_line2": "Line 2",
|
|
1861
|
-
"address_city": "Miami",
|
|
1862
|
-
"address_postcode": "33126",
|
|
1863
|
-
"address_state": "FL",
|
|
1864
|
-
"address_country": "US"
|
|
1865
|
-
}
|
|
1866
|
-
}
|
|
1872
|
+
unaccepted_card_type: 'DEBIT'
|
|
1867
1873
|
},
|
|
1868
1874
|
);
|
|
1869
1875
|
```
|
|
1870
1876
|
|
|
1871
|
-
##
|
|
1877
|
+
## Personalize the Style
|
|
1872
1878
|
|
|
1873
|
-
|
|
1879
|
+
Customize the look and feel of your UI. The following example demonstrates changes in the styling of the buttons.
|
|
1874
1880
|
|
|
1875
1881
|
### Example code
|
|
1876
1882
|
|
|
1877
1883
|
```
|
|
1878
|
-
var src = new paydock.
|
|
1879
|
-
"#checkoutButton",
|
|
1884
|
+
var src = new paydock.MastercardSRCClickToPay(
|
|
1880
1885
|
"#checkoutIframe",
|
|
1881
|
-
"
|
|
1886
|
+
"service_id",
|
|
1882
1887
|
"paydock_public_key",
|
|
1888
|
+
{},
|
|
1883
1889
|
);
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
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
|
+
});
|
|
1887
1898
|
```
|
|
1888
|
-
## Event and Values
|
|
1889
|
-
|
|
1890
|
-
| Event Value | Type | Description |
|
|
1891
|
-
| ------------------- | ------------------- | -------------------------------------------------------------- |
|
|
1892
|
-
| primary_color | <code>string</code> | HEX color for the principal buttons, example : #32a852 |
|
|
1893
|
-
| button_text_color | <code>string</code> | HEX color for the text of the buttons, example : #32a852|
|
|
1894
|
-
| font_family | <code>string</code> | Look more [mozilla.org/color](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family)|
|
|
1895
|
-
| 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"}
|