@paydock/client-sdk 1.10.59 → 1.10.73-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 +104 -13
- package/bundles/widget.umd.js +689 -68
- package/bundles/widget.umd.min.js +1 -1
- package/lib/api/api-charge-internal.d.ts +52 -0
- package/lib/api/api-charge-internal.js +12 -1
- package/lib/api/api-charge-internal.js.map +1 -1
- package/lib/canvas-3ds/canvas-3ds.d.ts +17 -1
- package/lib/canvas-3ds/canvas-3ds.js +30 -4
- package/lib/canvas-3ds/canvas-3ds.js.map +1 -1
- package/lib/canvas-3ds/services/gpayments-service.d.ts +42 -0
- package/lib/canvas-3ds/services/gpayments-service.js +162 -0
- package/lib/canvas-3ds/services/gpayments-service.js.map +1 -0
- package/lib/canvas-3ds/services/index.d.ts +1 -0
- package/lib/canvas-3ds/services/index.js +2 -0
- package/lib/canvas-3ds/services/index.js.map +1 -0
- package/lib/canvas-3ds/services/standalone3ds-service.d.ts +21 -0
- package/lib/canvas-3ds/services/standalone3ds-service.js +32 -0
- package/lib/canvas-3ds/services/standalone3ds-service.js.map +1 -0
- package/lib/components/param.d.ts +19 -3
- package/lib/components/param.js +2 -0
- package/lib/components/param.js.map +1 -1
- package/lib/helper/access-token.d.ts +1 -0
- package/lib/helper/access-token.js +8 -0
- package/lib/helper/access-token.js.map +1 -1
- package/lib/wallet-buttons/apple.wallet-service.d.ts +13 -1
- package/lib/wallet-buttons/apple.wallet-service.js +67 -41
- package/lib/wallet-buttons/apple.wallet-service.js.map +1 -1
- package/lib/wallet-buttons/flypay.wallet-service.js +1 -4
- package/lib/wallet-buttons/flypay.wallet-service.js.map +1 -1
- package/lib/wallet-buttons/google.wallet-service.d.ts +29 -0
- package/lib/wallet-buttons/google.wallet-service.js +240 -0
- package/lib/wallet-buttons/google.wallet-service.js.map +1 -0
- package/lib/wallet-buttons/interfaces.d.ts +4 -1
- package/lib/wallet-buttons/mastercard.wallet-service.js +7 -1
- package/lib/wallet-buttons/mastercard.wallet-service.js.map +1 -1
- package/lib/wallet-buttons/paypal.wallet-service.js +3 -3
- package/lib/wallet-buttons/paypal.wallet-service.js.map +1 -1
- package/lib/wallet-buttons/stripe.wallet-service.d.ts +1 -0
- package/lib/wallet-buttons/stripe.wallet-service.js +9 -3
- package/lib/wallet-buttons/stripe.wallet-service.js.map +1 -1
- package/lib/wallet-buttons/wallet-buttons.d.ts +44 -13
- package/lib/wallet-buttons/wallet-buttons.js +37 -12
- package/lib/wallet-buttons/wallet-buttons.js.map +1 -1
- package/lib/wallet-buttons/wallet-service.d.ts +2 -1
- package/lib/wallet-buttons/wallet-service.js.map +1 -1
- package/package.json +2 -1
- package/slate.md +51 -0
package/README.md
CHANGED
|
@@ -4557,6 +4557,57 @@ This example shows how you can use a lot of other methods to settings your form
|
|
|
4557
4557
|
</html>
|
|
4558
4558
|
```
|
|
4559
4559
|
|
|
4560
|
+
## Canvas 3ds for Standalone 3ds charges
|
|
4561
|
+
|
|
4562
|
+
After you initialized the 3ds charge via `v1/charges/standalone-3ds` API endpoint, you get a token used to initialized the Canvas3ds. All above information regarding setup, loading and initialization still apply.
|
|
4563
|
+
|
|
4564
|
+
### Full example
|
|
4565
|
+
|
|
4566
|
+
```html
|
|
4567
|
+
<!DOCTYPE html>
|
|
4568
|
+
<html lang="en">
|
|
4569
|
+
<head>
|
|
4570
|
+
<meta charset="UTF-8" />
|
|
4571
|
+
<title>Title</title>
|
|
4572
|
+
<style>
|
|
4573
|
+
iframe {
|
|
4574
|
+
border: 0;
|
|
4575
|
+
width: 40%;
|
|
4576
|
+
height: 450px;
|
|
4577
|
+
}
|
|
4578
|
+
</style>
|
|
4579
|
+
</head>
|
|
4580
|
+
<body>
|
|
4581
|
+
<div id="widget3ds"></div>
|
|
4582
|
+
<script src="https://app-sandbox.paydock.com/v1/widget.umd.js"></script>
|
|
4583
|
+
<script>
|
|
4584
|
+
var canvas3ds = new paydock.Canvas3ds("#widget3ds", "token");
|
|
4585
|
+
canvas3ds.on("chargeAuthSuccess", function (data) {
|
|
4586
|
+
console.log(data);
|
|
4587
|
+
});
|
|
4588
|
+
canvas3ds.on("chargeAuthReject", function (data) {
|
|
4589
|
+
console.log(data);
|
|
4590
|
+
});
|
|
4591
|
+
canvas3ds.on("chargeAuthChallenge", function (data) {
|
|
4592
|
+
console.log(data);
|
|
4593
|
+
});
|
|
4594
|
+
canvas3ds.on("chargeAuthDecoupled", function (data) {
|
|
4595
|
+
console.log(data.result.description);
|
|
4596
|
+
});
|
|
4597
|
+
canvas3ds.on("error", function ({ charge_3ds_id, error }) {
|
|
4598
|
+
console.log(error);
|
|
4599
|
+
});
|
|
4600
|
+
canvas3ds.load();
|
|
4601
|
+
</script>
|
|
4602
|
+
</body>
|
|
4603
|
+
</html>
|
|
4604
|
+
```
|
|
4605
|
+
|
|
4606
|
+
**The chargeAuthSuccess event is executed both for frictionless flow, or for challenge flow after the customer has correctly authenticated with the bank using whatever challenge imposed.**
|
|
4607
|
+
**The chargeAuthChallenge event is sent before starting a challenge flow (i.e. opening an IFrame for the customer to complete a challenge with ther bank)**
|
|
4608
|
+
**The chargeAuthDecoupled event is sent when the flow is a decoupled challenge, alongside a `data.result.description` field that you must show to the customer, indicating the method the user must use to authenticate. For example this may happen by having the cardholder authenticating directly with their banking app through biometrics. Once the end customer does this, the Canvas3ds will be able to recognize the challenge result is ready and will either produce a chargeAuthSuccess or chargeAuthReject event**
|
|
4609
|
+
**The error event is sent if an unexpected issue with the client library occurs. In such scenarios, you should consider the autentication process as interrupted**
|
|
4610
|
+
|
|
4560
4611
|
## Vault Display Widget
|
|
4561
4612
|
You can find description of all methods and parameters [here](https://www.npmjs.com/package/@paydock/client-sdk#vault-display-widget)
|
|
4562
4613
|
|
|
@@ -4807,8 +4858,14 @@ The final method to beginning, the load process of widget to html
|
|
|
4807
4858
|
<dt><a href="#IWalletMeta">IWalletMeta</a> : <code>object</code></dt>
|
|
4808
4859
|
<dd><p>Interface of data used by the wallet checkout and payment proccess.</p>
|
|
4809
4860
|
</dd>
|
|
4810
|
-
<dt><a href="#
|
|
4811
|
-
<dd><p>Interface of Shipping Options
|
|
4861
|
+
<dt><a href="#IApplePayShippingOption">IApplePayShippingOption</a> : <code>object</code></dt>
|
|
4862
|
+
<dd><p>Interface of Shipping Options for ApplePay</p>
|
|
4863
|
+
</dd>
|
|
4864
|
+
<dt><a href="#IGooglePayShippingOption">IGooglePayShippingOption</a> : <code>object</code></dt>
|
|
4865
|
+
<dd><p>Interface of Shipping Options for GooglePay</p>
|
|
4866
|
+
</dd>
|
|
4867
|
+
<dt><a href="#IPayPalShippingOption">IPayPalShippingOption</a> : <code>object</code></dt>
|
|
4868
|
+
<dd><p>Interface of Shipping Options for PayPal</p>
|
|
4812
4869
|
</dd>
|
|
4813
4870
|
</dl>
|
|
4814
4871
|
|
|
@@ -4821,23 +4878,24 @@ Interface of data used by the wallet checkout and payment proccess.
|
|
|
4821
4878
|
|
|
4822
4879
|
| Param | Type | Description |
|
|
4823
4880
|
| --- | --- | --- |
|
|
4824
|
-
| [amount_label] | <code>string</code> | Label shown next to the total amount to be paid. Required for [Stripe, ApplePay]. N/A for [FlyPay, PayPal]. |
|
|
4825
|
-
| [country] | <code>string</code> | Country of the user. 2 letter ISO code format. Required for [Stripe, ApplePay]. N/A for [FlyPay, PayPal]. |
|
|
4881
|
+
| [amount_label] | <code>string</code> | Label shown next to the total amount to be paid. Required for [Stripe, ApplePay, GooglePay]. N/A for [FlyPay, PayPal]. |
|
|
4882
|
+
| [country] | <code>string</code> | Country of the user. 2 letter ISO code format. Required for [Stripe, ApplePay, GooglePay]. N/A for [FlyPay, PayPal]. |
|
|
4826
4883
|
| [pay_later] | <code>string</code> | Used to enable Pay Later feature in PayPal Smart Checkout WalletButton integration when available. Optional for [PayPal]. N/A for other wallets. |
|
|
4827
4884
|
| [request_payer_name] | <code>boolean</code> | Used mainly for fraud purposes - recommended set to true. Optional for [Stripe]. N/A for other wallets. |
|
|
4828
4885
|
| [request_payer_email] | <code>boolean</code> | Used mainly for fraud purposes - recommended set to true. Optional for [Stripe]. N/A for other wallets. |
|
|
4829
4886
|
| [request_payer_phone] | <code>boolean</code> | Used mainly for fraud purposes - recommended set to true. Optional for [Stripe]. N/A for other wallets. |
|
|
4830
|
-
| [request_shipping] | <code>boolean</code> | Used to request or not shipping address in the Wallet checkout, being able to handle amount changes via the `update` event. Optional for [FlyPay, PayPal, ApplePay]. N/A for [Stripe]. |
|
|
4831
|
-
| [shipping_options] | [<code>
|
|
4887
|
+
| [request_shipping] | <code>boolean</code> | Used to request or not shipping address in the Wallet checkout, being able to handle amount changes via the `update` event. Optional for [FlyPay, PayPal, ApplePay, GooglePay]. N/A for [Stripe]. |
|
|
4888
|
+
| [shipping_options] | [<code>Array.<IApplePayShippingOption></code>](#IApplePayShippingOption) \| [<code>Array.<IPayPalShippingOption></code>](#IPayPalShippingOption) | Used to provide available shipping options.(To use shipping_options the request_shipping flag should be true). Optional for [ApplePay]. N/A for the other wallets. |
|
|
4889
|
+
| [merchant_name] | <code>string</code> | Merchant Name used for GooglePay integration via MPGS. Required for [GooglePay]. N/A for other wallets. |
|
|
4832
4890
|
| [raw_data_initialization] | <code>object</code> | Used to provide values to initialize wallet with raw data. Optional for [ApplePay]. N/A for the other wallets. |
|
|
4833
4891
|
| [style] | <code>object</code> | Used to style PayPal buttons, check possible values at https://developer.paypal.com/docs/business/checkout/reference/style-guide. Also used at ApplePay to select button type. Optional for [PayPal, ApplePay]. N/A for [Stripe, FlyPay]. |
|
|
4834
4892
|
| [style.button_type] | <code>object</code> | Used to select ApplePay button type (e.g: 'buy','donate', etc), check possible values at https://developer.apple.com/documentation/apple_pay_on_the_web/displaying_apple_pay_buttons_using_css. Optional for [ApplePay]. N/A for other wallets. |
|
|
4835
|
-
| [wallets] | <code>array</code> | By default if this is not sent or empty, we will try to show either Apple Pay or Google Pay buttons. This can be limited sending the following array in this field: ['apple','google]. Optional for [Stripe]. N/A for other wallets. |
|
|
4893
|
+
| [wallets] | <code>array</code> | By default if this is not sent or empty, we will try to show either Apple Pay or Google Pay buttons. This can be limited sending the following array in this field: ['apple','google]. Optional for [Stripe, ApplePay, GooglePay]. N/A for other wallets. |
|
|
4836
4894
|
|
|
4837
|
-
<a name="
|
|
4895
|
+
<a name="IApplePayShippingOption" id="IApplePayShippingOption"></a>
|
|
4838
4896
|
|
|
4839
|
-
##
|
|
4840
|
-
Interface of Shipping Options
|
|
4897
|
+
## IApplePayShippingOption : <code>object</code>
|
|
4898
|
+
Interface of Shipping Options for ApplePay
|
|
4841
4899
|
|
|
4842
4900
|
**Kind**: global interface
|
|
4843
4901
|
|
|
@@ -4846,9 +4904,37 @@ Interface of Shipping Options.
|
|
|
4846
4904
|
| [id] | <code>string</code> | Identifier of the Shipping Option. Required. |
|
|
4847
4905
|
| [label] | <code>string</code> | Identifier of the Shipping Option. Required. |
|
|
4848
4906
|
| [amount] | <code>string</code> | Amount of the Shipping Option. Required. |
|
|
4907
|
+
| [detail] | <code>string</code> | Details of the Shipping Option. Required. |
|
|
4908
|
+
| [type] | <code>string</code> | Type of the Shipping Option. Values can be 'ELECTRONIC', 'GROUND', 'NOT_SHIPPED', 'OVERNIGHT', 'PICKUP', 'PRIORITY', 'SAME_DAY'. Optional. |
|
|
4909
|
+
|
|
4910
|
+
<a name="IGooglePayShippingOption" id="IGooglePayShippingOption"></a>
|
|
4911
|
+
|
|
4912
|
+
## IGooglePayShippingOption : <code>object</code>
|
|
4913
|
+
Interface of Shipping Options for GooglePay
|
|
4914
|
+
|
|
4915
|
+
**Kind**: global interface
|
|
4916
|
+
|
|
4917
|
+
| Param | Type | Description |
|
|
4918
|
+
| --- | --- | --- |
|
|
4919
|
+
| [id] | <code>string</code> | Identifier of the Shipping Option. Required. |
|
|
4920
|
+
| [label] | <code>string</code> | Identifier of the Shipping Option. Required. |
|
|
4849
4921
|
| [detail] | <code>string</code> | Details of the Shipping Option. Optional. |
|
|
4850
|
-
| [
|
|
4851
|
-
|
|
4922
|
+
| [type] | <code>string</code> | Type of the Shipping Option. Values can be 'ELECTRONIC', 'GROUND', 'NOT_SHIPPED', 'OVERNIGHT', 'PICKUP', 'PRIORITY', 'SAME_DAY'. Optional. |
|
|
4923
|
+
|
|
4924
|
+
<a name="IPayPalShippingOption" id="IPayPalShippingOption"></a>
|
|
4925
|
+
|
|
4926
|
+
## IPayPalShippingOption : <code>object</code>
|
|
4927
|
+
Interface of Shipping Options for PayPal
|
|
4928
|
+
|
|
4929
|
+
**Kind**: global interface
|
|
4930
|
+
|
|
4931
|
+
| Param | Type | Description |
|
|
4932
|
+
| --- | --- | --- |
|
|
4933
|
+
| [id] | <code>string</code> | Identifier of the Shipping Option. Required. |
|
|
4934
|
+
| [label] | <code>string</code> | Identifier of the Shipping Option. Required. |
|
|
4935
|
+
| [amount] | <code>string</code> | Amount of the Shipping Option. Required. |
|
|
4936
|
+
| [currency] | <code>string</code> | Currency of the Shipping Option. Required. |
|
|
4937
|
+
| [type] | <code>string</code> | Type of the Shipping Option. Values can be 'SHIPPING' or 'PICKUP'. Required. |
|
|
4852
4938
|
|
|
4853
4939
|
<a name="WalletButtons" id="WalletButtons"></a>
|
|
4854
4940
|
|
|
@@ -4907,7 +4993,7 @@ var button = new WalletButtons(
|
|
|
4907
4993
|
|
|
4908
4994
|
### walletButtons.update()
|
|
4909
4995
|
Triggers the update process of the wallet, if available.
|
|
4910
|
-
Currently supported by Flypay, Paypal and ApplePay via MPGS Wallets.
|
|
4996
|
+
Currently supported by Flypay, Paypal and ApplePay/GooglePay via MPGS Wallets.
|
|
4911
4997
|
|
|
4912
4998
|
**Kind**: instance method of [<code>WalletButtons</code>](#WalletButtons)
|
|
4913
4999
|
**Example**
|
|
@@ -5018,6 +5104,7 @@ button.on('unavailable').then(function () {
|
|
|
5018
5104
|
|
|
5019
5105
|
### walletButtons.onUnavailable([handler])
|
|
5020
5106
|
User to subscribe to the no button available event. This method is used after loading when the button is not available.
|
|
5107
|
+
For MPGS, since can have more than one wallet button configured (ApplePay/GooglePay) you will receive a body (({ wallet: WALLET_TYPE.GOOGLE }) or ({ wallet: WALLET_TYPE.APPLE })) indicating which button is unavailable
|
|
5021
5108
|
Important: Do not perform thread blocking operations in callback such as window.alert() calls.
|
|
5022
5109
|
|
|
5023
5110
|
**Kind**: instance method of [<code>WalletButtons</code>](#WalletButtons)
|
|
@@ -5036,6 +5123,10 @@ button.onUnavailable(() => {
|
|
|
5036
5123
|
```js
|
|
5037
5124
|
button.onUnavailable().then(() => console.log('No wallet buttons available'));
|
|
5038
5125
|
```
|
|
5126
|
+
**Example**
|
|
5127
|
+
```js
|
|
5128
|
+
button.onUnavailable(function (data) {console.log('data.wallet :: ', data.wallet)});
|
|
5129
|
+
```
|
|
5039
5130
|
<a name="WalletButtons+onUpdate" id="WalletButtons+onUpdate"></a>
|
|
5040
5131
|
|
|
5041
5132
|
### walletButtons.onUpdate([handler])
|