@paydock/client-sdk 1.103.11-beta → 1.103.24-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 +266 -444
- package/bundles/widget.umd.js +303 -646
- package/bundles/widget.umd.min.js +1 -1
- package/lib/api/api-service-internal.d.ts +2 -1
- package/lib/api/api-service-internal.js +1 -0
- package/lib/api/api-service-internal.js.map +1 -1
- package/lib/components/container.d.ts +0 -1
- package/lib/components/container.js +0 -3
- package/lib/components/container.js.map +1 -1
- package/lib/components/iframe-event.d.ts +2 -0
- package/lib/components/iframe-event.js +2 -0
- package/lib/components/iframe-event.js.map +1 -1
- package/lib/components/link.d.ts +3 -2
- package/lib/components/link.js +1 -0
- package/lib/components/link.js.map +1 -1
- package/lib/components/param.d.ts +2 -2
- package/lib/components/param.js.map +1 -1
- package/lib/components/wallet-background.d.ts +1 -2
- package/lib/components/wallet-background.js +1 -4
- package/lib/components/wallet-background.js.map +1 -1
- package/lib/configs/env/env.d.ts +3 -0
- package/lib/configs/env/env.js +9 -0
- package/lib/configs/env/env.js.map +1 -1
- package/lib/configs/sdk.js +1 -1
- package/lib/secure-remote-commerce/index.d.ts +102 -1
- package/lib/secure-remote-commerce/index.js +102 -1
- package/lib/secure-remote-commerce/index.js.map +1 -1
- package/lib/secure-remote-commerce/interfaces.d.ts +109 -32
- package/lib/secure-remote-commerce/interfaces.js +31 -11
- package/lib/secure-remote-commerce/interfaces.js.map +1 -1
- package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.d.ts +30 -0
- package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.js +39 -0
- package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.js.map +1 -0
- package/lib/secure-remote-commerce/providers/mastercard-src/index.d.ts +1 -0
- package/lib/secure-remote-commerce/providers/mastercard-src/index.js +2 -0
- package/lib/secure-remote-commerce/providers/mastercard-src/index.js.map +1 -0
- package/lib/secure-remote-commerce/providers/{visa-src/visa-src.d.ts → mastercard-src/mastercard-src.d.ts} +4 -7
- package/lib/secure-remote-commerce/providers/mastercard-src/mastercard-src.js +88 -0
- package/lib/secure-remote-commerce/providers/mastercard-src/mastercard-src.js.map +1 -0
- package/lib/secure-remote-commerce/secure-remote-commerce.d.ts +13 -91
- package/lib/secure-remote-commerce/secure-remote-commerce.js +15 -98
- package/lib/secure-remote-commerce/secure-remote-commerce.js.map +1 -1
- package/lib/wallet-buttons/apple.wallet-service.d.ts +0 -2
- package/lib/wallet-buttons/apple.wallet-service.js +5 -38
- package/lib/wallet-buttons/apple.wallet-service.js.map +1 -1
- package/lib/wallet-buttons/flypay-v2.wallet-service.d.ts +1 -9
- package/lib/wallet-buttons/flypay-v2.wallet-service.js +132 -105
- package/lib/wallet-buttons/flypay-v2.wallet-service.js.map +1 -1
- package/lib/wallet-buttons/google.wallet-service.d.ts +0 -3
- package/lib/wallet-buttons/google.wallet-service.js +8 -41
- package/lib/wallet-buttons/google.wallet-service.js.map +1 -1
- package/lib/wallet-buttons/index.d.ts +0 -126
- package/lib/wallet-buttons/index.js +0 -126
- package/lib/wallet-buttons/index.js.map +1 -1
- package/lib/wallet-buttons/interfaces.d.ts +0 -3
- package/lib/wallet-buttons/paypal.wallet-service.js +2 -17
- package/lib/wallet-buttons/paypal.wallet-service.js.map +1 -1
- package/lib/wallet-buttons/wallet-buttons.d.ts +120 -62
- package/lib/wallet-buttons/wallet-buttons.js +60 -84
- package/lib/wallet-buttons/wallet-buttons.js.map +1 -1
- package/lib/wallet-buttons/wallet-service.d.ts +0 -7
- package/lib/wallet-buttons/wallet-service.js +0 -11
- package/lib/wallet-buttons/wallet-service.js.map +1 -1
- package/package.json +1 -1
- package/slate.md +78 -132
- package/lib/secure-remote-commerce/providers/visa-src/helper.d.ts +0 -7
- package/lib/secure-remote-commerce/providers/visa-src/helper.js +0 -36
- package/lib/secure-remote-commerce/providers/visa-src/helper.js.map +0 -1
- package/lib/secure-remote-commerce/providers/visa-src/index.d.ts +0 -1
- package/lib/secure-remote-commerce/providers/visa-src/index.js +0 -2
- package/lib/secure-remote-commerce/providers/visa-src/index.js.map +0 -1
- package/lib/secure-remote-commerce/providers/visa-src/visa-src.js +0 -113
- package/lib/secure-remote-commerce/providers/visa-src/visa-src.js.map +0 -1
- package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.d.ts +0 -8
- package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.js +0 -10
- package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.js.map +0 -1
- package/lib/wallet-buttons/helpers/flypay-v2.helper.d.ts +0 -3
- package/lib/wallet-buttons/helpers/flypay-v2.helper.js +0 -151
- package/lib/wallet-buttons/helpers/flypay-v2.helper.js.map +0 -1
package/README.md
CHANGED
|
@@ -5248,14 +5248,6 @@ In some situations you may want to forcibly close the checkout so that your user
|
|
|
5248
5248
|
button.close();
|
|
5249
5249
|
```
|
|
5250
5250
|
|
|
5251
|
-
### Performing actions when the wallet button is clicked
|
|
5252
|
-
|
|
5253
|
-
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.
|
|
5254
|
-
|
|
5255
|
-
```javascript
|
|
5256
|
-
button.onClick(() => console.log("Perform actions on button click"));
|
|
5257
|
-
```
|
|
5258
|
-
|
|
5259
5251
|
### Performing actions when shipping info is updated
|
|
5260
5252
|
|
|
5261
5253
|
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).
|
|
@@ -5383,51 +5375,30 @@ _(Required `meta` fields: - . Optional `meta` fields: `request_shipping`, `pay_l
|
|
|
5383
5375
|
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
5384
5376
|
<script>
|
|
5385
5377
|
let button = new paydock.WalletButtons(
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
|
|
5398
|
-
|
|
5399
|
-
|
|
5378
|
+
"#widget",
|
|
5379
|
+
charge_token,
|
|
5380
|
+
{
|
|
5381
|
+
request_shipping: true,
|
|
5382
|
+
pay_later: true,
|
|
5383
|
+
standalone: false,
|
|
5384
|
+
style: {
|
|
5385
|
+
layout: 'horizontal',
|
|
5386
|
+
color: 'blue',
|
|
5387
|
+
shape: 'rect',
|
|
5388
|
+
label: 'paypal',
|
|
5389
|
+
},
|
|
5390
|
+
}
|
|
5391
|
+
);
|
|
5400
5392
|
button.setEnv('sandbox');
|
|
5401
5393
|
button.onUnavailable(() => console.log("No wallet buttons available"));
|
|
5402
5394
|
button.onUpdate((data) => {
|
|
5403
|
-
|
|
5404
|
-
|
|
5405
|
-
|
|
5406
|
-
|
|
5395
|
+
console.log("Updating amount via a backend to backend call to POST charges/:id");
|
|
5396
|
+
// call `POST charges/:id` to modify charge
|
|
5397
|
+
button.update({ success: true });
|
|
5398
|
+
});
|
|
5407
5399
|
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
5408
5400
|
button.onPaymentError((data) => console.log("The payment was not successful"));
|
|
5409
5401
|
button.onPaymentInReview((data) => console.log("The payment is on fraud review"));
|
|
5410
|
-
|
|
5411
|
-
// Example 1: Asynchronous onClick handler
|
|
5412
|
-
const asyncLogic = async () => {
|
|
5413
|
-
// Perform asynchronous logic. Expectation is that a Promise is returned and attached to response via `attachResult`,
|
|
5414
|
-
// and resolve or reject of it will dictate how wallet behaves.
|
|
5415
|
-
}
|
|
5416
|
-
|
|
5417
|
-
button.onClick(({ data: { attachResult } }) => {
|
|
5418
|
-
// Promise is attached to the result. On Paypal, when promise is resolved, the user Journey will continue.
|
|
5419
|
-
// If no promise is attached then the Paypal journey will not depend on the promise being resolved or rejected
|
|
5420
|
-
attachResult(asyncLogic());
|
|
5421
|
-
});
|
|
5422
|
-
|
|
5423
|
-
// Example 2: Synchronous onClick handler
|
|
5424
|
-
// button.onClick(({ data: { attachResult } }) => {
|
|
5425
|
-
// // Perform synchronous logic
|
|
5426
|
-
// console.log("Synchronous onClick: Button clicked");
|
|
5427
|
-
// // Optionally return a boolean flag to halt the operation
|
|
5428
|
-
// attachResult(false);
|
|
5429
|
-
// });
|
|
5430
|
-
|
|
5431
5402
|
button.load();
|
|
5432
5403
|
</script>
|
|
5433
5404
|
</html>
|
|
@@ -5561,7 +5532,6 @@ _(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `ra
|
|
|
5561
5532
|
button.onUnavailable(() => console.log("No wallet buttons available"));
|
|
5562
5533
|
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
5563
5534
|
button.onPaymentError((data) => console.log("The payment was not successful"));
|
|
5564
|
-
button.onClick(() => console.log("On WalletButton Click"));
|
|
5565
5535
|
button.onUpdate((data) => {
|
|
5566
5536
|
console.log("Updating amount via a backend to backend call to POST charges/:id");
|
|
5567
5537
|
// call `POST charges/:id` to modify charge
|
|
@@ -5594,6 +5564,7 @@ _(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `ra
|
|
|
5594
5564
|
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.
|
|
5595
5565
|
|
|
5596
5566
|
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.
|
|
5567
|
+
|
|
5597
5568
|
### ApplePay and GooglePay via MPGS Raw data initialization example
|
|
5598
5569
|
|
|
5599
5570
|
```html
|
|
@@ -5725,24 +5696,6 @@ Similarly, for **GooglePay via MPGS** you can initialize the `PaymentMethodSpeci
|
|
|
5725
5696
|
## Interfaces
|
|
5726
5697
|
|
|
5727
5698
|
<dl>
|
|
5728
|
-
<dt><a href="#IEventData">IEventData</a></dt>
|
|
5729
|
-
<dd><p>Interface of data from events.</p>
|
|
5730
|
-
</dd>
|
|
5731
|
-
<dt><a href="#IWalletPaymentSuccessful">IWalletPaymentSuccessful</a></dt>
|
|
5732
|
-
<dd><p>Interface of data from a successful payment result.</p>
|
|
5733
|
-
</dd>
|
|
5734
|
-
<dt><a href="#IWalletUpdate">IWalletUpdate</a></dt>
|
|
5735
|
-
<dd><p>Interface of data from an update event.</p>
|
|
5736
|
-
</dd>
|
|
5737
|
-
<dt><a href="#IWalletOnClick">IWalletOnClick</a></dt>
|
|
5738
|
-
<dd><p>Interface of data from a wallet onClick event.</p>
|
|
5739
|
-
</dd>
|
|
5740
|
-
<dt><a href="#IWalletUnavailable">IWalletUnavailable</a></dt>
|
|
5741
|
-
<dd><p>Interface of data from an unavailable event.</p>
|
|
5742
|
-
</dd>
|
|
5743
|
-
<dt><a href="#IWalletUpdateData">IWalletUpdateData</a></dt>
|
|
5744
|
-
<dd><p>Interface of data for wallet button <code>update</code> call.</p>
|
|
5745
|
-
</dd>
|
|
5746
5699
|
<dt><a href="#IWalletMeta">IWalletMeta</a> : <code>object</code></dt>
|
|
5747
5700
|
<dd><p>Interface of data used by the wallet checkout and payment proccess.</p>
|
|
5748
5701
|
</dd>
|
|
@@ -5757,100 +5710,6 @@ Similarly, for **GooglePay via MPGS** you can initialize the `PaymentMethodSpeci
|
|
|
5757
5710
|
</dd>
|
|
5758
5711
|
</dl>
|
|
5759
5712
|
|
|
5760
|
-
<a name="IEventData" id="IEventData" href="#IEventData"> </a>
|
|
5761
|
-
|
|
5762
|
-
## IEventData
|
|
5763
|
-
Interface of data from events.
|
|
5764
|
-
|
|
5765
|
-
**Kind**: global interface
|
|
5766
|
-
|
|
5767
|
-
| Param | Type |
|
|
5768
|
-
| --- | --- |
|
|
5769
|
-
| event | <code>string</code> |
|
|
5770
|
-
| data | <code>void</code> \| [<code>IWalletPaymentSuccessful</code>](#IWalletPaymentSuccessful) \| [<code>IWalletUpdate</code>](#IWalletUpdate) \| [<code>IWalletUnavailable</code>](#IWalletUnavailable) \| [<code>IWalletOnClick</code>](#IWalletOnClick) \| <code>any</code> |
|
|
5771
|
-
|
|
5772
|
-
<a name="IWalletPaymentSuccessful" id="IWalletPaymentSuccessful" href="#IWalletPaymentSuccessful"> </a>
|
|
5773
|
-
|
|
5774
|
-
## IWalletPaymentSuccessful
|
|
5775
|
-
Interface of data from a successful payment result.
|
|
5776
|
-
|
|
5777
|
-
**Kind**: global interface
|
|
5778
|
-
|
|
5779
|
-
| Param | Type |
|
|
5780
|
-
| --- | --- |
|
|
5781
|
-
| id | <code>string</code> |
|
|
5782
|
-
| amount | <code>number</code> |
|
|
5783
|
-
| currency | <code>string</code> |
|
|
5784
|
-
| status | <code>string</code> |
|
|
5785
|
-
| [payer_name] | <code>string</code> |
|
|
5786
|
-
| [payer_email] | <code>string</code> |
|
|
5787
|
-
| [payer_phone] | <code>string</code> |
|
|
5788
|
-
|
|
5789
|
-
<a name="IWalletUpdate" id="IWalletUpdate" href="#IWalletUpdate"> </a>
|
|
5790
|
-
|
|
5791
|
-
## IWalletUpdate
|
|
5792
|
-
Interface of data from an update event.
|
|
5793
|
-
|
|
5794
|
-
**Kind**: global interface
|
|
5795
|
-
|
|
5796
|
-
| Param | Type |
|
|
5797
|
-
| --- | --- |
|
|
5798
|
-
| [wallet_response_code] | <code>string</code> |
|
|
5799
|
-
| [wallet_session_id] | <code>string</code> |
|
|
5800
|
-
| [payment_source] | <code>object</code> |
|
|
5801
|
-
| [payment_source.wallet_payment_method_id] | <code>string</code> |
|
|
5802
|
-
| [payment_source.card_number_last4] | <code>string</code> |
|
|
5803
|
-
| [payment_source.card_scheme] | <code>string</code> |
|
|
5804
|
-
| [wallet_loyalty_account] | <code>object</code> |
|
|
5805
|
-
| [wallet_loyalty_account.id] | <code>string</code> |
|
|
5806
|
-
| [wallet_loyalty_account.barcode] | <code>string</code> |
|
|
5807
|
-
| [shipping] | <code>object</code> |
|
|
5808
|
-
| [shipping.address_line1] | <code>string</code> |
|
|
5809
|
-
| [shipping.address_line2] | <code>string</code> |
|
|
5810
|
-
| [shipping.address_postcode] | <code>string</code> |
|
|
5811
|
-
| [shipping.address_city] | <code>string</code> |
|
|
5812
|
-
| [shipping.address_state] | <code>string</code> |
|
|
5813
|
-
| [shipping.address_country] | <code>string</code> |
|
|
5814
|
-
| [shipping.address_company] | <code>string</code> |
|
|
5815
|
-
| [shipping.post_office_box_number] | <code>string</code> |
|
|
5816
|
-
| [shipping.wallet_address_id] | <code>string</code> |
|
|
5817
|
-
| [shipping.wallet_address_name] | <code>string</code> |
|
|
5818
|
-
| [shipping.wallet_address_created_timestamp] | <code>string</code> |
|
|
5819
|
-
| [shipping.wallet_address_updated_timestamp] | <code>string</code> |
|
|
5820
|
-
|
|
5821
|
-
<a name="IWalletOnClick" id="IWalletOnClick" href="#IWalletOnClick"> </a>
|
|
5822
|
-
|
|
5823
|
-
## IWalletOnClick
|
|
5824
|
-
Interface of data from a wallet onClick event.
|
|
5825
|
-
|
|
5826
|
-
**Kind**: global interface
|
|
5827
|
-
|
|
5828
|
-
| Param | Description |
|
|
5829
|
-
| --- | --- |
|
|
5830
|
-
| attachResult | Method to be called that attaches a result to the wallet onClick operation. When handler is synchronous, this method is optionally called with a boolean flag indicating validation result. When handler executes asynchronous operations, this method must be called with the Promise to have the wallet process wait for its completion or rejection. |
|
|
5831
|
-
|
|
5832
|
-
<a name="IWalletUnavailable" id="IWalletUnavailable" href="#IWalletUnavailable"> </a>
|
|
5833
|
-
|
|
5834
|
-
## IWalletUnavailable
|
|
5835
|
-
Interface of data from an unavailable event.
|
|
5836
|
-
|
|
5837
|
-
**Kind**: global interface
|
|
5838
|
-
|
|
5839
|
-
| Param | Type | Description |
|
|
5840
|
-
| --- | --- | --- |
|
|
5841
|
-
| [wallet] | <code>string</code> | For gateways with more than one wallet button available (e.g: MPGS with ApplePay and GooglePay). Possible values for wallet are 'apple' or 'google'. |
|
|
5842
|
-
|
|
5843
|
-
<a name="IWalletUpdateData" id="IWalletUpdateData" href="#IWalletUpdateData"> </a>
|
|
5844
|
-
|
|
5845
|
-
## IWalletUpdateData
|
|
5846
|
-
Interface of data for wallet button `update` call.
|
|
5847
|
-
|
|
5848
|
-
**Kind**: global interface
|
|
5849
|
-
|
|
5850
|
-
| Param | Type |
|
|
5851
|
-
| --- | --- |
|
|
5852
|
-
| success | <code>boolean</code> |
|
|
5853
|
-
|
|
5854
5713
|
<a name="IWalletMeta" id="IWalletMeta" href="#IWalletMeta"> </a>
|
|
5855
5714
|
|
|
5856
5715
|
## IWalletMeta : <code>object</code>
|
|
@@ -5935,19 +5794,14 @@ Class WalletButtons to work with different E-Wallets within html (currently supp
|
|
|
5935
5794
|
* [.load()](#WalletButtons+load)
|
|
5936
5795
|
* [.update()](#WalletButtons+update)
|
|
5937
5796
|
* [.setEnv(env, [alias])](#WalletButtons+setEnv)
|
|
5938
|
-
* [.enable()](#WalletButtons+enable)
|
|
5939
|
-
* [.disable()](#WalletButtons+disable)
|
|
5940
5797
|
* [.close()](#WalletButtons+close)
|
|
5941
|
-
* [.on(eventName, [cb])](#WalletButtons+on) ⇒
|
|
5798
|
+
* [.on(eventName, [cb])](#WalletButtons+on) ⇒ <code>Promise.<IEventData></code> \| <code>void</code>
|
|
5942
5799
|
* [.onUnavailable([handler])](#WalletButtons+onUnavailable)
|
|
5943
5800
|
* [.onUpdate([handler])](#WalletButtons+onUpdate)
|
|
5944
5801
|
* [.onPaymentSuccessful([handler])](#WalletButtons+onPaymentSuccessful)
|
|
5945
5802
|
* [.onPaymentInReview([handler])](#WalletButtons+onPaymentInReview)
|
|
5946
5803
|
* [.onPaymentError([handler])](#WalletButtons+onPaymentError)
|
|
5947
5804
|
* [.onAuthTokensChanged([handler])](#WalletButtons+onAuthTokensChanged)
|
|
5948
|
-
* [.onClick(handler)](#WalletButtons+onClick)
|
|
5949
|
-
* [.onCheckoutOpen(handler)](#WalletButtons+onCheckoutOpen)
|
|
5950
|
-
* [.onCheckoutClose(handler)](#WalletButtons+onCheckoutClose)
|
|
5951
5805
|
|
|
5952
5806
|
<a name="new_WalletButtons_new" id="new_WalletButtons_new" href="#new_WalletButtons_new"> </a>
|
|
5953
5807
|
|
|
@@ -6058,26 +5912,6 @@ Bear in mind that you must set an environment before calling `button.load()`.
|
|
|
6058
5912
|
```js
|
|
6059
5913
|
button.setEnv('production', 'paydock.com');
|
|
6060
5914
|
```
|
|
6061
|
-
<a name="WalletButtons+enable" id="WalletButtons+enable" href="#WalletButtons+enable"> </a>
|
|
6062
|
-
|
|
6063
|
-
### walletButtons.enable()
|
|
6064
|
-
Current method can enable the payment button. This method is only supported for Flypay V2.
|
|
6065
|
-
|
|
6066
|
-
**Kind**: instance method of [<code>WalletButtons</code>](#WalletButtons)
|
|
6067
|
-
**Example**
|
|
6068
|
-
```js
|
|
6069
|
-
button.enable();
|
|
6070
|
-
```
|
|
6071
|
-
<a name="WalletButtons+disable" id="WalletButtons+disable" href="#WalletButtons+disable"> </a>
|
|
6072
|
-
|
|
6073
|
-
### walletButtons.disable()
|
|
6074
|
-
Current method can disable the payment button. This method is only supported for Flypay V2.
|
|
6075
|
-
|
|
6076
|
-
**Kind**: instance method of [<code>WalletButtons</code>](#WalletButtons)
|
|
6077
|
-
**Example**
|
|
6078
|
-
```js
|
|
6079
|
-
button.disable('production', 'paydock.com');
|
|
6080
|
-
```
|
|
6081
5915
|
<a name="WalletButtons+close" id="WalletButtons+close" href="#WalletButtons+close"> </a>
|
|
6082
5916
|
|
|
6083
5917
|
### walletButtons.close()
|
|
@@ -6090,7 +5924,7 @@ button.close();
|
|
|
6090
5924
|
```
|
|
6091
5925
|
<a name="WalletButtons+on" id="WalletButtons+on" href="#WalletButtons+on"> </a>
|
|
6092
5926
|
|
|
6093
|
-
### walletButtons.on(eventName, [cb]) ⇒
|
|
5927
|
+
### walletButtons.on(eventName, [cb]) ⇒ <code>Promise.<IEventData></code> \| <code>void</code>
|
|
6094
5928
|
Listen to events of button. `unavailable` returns no data, `paymentSuccessful` returns IWalletPaymentSuccessful
|
|
6095
5929
|
for Stripe or full response for Flypay, and `paymentError` an error.
|
|
6096
5930
|
|
|
@@ -6253,63 +6087,6 @@ button.onAuthTokensChanged().then((eventData) => {
|
|
|
6253
6087
|
console.log('Authentication tokens changed:', eventData);
|
|
6254
6088
|
});
|
|
6255
6089
|
```
|
|
6256
|
-
<a name="WalletButtons+onClick" id="WalletButtons+onClick" href="#WalletButtons+onClick"> </a>
|
|
6257
|
-
|
|
6258
|
-
### walletButtons.onClick(handler)
|
|
6259
|
-
Registers a callback function to be invoked when the wallet button gets clicked.
|
|
6260
|
-
There are two operational modes supported, Synchronous and Asynchronous.
|
|
6261
|
-
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.
|
|
6262
|
-
When synchronous operations occur on the callback handler, attaching a boolean result via `attachResult` is optional to control the execution flow.
|
|
6263
|
-
Note this is supported for Paypal, GooglePay and ApplePay wallet buttons at the moment.
|
|
6264
|
-
|
|
6265
|
-
**Kind**: instance method of [<code>WalletButtons</code>](#WalletButtons)
|
|
6266
|
-
|
|
6267
|
-
| Param | Type | Description |
|
|
6268
|
-
| --- | --- | --- |
|
|
6269
|
-
| handler | <code>listener</code> | Function to be called when the wallet button is clicked. |
|
|
6270
|
-
|
|
6271
|
-
**Example**
|
|
6272
|
-
```js
|
|
6273
|
-
button.onClick((data) => {
|
|
6274
|
-
performValidationLogic();
|
|
6275
|
-
});
|
|
6276
|
-
```
|
|
6277
|
-
<a name="WalletButtons+onCheckoutOpen" id="WalletButtons+onCheckoutOpen" href="#WalletButtons+onCheckoutOpen"> </a>
|
|
6278
|
-
|
|
6279
|
-
### walletButtons.onCheckoutOpen(handler)
|
|
6280
|
-
Registers a callback function to be invoked when the wallet checkout opens.
|
|
6281
|
-
Note this is supported for FlypayV2 wallet button at the moment.
|
|
6282
|
-
|
|
6283
|
-
**Kind**: instance method of [<code>WalletButtons</code>](#WalletButtons)
|
|
6284
|
-
|
|
6285
|
-
| Param | Type | Description |
|
|
6286
|
-
| --- | --- | --- |
|
|
6287
|
-
| handler | <code>listener</code> | Function to be called when the wallet checkout opens. |
|
|
6288
|
-
|
|
6289
|
-
**Example**
|
|
6290
|
-
```js
|
|
6291
|
-
button.onCheckoutOpen((data) => {
|
|
6292
|
-
console.log('Checkout opens');
|
|
6293
|
-
});
|
|
6294
|
-
```
|
|
6295
|
-
<a name="WalletButtons+onCheckoutClose" id="WalletButtons+onCheckoutClose" href="#WalletButtons+onCheckoutClose"> </a>
|
|
6296
|
-
|
|
6297
|
-
### walletButtons.onCheckoutClose(handler)
|
|
6298
|
-
Registers a callback function to be invoked when the wallet checkout closes.
|
|
6299
|
-
Note this is supported for FlypayV2 wallet button at the moment.
|
|
6300
|
-
|
|
6301
|
-
**Kind**: instance method of [<code>WalletButtons</code>](#WalletButtons)
|
|
6302
|
-
|
|
6303
|
-
| Param | Type | Description |
|
|
6304
|
-
| --- | --- | --- |
|
|
6305
|
-
| handler | <code>listener</code> | Function to be called when the wallet checkout closes. |
|
|
6306
|
-
|
|
6307
|
-
**Example**
|
|
6308
|
-
```js
|
|
6309
|
-
button.onCheckoutClose(() => {
|
|
6310
|
-
console.log('Wallet checkout closes');
|
|
6311
|
-
});
|
|
6312
|
-
```
|
|
6313
6090
|
<a name="EVENT" id="EVENT" href="#EVENT"> </a>
|
|
6314
6091
|
|
|
6315
6092
|
## EVENT : <code>object</code>
|
|
@@ -6323,32 +6100,27 @@ List of available event's name in the wallet button lifecycle
|
|
|
6323
6100
|
| UPDATE | <code>string</code> | <code>"update"</code> |
|
|
6324
6101
|
| PAYMENT_SUCCESSFUL | <code>string</code> | <code>"paymentSuccessful"</code> |
|
|
6325
6102
|
| PAYMENT_ERROR | <code>string</code> | <code>"paymentError"</code> |
|
|
6326
|
-
| ON_CLICK | <code>string</code> | <code>"onClick"</code> |
|
|
6327
6103
|
|
|
6328
6104
|
|
|
6329
6105
|
## Secure Remote Commerce
|
|
6330
6106
|
You can find description of all methods and parameters [here](https://www.npmjs.com/package/@paydock/client-sdk#SRC).
|
|
6331
6107
|
|
|
6332
|
-
This widget provides you with the ability to easily integrate with
|
|
6108
|
+
This widget provides you with the ability to easily integrate with Mastercard SRC.
|
|
6333
6109
|
|
|
6334
6110
|
## SRC simple example
|
|
6335
6111
|
|
|
6336
6112
|
### Container
|
|
6113
|
+
To integrate the SRC checkout iFrame you first need to create a container within your HTML code. This container will serve as the placeholder for the iFrame.
|
|
6337
6114
|
|
|
6338
6115
|
```html
|
|
6339
|
-
<div id="checkoutButton"></div>
|
|
6340
6116
|
<div id="checkoutIframe"></div>
|
|
6341
6117
|
```
|
|
6342
6118
|
|
|
6343
|
-
You must create a container for the initial checkout button, and a different one for the checkout iFrame. Inside the first tag the button will be initialized, and inside the second one the iFrame will be loaded once the button is clicked.
|
|
6344
|
-
|
|
6345
|
-
|
|
6346
6119
|
### Initialization
|
|
6347
6120
|
```javascript
|
|
6348
|
-
var src = new paydock.
|
|
6349
|
-
"#checkoutButton",
|
|
6121
|
+
var src = new paydock.MastercardSRCClickToPay(
|
|
6350
6122
|
"#checkoutIframe",
|
|
6351
|
-
"
|
|
6123
|
+
"service_id",
|
|
6352
6124
|
"paydock_public_key_or_access_token",
|
|
6353
6125
|
{}, // meta
|
|
6354
6126
|
);
|
|
@@ -6358,19 +6130,18 @@ src.load();
|
|
|
6358
6130
|
```javascript--es2015
|
|
6359
6131
|
// ES2015 | TypeScript
|
|
6360
6132
|
|
|
6361
|
-
import {
|
|
6133
|
+
import { MastercardSRCClickToPay } from '@paydock/client-sdk';
|
|
6362
6134
|
|
|
6363
|
-
var src = new
|
|
6364
|
-
"#checkoutButton",
|
|
6135
|
+
var src = new MastercardSRCClickToPay(
|
|
6365
6136
|
"#checkoutIframe",
|
|
6366
|
-
"
|
|
6137
|
+
"service_id",
|
|
6367
6138
|
"paydock_public_key_or_access_token",
|
|
6368
6139
|
{}, // meta
|
|
6369
6140
|
);
|
|
6370
6141
|
src.load();
|
|
6371
6142
|
```
|
|
6372
6143
|
|
|
6373
|
-
*NOTE:* it's highly recommended to use a Paydock Access Token instead of the public key for security reasons. When creating it, you will need to enable the `Secure Remote Commerce` and add a
|
|
6144
|
+
*NOTE:* it's highly recommended to use a Paydock Access Token instead of the public key for security reasons in production environments. When creating it, you will need to enable the `Secure Remote Commerce` and add a whitelist for the domain of your checkout screen.
|
|
6374
6145
|
|
|
6375
6146
|
### Full example
|
|
6376
6147
|
|
|
@@ -6383,14 +6154,12 @@ src.load();
|
|
|
6383
6154
|
<style>iframe {border: 0;width: 40%;height: 300px;}</style>
|
|
6384
6155
|
</head>
|
|
6385
6156
|
<body>
|
|
6386
|
-
<div id="checkoutButton"></div>
|
|
6387
6157
|
<div id="checkoutIframe"></div>
|
|
6388
6158
|
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
6389
6159
|
<script>
|
|
6390
|
-
var src = new paydock.
|
|
6391
|
-
"#checkoutButton",
|
|
6160
|
+
var src = new paydock.MastercardSRCClickToPay(
|
|
6392
6161
|
"#checkoutIframe",
|
|
6393
|
-
"
|
|
6162
|
+
"service_id",
|
|
6394
6163
|
"paydock_public_key_or_access_token",
|
|
6395
6164
|
{},
|
|
6396
6165
|
);
|
|
@@ -6406,25 +6175,12 @@ src.load();
|
|
|
6406
6175
|
### Settings
|
|
6407
6176
|
|
|
6408
6177
|
```javascript
|
|
6409
|
-
|
|
6410
|
-
src.setEnv('sandbox'); // set enviroment
|
|
6411
|
-
|
|
6412
|
-
src.hideButton(); // hide button
|
|
6413
|
-
|
|
6414
|
-
src.showButton(); // show button
|
|
6178
|
+
src.setEnv('sandbox'); // set environment
|
|
6415
6179
|
|
|
6416
6180
|
src.hideCheckout(); // hide checkout iframe
|
|
6417
6181
|
|
|
6418
6182
|
src.showCheckout(); // show checkout iframe
|
|
6419
6183
|
|
|
6420
|
-
src.on('checkoutButtonLoaded', () => {
|
|
6421
|
-
console.log("Button loaded");
|
|
6422
|
-
});
|
|
6423
|
-
|
|
6424
|
-
src.on('checkoutButtonClicked', () => {
|
|
6425
|
-
console.log("Button clicked");
|
|
6426
|
-
});
|
|
6427
|
-
|
|
6428
6184
|
src.on('iframeLoaded', () => {
|
|
6429
6185
|
console.log("Initial iframe loaded");
|
|
6430
6186
|
});
|
|
@@ -6455,18 +6211,20 @@ Here you can see how you can use this methods to customize your checkout experie
|
|
|
6455
6211
|
<style>iframe {border: 0;width: 40%;height: 450px;}</style>
|
|
6456
6212
|
</head>
|
|
6457
6213
|
<body>
|
|
6458
|
-
<div id="checkoutButton"></div>
|
|
6459
6214
|
<div id="checkoutIframe"></div>
|
|
6460
6215
|
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
6461
6216
|
<script>
|
|
6462
|
-
var src = new paydock.
|
|
6463
|
-
"#checkoutButton",
|
|
6217
|
+
var src = new paydock.MastercardSRCClickToPay(
|
|
6464
6218
|
"#checkoutIframe",
|
|
6465
|
-
"
|
|
6219
|
+
"service_id",
|
|
6466
6220
|
"paydock_public_key_or_access_token",
|
|
6467
6221
|
{},
|
|
6468
6222
|
);
|
|
6469
6223
|
|
|
6224
|
+
src.on('iframeLoaded', () => {
|
|
6225
|
+
console.log("Initial iframe loaded");
|
|
6226
|
+
});
|
|
6227
|
+
|
|
6470
6228
|
src.on('checkoutReady', () => {
|
|
6471
6229
|
console.log("Checkout ready to be used");
|
|
6472
6230
|
});
|
|
@@ -6474,34 +6232,37 @@ Here you can see how you can use this methods to customize your checkout experie
|
|
|
6474
6232
|
src.on('checkoutCompleted', (token) => {
|
|
6475
6233
|
console.log(token);
|
|
6476
6234
|
});
|
|
6235
|
+
|
|
6236
|
+
src.on('checkoutError', (error) => {
|
|
6237
|
+
console.log(error);
|
|
6238
|
+
});
|
|
6239
|
+
|
|
6477
6240
|
src.load();
|
|
6478
6241
|
</script>
|
|
6479
6242
|
</body>
|
|
6480
6243
|
</html>
|
|
6481
6244
|
```
|
|
6482
6245
|
|
|
6483
|
-
## Customization options for address fields
|
|
6484
|
-
### Shipping address:
|
|
6246
|
+
## Customization options for billing address fields
|
|
6485
6247
|
|
|
6486
|
-
To customize
|
|
6248
|
+
To customize billing address experience we use a flag that manages how MastercardSRC requires or not billing address to the customer. Options are NONE (default option), POSTAL_COUNTRY or FULL.
|
|
6487
6249
|
|
|
6488
6250
|
```
|
|
6489
|
-
var src = new paydock.
|
|
6490
|
-
"#checkoutButton",
|
|
6251
|
+
var src = new paydock.MastercardSRCClickToPay(
|
|
6491
6252
|
"#checkoutIframe",
|
|
6492
|
-
"
|
|
6253
|
+
"service_id",
|
|
6493
6254
|
"paydock_public_key_or_access_token",
|
|
6494
6255
|
{
|
|
6495
6256
|
"dpa_transaction_options": {
|
|
6496
|
-
"
|
|
6257
|
+
"dpa_billing_preference": "FULL"
|
|
6497
6258
|
}
|
|
6498
6259
|
},
|
|
6499
6260
|
);
|
|
6500
6261
|
```
|
|
6501
6262
|
|
|
6502
|
-
With this the
|
|
6263
|
+
With this the SRC checkout will require the billing address from consumer and be returned as part of the checkout data. These information will be stored and leveraged in the Paydock charge as well.
|
|
6503
6264
|
|
|
6504
|
-
Another option is at time of creating the charge. Say that you have a different way of collecting the
|
|
6265
|
+
Another option is to provide it at the time of creating the charge. Say that you have a different way of collecting the billing address (outside SRC checkout), you can then disable the shipping address on our SRC widget and send it when creating the charge after getting the One Time Token out of the SRC widget, alongside other details that may have been collected outside the SRC checkout as the shipping address.
|
|
6505
6266
|
|
|
6506
6267
|
```
|
|
6507
6268
|
POST v1/charges
|
|
@@ -6509,10 +6270,16 @@ POST v1/charges
|
|
|
6509
6270
|
{
|
|
6510
6271
|
"amount": "10.00",
|
|
6511
6272
|
"currency": "AUD",
|
|
6512
|
-
"token": "
|
|
6273
|
+
"token": "one_time_token",
|
|
6513
6274
|
"customer": {
|
|
6514
6275
|
"payment_source": {
|
|
6515
|
-
"gateway_id": "gateway_id"
|
|
6276
|
+
"gateway_id": "gateway_id",
|
|
6277
|
+
"address_line1": "address_line1",
|
|
6278
|
+
"address_line2": "address_line2",
|
|
6279
|
+
"address_city": "address_city",
|
|
6280
|
+
"address_postcode": "address_postcode",
|
|
6281
|
+
"address_state": "address_state",
|
|
6282
|
+
"address_country": "address_country"
|
|
6516
6283
|
}
|
|
6517
6284
|
},
|
|
6518
6285
|
"shipping": {
|
|
@@ -6527,201 +6294,262 @@ POST v1/charges
|
|
|
6527
6294
|
}
|
|
6528
6295
|
```
|
|
6529
6296
|
|
|
6530
|
-
|
|
6297
|
+
## Customization options for accepted cards
|
|
6298
|
+
|
|
6299
|
+
To improve the experience in the use of the widget, it is allowed to send a flag `unaccepted_card_type` to block the usage of an specific card type. The available options are 'DEBIT' and 'CREDIT'.
|
|
6531
6300
|
|
|
6532
|
-
|
|
6301
|
+
### Example code
|
|
6533
6302
|
|
|
6534
6303
|
```
|
|
6535
|
-
var src = new paydock.
|
|
6536
|
-
"#checkoutButton",
|
|
6304
|
+
var src = new paydock.MastercardSRCClickToPay(
|
|
6537
6305
|
"#checkoutIframe",
|
|
6538
|
-
"
|
|
6539
|
-
"
|
|
6306
|
+
"service_id",
|
|
6307
|
+
"paydock_public_key",
|
|
6540
6308
|
{
|
|
6541
|
-
|
|
6542
|
-
"email": "test@email.com",
|
|
6543
|
-
"first_name": "Name",
|
|
6544
|
-
"last_name": "Surname",
|
|
6545
|
-
"phone": {
|
|
6546
|
-
"country_code": "1",
|
|
6547
|
-
"phone": "2124567890"
|
|
6548
|
-
},
|
|
6549
|
-
"payment_source": {
|
|
6550
|
-
"address_line1": "Line 1",
|
|
6551
|
-
"address_line2": "Line 2",
|
|
6552
|
-
"address_city": "Miami",
|
|
6553
|
-
"address_postcode": "33126",
|
|
6554
|
-
"address_state": "FL",
|
|
6555
|
-
"address_country": "US"
|
|
6556
|
-
}
|
|
6557
|
-
}
|
|
6309
|
+
unaccepted_card_type: 'DEBIT'
|
|
6558
6310
|
},
|
|
6559
6311
|
);
|
|
6312
|
+
|
|
6560
6313
|
```
|
|
6561
6314
|
|
|
6562
|
-
## Personalization
|
|
6315
|
+
## Styling Personalization
|
|
6563
6316
|
|
|
6564
|
-
To improve the experience in the use of the widget, it is allowed to send props that customize the UI.
|
|
6317
|
+
To improve the experience in the use of the widget, it is allowed to send props that customize the UI look and feel.
|
|
6565
6318
|
|
|
6566
6319
|
### Example code
|
|
6567
6320
|
|
|
6568
6321
|
```
|
|
6569
|
-
var src = new paydock.
|
|
6570
|
-
"#checkoutButton",
|
|
6322
|
+
var src = new paydock.MastercardSRCClickToPay(
|
|
6571
6323
|
"#checkoutIframe",
|
|
6572
|
-
"
|
|
6324
|
+
"service_id",
|
|
6573
6325
|
"paydock_public_key",
|
|
6326
|
+
{},
|
|
6574
6327
|
);
|
|
6575
6328
|
|
|
6576
|
-
|
|
6577
|
-
|
|
6329
|
+
src.setStyles({
|
|
6330
|
+
enable_src_popup: true,
|
|
6331
|
+
primary_button_color: 'red',
|
|
6332
|
+
secondary_button_color: 'red',
|
|
6333
|
+
primary_button_text_color: 'red',
|
|
6334
|
+
secondary_button_text_color: 'red',
|
|
6335
|
+
font_family: 'Arial',
|
|
6336
|
+
});
|
|
6578
6337
|
```
|
|
6579
|
-
## Event and Values
|
|
6580
|
-
|
|
6581
|
-
| Event Value | Type | Description |
|
|
6582
|
-
| ------------------- | ------------------- | -------------------------------------------------------------- |
|
|
6583
|
-
| primary_color | <code>string</code> | HEX color for the principal buttons, example : #32a852 |
|
|
6584
|
-
| button_text_color | <code>string</code> | HEX color for the text of the buttons, example : #32a852|
|
|
6585
|
-
| font_family | <code>string</code> | Look more [mozilla.org/color](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family)|
|
|
6586
|
-
| card_schemes | <code>[string] - array of string</code> | Possible values "visa", "mastercard", "amex" and "discover" - Default show all logos
|
|
6587
6338
|
|
|
6588
6339
|
## Classes
|
|
6589
6340
|
|
|
6590
6341
|
<dl>
|
|
6591
|
-
<dt><a href="#
|
|
6592
|
-
<dd><p>Class
|
|
6342
|
+
<dt><a href="#MastercardSRCClickToPay">MastercardSRCClickToPay</a> ⇐ <code>SRC</code></dt>
|
|
6343
|
+
<dd><p>Class MastercardSRCClickToPay include methods for interacting with the MastercardSRC checkout and Manual Card option</p>
|
|
6593
6344
|
</dd>
|
|
6594
6345
|
</dl>
|
|
6595
6346
|
|
|
6596
6347
|
## Interfaces
|
|
6597
6348
|
|
|
6598
6349
|
<dl>
|
|
6599
|
-
<dt><a href="#
|
|
6600
|
-
<dd><p>Interface of data used for the
|
|
6350
|
+
<dt><a href="#IMastercardSRCMeta">IMastercardSRCMeta</a> : <code>object</code></dt>
|
|
6351
|
+
<dd><p>Interface of data used for the Mastercard Checkout. For further information refer to <a href="https://developer.mastercard.com/unified-checkout-solutions/documentation/sdk-reference/init">the documentation</a>.</p>
|
|
6352
|
+
</dd>
|
|
6353
|
+
<dt><a href="#EventData">EventData</a> : <code>object</code></dt>
|
|
6354
|
+
<dd><p>Interface for data returned in callbacks</p>
|
|
6355
|
+
</dd>
|
|
6356
|
+
<dt><a href="#EventDataCheckoutCompletedData">EventDataCheckoutCompletedData</a> : <code>object</code></dt>
|
|
6357
|
+
<dd><p>Event data returned for checkoutCompleted callback, holding the One Time Token and the flow type completed.
|
|
6358
|
+
When the flow type is src, masked checkoutData available is also returned</p>
|
|
6359
|
+
</dd>
|
|
6360
|
+
<dt><a href="#IStyles">IStyles</a> : <code>object</code></dt>
|
|
6361
|
+
<dd><p>Interface for style configs inyected to the SRC checkout</p>
|
|
6601
6362
|
</dd>
|
|
6602
6363
|
</dl>
|
|
6603
6364
|
|
|
6604
|
-
<a name="
|
|
6365
|
+
<a name="IMastercardSRCMeta" id="IMastercardSRCMeta" href="#IMastercardSRCMeta"> </a>
|
|
6605
6366
|
|
|
6606
|
-
##
|
|
6607
|
-
Interface of data used for the
|
|
6367
|
+
## IMastercardSRCMeta : <code>object</code>
|
|
6368
|
+
Interface of data used for the Mastercard Checkout. For further information refer to [the documentation](https://developer.mastercard.com/unified-checkout-solutions/documentation/sdk-reference/init).
|
|
6608
6369
|
|
|
6609
6370
|
**Kind**: global interface
|
|
6610
6371
|
|
|
6611
6372
|
| Param | Type | Description |
|
|
6612
6373
|
| --- | --- | --- |
|
|
6613
|
-
| [
|
|
6374
|
+
| [disable_summary_screen] | <code>boolean</code> | Boolean flag that controls if a final summary screen is presented in the checkout flow. |
|
|
6614
6375
|
| [dpa_data] | <code>object</code> | Object where the DPA creation data is stored. |
|
|
6615
|
-
| [dpa_data.dpa_presentation_name] | <code>string</code> | Name in which the DPA is presented
|
|
6376
|
+
| [dpa_data.dpa_presentation_name] | <code>string</code> | Name in which the DPA is presented. |
|
|
6616
6377
|
| [dpa_data.dpa_uri] | <code>string</code> | Used for indicating the DPA URI. |
|
|
6617
|
-
| [
|
|
6378
|
+
| [dpa_data.dpa_address] | <code>string</code> | Address associated with the DPA. |
|
|
6379
|
+
| [dpa_data.dpa_email_address] | <code>string</code> | Email address for DPA communication. |
|
|
6380
|
+
| [dpa_data.dpa_phone_number] | <code>object</code> | Phone number structure for DPA communication. |
|
|
6381
|
+
| [dpa_data.dpa_phone_number.country_code] | <code>string</code> | The country code of the phone number. |
|
|
6382
|
+
| [dpa_data.dpa_phone_number.phone_number] | <code>string</code> | The phone number part of the phone number. |
|
|
6383
|
+
| [dpa_data.dpa_logo_uri] | <code>string</code> | URI for the DPA logo. |
|
|
6384
|
+
| [dpa_data.dpa_supported_email_address] | <code>string</code> | Supported email address for DPA support. |
|
|
6385
|
+
| [dpa_data.dpa_supported_phone_number] | <code>object</code> | Supported phone number for DPA support. |
|
|
6386
|
+
| [dpa_data.dpa_supported_phone_number.country_code] | <code>string</code> | The country code of the phone number. |
|
|
6387
|
+
| [dpa_data.dpa_supported_phone_number.phone_number] | <code>string</code> | The phone number part of the phone number. |
|
|
6388
|
+
| [dpa_data.dpa_support_uri] | <code>string</code> | URI for DPA support. |
|
|
6389
|
+
| [dpa_data.application_type] | <code>string</code> | Application type, either 'WEB_BROWSER' or 'MOBILE_APP'. |
|
|
6390
|
+
| [co_brand_names] | <code>Array.<string></code> | List of co-brand names associated with the SRC experience. |
|
|
6391
|
+
| [checkout_experience] | <code>string</code> | Checkout experience type, either 'WITHIN_CHECKOUT' or 'PAYMENT_SETTINGS'. |
|
|
6392
|
+
| [services] | <code>string</code> | Services offered, such as 'INLINE_CHECKOUT' or 'INLINE_INSTALLMENTS'. |
|
|
6393
|
+
| [dpa_transaction_options] | <code>object</code> | Object that stores options for creating a transaction with DPA. |
|
|
6618
6394
|
| [dpa_transaction_options.dpa_locale] | <code>string</code> | DPA’s preferred locale, example en_US. |
|
|
6619
|
-
| [dpa_transaction_options.dpa_accepted_billing_countries] | <code>Array
|
|
6620
|
-
| [dpa_transaction_options.
|
|
6621
|
-
| [dpa_transaction_options.
|
|
6622
|
-
| [dpa_transaction_options.
|
|
6623
|
-
| [dpa_transaction_options.
|
|
6624
|
-
| [dpa_transaction_options.
|
|
6625
|
-
| [dpa_transaction_options.
|
|
6626
|
-
| [dpa_transaction_options.
|
|
6627
|
-
| [dpa_transaction_options.
|
|
6628
|
-
| [dpa_transaction_options.
|
|
6629
|
-
| [dpa_transaction_options.
|
|
6630
|
-
| [dpa_transaction_options.
|
|
6631
|
-
| [dpa_transaction_options.
|
|
6632
|
-
| [dpa_transaction_options.
|
|
6633
|
-
| [dpa_transaction_options.
|
|
6634
|
-
| [dpa_transaction_options.
|
|
6635
|
-
| [dpa_transaction_options.transaction_amount.transaction_amount] | <code>number</code> | Used to indicate the amount of the transaction. |
|
|
6636
|
-
| [dpa_transaction_options.transaction_amount.transaction_currency_code] | <code>string</code> | Used to indicate the currency code of the transaction. 3 letter ISO code format. |
|
|
6637
|
-
| [dpa_transaction_options.merchant_order_id] | <code>string</code> | Used to indicate the merchants order Id. |
|
|
6638
|
-
| [dpa_transaction_options.merchant_category_code] | <code>string</code> | Used to indicate the merchants category code. |
|
|
6639
|
-
| [dpa_transaction_options.merchant_country_code] | <code>string</code> | Used to indicate the merchants country code. 2 letter ISO code format. |
|
|
6395
|
+
| [dpa_transaction_options.dpa_accepted_billing_countries] | <code>Array.<string></code> | List of accepted billing countries for DPA in ISO 3166-1 alpha-2 format. |
|
|
6396
|
+
| [dpa_transaction_options.dpa_billing_preference] | <code>string</code> | Billing preferences for DPA, options are 'FULL', 'POSTAL_COUNTRY', 'NONE'. |
|
|
6397
|
+
| [dpa_transaction_options.payment_options] | <code>Array.<object></code> | Payment options included in the transaction. |
|
|
6398
|
+
| [dpa_transaction_options.payment_options.dynamic_data_type] | <code>string</code> | Dynamic data types. |
|
|
6399
|
+
| [dpa_transaction_options.order_type] | <code>string</code> | Type of the order, options are 'SPLIT_SHIPMENT', 'PREFERRED_CARD'. |
|
|
6400
|
+
| [dpa_transaction_options.three_ds_preference] | <code>string</code> | Preference for 3DS usage in the transaction. |
|
|
6401
|
+
| [dpa_transaction_options.confirm_payment] | <code>boolean</code> | Indicates if payment confirmation is required. |
|
|
6402
|
+
| [dpa_transaction_options.consumer_name_requested] | <code>boolean</code> | Indicates if consumer name is requested. |
|
|
6403
|
+
| [dpa_transaction_options.consumer_email_address_requested] | <code>boolean</code> | Indicates if consumer email address is requested. |
|
|
6404
|
+
| [dpa_transaction_options.consumer_phone_number_requested] | <code>boolean</code> | Indicates if consumer phone number is requested. |
|
|
6405
|
+
| [dpa_transaction_options.transaction_amount] | <code>object</code> | Details of the transaction amount. |
|
|
6406
|
+
| [dpa_transaction_options.transaction_amount.transaction_amount] | <code>number</code> | Amount of the transaction. |
|
|
6407
|
+
| [dpa_transaction_options.transaction_amount.transaction_currency_code] | <code>string</code> | Currency code of the transaction in 3 letter ISO code format. |
|
|
6408
|
+
| [dpa_transaction_options.merchant_order_id] | <code>string</code> | Merchant's order ID. |
|
|
6409
|
+
| [dpa_transaction_options.merchant_category_code] | <code>string</code> | Merchant's category code. |
|
|
6410
|
+
| [dpa_transaction_options.merchant_country_code] | <code>string</code> | Merchant's country code in ISO 3166-1 alpha-2 format. |
|
|
6640
6411
|
| [customer] | <code>object</code> | Object where the customer data is stored to prefill in the checkout. |
|
|
6641
6412
|
| [customer.email] | <code>string</code> | Customer email. |
|
|
6642
6413
|
| [customer.first_name] | <code>string</code> | Customer first name. |
|
|
6643
6414
|
| [customer.last_name] | <code>string</code> | Customer last name. |
|
|
6644
6415
|
| [customer.phone] | <code>object</code> | Object where the customer phone is stored. |
|
|
6645
|
-
| [customer.phone.country_code] | <code>string</code> | Customer phone country code (example "1" for US). |
|
|
6416
|
+
| [customer.phone.country_code] | <code>string</code> | Customer phone country code (example "1" for US). // TODO: Confirm if it can be removed! |
|
|
6646
6417
|
| [customer.phone.phone] | <code>string</code> | Customer phone number. |
|
|
6647
|
-
| [
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
| [customer.payment_source.address_country] | <code>string</code> | Customer billing address country code (example "US"). |
|
|
6418
|
+
| [unaccepted_card_type] | <code>string</code> | Used to block a specific card type. Options are 'CREDIT', 'DEBIT'. |
|
|
6419
|
+
|
|
6420
|
+
<a name="EventData" id="EventData" href="#EventData"> </a>
|
|
6421
|
+
|
|
6422
|
+
## EventData : <code>object</code>
|
|
6423
|
+
Interface for data returned in callbacks
|
|
6654
6424
|
|
|
6655
|
-
|
|
6425
|
+
**Kind**: global interface
|
|
6426
|
+
|
|
6427
|
+
| Param | Type | Description |
|
|
6428
|
+
| --- | --- | --- |
|
|
6429
|
+
| type | [<code>EVENT\_DATA\_TYPE</code>](#EVENT_DATA_TYPE) | Event type of type [EVENT_DATA_TYPE](#EVENT_DATA_TYPE) |
|
|
6430
|
+
| data | <code>string</code> \| [<code>EventDataCheckoutCompletedData</code>](#EventDataCheckoutCompletedData) | optional data returning a string for checkoutError event or [EventDataCheckoutCompletedData](#EventDataCheckoutCompletedData) for checkoutCompleted |
|
|
6431
|
+
|
|
6432
|
+
<a name="EventDataCheckoutCompletedData" id="EventDataCheckoutCompletedData" href="#EventDataCheckoutCompletedData"> </a>
|
|
6433
|
+
|
|
6434
|
+
## EventDataCheckoutCompletedData : <code>object</code>
|
|
6435
|
+
Event data returned for checkoutCompleted callback, holding the One Time Token and the flow type completed.
|
|
6436
|
+
When the flow type is src, masked checkoutData available is also returned
|
|
6437
|
+
|
|
6438
|
+
**Kind**: global interface
|
|
6439
|
+
|
|
6440
|
+
| Param | Type | Description |
|
|
6441
|
+
| --- | --- | --- |
|
|
6442
|
+
| type | <code>string</code> | type of the checkout, can be `src` or `manual`. |
|
|
6443
|
+
| token | <code>string</code> | one time token value. |
|
|
6444
|
+
| [checkoutData] | <code>object</code> | Optional checkout data related to the checkout information. Only available on src flow. |
|
|
6445
|
+
| [checkoutData.card_number_bin] | <code>string</code> | The BIN of the card used for the transaction. |
|
|
6446
|
+
| [checkoutData.card_number_last4] | <code>string</code> | The last four digits of the card number. |
|
|
6447
|
+
| [checkoutData.card_scheme] | <code>string</code> | The card scheme. Values: visa, mastercard, amex, diners, discover. |
|
|
6448
|
+
| [checkoutData.card_type] | <code>string</code> | The type of card. Values: credit, debit, prepaid, combo, flex. |
|
|
6449
|
+
| [checkoutData.address_line1] | <code>string</code> | Address line 1 for billing address. |
|
|
6450
|
+
| [checkoutData.address_line2] | <code>string</code> | Address line 2 for billing address. |
|
|
6451
|
+
| [checkoutData.address_line3] | <code>string</code> | Address line 3 for billing address. |
|
|
6452
|
+
| [checkoutData.address_city] | <code>string</code> | City for billing address. |
|
|
6453
|
+
| [checkoutData.address_postcode] | <code>string</code> | Postal code for billing address. |
|
|
6454
|
+
| [checkoutData.address_state] | <code>string</code> | State or province for billing address. |
|
|
6455
|
+
| [checkoutData.address_country] | <code>string</code> | Country for billing address. |
|
|
6456
|
+
| [checkoutData.shipping] | <code>object</code> | Optional shipping information. |
|
|
6457
|
+
| [checkoutData.shipping.address_line1] | <code>string</code> | Address line 1 for shipping address. |
|
|
6458
|
+
| [checkoutData.shipping.address_line2] | <code>string</code> | Address line 2 for shipping address. |
|
|
6459
|
+
| [checkoutData.shipping.address_line3] | <code>string</code> | Address line 3 for shipping address. |
|
|
6460
|
+
| [checkoutData.shipping.address_city] | <code>string</code> | City for shipping address. |
|
|
6461
|
+
| [checkoutData.shipping.address_postcode] | <code>string</code> | Postal code for shipping address. |
|
|
6462
|
+
| [checkoutData.shipping.address_state] | <code>string</code> | State or province for shipping address. |
|
|
6463
|
+
| [checkoutData.shipping.address_country] | <code>string</code> | Country for shipping address. |
|
|
6464
|
+
|
|
6465
|
+
<a name="IStyles" id="IStyles" href="#IStyles"> </a>
|
|
6466
|
+
|
|
6467
|
+
## IStyles : <code>object</code>
|
|
6468
|
+
Interface for style configs inyected to the SRC checkout
|
|
6469
|
+
|
|
6470
|
+
**Kind**: global interface
|
|
6656
6471
|
|
|
6657
|
-
|
|
6658
|
-
|
|
6472
|
+
| Param | Type | Description |
|
|
6473
|
+
| --- | --- | --- |
|
|
6474
|
+
| [primary_button_color] | <code>string</code> | Color Code for primary button. |
|
|
6475
|
+
| [primary_button_text_color] | <code>string</code> | Color Code for primary button text. |
|
|
6476
|
+
| [secondary_button_color] | <code>string</code> | Color Code for secondary button. |
|
|
6477
|
+
| [secondary_button_text_color] | <code>string</code> | Color Code for secondary button text. |
|
|
6478
|
+
| [font_family] | <code>string</code> | Font family to be used. |
|
|
6479
|
+
| [enable_src_popup] | <code>boolean</code> | Boolean flag to make the SRC checkout show in a popup window instead of embedded in iframe. |
|
|
6480
|
+
|
|
6481
|
+
<a name="MastercardSRCClickToPay" id="MastercardSRCClickToPay" href="#MastercardSRCClickToPay"> </a>
|
|
6482
|
+
|
|
6483
|
+
## MastercardSRCClickToPay ⇐ <code>SRC</code>
|
|
6484
|
+
Class MastercardSRCClickToPay include methods for interacting with the MastercardSRC checkout and Manual Card option
|
|
6659
6485
|
|
|
6660
6486
|
**Kind**: global class
|
|
6487
|
+
**Extends**: <code>SRC</code>
|
|
6661
6488
|
|
|
6662
|
-
* [
|
|
6663
|
-
* [new
|
|
6489
|
+
* [MastercardSRCClickToPay](#MastercardSRCClickToPay) ⇐ <code>SRC</code>
|
|
6490
|
+
* [new MastercardSRCClickToPay(iframe_selector, service_id, public_key_or_access_token, meta)](#new_MastercardSRCClickToPay_new)
|
|
6491
|
+
* [.load()](#MastercardSRCClickToPay+load)
|
|
6664
6492
|
* [.setStyles(fields)](#SRC+setStyles)
|
|
6665
|
-
* [.load()](#SRC+load)
|
|
6666
6493
|
* [.setEnv(env, [alias])](#SRC+setEnv)
|
|
6667
6494
|
* [.getEnv()](#SRC+getEnv)
|
|
6668
6495
|
* [.on(eventName, [cb])](#SRC+on) ⇒ <code>Promise.<any></code> \| <code>void</code>
|
|
6669
|
-
* [.hideButton([saveSize])](#SRC+hideButton)
|
|
6670
|
-
* [.showButton()](#SRC+showButton)
|
|
6671
6496
|
* [.hideCheckout([saveSize])](#SRC+hideCheckout)
|
|
6672
6497
|
* [.showCheckout()](#SRC+showCheckout)
|
|
6673
6498
|
* [.reload()](#SRC+reload)
|
|
6674
6499
|
* [.useAutoResize()](#SRC+useAutoResize)
|
|
6675
6500
|
|
|
6676
|
-
<a name="
|
|
6501
|
+
<a name="new_MastercardSRCClickToPay_new" id="new_MastercardSRCClickToPay_new" href="#new_MastercardSRCClickToPay_new"> </a>
|
|
6677
6502
|
|
|
6678
|
-
### new
|
|
6503
|
+
### new MastercardSRCClickToPay(iframe_selector, service_id, public_key_or_access_token, meta)
|
|
6679
6504
|
|
|
6680
6505
|
| Param | Type | Description |
|
|
6681
6506
|
| --- | --- | --- |
|
|
6682
|
-
| button_selector | <code>string</code> | Selector of html element. Container for SRC checkout button. |
|
|
6683
6507
|
| iframe_selector | <code>string</code> | Selector of html element. Container for SRC checkout iFrame. |
|
|
6684
6508
|
| service_id | <code>string</code> | Card Scheme Service ID |
|
|
6685
6509
|
| public_key_or_access_token | <code>string</code> | Paydock public key or Access Token |
|
|
6686
|
-
| meta | [<code>
|
|
6510
|
+
| meta | [<code>IMastercardSRCMeta</code>](#IMastercardSRCMeta) | Data that configures the SRC checkout |
|
|
6687
6511
|
|
|
6688
6512
|
**Example**
|
|
6689
6513
|
```js
|
|
6690
|
-
var
|
|
6514
|
+
var mastercardSRC = new MastercardSRCClickToPay('#checkoutIframe', 'service_id', 'public_key', {});
|
|
6691
6515
|
```
|
|
6516
|
+
<a name="MastercardSRCClickToPay+load" id="MastercardSRCClickToPay+load" href="#MastercardSRCClickToPay+load"> </a>
|
|
6517
|
+
|
|
6518
|
+
### mastercardSRCClickToPay.load()
|
|
6519
|
+
The final method after configuring the SRC to start the load process of SRC checkout
|
|
6520
|
+
|
|
6521
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
6692
6522
|
<a name="SRC+setStyles" id="SRC+setStyles" href="#SRC+setStyles"> </a>
|
|
6693
6523
|
|
|
6694
|
-
###
|
|
6524
|
+
### mastercardSRCClickToPay.setStyles(fields)
|
|
6695
6525
|
Object contain styles for widget - call before `.load()`.
|
|
6696
6526
|
|
|
6697
|
-
**Kind**: instance method of [<code>
|
|
6527
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
6528
|
+
**Overrides**: [<code>setStyles</code>](#SRC+setStyles)
|
|
6698
6529
|
|
|
6699
6530
|
| Param | Type | Description |
|
|
6700
6531
|
| --- | --- | --- |
|
|
6701
|
-
| fields | <code>IStyles</code> | name of styles which can be shown in widget [STYLE](STYLE) |
|
|
6532
|
+
| fields | [<code>IStyles</code>](#IStyles) | name of styles which can be shown in widget [STYLE](STYLE) |
|
|
6702
6533
|
|
|
6703
6534
|
**Example**
|
|
6704
6535
|
```js
|
|
6705
6536
|
widget.setStyles({
|
|
6706
|
-
|
|
6707
|
-
|
|
6708
|
-
|
|
6709
|
-
|
|
6710
|
-
|
|
6537
|
+
enable_src_popup: true
|
|
6538
|
+
primary_button_color: 'red',
|
|
6539
|
+
secondary_button_color: 'blue',
|
|
6540
|
+
primary_button_text_color: 'white',
|
|
6541
|
+
secondary_button_text_color: 'white',
|
|
6542
|
+
font_family: 'Arial',
|
|
6543
|
+
});
|
|
6711
6544
|
```
|
|
6712
|
-
<a name="SRC+load" id="SRC+load" href="#SRC+load"> </a>
|
|
6713
|
-
|
|
6714
|
-
### srC.load()
|
|
6715
|
-
The final method after configuring the SRC to start the load process of SRC checkout
|
|
6716
|
-
|
|
6717
|
-
**Kind**: instance method of [<code>SRC</code>](#SRC)
|
|
6718
6545
|
<a name="SRC+setEnv" id="SRC+setEnv" href="#SRC+setEnv"> </a>
|
|
6719
6546
|
|
|
6720
|
-
###
|
|
6547
|
+
### mastercardSRCClickToPay.setEnv(env, [alias])
|
|
6721
6548
|
Current method can change environment. By default environment = sandbox.
|
|
6722
6549
|
Also we can change domain alias for this environment. By default domain_alias = paydock.com
|
|
6723
6550
|
|
|
6724
|
-
**Kind**: instance method of [<code>
|
|
6551
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
6552
|
+
**Overrides**: [<code>setEnv</code>](#SRC+setEnv)
|
|
6725
6553
|
|
|
6726
6554
|
| Param | Type | Description |
|
|
6727
6555
|
| --- | --- | --- |
|
|
@@ -6734,25 +6562,27 @@ SRC.setEnv('production');
|
|
|
6734
6562
|
```
|
|
6735
6563
|
<a name="SRC+getEnv" id="SRC+getEnv" href="#SRC+getEnv"> </a>
|
|
6736
6564
|
|
|
6737
|
-
###
|
|
6565
|
+
### mastercardSRCClickToPay.getEnv()
|
|
6738
6566
|
Method to read the current environment
|
|
6739
6567
|
|
|
6740
|
-
**Kind**: instance method of [<code>
|
|
6568
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
6569
|
+
**Overrides**: [<code>getEnv</code>](#SRC+getEnv)
|
|
6741
6570
|
**Example**
|
|
6742
6571
|
```js
|
|
6743
6572
|
SRC.getEnv();
|
|
6744
6573
|
```
|
|
6745
6574
|
<a name="SRC+on" id="SRC+on" href="#SRC+on"> </a>
|
|
6746
6575
|
|
|
6747
|
-
###
|
|
6576
|
+
### mastercardSRCClickToPay.on(eventName, [cb]) ⇒ <code>Promise.<any></code> \| <code>void</code>
|
|
6748
6577
|
Listen to events of SRC
|
|
6749
6578
|
|
|
6750
|
-
**Kind**: instance method of [<code>
|
|
6579
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
6580
|
+
**Overrides**: [<code>on</code>](#SRC+on)
|
|
6751
6581
|
|
|
6752
6582
|
| Param | Type | Description |
|
|
6753
6583
|
| --- | --- | --- |
|
|
6754
6584
|
| eventName | <code>string</code> | Available event names [EVENT](#EVENT) |
|
|
6755
|
-
| [cb] | <code>listener</code> |
|
|
6585
|
+
| [cb] | <code>listener</code> | The callback to handle the event. When available, it will send back data of type [EventData](#EventData) |
|
|
6756
6586
|
|
|
6757
6587
|
**Example**
|
|
6758
6588
|
```js
|
|
@@ -6764,37 +6594,13 @@ SRC.on('checkoutCompleted').then(function (token) {
|
|
|
6764
6594
|
console.log(token);
|
|
6765
6595
|
});
|
|
6766
6596
|
```
|
|
6767
|
-
<a name="SRC+hideButton" id="SRC+hideButton" href="#SRC+hideButton"> </a>
|
|
6768
|
-
|
|
6769
|
-
### srC.hideButton([saveSize])
|
|
6770
|
-
Using this method you can hide button
|
|
6771
|
-
|
|
6772
|
-
**Kind**: instance method of [<code>SRC</code>](#SRC)
|
|
6773
|
-
|
|
6774
|
-
| Param | Type | Default | Description |
|
|
6775
|
-
| --- | --- | --- | --- |
|
|
6776
|
-
| [saveSize] | <code>boolean</code> | <code>false</code> | using this param you can save iframe's size (if applicable) |
|
|
6777
|
-
|
|
6778
|
-
**Example**
|
|
6779
|
-
```js
|
|
6780
|
-
SRC.hideButton();
|
|
6781
|
-
```
|
|
6782
|
-
<a name="SRC+showButton" id="SRC+showButton" href="#SRC+showButton"> </a>
|
|
6783
|
-
|
|
6784
|
-
### srC.showButton()
|
|
6785
|
-
Using this method you can show the SRC button after using hideButton method
|
|
6786
|
-
|
|
6787
|
-
**Kind**: instance method of [<code>SRC</code>](#SRC)
|
|
6788
|
-
**Example**
|
|
6789
|
-
```js
|
|
6790
|
-
SRC.showButton();
|
|
6791
|
-
```
|
|
6792
6597
|
<a name="SRC+hideCheckout" id="SRC+hideCheckout" href="#SRC+hideCheckout"> </a>
|
|
6793
6598
|
|
|
6794
|
-
###
|
|
6599
|
+
### mastercardSRCClickToPay.hideCheckout([saveSize])
|
|
6795
6600
|
Using this method you can hide checkout after load and button click
|
|
6796
6601
|
|
|
6797
|
-
**Kind**: instance method of [<code>
|
|
6602
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
6603
|
+
**Overrides**: [<code>hideCheckout</code>](#SRC+hideCheckout)
|
|
6798
6604
|
|
|
6799
6605
|
| Param | Type | Default | Description |
|
|
6800
6606
|
| --- | --- | --- | --- |
|
|
@@ -6806,30 +6612,33 @@ SRC.hideCheckout();
|
|
|
6806
6612
|
```
|
|
6807
6613
|
<a name="SRC+showCheckout" id="SRC+showCheckout" href="#SRC+showCheckout"> </a>
|
|
6808
6614
|
|
|
6809
|
-
###
|
|
6615
|
+
### mastercardSRCClickToPay.showCheckout()
|
|
6810
6616
|
Using this method you can show checkout after using hideCheckout method
|
|
6811
6617
|
|
|
6812
|
-
**Kind**: instance method of [<code>
|
|
6618
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
6619
|
+
**Overrides**: [<code>showCheckout</code>](#SRC+showCheckout)
|
|
6813
6620
|
**Example**
|
|
6814
6621
|
```js
|
|
6815
6622
|
SRC.showCheckout()
|
|
6816
6623
|
```
|
|
6817
6624
|
<a name="SRC+reload" id="SRC+reload" href="#SRC+reload"> </a>
|
|
6818
6625
|
|
|
6819
|
-
###
|
|
6626
|
+
### mastercardSRCClickToPay.reload()
|
|
6820
6627
|
Using this method you can reload the whole checkout
|
|
6821
6628
|
|
|
6822
|
-
**Kind**: instance method of [<code>
|
|
6629
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
6630
|
+
**Overrides**: [<code>reload</code>](#SRC+reload)
|
|
6823
6631
|
**Example**
|
|
6824
6632
|
```js
|
|
6825
6633
|
SRC.reload()
|
|
6826
6634
|
```
|
|
6827
6635
|
<a name="SRC+useAutoResize" id="SRC+useAutoResize" href="#SRC+useAutoResize"> </a>
|
|
6828
6636
|
|
|
6829
|
-
###
|
|
6637
|
+
### mastercardSRCClickToPay.useAutoResize()
|
|
6830
6638
|
Use this method for resize checkout iFrame according to content height, if applicable
|
|
6831
6639
|
|
|
6832
|
-
**Kind**: instance method of [<code>
|
|
6640
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
6641
|
+
**Overrides**: [<code>useAutoResize</code>](#SRC+useAutoResize)
|
|
6833
6642
|
**Example**
|
|
6834
6643
|
```js
|
|
6835
6644
|
SRC.useAutoResize();
|
|
@@ -6841,15 +6650,28 @@ List of available event's name in the SRC checkout lifecycle
|
|
|
6841
6650
|
|
|
6842
6651
|
**Kind**: global enum
|
|
6843
6652
|
|
|
6844
|
-
| Param | Type | Default |
|
|
6845
|
-
| --- | --- | --- |
|
|
6846
|
-
|
|
|
6847
|
-
|
|
|
6848
|
-
|
|
|
6849
|
-
|
|
|
6850
|
-
| CHECKOUT_COMPLETED | <code>string</code> | <code>"checkoutCompleted"</code> |
|
|
6851
|
-
| CHECKOUT_ERROR | <code>string</code> | <code>"checkoutError"</code> |
|
|
6653
|
+
| Param | Type | Default | Description |
|
|
6654
|
+
| --- | --- | --- | --- |
|
|
6655
|
+
| IFRAME_LOADED | <code>string</code> | <code>"iframeLoaded"</code> | Initial event sent when IFrame is initially loaded. |
|
|
6656
|
+
| CHECKOUT_READY | <code>string</code> | <code>"checkoutReady"</code> | Event sent when checkout is loaded and ready to be used by customer. Leverage alongside [showCheckout](#SRC+showCheckout) and [hideCheckout](#SRC+hideCheckout). |
|
|
6657
|
+
| CHECKOUT_POPUP_OPEN | <code>string</code> | <code>"checkoutPopupOpen"</code> | Event sent when SRC Checkout flow is started, regardless of embedded or windowed mode. |
|
|
6658
|
+
| CHECKOUT_POPUP_CLOSE | <code>string</code> | <code>"checkoutPopupClose"</code> | Event sent when SRC Checkout flow is closed, regardless of embedded or windowed mode. |
|
|
6659
|
+
| CHECKOUT_COMPLETED | <code>string</code> | <code>"checkoutCompleted"</code> | Event sent on successful checkout by customer. Check [data](#EventDataCheckoutCompletedData) for more information. |
|
|
6660
|
+
| CHECKOUT_ERROR | <code>string</code> | <code>"checkoutError"</code> | Event sent on error checkout by customer. Check [data](#EventData) for more information. |
|
|
6661
|
+
|
|
6662
|
+
<a name="EVENT_DATA_TYPE" id="EVENT_DATA_TYPE" href="#EVENT_DATA_TYPE"> </a>
|
|
6663
|
+
|
|
6664
|
+
## EVENT\_DATA\_TYPE : <code>enum</code>
|
|
6665
|
+
List of available event data types
|
|
6666
|
+
|
|
6667
|
+
**Kind**: global enum
|
|
6668
|
+
|
|
6669
|
+
| Param | Type | Default | Description |
|
|
6670
|
+
| --- | --- | --- | --- |
|
|
6671
|
+
| CRITICAL_ERROR | <code>string</code> | <code>"CriticalError"</code> | in this error scenario the checkout is understood to be in a non-recoverable state and should be closed by the merchant and give alternate payment options to the user |
|
|
6672
|
+
| USER_ERROR | <code>string</code> | <code>"UserError"</code> | in this error scenario the error in likely a user input error and the checkout is in a recoverable state, so the user will be kept within the checkout and can retry the flow |
|
|
6673
|
+
| SUCCESS | <code>string</code> | <code>"Success"</code> | |
|
|
6852
6674
|
|
|
6853
6675
|
|
|
6854
6676
|
## License
|
|
6855
|
-
Copyright (c)
|
|
6677
|
+
Copyright (c) 2024 paydock
|