@paydock/client-sdk 1.138.1-beta → 1.139.0-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 +24 -9
- package/bundles/index.cjs +194 -164
- package/bundles/index.cjs.d.ts +13 -2
- package/bundles/index.mjs +194 -164
- package/bundles/index.mjs.d.ts +13 -2
- package/bundles/types/checkout/v3/instructions/instruction.card_form.show.d.ts.map +1 -1
- package/bundles/types/checkout/v3/utils/checkout-customisation-styles.util.d.ts.map +1 -1
- package/bundles/types/components/iframe.d.ts +2 -0
- package/bundles/types/components/iframe.d.ts.map +1 -1
- package/bundles/types/helper/browser.d.ts +1 -0
- package/bundles/types/helper/browser.d.ts.map +1 -1
- package/bundles/types/paypal-data-collector/paypal-data-collector.d.ts +12 -3
- package/bundles/types/paypal-data-collector/paypal-data-collector.d.ts.map +1 -1
- package/bundles/types/paypal-data-collector/paypal-data-collector.service.d.ts +6 -5
- package/bundles/types/paypal-data-collector/paypal-data-collector.service.d.ts.map +1 -1
- package/bundles/types/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/index-cba.d.ts +132 -1
- package/bundles/types/wallet-buttons/index-cba.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/wallet-buttons.d.ts +1 -1
- package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts +81 -126
- package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/wallet-services/afterpay.wallet-service.d.ts +1 -0
- package/bundles/types/wallet-buttons/wallet-services/afterpay.wallet-service.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/wallet-services/apple.wallet-service.d.ts +0 -1
- package/bundles/types/wallet-buttons/wallet-services/apple.wallet-service.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/wallet-services/flypay-v2.wallet-service.d.ts +0 -1
- package/bundles/types/wallet-buttons/wallet-services/flypay-v2.wallet-service.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/wallet-services/google.wallet-service.d.ts +0 -1
- package/bundles/types/wallet-buttons/wallet-services/google.wallet-service.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/wallet-services/paypal.wallet-service.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/wallet-services/wallet-service.d.ts +6 -0
- package/bundles/types/wallet-buttons/wallet-services/wallet-service.d.ts.map +1 -1
- package/bundles/widget.umd.js +194 -164
- package/bundles/widget.umd.js.d.ts +13 -2
- package/bundles/widget.umd.js.min.d.ts +13 -2
- package/bundles/widget.umd.min.js +1 -1
- package/docs/paypal-data-collector-examples.md +12 -7
- package/docs/paypal-data-collector.md +11 -1
- package/docs/wallet-buttons.md +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3565,7 +3565,7 @@ Registers a callback function to be invoked when the wallet button gets clicked.
|
|
|
3565
3565
|
There are two operational modes supported, Synchronous and Asynchronous.
|
|
3566
3566
|
When asynchronous operations need to occur on the callback handler, attaching the Promise via `attachResult` is required to have the wallet wait for a result.
|
|
3567
3567
|
When synchronous operations occur on the callback handler, attaching a boolean result via `attachResult` is optional to control the execution flow.
|
|
3568
|
-
Note this is supported for Paypal, GooglePay and
|
|
3568
|
+
Note this is supported for Paypal, GooglePay, ApplePay, Afterpay and FlypayV2 wallet buttons at the moment.
|
|
3569
3569
|
|
|
3570
3570
|
**Kind**: instance method of [<code>WalletButtons</code>](#WalletButtons)
|
|
3571
3571
|
|
|
@@ -6655,7 +6655,7 @@ Widget that collect browser-based data to help reduce fraud. Upon checkout, thes
|
|
|
6655
6655
|
The general flow to use the widgets is:
|
|
6656
6656
|
1. Initialize the PayPal Data Collector Widget, providing a Source Website Identifier (Flow ID), plus optional config parameters for the widget. The general format is:
|
|
6657
6657
|
```js
|
|
6658
|
-
|
|
6658
|
+
var paypalDataCollector = new paydock.PayPalDataCollector(
|
|
6659
6659
|
sourceWebsiteIdentifier,
|
|
6660
6660
|
widgetConfigParams,
|
|
6661
6661
|
);
|
|
@@ -6666,7 +6666,7 @@ const collectedDeviceData = await paypalDataCollector.collectDeviceData();
|
|
|
6666
6666
|
const correlationId = collectedDeviceData.correlation_id;
|
|
6667
6667
|
```
|
|
6668
6668
|
3. Use freely the correlation_id value as is needed.
|
|
6669
|
-
4. Handle the `onError` callback.
|
|
6669
|
+
4. Handle the `onError` callback. The error handler is set up before scripts are loaded to prevent race conditions where script load failures occur before the promise rejection handler is assigned.
|
|
6670
6670
|
5. If you are using Content Security Policy (CSP), you must allowlist the paypal fraudnet script URL: `https://c.paypal.com`. See reference [here](https://developer.paypal.com/limited-release/fraudnet/integrate/#link-contentsecuritypolicyintegration).
|
|
6671
6671
|
|
|
6672
6672
|
### PayPalDataCollector Widget example
|
|
@@ -6699,11 +6699,16 @@ A full description of the config parameters for [PayPalDataCollector](#PayPalDat
|
|
|
6699
6699
|
console.log("On Error Callback", error);
|
|
6700
6700
|
});
|
|
6701
6701
|
|
|
6702
|
-
payPalDataCollector.collectDeviceData()
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
|
|
6702
|
+
payPalDataCollector.collectDeviceData()
|
|
6703
|
+
.then(function(collectedDeviceData) {
|
|
6704
|
+
//Here when the promise is resolved, it should be able to see the correlation_id.
|
|
6705
|
+
const correlationId = collectedDeviceData.correlation_id;
|
|
6706
|
+
console.log("On Success", correlationId);
|
|
6707
|
+
})
|
|
6708
|
+
.catch(function(error) {
|
|
6709
|
+
// Handle promise rejection if script loading fails
|
|
6710
|
+
console.log("Promise rejected", error);
|
|
6711
|
+
});
|
|
6707
6712
|
</script>
|
|
6708
6713
|
</html>
|
|
6709
6714
|
```
|
|
@@ -6805,12 +6810,22 @@ the correlation id used among the requests asynchronously.
|
|
|
6805
6810
|
|
|
6806
6811
|
**Kind**: instance method of [<code>PayPalDataCollector</code>](#PayPalDataCollector)
|
|
6807
6812
|
**Returns**: [<code>Promise.<CollectedDeviceData></code>](#CollectedDeviceData) - Promise when resolved, returns an object
|
|
6808
|
-
that contains the `correlation_id` key.
|
|
6813
|
+
that contains the `correlation_id` key. The promise may be rejected if script loading fails.
|
|
6809
6814
|
**Example**
|
|
6810
6815
|
```js
|
|
6811
6816
|
const collectedDeviceData = await payPalDataCollectorWidget.collectDeviceData();
|
|
6812
6817
|
console.log(collectedDeviceData.correlation_id)
|
|
6813
6818
|
```
|
|
6819
|
+
**Example**
|
|
6820
|
+
```js
|
|
6821
|
+
payPalDataCollectorWidget.collectDeviceData()
|
|
6822
|
+
.then((collectedDeviceData) => {
|
|
6823
|
+
console.log(collectedDeviceData.correlation_id);
|
|
6824
|
+
})
|
|
6825
|
+
.catch((error) => {
|
|
6826
|
+
console.error('Failed to collect device data', error);
|
|
6827
|
+
});
|
|
6828
|
+
```
|
|
6814
6829
|
<a name="PayPalDataCollector+onError" id="PayPalDataCollector+onError" href="#PayPalDataCollector+onError"> </a>
|
|
6815
6830
|
|
|
6816
6831
|
### payPalDataCollector.onError([callback])
|