@paydock/client-sdk 1.87.3 → 1.90.1
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 +285 -16
- package/bundles/widget.umd.js +7 -2
- package/bundles/widget.umd.min.js +1 -1
- package/examples/html-widget/actions.html +2 -2
- package/examples/html-widget/events.html +2 -2
- package/examples/html-widget/form.html +1 -1
- package/examples/html-widget/html-styles.html +2 -2
- package/examples/html-widget/insert-input.html +2 -2
- package/examples/html-widget/optional-settings.html +2 -2
- package/examples/html-widget/simple.html +2 -2
- package/examples/html-widget/styles.html +2 -2
- package/examples/multi-html-widget/extend.html +2 -2
- package/examples/multi-html-widget/simple.html +2 -2
- package/lib/canvas-3ds/canvas-3ds.d.ts +1 -0
- package/lib/canvas-3ds/canvas-3ds.js +1 -0
- package/lib/canvas-3ds/canvas-3ds.js.map +1 -1
- package/lib/canvas-3ds/services/gpayments-service.d.ts +1 -0
- package/lib/canvas-3ds/services/gpayments-service.js +5 -1
- package/lib/canvas-3ds/services/gpayments-service.js.map +1 -1
- package/package.json +1 -1
- package/slate.md +19 -16
package/README.md
CHANGED
|
@@ -146,7 +146,7 @@ Then write only need 2 lines of code in js to initialize widget
|
|
|
146
146
|
<div id="widget"></div>
|
|
147
147
|
<input name="payment_source_token" id="payment_source_token" type="hidden">
|
|
148
148
|
</form>
|
|
149
|
-
<script src="https://
|
|
149
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
150
150
|
<script>
|
|
151
151
|
var widget = new paydock.HtmlWidget('#widget', 'publicKey');
|
|
152
152
|
widget.onFinishInsert('input[name="payment_source_token"]', 'payment_source');
|
|
@@ -4529,7 +4529,7 @@ Then write only need 2 lines of code in js to make request
|
|
|
4529
4529
|
<style></style>
|
|
4530
4530
|
</head>
|
|
4531
4531
|
<body>
|
|
4532
|
-
<script src="https://
|
|
4532
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
4533
4533
|
<script>
|
|
4534
4534
|
(async function() {
|
|
4535
4535
|
var response = await new Api('publicKey').setEnv('env').charge().preAuth({
|
|
@@ -4543,8 +4543,6 @@ Then write only need 2 lines of code in js to make request
|
|
|
4543
4543
|
</html>
|
|
4544
4544
|
```
|
|
4545
4545
|
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
4546
|
## Canvas3ds
|
|
4549
4547
|
You can find description of all methods and parameters [here](https://www.npmjs.com/package/@paydock/client-sdk#canvas3d)
|
|
4550
4548
|
|
|
@@ -4591,7 +4589,7 @@ Then write only need 2 lines of code in js to initialize widget
|
|
|
4591
4589
|
</head>
|
|
4592
4590
|
<body>
|
|
4593
4591
|
<div id="widget"></div>
|
|
4594
|
-
<script src="https://
|
|
4592
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js"></script>
|
|
4595
4593
|
<script>
|
|
4596
4594
|
var canvas3ds = new paydock.Canvas3ds('#widget', 'token');
|
|
4597
4595
|
canvas3ds.load();
|
|
@@ -4647,7 +4645,7 @@ This example shows how you can use a lot of other methods to settings your form
|
|
|
4647
4645
|
</head>
|
|
4648
4646
|
<body>
|
|
4649
4647
|
<div id="widget3ds"></div>
|
|
4650
|
-
<script src="https://
|
|
4648
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js"></script>
|
|
4651
4649
|
<script>
|
|
4652
4650
|
var canvas3ds = new paydock.Canvas3ds('#widget3ds', 'token');
|
|
4653
4651
|
canvas3ds.on('chargeAuthSuccess', function (data) {
|
|
@@ -4675,7 +4673,7 @@ This example shows how you can use a lot of other methods to settings your form
|
|
|
4675
4673
|
<body>
|
|
4676
4674
|
<div id="widget"></div>
|
|
4677
4675
|
<div id="widget3ds"></div>
|
|
4678
|
-
<script src="https://
|
|
4676
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js"></script>
|
|
4679
4677
|
<script>
|
|
4680
4678
|
(async function () {
|
|
4681
4679
|
var htmlWidget = new paydock.HtmlWidget('#widget', 'publicKey', 'gatewayId');
|
|
@@ -4718,7 +4716,7 @@ After you initialized the standalone 3ds charge via `v1/charges/standalone-3ds`
|
|
|
4718
4716
|
</head>
|
|
4719
4717
|
<body>
|
|
4720
4718
|
<div id="widget3ds"></div>
|
|
4721
|
-
<script src="https://
|
|
4719
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js"></script>
|
|
4722
4720
|
<script>
|
|
4723
4721
|
var canvas3ds = new paydock.Canvas3ds("#widget3ds", "token");
|
|
4724
4722
|
canvas3ds.on("chargeAuthSuccess", function (data) {
|
|
@@ -4733,6 +4731,9 @@ After you initialized the standalone 3ds charge via `v1/charges/standalone-3ds`
|
|
|
4733
4731
|
canvas3ds.on("chargeAuthDecoupled", function (data) {
|
|
4734
4732
|
console.log(data.result.description);
|
|
4735
4733
|
});
|
|
4734
|
+
canvas3ds.on("chargeAuthInfo", function (data) {
|
|
4735
|
+
console.log(data.info);
|
|
4736
|
+
});
|
|
4736
4737
|
canvas3ds.on("error", function ({ charge_3ds_id, error }) {
|
|
4737
4738
|
console.log(error);
|
|
4738
4739
|
});
|
|
@@ -4760,6 +4761,7 @@ After you initialized the standalone 3ds charge via `v1/charges/standalone-3ds`
|
|
|
4760
4761
|
| <code>chargeAuthReject</code> | <code>object</code> | Instance of [ChargeEventResponse](#cb_chargeEventResponse) |
|
|
4761
4762
|
| <code>chargeAuthChallenge</code> | <code>object</code> | Instance of [ChargeEventResponse](#cb_chargeEventResponse) |
|
|
4762
4763
|
| <code>chargeAuthDecoupled</code> | <code>object</code> | Instance of [ChargeEventResponse](#cb_chargeEventResponse) |
|
|
4764
|
+
| <code>chargeAuthInfo</code> | <code>object</code> | Instance of [ChargeEventResponse](#cb_chargeEventResponse) |
|
|
4763
4765
|
| <code>error</code> | <code>object</code> | Instance of [chargeError](#cb_chargeError) |
|
|
4764
4766
|
|
|
4765
4767
|
## Response Values
|
|
@@ -4772,6 +4774,7 @@ After you initialized the standalone 3ds charge via `v1/charges/standalone-3ds`
|
|
|
4772
4774
|
| ------------------------------- | ------------------------------ | -------------------------------------------------------------------------------------------------- |
|
|
4773
4775
|
| <code>status</code> | <code>string</code> | status for the event transaction |
|
|
4774
4776
|
| <code>charge_3ds_id</code> | <code>string</code> | Universal unique transaction identifier to identify the transaction |
|
|
4777
|
+
| <code>info</code> | <code>string</code> | info field for `chargeAuthInfo` event |
|
|
4775
4778
|
| <code>result.description</code> | <code>string</code> [Optional] | field that you must show to the customer, indicating the method the user must use to authenticate during the decoupled challenge flow. |
|
|
4776
4779
|
|
|
4777
4780
|
### ChargeError
|
|
@@ -5130,7 +5133,7 @@ button.setEnv('sandbox');
|
|
|
5130
5133
|
<h2>Payment using PayDock Wallet Button!</h2>
|
|
5131
5134
|
<div id="widget"></div>
|
|
5132
5135
|
</body>
|
|
5133
|
-
<script src="https://
|
|
5136
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
5134
5137
|
<script>
|
|
5135
5138
|
let button = new paydock.WalletButtons(
|
|
5136
5139
|
"#widget",
|
|
@@ -5252,7 +5255,7 @@ _(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `wa
|
|
|
5252
5255
|
<h2>Payment using PayDock Wallet Button!</h2>
|
|
5253
5256
|
<div id="widget"></div>
|
|
5254
5257
|
</body>
|
|
5255
|
-
<script src="https://
|
|
5258
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
5256
5259
|
<script>
|
|
5257
5260
|
let button = new paydock.WalletButtons(
|
|
5258
5261
|
"#widget",
|
|
@@ -5287,7 +5290,7 @@ _(Required `meta` fields: - . Optional `meta` fields: `request_shipping`, `pay_l
|
|
|
5287
5290
|
<h2>Payment using PayDock Wallet Button!</h2>
|
|
5288
5291
|
<div id="widget"></div>
|
|
5289
5292
|
</body>
|
|
5290
|
-
<script src="https://
|
|
5293
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
5291
5294
|
<script>
|
|
5292
5295
|
let button = new paydock.WalletButtons(
|
|
5293
5296
|
"#widget",
|
|
@@ -5332,7 +5335,7 @@ _(Required `meta` fields: - . Optional `meta` fields: `request_shipping`, `pay_l
|
|
|
5332
5335
|
<h2>Payment using PayDock Wallet Button!</h2>
|
|
5333
5336
|
<div id="widget"></div>
|
|
5334
5337
|
</body>
|
|
5335
|
-
<script src="https://
|
|
5338
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
5336
5339
|
<script>
|
|
5337
5340
|
let button = new paydock.WalletButtons(
|
|
5338
5341
|
"#widget",
|
|
@@ -5371,7 +5374,7 @@ _(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `ra
|
|
|
5371
5374
|
<h2>Payment using PayDock Wallet Button!</h2>
|
|
5372
5375
|
<div id="widget"></div>
|
|
5373
5376
|
</body>
|
|
5374
|
-
<script src="https://
|
|
5377
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
5375
5378
|
<script>
|
|
5376
5379
|
let button = new paydock.WalletButtons(
|
|
5377
5380
|
"#widget",
|
|
@@ -5423,7 +5426,7 @@ Also, for **ApplePay via MPGS** you can initialize the `ApplePayPaymentRequest`
|
|
|
5423
5426
|
<h2>Payment using PayDock Wallet Button!</h2>
|
|
5424
5427
|
<div id="widget"></div>
|
|
5425
5428
|
</body>
|
|
5426
|
-
<script src="https://
|
|
5429
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
5427
5430
|
<script>
|
|
5428
5431
|
let button = new paydock.WalletButtons(
|
|
5429
5432
|
"#widget",
|
|
@@ -5929,7 +5932,7 @@ src.load();
|
|
|
5929
5932
|
<body>
|
|
5930
5933
|
<div id="checkoutButton"></div>
|
|
5931
5934
|
<div id="checkoutIframe"></div>
|
|
5932
|
-
<script src="https://
|
|
5935
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
5933
5936
|
<script>
|
|
5934
5937
|
var src = new paydock.SRC(
|
|
5935
5938
|
"#checkoutButton",
|
|
@@ -6001,7 +6004,7 @@ Here you can see how you can use this methods to customize your checkout experie
|
|
|
6001
6004
|
<body>
|
|
6002
6005
|
<div id="checkoutButton"></div>
|
|
6003
6006
|
<div id="checkoutIframe"></div>
|
|
6004
|
-
<script src="https://
|
|
6007
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
6005
6008
|
<script>
|
|
6006
6009
|
var src = new paydock.SRC(
|
|
6007
6010
|
"#checkoutButton",
|
|
@@ -6129,5 +6132,271 @@ button.setStyles({"primary_color":"#a83232","button_text_color":"#171e9c","font_
|
|
|
6129
6132
|
| font_family | <code>string</code> | Look more [mozilla.org/color](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family)|
|
|
6130
6133
|
| card_schemes | <code>[string] - array of string</code> | Possible values "visa", "mastercard", "amex" and "discover" - Default show all logos
|
|
6131
6134
|
|
|
6135
|
+
## Classes
|
|
6136
|
+
|
|
6137
|
+
<dl>
|
|
6138
|
+
<dt><a href="#SRC">SRC</a></dt>
|
|
6139
|
+
<dd><p>Class SRC include methods for interacting with different secure remote commerce options such as Visa SRC</p>
|
|
6140
|
+
</dd>
|
|
6141
|
+
</dl>
|
|
6142
|
+
|
|
6143
|
+
## Interfaces
|
|
6144
|
+
|
|
6145
|
+
<dl>
|
|
6146
|
+
<dt><a href="#IVisaSRCMeta">IVisaSRCMeta</a> : <code>object</code></dt>
|
|
6147
|
+
<dd><p>Interface of data used for the Visa Checkout.</p>
|
|
6148
|
+
</dd>
|
|
6149
|
+
</dl>
|
|
6150
|
+
|
|
6151
|
+
<a name="IVisaSRCMeta" id="IVisaSRCMeta" href="#IVisaSRCMeta"> </a>
|
|
6152
|
+
|
|
6153
|
+
## IVisaSRCMeta : <code>object</code>
|
|
6154
|
+
Interface of data used for the Visa Checkout.
|
|
6155
|
+
|
|
6156
|
+
**Kind**: global interface
|
|
6157
|
+
|
|
6158
|
+
| Param | Type | Description |
|
|
6159
|
+
| --- | --- | --- |
|
|
6160
|
+
| [srci_transaction_id] | <code>string</code> | Used to identify the SRC Id. |
|
|
6161
|
+
| [dpa_data] | <code>object</code> | Object where the DPA creation data is stored. |
|
|
6162
|
+
| [dpa_data.dpa_presentation_name] | <code>string</code> | Name in which the DPA is presented in. |
|
|
6163
|
+
| [dpa_data.dpa_uri] | <code>string</code> | Used for indicating the DPA URI. |
|
|
6164
|
+
| [dpa_transaction_options] | <code>object</code> | Object that stores options for creating a trasaction with DPA. |
|
|
6165
|
+
| [dpa_transaction_options.dpa_locale] | <code>string</code> | DPA’s preferred locale, example en_US. |
|
|
6166
|
+
| [dpa_transaction_options.dpa_accepted_billing_countries] | <code>Array</code> | Used to indicate list of accepted billing countries for DPA. |
|
|
6167
|
+
| [dpa_transaction_options.dpa_accepted_shipping_countries] | <code>Array</code> | Used to indicate list of accepted shipping countries for DPA. |
|
|
6168
|
+
| [dpa_transaction_options.dpa_billing_preference] | <code>string</code> | Used for listing the enumeration for billing preferences for DPA. Options are 'ALL', 'POSTAL_COUNTRY' and 'NONE'. |
|
|
6169
|
+
| [dpa_transaction_options.dpa_shipping_preference] | <code>string</code> | Used for listing the enumeration for shipping preferences for DPA. Options are 'ALL', 'POSTAL_COUNTRY' and 'NONE'. |
|
|
6170
|
+
| [dpa_transaction_options.consumer_name_requested] | <code>boolean</code> | Used to check if the name of the consumer is needed. |
|
|
6171
|
+
| [dpa_transaction_options.consumer_email_address_requested] | <code>boolean</code> | Used to check if the email of the consumer is needed. |
|
|
6172
|
+
| [dpa_transaction_options.consumer_phone_number_requested] | <code>boolean</code> | Used to check if the phone number of the consumer is needed. |
|
|
6173
|
+
| [dpa_transaction_options.payment_options] | <code>object</code> | Object used to check the payment options that are included. |
|
|
6174
|
+
| [dpa_transaction_options.payment_options.dpa_dynamic_data_ttl_minutes] | <code>number</code> | The minimum requested validity period for the transaction credentials. |
|
|
6175
|
+
| [dpa_transaction_options.payment_options.dynamic_data_type] | <code>string</code> | Used for listing the enumeration for dynamic data types. Options are 'TAVV' and 'DTVV'. |
|
|
6176
|
+
| [dpa_transaction_options.payment_options.dpa_pan_requested] | <code>boolean</code> | Used to check if PAN number was requested. |
|
|
6177
|
+
| [dpa_transaction_options.review_action] | <code>string</code> | Used for listing the enumeration of review actions. Options are 'pay' and 'continue'. |
|
|
6178
|
+
| [dpa_transaction_options.checkout_description] | <code>string</code> | Used for indicating the description of the checkout. |
|
|
6179
|
+
| [dpa_transaction_options.transaction_type] | <code>string</code> | Used for listing the enumeration of the type of the transaction. 'PURCHASE', 'BILL_PAYMENT' and 'MONEY_TRANSFER' |
|
|
6180
|
+
| [dpa_transaction_options.order_type] | <code>string</code> | Used for listing the enumeration of the type of the order. Options are 'REAUTHORIZATION', 'RECURRING' and 'INSTALLMENT'. |
|
|
6181
|
+
| [dpa_transaction_options.transaction_amount] | <code>object</code> | Object used to describe the details of the transaction. |
|
|
6182
|
+
| [dpa_transaction_options.transaction_amount.transaction_amount] | <code>number</code> | Used to indicate the amount of the transaction. |
|
|
6183
|
+
| [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. |
|
|
6184
|
+
| [dpa_transaction_options.merchant_order_id] | <code>string</code> | Used to indicate the merchants order Id. |
|
|
6185
|
+
| [dpa_transaction_options.merchant_category_code] | <code>string</code> | Used to indicate the merchants category code. |
|
|
6186
|
+
| [dpa_transaction_options.merchant_country_code] | <code>string</code> | Used to indicate the merchants country code. 2 letter ISO code format. |
|
|
6187
|
+
| [customer] | <code>object</code> | Object where the customer data is stored to prefill in the checkout. |
|
|
6188
|
+
| [customer.email] | <code>string</code> | Customer email. |
|
|
6189
|
+
| [customer.first_name] | <code>string</code> | Customer first name. |
|
|
6190
|
+
| [customer.last_name] | <code>string</code> | Customer last name. |
|
|
6191
|
+
| [customer.phone] | <code>object</code> | Object where the customer phone is stored. |
|
|
6192
|
+
| [customer.phone.country_code] | <code>string</code> | Customer phone country code (example "1" for US). |
|
|
6193
|
+
| [customer.phone.phone] | <code>string</code> | Customer phone number. |
|
|
6194
|
+
| [customer.payment_source] | <code>object</code> | Object where the customer billing address data is stored. |
|
|
6195
|
+
| [customer.payment_source.address_line1] | <code>string</code> | Customer billing address line 1. |
|
|
6196
|
+
| [customer.payment_source.address_line2] | <code>string</code> | Customer billing address line 2. |
|
|
6197
|
+
| [customer.payment_source.address_city] | <code>string</code> | Customer billing address city. |
|
|
6198
|
+
| [customer.payment_source.address_postcode] | <code>string</code> | Customer billing address postcode. |
|
|
6199
|
+
| [customer.payment_source.address_state] | <code>string</code> | Customer billing address state code (if applicable for the country, example "FL" for Florida). |
|
|
6200
|
+
| [customer.payment_source.address_country] | <code>string</code> | Customer billing address country code (example "US"). |
|
|
6201
|
+
|
|
6202
|
+
<a name="SRC" id="SRC" href="#SRC"> </a>
|
|
6203
|
+
|
|
6204
|
+
## SRC
|
|
6205
|
+
Class SRC include methods for interacting with different secure remote commerce options such as Visa SRC
|
|
6206
|
+
|
|
6207
|
+
**Kind**: global class
|
|
6208
|
+
|
|
6209
|
+
* [SRC](#SRC)
|
|
6210
|
+
* [new exports.SRC(button_selector, iframe_selector, service_id, public_key_or_access_token, meta)](#new_SRC_new)
|
|
6211
|
+
* [.setStyles(fields)](#SRC+setStyles)
|
|
6212
|
+
* [.load()](#SRC+load)
|
|
6213
|
+
* [.setEnv(env, [alias])](#SRC+setEnv)
|
|
6214
|
+
* [.getEnv()](#SRC+getEnv)
|
|
6215
|
+
* [.on(eventName, [cb])](#SRC+on) ⇒ <code>Promise.<any></code> \| <code>void</code>
|
|
6216
|
+
* [.hideButton([saveSize])](#SRC+hideButton)
|
|
6217
|
+
* [.showButton()](#SRC+showButton)
|
|
6218
|
+
* [.hideCheckout([saveSize])](#SRC+hideCheckout)
|
|
6219
|
+
* [.showCheckout()](#SRC+showCheckout)
|
|
6220
|
+
* [.reload()](#SRC+reload)
|
|
6221
|
+
* [.useAutoResize()](#SRC+useAutoResize)
|
|
6222
|
+
|
|
6223
|
+
<a name="new_SRC_new" id="new_SRC_new" href="#new_SRC_new"> </a>
|
|
6224
|
+
|
|
6225
|
+
### new exports.SRC(button_selector, iframe_selector, service_id, public_key_or_access_token, meta)
|
|
6226
|
+
|
|
6227
|
+
| Param | Type | Description |
|
|
6228
|
+
| --- | --- | --- |
|
|
6229
|
+
| button_selector | <code>string</code> | Selector of html element. Container for SRC checkout button. |
|
|
6230
|
+
| iframe_selector | <code>string</code> | Selector of html element. Container for SRC checkout iFrame. |
|
|
6231
|
+
| service_id | <code>string</code> | Card Scheme Service ID |
|
|
6232
|
+
| public_key_or_access_token | <code>string</code> | Paydock public key or Access Token |
|
|
6233
|
+
| meta | [<code>IVisaSRCMeta</code>](#IVisaSRCMeta) | Data that configures the SRC checkout |
|
|
6234
|
+
|
|
6235
|
+
**Example**
|
|
6236
|
+
```js
|
|
6237
|
+
var SRC = new SRC('#checkoutButton', '#checkoutIframe', 'service_id', 'public_key', {});
|
|
6238
|
+
```
|
|
6239
|
+
<a name="SRC+setStyles" id="SRC+setStyles" href="#SRC+setStyles"> </a>
|
|
6240
|
+
|
|
6241
|
+
### srC.setStyles(fields)
|
|
6242
|
+
Object contain styles for widget - call before `.load()`.
|
|
6243
|
+
|
|
6244
|
+
**Kind**: instance method of [<code>SRC</code>](#SRC)
|
|
6245
|
+
|
|
6246
|
+
| Param | Type | Description |
|
|
6247
|
+
| --- | --- | --- |
|
|
6248
|
+
| fields | <code>IStyles</code> | name of styles which can be shown in widget [STYLE](STYLE) |
|
|
6249
|
+
|
|
6250
|
+
**Example**
|
|
6251
|
+
```js
|
|
6252
|
+
widget.setStyles({
|
|
6253
|
+
button_text_color: '#32a852',
|
|
6254
|
+
primary_color: '#32a852',
|
|
6255
|
+
font_family: 'sans-serif',
|
|
6256
|
+
card_schemes: ['visa']
|
|
6257
|
+
});
|
|
6258
|
+
```
|
|
6259
|
+
<a name="SRC+load" id="SRC+load" href="#SRC+load"> </a>
|
|
6260
|
+
|
|
6261
|
+
### srC.load()
|
|
6262
|
+
The final method after configuring the SRC to start the load process of SRC checkout
|
|
6263
|
+
|
|
6264
|
+
**Kind**: instance method of [<code>SRC</code>](#SRC)
|
|
6265
|
+
<a name="SRC+setEnv" id="SRC+setEnv" href="#SRC+setEnv"> </a>
|
|
6266
|
+
|
|
6267
|
+
### srC.setEnv(env, [alias])
|
|
6268
|
+
Current method can change environment. By default environment = sandbox.
|
|
6269
|
+
Also we can change domain alias for this environment. By default domain_alias = paydock.com
|
|
6270
|
+
|
|
6271
|
+
**Kind**: instance method of [<code>SRC</code>](#SRC)
|
|
6272
|
+
|
|
6273
|
+
| Param | Type | Description |
|
|
6274
|
+
| --- | --- | --- |
|
|
6275
|
+
| env | <code>string</code> | sandbox, production |
|
|
6276
|
+
| [alias] | <code>string</code> | Own domain alias |
|
|
6277
|
+
|
|
6278
|
+
**Example**
|
|
6279
|
+
```js
|
|
6280
|
+
SRC.setEnv('production');
|
|
6281
|
+
```
|
|
6282
|
+
<a name="SRC+getEnv" id="SRC+getEnv" href="#SRC+getEnv"> </a>
|
|
6283
|
+
|
|
6284
|
+
### srC.getEnv()
|
|
6285
|
+
Method to read the current environment
|
|
6286
|
+
|
|
6287
|
+
**Kind**: instance method of [<code>SRC</code>](#SRC)
|
|
6288
|
+
**Example**
|
|
6289
|
+
```js
|
|
6290
|
+
SRC.getEnv();
|
|
6291
|
+
```
|
|
6292
|
+
<a name="SRC+on" id="SRC+on" href="#SRC+on"> </a>
|
|
6293
|
+
|
|
6294
|
+
### srC.on(eventName, [cb]) ⇒ <code>Promise.<any></code> \| <code>void</code>
|
|
6295
|
+
Listen to events of SRC
|
|
6296
|
+
|
|
6297
|
+
**Kind**: instance method of [<code>SRC</code>](#SRC)
|
|
6298
|
+
|
|
6299
|
+
| Param | Type | Description |
|
|
6300
|
+
| --- | --- | --- |
|
|
6301
|
+
| eventName | <code>string</code> | Available event names [EVENT](#EVENT) |
|
|
6302
|
+
| [cb] | <code>listener</code> | |
|
|
6303
|
+
|
|
6304
|
+
**Example**
|
|
6305
|
+
```js
|
|
6306
|
+
SRC.on('checkoutCompleted', function (token) {
|
|
6307
|
+
console.log(token);
|
|
6308
|
+
});
|
|
6309
|
+
// or
|
|
6310
|
+
SRC.on('checkoutCompleted').then(function (token) {
|
|
6311
|
+
console.log(token);
|
|
6312
|
+
});
|
|
6313
|
+
```
|
|
6314
|
+
<a name="SRC+hideButton" id="SRC+hideButton" href="#SRC+hideButton"> </a>
|
|
6315
|
+
|
|
6316
|
+
### srC.hideButton([saveSize])
|
|
6317
|
+
Using this method you can hide button
|
|
6318
|
+
|
|
6319
|
+
**Kind**: instance method of [<code>SRC</code>](#SRC)
|
|
6320
|
+
|
|
6321
|
+
| Param | Type | Default | Description |
|
|
6322
|
+
| --- | --- | --- | --- |
|
|
6323
|
+
| [saveSize] | <code>boolean</code> | <code>false</code> | using this param you can save iframe's size (if applicable) |
|
|
6324
|
+
|
|
6325
|
+
**Example**
|
|
6326
|
+
```js
|
|
6327
|
+
SRC.hideButton();
|
|
6328
|
+
```
|
|
6329
|
+
<a name="SRC+showButton" id="SRC+showButton" href="#SRC+showButton"> </a>
|
|
6330
|
+
|
|
6331
|
+
### srC.showButton()
|
|
6332
|
+
Using this method you can show the SRC button after using hideButton method
|
|
6333
|
+
|
|
6334
|
+
**Kind**: instance method of [<code>SRC</code>](#SRC)
|
|
6335
|
+
**Example**
|
|
6336
|
+
```js
|
|
6337
|
+
SRC.showButton();
|
|
6338
|
+
```
|
|
6339
|
+
<a name="SRC+hideCheckout" id="SRC+hideCheckout" href="#SRC+hideCheckout"> </a>
|
|
6340
|
+
|
|
6341
|
+
### srC.hideCheckout([saveSize])
|
|
6342
|
+
Using this method you can hide checkout after load and button click
|
|
6343
|
+
|
|
6344
|
+
**Kind**: instance method of [<code>SRC</code>](#SRC)
|
|
6345
|
+
|
|
6346
|
+
| Param | Type | Default | Description |
|
|
6347
|
+
| --- | --- | --- | --- |
|
|
6348
|
+
| [saveSize] | <code>boolean</code> | <code>false</code> | using this param you can save iframe's size (if applicable) |
|
|
6349
|
+
|
|
6350
|
+
**Example**
|
|
6351
|
+
```js
|
|
6352
|
+
SRC.hideCheckout();
|
|
6353
|
+
```
|
|
6354
|
+
<a name="SRC+showCheckout" id="SRC+showCheckout" href="#SRC+showCheckout"> </a>
|
|
6355
|
+
|
|
6356
|
+
### srC.showCheckout()
|
|
6357
|
+
Using this method you can show checkout after using hideCheckout method
|
|
6358
|
+
|
|
6359
|
+
**Kind**: instance method of [<code>SRC</code>](#SRC)
|
|
6360
|
+
**Example**
|
|
6361
|
+
```js
|
|
6362
|
+
SRC.showCheckout()
|
|
6363
|
+
```
|
|
6364
|
+
<a name="SRC+reload" id="SRC+reload" href="#SRC+reload"> </a>
|
|
6365
|
+
|
|
6366
|
+
### srC.reload()
|
|
6367
|
+
Using this method you can reload the whole checkout
|
|
6368
|
+
|
|
6369
|
+
**Kind**: instance method of [<code>SRC</code>](#SRC)
|
|
6370
|
+
**Example**
|
|
6371
|
+
```js
|
|
6372
|
+
SRC.reload()
|
|
6373
|
+
```
|
|
6374
|
+
<a name="SRC+useAutoResize" id="SRC+useAutoResize" href="#SRC+useAutoResize"> </a>
|
|
6375
|
+
|
|
6376
|
+
### srC.useAutoResize()
|
|
6377
|
+
Use this method for resize checkout iFrame according to content height, if applicable
|
|
6378
|
+
|
|
6379
|
+
**Kind**: instance method of [<code>SRC</code>](#SRC)
|
|
6380
|
+
**Example**
|
|
6381
|
+
```js
|
|
6382
|
+
SRC.useAutoResize();
|
|
6383
|
+
```
|
|
6384
|
+
<a name="EVENT" id="EVENT" href="#EVENT"> </a>
|
|
6385
|
+
|
|
6386
|
+
## EVENT : <code>enum</code>
|
|
6387
|
+
List of available event's name in the SRC checkout lifecycle
|
|
6388
|
+
|
|
6389
|
+
**Kind**: global enum
|
|
6390
|
+
|
|
6391
|
+
| Param | Type | Default |
|
|
6392
|
+
| --- | --- | --- |
|
|
6393
|
+
| CHECKOUT_BUTTON_LOADED | <code>string</code> | <code>"checkoutButtonLoaded"</code> |
|
|
6394
|
+
| CHECKOUT_BUTTON_CLICKED | <code>string</code> | <code>"checkoutButtonClicked"</code> |
|
|
6395
|
+
| IFRAME_LOADED | <code>string</code> | <code>"iframeLoaded"</code> |
|
|
6396
|
+
| CHECKOUT_READY | <code>string</code> | <code>"checkoutReady"</code> |
|
|
6397
|
+
| CHECKOUT_COMPLETED | <code>string</code> | <code>"checkoutCompleted"</code> |
|
|
6398
|
+
| CHECKOUT_ERROR | <code>string</code> | <code>"checkoutError"</code> |
|
|
6399
|
+
|
|
6400
|
+
|
|
6132
6401
|
## License
|
|
6133
6402
|
Copyright (c) 2022 paydock
|
package/bundles/widget.umd.js
CHANGED
|
@@ -242,7 +242,7 @@
|
|
|
242
242
|
// the empty string is set in case if version not provided.
|
|
243
243
|
//
|
|
244
244
|
// e.g: grunt build --sdk-version=v1.0.0
|
|
245
|
-
SDK._version = 'v1.
|
|
245
|
+
SDK._version = 'v1.90.1';
|
|
246
246
|
|
|
247
247
|
var ENV = {
|
|
248
248
|
SANDBOX: 'sandbox',
|
|
@@ -7986,6 +7986,7 @@
|
|
|
7986
7986
|
AUTH_ERROR: 'chargeAuthReject',
|
|
7987
7987
|
DECOUPLED: 'chargeAuthDecoupled',
|
|
7988
7988
|
CHALLENGE: 'chargeAuthChallenge',
|
|
7989
|
+
INFO: 'chargeAuthInfo',
|
|
7989
7990
|
ERROR: 'error'
|
|
7990
7991
|
};
|
|
7991
7992
|
var GPaymentsService = function () {
|
|
@@ -8056,7 +8057,10 @@
|
|
|
8056
8057
|
var _this = this;
|
|
8057
8058
|
|
|
8058
8059
|
this.iFrameEvent.on(EVENT.CHARGE_AUTH, widgetId, function (data) {
|
|
8059
|
-
if (data.status === "MethodSkipped" /* SKIPPED */ || data.status === "MethodFinished" /* FINISHED */)
|
|
8060
|
+
if (data.status === "MethodSkipped" /* SKIPPED */ || data.status === "MethodFinished" /* FINISHED */) {
|
|
8061
|
+
if (data.info) _this.eventEmitter.emit(GPAYMENTS_EVENT.INFO, { info: data.info });
|
|
8062
|
+
_this.performAuthentication(data);
|
|
8063
|
+
} else if (data.status === "AuthTimedOut" /* TIMEOUT */ || data.status === "invalid_event" /* INVALID */) _this.eventEmitter.emit(GPAYMENTS_EVENT.AUTH_ERROR, _this.parseHandleResponse({ status: data.status }, data.charge_3ds_id));
|
|
8060
8064
|
});
|
|
8061
8065
|
this.iFrameEvent.on(EVENT.CHARGE_AUTH_SUCCESS, widgetId, function (data) {
|
|
8062
8066
|
_this.processResult(data.charge_3ds_id);
|
|
@@ -8236,6 +8240,7 @@
|
|
|
8236
8240
|
* @param {string} CHARGE_AUTH_REJECT=chargeAuthReject
|
|
8237
8241
|
* @param {string} CHARGE_AUTH_DECOUPLED=chargeAuthDecoupled
|
|
8238
8242
|
* @param {string} CHARGE_AUTH_CHALLENGE=chargeAuthChallenge
|
|
8243
|
+
* @param {string} CHARGE_AUTH_INFO=chargeAuthInfo
|
|
8239
8244
|
* @param {string} ERROR=error
|
|
8240
8245
|
*/
|
|
8241
8246
|
/**
|