@paydock/client-sdk 1.94.22 → 1.100.0
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/.nvmrc +1 -0
- package/README.md +189 -73
- package/bundles/widget.umd.js +8847 -7218
- package/bundles/widget.umd.min.js +1 -1
- package/lib/components/param.d.ts +5 -0
- package/lib/components/param.js +2 -0
- package/lib/components/param.js.map +1 -1
- package/lib/configs/env/env.d.ts +0 -1
- package/lib/configs/env/env.js +0 -3
- package/lib/configs/env/env.js.map +1 -1
- package/lib/configs/sdk.js +1 -1
- package/lib/wallet-buttons/flypay-v2.wallet-service.d.ts +20 -0
- package/lib/wallet-buttons/flypay-v2.wallet-service.js +185 -0
- package/lib/wallet-buttons/flypay-v2.wallet-service.js.map +1 -0
- package/lib/wallet-buttons/google.wallet-service.js +11 -8
- package/lib/wallet-buttons/google.wallet-service.js.map +1 -1
- package/lib/wallet-buttons/interfaces.d.ts +10 -10
- package/lib/wallet-buttons/paypal.wallet-service.d.ts +3 -0
- package/lib/wallet-buttons/paypal.wallet-service.js +82 -41
- package/lib/wallet-buttons/paypal.wallet-service.js.map +1 -1
- package/lib/wallet-buttons/wallet-buttons.d.ts +10 -7
- package/lib/wallet-buttons/wallet-buttons.js +14 -7
- package/lib/wallet-buttons/wallet-buttons.js.map +1 -1
- package/package.json +20 -19
- package/slate.md +180 -65
- package/typings/globals/@auspayplus/open-payments-checkout/index.d.ts +41 -0
- package/typings/index.d.ts +1 -0
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
18
|
package/README.md
CHANGED
|
@@ -2636,7 +2636,7 @@ List of available triggers
|
|
|
2636
2636
|
You can find description of all methods and parameters [here](https://www.npmjs.com/package/@paydock/client-sdk#payment-sources-simple-example)
|
|
2637
2637
|
|
|
2638
2638
|
This widget provides a list of previously added (saved) payment-sources by customer_id or reference.
|
|
2639
|
-
The widget provides an opportunity to use events to track the process of selecting payment-sources and provide meta information about the payment-sources.
|
|
2639
|
+
The widget provides an opportunity to use events to track the process of selecting payment-sources and provide meta information about the payment-sources.
|
|
2640
2640
|
|
|
2641
2641
|
Payment-source requires a query_token that represents a pre-generated and secure token for limiting the list
|
|
2642
2642
|
payment-sources, for a specific user or reference.
|
|
@@ -2665,7 +2665,7 @@ list.load();
|
|
|
2665
2665
|
// ES2015 | TypeScript
|
|
2666
2666
|
|
|
2667
2667
|
import { HtmlPaymentSourceWidget } from '@paydock/client-sdk/payment-source-widget';
|
|
2668
|
-
|
|
2668
|
+
|
|
2669
2669
|
var list = new HtmlPaymentSourceWidget('#list', 'publicKey', 'queryToken');
|
|
2670
2670
|
list.load();
|
|
2671
2671
|
```
|
|
@@ -2673,7 +2673,7 @@ list.load();
|
|
|
2673
2673
|
Then write only need 2 lines of code in js to initialize widget
|
|
2674
2674
|
|
|
2675
2675
|
|
|
2676
|
-
### Full example
|
|
2676
|
+
### Full example
|
|
2677
2677
|
|
|
2678
2678
|
```html
|
|
2679
2679
|
<!DOCTYPE html>
|
|
@@ -2685,7 +2685,7 @@ Then write only need 2 lines of code in js to initialize widget
|
|
|
2685
2685
|
</head>
|
|
2686
2686
|
<body>
|
|
2687
2687
|
<div id="list"></div>
|
|
2688
|
-
<script src="https://widget.paydock.com/sdk/latest/widget.umd.js" ></script>
|
|
2688
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
2689
2689
|
<script>
|
|
2690
2690
|
var list = new paydock.HtmlPaymentSourceWidget('#list', 'publicKey', 'queryToken');
|
|
2691
2691
|
list.load();
|
|
@@ -2725,9 +2725,9 @@ list.on('select', function(data) {
|
|
|
2725
2725
|
});
|
|
2726
2726
|
```
|
|
2727
2727
|
|
|
2728
|
-
This example shows how you can use a lot of other methods to settings your form
|
|
2728
|
+
This example shows how you can use a lot of other methods to settings your form
|
|
2729
2729
|
|
|
2730
|
-
### Full example
|
|
2730
|
+
### Full example
|
|
2731
2731
|
|
|
2732
2732
|
```html
|
|
2733
2733
|
<!DOCTYPE html>
|
|
@@ -2740,7 +2740,7 @@ This example shows how you can use a lot of other methods to settings your form
|
|
|
2740
2740
|
<body>
|
|
2741
2741
|
<div id="list"></div>
|
|
2742
2742
|
<input type="text" name="ps_id" />
|
|
2743
|
-
<script src="https://widget.paydock.com/sdk/latest/widget.umd.js" ></script>
|
|
2743
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
2744
2744
|
<script>
|
|
2745
2745
|
var list = new paydock.HtmlPaymentSourceWidget('#list', 'publicKey', 'queryToken');
|
|
2746
2746
|
list.filterByTypes(['card', 'checkout']);
|
|
@@ -2750,9 +2750,9 @@ This example shows how you can use a lot of other methods to settings your form
|
|
|
2750
2750
|
list.setStyles({
|
|
2751
2751
|
icon_size: 'small'
|
|
2752
2752
|
});
|
|
2753
|
-
|
|
2753
|
+
|
|
2754
2754
|
list.load();
|
|
2755
|
-
|
|
2755
|
+
|
|
2756
2756
|
list.onSelectInsert('input[name="ps_id"]', 'payment_source_id');
|
|
2757
2757
|
list.on('select', function(data) {
|
|
2758
2758
|
console.log(data);
|
|
@@ -5018,7 +5018,7 @@ The final method to beginning, the load process of widget to html
|
|
|
5018
5018
|
You can find description of all methods and parameters [here](https://www.npmjs.com/package/@paydock/client-sdk#wallet-buttons-simple-example)
|
|
5019
5019
|
|
|
5020
5020
|
Wallet Buttons allow you to easily integrate different E-Wallets into your checkout.
|
|
5021
|
-
Currently supports ApplePay, Google Pay, Google Pay and Apple Pay via Stripe, Flypay checkout, Paypal Smart Buttons Checkout and Afterpay.
|
|
5021
|
+
Currently supports ApplePay, Google Pay, Google Pay and Apple Pay via Stripe, Flypay and Flypay V2 checkout, Paypal Smart Buttons Checkout and Afterpay.
|
|
5022
5022
|
|
|
5023
5023
|
If available in your client environment, you will display a simple button that upon clicking it the user will follow the standard flow for the appropriate Wallet. If not available an event will be raised and no button will be displayed.
|
|
5024
5024
|
|
|
@@ -5063,7 +5063,7 @@ var button = new WalletButtons(
|
|
|
5063
5063
|
button.load();
|
|
5064
5064
|
```
|
|
5065
5065
|
|
|
5066
|
-
Flypay and Paypal wallets do not require any meta sent to the wallet, so the following is enough for initialization:
|
|
5066
|
+
Flypay, Flypay V2 and Paypal wallets do not require any meta sent to the wallet, so the following is enough for initialization:
|
|
5067
5067
|
```javascript
|
|
5068
5068
|
let button = new paydock.WalletButtons(
|
|
5069
5069
|
"#widget",
|
|
@@ -5168,7 +5168,7 @@ button.close();
|
|
|
5168
5168
|
|
|
5169
5169
|
### Performing actions when shipping info is updated
|
|
5170
5170
|
|
|
5171
|
-
In Flypay, Paypal and
|
|
5171
|
+
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).
|
|
5172
5172
|
|
|
5173
5173
|
For Paypal integration specifically, if shipping is enabled for the wallet button and different shipping methods were provided in the create wallet charge call, Merchants must ensure that the posted `shipping.amount` to `POST charges/:id` matches the selected shipping option amount (value sent in when initializing the wallet charge). In other words, when providing shipping methods the shipping amount is bound to being one of the provided shipping method amount necessarily. Bear in mind that the total charge amount must include the `shipping.amount`, since it represents the full amount to be charged to the customer.
|
|
5174
5174
|
|
|
@@ -5177,18 +5177,18 @@ After analyzing the new shipping information, and making the post with the updat
|
|
|
5177
5177
|
```javascript
|
|
5178
5178
|
button.onUpdate((data) => {
|
|
5179
5179
|
console.log("Updating amount via a backend to backend call to POST charges/:id");
|
|
5180
|
-
|
|
5181
|
-
|
|
5180
|
+
// call `POST charges/:id` to modify charge
|
|
5181
|
+
button.update({ success: true });
|
|
5182
5182
|
});
|
|
5183
5183
|
```
|
|
5184
5184
|
|
|
5185
|
-
For ApplePay via MPGS
|
|
5185
|
+
For ApplePay via MPGS and GooglePay via MPGS integrations, you can also return a new `amount` and new `shipping_options` in case new options are needed based on the updated shipping data. Before the user authorizes the transaction, you receive redacted address information (address_country, address_city, address_state, address_postcode), and this data can be used to recalculate the new amount and new shipping options.
|
|
5186
5186
|
|
|
5187
5187
|
```javascript
|
|
5188
5188
|
button.onUpdate((data) => {
|
|
5189
5189
|
console.log("Updating amount via a backend to backend call to POST charges/:id");
|
|
5190
|
-
|
|
5191
|
-
|
|
5190
|
+
// call `POST charges/:id` to modify charge
|
|
5191
|
+
button.update({
|
|
5192
5192
|
success: true,
|
|
5193
5193
|
body: {
|
|
5194
5194
|
amount: 15,
|
|
@@ -5200,7 +5200,7 @@ button.onUpdate((data) => {
|
|
|
5200
5200
|
amount: "0.00"
|
|
5201
5201
|
},
|
|
5202
5202
|
{
|
|
5203
|
-
id: "NEW
|
|
5203
|
+
id: "NEW-FastShip",
|
|
5204
5204
|
label: "NEW - Fast Shipping",
|
|
5205
5205
|
detail: "Arrives in less than 1 day",
|
|
5206
5206
|
amount: "10.00"
|
|
@@ -5242,7 +5242,7 @@ button.on(EVENT.PAYMENT_ERROR, (data) => console.log("The payment was not succes
|
|
|
5242
5242
|
|
|
5243
5243
|
This example shows how to use these functions for **Apple and Google Pay via Stripe**:
|
|
5244
5244
|
_(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `wallets`)_
|
|
5245
|
-
### Full example
|
|
5245
|
+
### Apple and Google Pay via Stripe Full example
|
|
5246
5246
|
|
|
5247
5247
|
```html
|
|
5248
5248
|
<!DOCTYPE html>
|
|
@@ -5277,8 +5277,8 @@ _(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `wa
|
|
|
5277
5277
|
```
|
|
5278
5278
|
|
|
5279
5279
|
This example shows how to use these functions for **Paypal Smart Checkout Buttons**:
|
|
5280
|
-
_(Required `meta` fields: - . Optional `meta` fields: `request_shipping`, `pay_later`, `style`)_
|
|
5281
|
-
### Full example
|
|
5280
|
+
_(Required `meta` fields: - . Optional `meta` fields: `request_shipping`, `pay_later`, `standalone`, `style`)_
|
|
5281
|
+
### Paypal Smart Checkout Buttons Full example
|
|
5282
5282
|
```html
|
|
5283
5283
|
<!DOCTYPE html>
|
|
5284
5284
|
<html lang="en">
|
|
@@ -5293,26 +5293,27 @@ _(Required `meta` fields: - . Optional `meta` fields: `request_shipping`, `pay_l
|
|
|
5293
5293
|
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
5294
5294
|
<script>
|
|
5295
5295
|
let button = new paydock.WalletButtons(
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5296
|
+
"#widget",
|
|
5297
|
+
charge_token,
|
|
5298
|
+
{
|
|
5299
|
+
request_shipping: true,
|
|
5300
|
+
pay_later: true,
|
|
5301
|
+
standalone: false,
|
|
5302
|
+
style: {
|
|
5303
|
+
layout: 'horizontal',
|
|
5304
|
+
color: 'blue',
|
|
5305
|
+
shape: 'rect',
|
|
5306
|
+
label: 'paypal',
|
|
5307
|
+
},
|
|
5308
|
+
}
|
|
5309
|
+
);
|
|
5309
5310
|
button.setEnv('sandbox');
|
|
5310
5311
|
button.onUnavailable(() => console.log("No wallet buttons available"));
|
|
5311
5312
|
button.onUpdate((data) => {
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5313
|
+
console.log("Updating amount via a backend to backend call to POST charges/:id");
|
|
5314
|
+
// call `POST charges/:id` to modify charge
|
|
5315
|
+
button.update({ success: true });
|
|
5316
|
+
});
|
|
5316
5317
|
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
5317
5318
|
button.onPaymentError((data) => console.log("The payment was not successful"));
|
|
5318
5319
|
button.onPaymentInReview((data) => console.log("The payment is on fraud review"));
|
|
@@ -5321,8 +5322,46 @@ _(Required `meta` fields: - . Optional `meta` fields: `request_shipping`, `pay_l
|
|
|
5321
5322
|
</html>
|
|
5322
5323
|
```
|
|
5323
5324
|
|
|
5324
|
-
This example shows how to use these functions for **Flypay
|
|
5325
|
+
This example shows how to use these functions for **Flypay v1 Wallet**.
|
|
5325
5326
|
_(Required `meta` fields: - . Optional `meta` fields: `request_shipping`, `pay_later`, `style`)_
|
|
5327
|
+
### Flypay Full example
|
|
5328
|
+
```html
|
|
5329
|
+
<!DOCTYPE html>
|
|
5330
|
+
<html lang="en">
|
|
5331
|
+
<head>
|
|
5332
|
+
<meta charset="UTF-8">
|
|
5333
|
+
<title>Title</title>
|
|
5334
|
+
</head>
|
|
5335
|
+
<body>
|
|
5336
|
+
<h2>Payment using PayDock Wallet Button!</h2>
|
|
5337
|
+
<div id="widget"></div>
|
|
5338
|
+
</body>
|
|
5339
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
5340
|
+
<script>
|
|
5341
|
+
let button = new paydock.WalletButtons(
|
|
5342
|
+
"#widget",
|
|
5343
|
+
charge_token,
|
|
5344
|
+
{
|
|
5345
|
+
request_shipping: true
|
|
5346
|
+
}
|
|
5347
|
+
);
|
|
5348
|
+
button.setEnv('sandbox');
|
|
5349
|
+
button.onUnavailable(() => console.log("No wallet buttons available"));
|
|
5350
|
+
button.onUpdate((data) => {
|
|
5351
|
+
console.log("Updating amount via a backend to backend call to POST charges/:id");
|
|
5352
|
+
// call `POST charges/:id` to modify charge
|
|
5353
|
+
button.update({ success: true });
|
|
5354
|
+
});
|
|
5355
|
+
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
5356
|
+
button.onPaymentError((data) => console.log("The payment was not successful"));
|
|
5357
|
+
button.onPaymentInReview((data) => console.log("The payment is on fraud review"));
|
|
5358
|
+
button.load();
|
|
5359
|
+
</script>
|
|
5360
|
+
</html>
|
|
5361
|
+
```
|
|
5362
|
+
|
|
5363
|
+
This example shows how to use these functions for **Flypay v2 Wallet**.
|
|
5364
|
+
_(Required `meta` fields: - . Optional `meta` fields: -)_
|
|
5326
5365
|
### Full example
|
|
5327
5366
|
```html
|
|
5328
5367
|
<!DOCTYPE html>
|
|
@@ -5340,28 +5379,21 @@ _(Required `meta` fields: - . Optional `meta` fields: `request_shipping`, `pay_l
|
|
|
5340
5379
|
let button = new paydock.WalletButtons(
|
|
5341
5380
|
"#widget",
|
|
5342
5381
|
charge_token,
|
|
5343
|
-
{
|
|
5344
|
-
request_shipping: true
|
|
5345
|
-
}
|
|
5382
|
+
{},
|
|
5346
5383
|
);
|
|
5347
5384
|
button.setEnv('sandbox');
|
|
5348
5385
|
button.onUnavailable(() => console.log("No wallet buttons available"));
|
|
5349
|
-
button.onUpdate((data) => {
|
|
5350
|
-
console.log("Updating amount via a backend to backend call to POST charges/:id");
|
|
5351
|
-
// call `POST charges/:id` to modify charge
|
|
5352
|
-
button.update({ success: true });
|
|
5353
|
-
});
|
|
5354
5386
|
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
5355
5387
|
button.onPaymentError((data) => console.log("The payment was not successful"));
|
|
5356
|
-
button.onPaymentInReview((data) => console.log("The payment is on fraud review"));
|
|
5357
5388
|
button.load();
|
|
5358
5389
|
</script>
|
|
5359
5390
|
</html>
|
|
5360
5391
|
```
|
|
5361
5392
|
|
|
5362
|
-
This example shows how to use these functions for **ApplePay via MPGS**:
|
|
5393
|
+
This example shows how to use these functions for **ApplePay via MPGS** and **GooglePay via MPGS**:
|
|
5394
|
+
|
|
5363
5395
|
_(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `raw_data_initialization`, `request_shipping`, `style.button_type`)_
|
|
5364
|
-
### Full example
|
|
5396
|
+
### ApplePay and GooglePay via MPGS Full example
|
|
5365
5397
|
|
|
5366
5398
|
```html
|
|
5367
5399
|
<!DOCTYPE html>
|
|
@@ -5383,8 +5415,16 @@ _(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `ra
|
|
|
5383
5415
|
amount_label: "Total",
|
|
5384
5416
|
country: 'DE',
|
|
5385
5417
|
request_shipping: true,
|
|
5418
|
+
show_billing_address: true,
|
|
5386
5419
|
style: {
|
|
5387
|
-
|
|
5420
|
+
google: {
|
|
5421
|
+
button_type: 'buy',
|
|
5422
|
+
button_size_mode: 'static',
|
|
5423
|
+
button_color: 'white',
|
|
5424
|
+
},
|
|
5425
|
+
apple: {
|
|
5426
|
+
button_type: 'buy',
|
|
5427
|
+
},
|
|
5388
5428
|
},
|
|
5389
5429
|
shipping_options: [
|
|
5390
5430
|
{
|
|
@@ -5406,14 +5446,40 @@ _(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `ra
|
|
|
5406
5446
|
button.onUnavailable(() => console.log("No wallet buttons available"));
|
|
5407
5447
|
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
5408
5448
|
button.onPaymentError((data) => console.log("The payment was not successful"));
|
|
5449
|
+
button.onUpdate((data) => {
|
|
5450
|
+
console.log("Updating amount via a backend to backend call to POST charges/:id");
|
|
5451
|
+
// call `POST charges/:id` to modify charge
|
|
5452
|
+
button.update({
|
|
5453
|
+
success: true,
|
|
5454
|
+
body: {
|
|
5455
|
+
amount: 15,
|
|
5456
|
+
shipping_options: [
|
|
5457
|
+
{
|
|
5458
|
+
id: "NEW-FreeShip",
|
|
5459
|
+
label: "NEW - Free Shipping",
|
|
5460
|
+
detail: "Arrives in 3 to 5 days",
|
|
5461
|
+
amount: "0.00"
|
|
5462
|
+
},
|
|
5463
|
+
{
|
|
5464
|
+
id: "NEW-FastShip",
|
|
5465
|
+
label: "NEW - Fast Shipping",
|
|
5466
|
+
detail: "Arrives in less than 1 day",
|
|
5467
|
+
amount: "10.00"
|
|
5468
|
+
}
|
|
5469
|
+
]
|
|
5470
|
+
}
|
|
5471
|
+
});
|
|
5472
|
+
});
|
|
5409
5473
|
button.load();
|
|
5410
5474
|
</script>
|
|
5411
5475
|
</html>
|
|
5412
5476
|
```
|
|
5413
5477
|
|
|
5414
|
-
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
|
|
5478
|
+
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.
|
|
5479
|
+
|
|
5480
|
+
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.
|
|
5415
5481
|
|
|
5416
|
-
### Raw data initialization example
|
|
5482
|
+
### ApplePay and GooglePay via MPGS Raw data initialization example
|
|
5417
5483
|
|
|
5418
5484
|
```html
|
|
5419
5485
|
<!DOCTYPE html>
|
|
@@ -5433,23 +5499,48 @@ Also, for **ApplePay via MPGS** you can initialize the `ApplePayPaymentRequest`
|
|
|
5433
5499
|
charge_token,
|
|
5434
5500
|
{
|
|
5435
5501
|
raw_data_initialization: {
|
|
5436
|
-
|
|
5437
|
-
|
|
5438
|
-
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5502
|
+
apple: {
|
|
5503
|
+
countryCode: "AU",
|
|
5504
|
+
currencyCode: "AUD",
|
|
5505
|
+
merchantCapabilities: ["supports3DS","supportsCredit","supportsDebit"],
|
|
5506
|
+
supportedNetworks: ["visa","masterCard","amex","discover"],
|
|
5507
|
+
requiredBillingContactFields: ["name","postalAddress"],
|
|
5508
|
+
requiredShippingContactFields:["postalAddress","name","phone","email" ],
|
|
5509
|
+
total: {
|
|
5510
|
+
label: "Total",
|
|
5511
|
+
amount: "10",
|
|
5512
|
+
type: "final",
|
|
5513
|
+
}
|
|
5514
|
+
},
|
|
5515
|
+
google: {
|
|
5516
|
+
type: "CARD",
|
|
5517
|
+
parameters: {
|
|
5518
|
+
allowedAuthMethods: ["PAN_ONLY", "CRYPTOGRAM_3DS"],
|
|
5519
|
+
allowedCardNetworks: [
|
|
5520
|
+
"AMEX",
|
|
5521
|
+
"DISCOVER",
|
|
5522
|
+
"INTERAC",
|
|
5523
|
+
"JCB",
|
|
5524
|
+
"MASTERCARD",
|
|
5525
|
+
"VISA",
|
|
5526
|
+
],
|
|
5527
|
+
billingAddressRequired: true,
|
|
5528
|
+
},
|
|
5529
|
+
},
|
|
5447
5530
|
},
|
|
5448
5531
|
amount_label: "Total",
|
|
5449
5532
|
country: 'DE',
|
|
5450
5533
|
request_shipping: true,
|
|
5534
|
+
show_billing_address: true,
|
|
5451
5535
|
style: {
|
|
5452
|
-
|
|
5536
|
+
google: {
|
|
5537
|
+
button_type: 'buy',
|
|
5538
|
+
button_size_mode: 'static',
|
|
5539
|
+
button_color: 'white',
|
|
5540
|
+
},
|
|
5541
|
+
apple: {
|
|
5542
|
+
button_type: 'buy',
|
|
5543
|
+
},
|
|
5453
5544
|
},
|
|
5454
5545
|
shipping_options: [
|
|
5455
5546
|
{
|
|
@@ -5471,6 +5562,30 @@ Also, for **ApplePay via MPGS** you can initialize the `ApplePayPaymentRequest`
|
|
|
5471
5562
|
button.onUnavailable(() => console.log("No wallet buttons available"));
|
|
5472
5563
|
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
5473
5564
|
button.onPaymentError((data) => console.log("The payment was not successful"));
|
|
5565
|
+
button.onUpdate((data) => {
|
|
5566
|
+
console.log("Updating amount via a backend to backend call to POST charges/:id");
|
|
5567
|
+
// call `POST charges/:id` to modify charge
|
|
5568
|
+
button.update({
|
|
5569
|
+
success: true,
|
|
5570
|
+
body: {
|
|
5571
|
+
amount: 15,
|
|
5572
|
+
shipping_options: [
|
|
5573
|
+
{
|
|
5574
|
+
id: "NEW-FreeShip",
|
|
5575
|
+
label: "NEW - Free Shipping",
|
|
5576
|
+
detail: "Arrives in 3 to 5 days",
|
|
5577
|
+
amount: "0.00"
|
|
5578
|
+
},
|
|
5579
|
+
{
|
|
5580
|
+
id: "NEW-FastShip",
|
|
5581
|
+
label: "NEW - Fast Shipping",
|
|
5582
|
+
detail: "Arrives in less than 1 day",
|
|
5583
|
+
amount: "10.00"
|
|
5584
|
+
}
|
|
5585
|
+
]
|
|
5586
|
+
}
|
|
5587
|
+
});
|
|
5588
|
+
});
|
|
5474
5589
|
button.load();
|
|
5475
5590
|
</script>
|
|
5476
5591
|
</html>
|
|
@@ -5480,7 +5595,7 @@ Also, for **ApplePay via MPGS** you can initialize the `ApplePayPaymentRequest`
|
|
|
5480
5595
|
|
|
5481
5596
|
<dl>
|
|
5482
5597
|
<dt><a href="#WalletButtons">WalletButtons</a></dt>
|
|
5483
|
-
<dd><p>Class WalletButtons to work with different E-Wallets within html (currently supports Apple Pay, Google Pay, Google Pay™ and Apple Pay via Stripe, Flypay, Paypal, Afterpay)</p>
|
|
5598
|
+
<dd><p>Class WalletButtons to work with different E-Wallets within html (currently supports Apple Pay, Google Pay, Google Pay™ and Apple Pay via Stripe, Flypay, Flypay V2, Paypal, Afterpay)</p>
|
|
5484
5599
|
</dd>
|
|
5485
5600
|
</dl>
|
|
5486
5601
|
|
|
@@ -5518,18 +5633,19 @@ Interface of data used by the wallet checkout and payment proccess.
|
|
|
5518
5633
|
|
|
5519
5634
|
| Param | Type | Description |
|
|
5520
5635
|
| --- | --- | --- |
|
|
5521
|
-
| [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, Afterpay]. |
|
|
5522
|
-
| [country] | <code>string</code> | Country of the user. 2 letter ISO code format. Required for [Stripe, ApplePay, GooglePay, Afterpay]. N/A for [FlyPay, PayPal]. |
|
|
5523
|
-
| [pay_later] | <code>
|
|
5636
|
+
| [amount_label] | <code>string</code> | Label shown next to the total amount to be paid. Required for [Stripe, ApplePay, GooglePay]. N/A for [FlyPay, Flypay V2, PayPal, Afterpay]. |
|
|
5637
|
+
| [country] | <code>string</code> | Country of the user. 2 letter ISO code format. Required for [Stripe, ApplePay, GooglePay, Afterpay]. N/A for [FlyPay, Flypay V2, PayPal]. |
|
|
5638
|
+
| [pay_later] | <code>boolean</code> | Used to enable Pay Later feature in PayPal Smart Checkout WalletButton integration when available. Optional for [PayPal]. N/A for other wallets. |
|
|
5639
|
+
| [standalone] | <code>boolean</code> | Used to enable Standalone Buttons feature in PayPal Smart Checkout WalletButton integration. Used together with `pay_later`. Optional for [PayPal]. N/A for other wallets. |
|
|
5524
5640
|
| [show_billing_address] | <code>boolean</code> | Used to hide/show the billing address on ApplePay and GooglePay popups. Default value is false. Optional for [ApplePay, GooglePay]. N/A for other wallets. |
|
|
5525
5641
|
| [request_payer_name] | <code>boolean</code> | Used mainly for fraud purposes - recommended set to true. Optional for [Stripe]. N/A for other wallets. |
|
|
5526
5642
|
| [request_payer_email] | <code>boolean</code> | Used mainly for fraud purposes - recommended set to true. Optional for [Stripe]. N/A for other wallets. |
|
|
5527
5643
|
| [request_payer_phone] | <code>boolean</code> | Used mainly for fraud purposes - recommended set to true. Optional for [Stripe]. N/A for other wallets. |
|
|
5528
|
-
| [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, Afterpay]. |
|
|
5644
|
+
| [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 [Flypay V2, Stripe, Afterpay]. |
|
|
5529
5645
|
| [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. |
|
|
5530
5646
|
| [merchant_name] | <code>string</code> | Merchant Name used for GooglePay integration via MPGS. Required for [GooglePay]. N/A for other wallets. |
|
|
5531
5647
|
| [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. |
|
|
5532
|
-
| [style] | <code>object</code> |
|
|
5648
|
+
| [style] | <code>object</code> | For **Paypal**: used to style the buttons, check possible values in the [style guide](https://developer.paypal.com/docs/business/checkout/reference/style-guide). When `standalone` and `pay_later`, extra options can be provided in `style.messages` with the [messages style options](https://developer.paypal.com/docs/checkout/pay-later/us/integrate/reference/#stylelayout). Also used at **ApplePay**, **GooglePay** and **Afterpay** to select button type. Optional for [PayPal, ApplePay, GooglePay, Afterpay]. N/A for [Stripe, FlyPay, Flypay V2]. |
|
|
5533
5649
|
| [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. Also select button type for GooglePay (check GooglePayStyles) and Afterpay (check AfterpayStyles). Optional for [ApplePay, GooglePay, Afterpay]. N/A for other wallets. |
|
|
5534
5650
|
| [style.height] | <code>object</code> | Used to select Afterpay button height. Optional for [Afterpay]. N/A for other wallets. |
|
|
5535
5651
|
| [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. |
|
|
@@ -5581,7 +5697,7 @@ Interface of Shipping Options for PayPal
|
|
|
5581
5697
|
<a name="WalletButtons" id="WalletButtons" href="#WalletButtons"> </a>
|
|
5582
5698
|
|
|
5583
5699
|
## WalletButtons
|
|
5584
|
-
Class WalletButtons to work with different E-Wallets within html (currently supports Apple Pay, Google Pay, Google Pay™ and Apple Pay via Stripe, Flypay, Paypal, Afterpay)
|
|
5700
|
+
Class WalletButtons to work with different E-Wallets within html (currently supports Apple Pay, Google Pay, Google Pay™ and Apple Pay via Stripe, Flypay, Flypay V2, Paypal, Afterpay)
|
|
5585
5701
|
|
|
5586
5702
|
**Kind**: global class
|
|
5587
5703
|
|
|
@@ -6399,4 +6515,4 @@ List of available event's name in the SRC checkout lifecycle
|
|
|
6399
6515
|
|
|
6400
6516
|
|
|
6401
6517
|
## License
|
|
6402
|
-
Copyright (c)
|
|
6518
|
+
Copyright (c) 2023 paydock
|