@paydock/client-sdk 1.105.1 → 1.106.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 +255 -246
- package/bundles/widget.umd.js +1197 -1724
- 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/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.js +12 -0
- package/lib/components/wallet-background.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 +40 -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 +89 -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 -99
- package/lib/secure-remote-commerce/secure-remote-commerce.js.map +1 -1
- package/lib/wallet-buttons/flypay-v2.wallet-service.d.ts +0 -1
- package/lib/wallet-buttons/flypay-v2.wallet-service.js +28 -30
- package/lib/wallet-buttons/flypay-v2.wallet-service.js.map +1 -1
- package/package.json +2 -2
- package/slate.md +69 -131
- package/typings/index.d.ts +0 -1
- package/vendors/zipmoney.js +1 -2
- 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/typings/globals/@auspayplus/open-payments-checkout/index.d.ts +0 -43
package/README.md
CHANGED
|
@@ -6381,54 +6381,42 @@ List of available event's name in the wallet button lifecycle
|
|
|
6381
6381
|
| ON_CLICK | <code>string</code> | <code>"onClick"</code> |
|
|
6382
6382
|
|
|
6383
6383
|
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6384
|
+
# Secure Remote Commerce
|
|
6385
|
+
## Overview
|
|
6386
|
+
Integrate with Mastercard SRC using Paydock's Mastercard SRC widget.
|
|
6387
|
+
For a full description of the methods and parameters, reference the [README file](https://www.npmjs.com/package/@paydock/client-sdk#SRC).
|
|
6389
6388
|
## SRC simple example
|
|
6390
|
-
|
|
6391
|
-
### Container
|
|
6392
|
-
|
|
6389
|
+
The following section provides an example use case and integration for the widget.
|
|
6390
|
+
### Create a Container
|
|
6391
|
+
To integrate the SRC checkout iFrame, create a container in your HTML code. This container serves as the placeholder for the iFrame.
|
|
6393
6392
|
```html
|
|
6394
|
-
<div id="checkoutButton"></div>
|
|
6395
6393
|
<div id="checkoutIframe"></div>
|
|
6396
6394
|
```
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
### Initialization
|
|
6395
|
+
### Initialize the Widget
|
|
6396
|
+
Use the following code to initialize your widget:
|
|
6402
6397
|
```javascript
|
|
6403
|
-
var src = new paydock.
|
|
6404
|
-
"#checkoutButton",
|
|
6398
|
+
var src = new paydock.MastercardSRCClickToPay(
|
|
6405
6399
|
"#checkoutIframe",
|
|
6406
|
-
"
|
|
6400
|
+
"service_id",
|
|
6407
6401
|
"paydock_public_key_or_access_token",
|
|
6408
6402
|
{}, // meta
|
|
6409
6403
|
);
|
|
6410
6404
|
src.load();
|
|
6411
6405
|
```
|
|
6412
|
-
|
|
6413
6406
|
```javascript--es2015
|
|
6414
6407
|
// ES2015 | TypeScript
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
var src = new SRC(
|
|
6419
|
-
"#checkoutButton",
|
|
6408
|
+
import { MastercardSRCClickToPay } from '@paydock/client-sdk';
|
|
6409
|
+
var src = new MastercardSRCClickToPay(
|
|
6420
6410
|
"#checkoutIframe",
|
|
6421
|
-
"
|
|
6411
|
+
"service_id",
|
|
6422
6412
|
"paydock_public_key_or_access_token",
|
|
6423
6413
|
{}, // meta
|
|
6424
6414
|
);
|
|
6425
6415
|
src.load();
|
|
6426
6416
|
```
|
|
6427
|
-
|
|
6428
|
-
*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 whiteliste for the domain of your checkout screen.
|
|
6429
|
-
|
|
6417
|
+
*NOTE:* Paydock recommends that you use a Paydock Access Token instead of a public key for security reasons in production environments. When creating your access token, you must enable the `Secure Remote Commerce` and add a whitelist for the domain of your checkout screen.
|
|
6430
6418
|
### Full example
|
|
6431
|
-
|
|
6419
|
+
A full example of the container and the initialized widget is as follows:
|
|
6432
6420
|
```html
|
|
6433
6421
|
<!DOCTYPE html>
|
|
6434
6422
|
<html lang="en">
|
|
@@ -6438,14 +6426,12 @@ src.load();
|
|
|
6438
6426
|
<style>iframe {border: 0;width: 40%;height: 300px;}</style>
|
|
6439
6427
|
</head>
|
|
6440
6428
|
<body>
|
|
6441
|
-
<div id="checkoutButton"></div>
|
|
6442
6429
|
<div id="checkoutIframe"></div>
|
|
6443
6430
|
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
6444
6431
|
<script>
|
|
6445
|
-
var src = new paydock.
|
|
6446
|
-
"#checkoutButton",
|
|
6432
|
+
var src = new paydock.MastercardSRCClickToPay(
|
|
6447
6433
|
"#checkoutIframe",
|
|
6448
|
-
"
|
|
6434
|
+
"service_id",
|
|
6449
6435
|
"paydock_public_key_or_access_token",
|
|
6450
6436
|
{},
|
|
6451
6437
|
);
|
|
@@ -6454,53 +6440,27 @@ src.load();
|
|
|
6454
6440
|
</body>
|
|
6455
6441
|
</html>
|
|
6456
6442
|
```
|
|
6457
|
-
|
|
6458
|
-
|
|
6459
|
-
## SRC advanced example
|
|
6460
|
-
|
|
6443
|
+
## Customize your SRC Checkout
|
|
6444
|
+
The following is an advanced example that includes customization. You can use these methods to enhance your checkout experience.
|
|
6461
6445
|
### Settings
|
|
6462
|
-
|
|
6463
6446
|
```javascript
|
|
6464
|
-
|
|
6465
|
-
src.setEnv('sandbox'); // set enviroment
|
|
6466
|
-
|
|
6467
|
-
src.hideButton(); // hide button
|
|
6468
|
-
|
|
6469
|
-
src.showButton(); // show button
|
|
6470
|
-
|
|
6447
|
+
src.setEnv('sandbox'); // set environment
|
|
6471
6448
|
src.hideCheckout(); // hide checkout iframe
|
|
6472
|
-
|
|
6473
6449
|
src.showCheckout(); // show checkout iframe
|
|
6474
|
-
|
|
6475
|
-
src.on('checkoutButtonLoaded', () => {
|
|
6476
|
-
console.log("Button loaded");
|
|
6477
|
-
});
|
|
6478
|
-
|
|
6479
|
-
src.on('checkoutButtonClicked', () => {
|
|
6480
|
-
console.log("Button clicked");
|
|
6481
|
-
});
|
|
6482
|
-
|
|
6483
6450
|
src.on('iframeLoaded', () => {
|
|
6484
6451
|
console.log("Initial iframe loaded");
|
|
6485
6452
|
});
|
|
6486
|
-
|
|
6487
6453
|
src.on('checkoutReady', () => {
|
|
6488
6454
|
console.log("Checkout ready to be used");
|
|
6489
6455
|
});
|
|
6490
|
-
|
|
6491
6456
|
src.on('checkoutCompleted', (token) => {
|
|
6492
6457
|
console.log(token);
|
|
6493
6458
|
});
|
|
6494
|
-
|
|
6495
6459
|
src.on('checkoutError', (error) => {
|
|
6496
6460
|
console.log(error);
|
|
6497
6461
|
});
|
|
6498
6462
|
```
|
|
6499
|
-
|
|
6500
|
-
Here you can see how you can use this methods to customize your checkout experience
|
|
6501
|
-
|
|
6502
6463
|
### Full example
|
|
6503
|
-
|
|
6504
6464
|
```html
|
|
6505
6465
|
<!DOCTYPE html>
|
|
6506
6466
|
<html lang="en">
|
|
@@ -6510,64 +6470,67 @@ Here you can see how you can use this methods to customize your checkout experie
|
|
|
6510
6470
|
<style>iframe {border: 0;width: 40%;height: 450px;}</style>
|
|
6511
6471
|
</head>
|
|
6512
6472
|
<body>
|
|
6513
|
-
<div id="checkoutButton"></div>
|
|
6514
6473
|
<div id="checkoutIframe"></div>
|
|
6515
6474
|
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
6516
6475
|
<script>
|
|
6517
|
-
var src = new paydock.
|
|
6518
|
-
"#checkoutButton",
|
|
6476
|
+
var src = new paydock.MastercardSRCClickToPay(
|
|
6519
6477
|
"#checkoutIframe",
|
|
6520
|
-
"
|
|
6478
|
+
"service_id",
|
|
6521
6479
|
"paydock_public_key_or_access_token",
|
|
6522
6480
|
{},
|
|
6523
6481
|
);
|
|
6524
|
-
|
|
6482
|
+
src.on('iframeLoaded', () => {
|
|
6483
|
+
console.log("Initial iframe loaded");
|
|
6484
|
+
});
|
|
6525
6485
|
src.on('checkoutReady', () => {
|
|
6526
6486
|
console.log("Checkout ready to be used");
|
|
6527
6487
|
});
|
|
6528
|
-
|
|
6529
6488
|
src.on('checkoutCompleted', (token) => {
|
|
6530
6489
|
console.log(token);
|
|
6531
6490
|
});
|
|
6491
|
+
src.on('checkoutError', (error) => {
|
|
6492
|
+
console.log(error);
|
|
6493
|
+
});
|
|
6532
6494
|
src.load();
|
|
6533
6495
|
</script>
|
|
6534
6496
|
</body>
|
|
6535
6497
|
</html>
|
|
6536
6498
|
```
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
To customize shipping address experience we use a flag that manages how VisaSRC requires or not shipping address to the customer. Options are NONE (default option), POSTAL_COUNTRY or ALL.
|
|
6542
|
-
|
|
6499
|
+
## Customize your billing address fields
|
|
6500
|
+
To customize your billing address experience, Paydock uses a flag that manages whether a customer's billing address is mandatory.
|
|
6501
|
+
The options for this customization are NONE (default option), and POSTAL_COUNTRY or FULL.
|
|
6543
6502
|
```
|
|
6544
|
-
var src = new paydock.
|
|
6545
|
-
"#checkoutButton",
|
|
6503
|
+
var src = new paydock.MastercardSRCClickToPay(
|
|
6546
6504
|
"#checkoutIframe",
|
|
6547
|
-
"
|
|
6505
|
+
"service_id",
|
|
6548
6506
|
"paydock_public_key_or_access_token",
|
|
6549
6507
|
{
|
|
6550
6508
|
"dpa_transaction_options": {
|
|
6551
|
-
"
|
|
6509
|
+
"dpa_billing_preference": "FULL"
|
|
6552
6510
|
}
|
|
6553
6511
|
},
|
|
6554
6512
|
);
|
|
6555
6513
|
```
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6514
|
+
The SRC checkout in the example requires the billing address from the customer, which is then returned as a part of the checkout data. The data is then stored and leveraged in the Paydock charge.
|
|
6515
|
+
You can also provide the billing address at the time of creating the charge. For example, if you have a different method for collecting the billing address, such as outside of the SRC checkout, you can provide it alongside other information at the charge creation step:
|
|
6516
|
+
1. Disable the billing address in Paydock's SRC widget.
|
|
6517
|
+
2. Get your One Time Token from the SRC widget alongside other details that may have been collected outside the SRC checkout as the shipping address.
|
|
6518
|
+
3. Send the billing address when creating the charge.
|
|
6561
6519
|
```
|
|
6562
6520
|
POST v1/charges
|
|
6563
|
-
|
|
6564
6521
|
{
|
|
6565
6522
|
"amount": "10.00",
|
|
6566
6523
|
"currency": "AUD",
|
|
6567
|
-
"token": "
|
|
6524
|
+
"token": "one_time_token",
|
|
6568
6525
|
"customer": {
|
|
6569
6526
|
"payment_source": {
|
|
6570
|
-
"gateway_id": "gateway_id"
|
|
6527
|
+
"gateway_id": "gateway_id",
|
|
6528
|
+
"address_line1": "address_line1",
|
|
6529
|
+
"address_line2": "address_line2",
|
|
6530
|
+
"address_city": "address_city",
|
|
6531
|
+
"address_postcode": "address_postcode",
|
|
6532
|
+
"address_state": "address_state",
|
|
6533
|
+
"address_country": "address_country"
|
|
6571
6534
|
}
|
|
6572
6535
|
},
|
|
6573
6536
|
"shipping": {
|
|
@@ -6581,202 +6544,254 @@ POST v1/charges
|
|
|
6581
6544
|
}
|
|
6582
6545
|
}
|
|
6583
6546
|
```
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6547
|
+
## How to customize accepted cards
|
|
6548
|
+
You can send a flag `unaccepted_card_type` to block the usage of a specific card type. The available options are 'DEBIT' and 'CREDIT'.
|
|
6549
|
+
### Example code
|
|
6550
|
+
The following example demonstrates how to block the card:
|
|
6589
6551
|
```
|
|
6590
|
-
var src = new paydock.
|
|
6591
|
-
"#checkoutButton",
|
|
6552
|
+
var src = new paydock.MastercardSRCClickToPay(
|
|
6592
6553
|
"#checkoutIframe",
|
|
6593
|
-
"
|
|
6594
|
-
"
|
|
6554
|
+
"service_id",
|
|
6555
|
+
"paydock_public_key",
|
|
6595
6556
|
{
|
|
6596
|
-
|
|
6597
|
-
"email": "test@email.com",
|
|
6598
|
-
"first_name": "Name",
|
|
6599
|
-
"last_name": "Surname",
|
|
6600
|
-
"phone": {
|
|
6601
|
-
"country_code": "1",
|
|
6602
|
-
"phone": "2124567890"
|
|
6603
|
-
},
|
|
6604
|
-
"payment_source": {
|
|
6605
|
-
"address_line1": "Line 1",
|
|
6606
|
-
"address_line2": "Line 2",
|
|
6607
|
-
"address_city": "Miami",
|
|
6608
|
-
"address_postcode": "33126",
|
|
6609
|
-
"address_state": "FL",
|
|
6610
|
-
"address_country": "US"
|
|
6611
|
-
}
|
|
6612
|
-
}
|
|
6557
|
+
unaccepted_card_type: 'DEBIT'
|
|
6613
6558
|
},
|
|
6614
6559
|
);
|
|
6615
6560
|
```
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
To improve the experience in the use of the widget, it is allowed to send props that customize the UI.
|
|
6620
|
-
|
|
6561
|
+
## Personalize the Style
|
|
6562
|
+
Customize the look and feel of your UI. The following example demonstrates changes in the styling of the buttons.
|
|
6621
6563
|
### Example code
|
|
6622
|
-
|
|
6623
6564
|
```
|
|
6624
|
-
var src = new paydock.
|
|
6625
|
-
"#checkoutButton",
|
|
6565
|
+
var src = new paydock.MastercardSRCClickToPay(
|
|
6626
6566
|
"#checkoutIframe",
|
|
6627
|
-
"
|
|
6567
|
+
"service_id",
|
|
6628
6568
|
"paydock_public_key",
|
|
6569
|
+
{},
|
|
6629
6570
|
);
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6571
|
+
src.setStyles({
|
|
6572
|
+
enable_src_popup: true,
|
|
6573
|
+
primary_button_color: 'red',
|
|
6574
|
+
secondary_button_color: 'red',
|
|
6575
|
+
primary_button_text_color: 'red',
|
|
6576
|
+
secondary_button_text_color: 'red',
|
|
6577
|
+
font_family: 'Arial',
|
|
6578
|
+
});
|
|
6633
6579
|
```
|
|
6634
|
-
## Event and Values
|
|
6635
|
-
|
|
6636
|
-
| Event Value | Type | Description |
|
|
6637
|
-
| ------------------- | ------------------- | -------------------------------------------------------------- |
|
|
6638
|
-
| primary_color | <code>string</code> | HEX color for the principal buttons, example : #32a852 |
|
|
6639
|
-
| button_text_color | <code>string</code> | HEX color for the text of the buttons, example : #32a852|
|
|
6640
|
-
| font_family | <code>string</code> | Look more [mozilla.org/color](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family)|
|
|
6641
|
-
| card_schemes | <code>[string] - array of string</code> | Possible values "visa", "mastercard", "amex" and "discover" - Default show all logos
|
|
6642
6580
|
|
|
6643
6581
|
## Classes
|
|
6644
6582
|
|
|
6645
6583
|
<dl>
|
|
6646
|
-
<dt><a href="#
|
|
6647
|
-
<dd><p>Class
|
|
6584
|
+
<dt><a href="#MastercardSRCClickToPay">MastercardSRCClickToPay</a> ⇐ <code>SRC</code></dt>
|
|
6585
|
+
<dd><p>Class MastercardSRCClickToPay include methods for interacting with the MastercardSRC checkout and Manual Card option</p>
|
|
6648
6586
|
</dd>
|
|
6649
6587
|
</dl>
|
|
6650
6588
|
|
|
6651
6589
|
## Interfaces
|
|
6652
6590
|
|
|
6653
6591
|
<dl>
|
|
6654
|
-
<dt><a href="#
|
|
6655
|
-
<dd><p>Interface of data used for the
|
|
6592
|
+
<dt><a href="#IMastercardSRCMeta">IMastercardSRCMeta</a> : <code>object</code></dt>
|
|
6593
|
+
<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>
|
|
6594
|
+
</dd>
|
|
6595
|
+
<dt><a href="#EventData">EventData</a> : <code>object</code></dt>
|
|
6596
|
+
<dd><p>Interface for data returned in callbacks</p>
|
|
6597
|
+
</dd>
|
|
6598
|
+
<dt><a href="#EventDataCheckoutCompletedData">EventDataCheckoutCompletedData</a> : <code>object</code></dt>
|
|
6599
|
+
<dd><p>Event data returned for checkoutCompleted callback, holding the One Time Token and the flow type completed.
|
|
6600
|
+
When the flow type is src, masked checkoutData available is also returned</p>
|
|
6601
|
+
</dd>
|
|
6602
|
+
<dt><a href="#IStyles">IStyles</a> : <code>object</code></dt>
|
|
6603
|
+
<dd><p>Interface for style configs inyected to the SRC checkout</p>
|
|
6656
6604
|
</dd>
|
|
6657
6605
|
</dl>
|
|
6658
6606
|
|
|
6659
|
-
<a name="
|
|
6607
|
+
<a name="IMastercardSRCMeta" id="IMastercardSRCMeta" href="#IMastercardSRCMeta"> </a>
|
|
6660
6608
|
|
|
6661
|
-
##
|
|
6662
|
-
Interface of data used for the
|
|
6609
|
+
## IMastercardSRCMeta : <code>object</code>
|
|
6610
|
+
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).
|
|
6663
6611
|
|
|
6664
6612
|
**Kind**: global interface
|
|
6665
6613
|
|
|
6666
6614
|
| Param | Type | Description |
|
|
6667
6615
|
| --- | --- | --- |
|
|
6668
|
-
| [
|
|
6616
|
+
| [disable_summary_screen] | <code>boolean</code> | Boolean flag that controls if a final summary screen is presented in the checkout flow. |
|
|
6669
6617
|
| [dpa_data] | <code>object</code> | Object where the DPA creation data is stored. |
|
|
6670
|
-
| [dpa_data.dpa_presentation_name] | <code>string</code> | Name in which the DPA is presented
|
|
6618
|
+
| [dpa_data.dpa_presentation_name] | <code>string</code> | Name in which the DPA is presented. |
|
|
6671
6619
|
| [dpa_data.dpa_uri] | <code>string</code> | Used for indicating the DPA URI. |
|
|
6672
|
-
| [
|
|
6620
|
+
| [dpa_data.dpa_address] | <code>string</code> | Address associated with the DPA. |
|
|
6621
|
+
| [dpa_data.dpa_email_address] | <code>string</code> | Email address for DPA communication. |
|
|
6622
|
+
| [dpa_data.dpa_phone_number] | <code>object</code> | Phone number structure for DPA communication. |
|
|
6623
|
+
| [dpa_data.dpa_phone_number.country_code] | <code>string</code> | The country code of the phone number. |
|
|
6624
|
+
| [dpa_data.dpa_phone_number.phone_number] | <code>string</code> | The phone number part of the phone number. |
|
|
6625
|
+
| [dpa_data.dpa_logo_uri] | <code>string</code> | URI for the DPA logo. |
|
|
6626
|
+
| [dpa_data.dpa_supported_email_address] | <code>string</code> | Supported email address for DPA support. |
|
|
6627
|
+
| [dpa_data.dpa_supported_phone_number] | <code>object</code> | Supported phone number for DPA support. |
|
|
6628
|
+
| [dpa_data.dpa_supported_phone_number.country_code] | <code>string</code> | The country code of the phone number. |
|
|
6629
|
+
| [dpa_data.dpa_supported_phone_number.phone_number] | <code>string</code> | The phone number part of the phone number. |
|
|
6630
|
+
| [dpa_data.dpa_support_uri] | <code>string</code> | URI for DPA support. |
|
|
6631
|
+
| [dpa_data.application_type] | <code>string</code> | Application type, either 'WEB_BROWSER' or 'MOBILE_APP'. |
|
|
6632
|
+
| [co_brand_names] | <code>Array.<string></code> | List of co-brand names associated with the SRC experience. |
|
|
6633
|
+
| [checkout_experience] | <code>string</code> | Checkout experience type, either 'WITHIN_CHECKOUT' or 'PAYMENT_SETTINGS'. |
|
|
6634
|
+
| [services] | <code>string</code> | Services offered, such as 'INLINE_CHECKOUT' or 'INLINE_INSTALLMENTS'. |
|
|
6635
|
+
| [dpa_transaction_options] | <code>object</code> | Object that stores options for creating a transaction with DPA. |
|
|
6673
6636
|
| [dpa_transaction_options.dpa_locale] | <code>string</code> | DPA’s preferred locale, example en_US. |
|
|
6674
|
-
| [dpa_transaction_options.dpa_accepted_billing_countries] | <code>Array
|
|
6675
|
-
| [dpa_transaction_options.
|
|
6676
|
-
| [dpa_transaction_options.
|
|
6677
|
-
| [dpa_transaction_options.
|
|
6678
|
-
| [dpa_transaction_options.
|
|
6679
|
-
| [dpa_transaction_options.
|
|
6680
|
-
| [dpa_transaction_options.
|
|
6681
|
-
| [dpa_transaction_options.
|
|
6682
|
-
| [dpa_transaction_options.
|
|
6683
|
-
| [dpa_transaction_options.
|
|
6684
|
-
| [dpa_transaction_options.
|
|
6685
|
-
| [dpa_transaction_options.
|
|
6686
|
-
| [dpa_transaction_options.
|
|
6687
|
-
| [dpa_transaction_options.
|
|
6688
|
-
| [dpa_transaction_options.
|
|
6689
|
-
| [dpa_transaction_options.
|
|
6690
|
-
| [dpa_transaction_options.transaction_amount.transaction_amount] | <code>number</code> | Used to indicate the amount of the transaction. |
|
|
6691
|
-
| [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. |
|
|
6692
|
-
| [dpa_transaction_options.merchant_order_id] | <code>string</code> | Used to indicate the merchants order Id. |
|
|
6693
|
-
| [dpa_transaction_options.merchant_category_code] | <code>string</code> | Used to indicate the merchants category code. |
|
|
6694
|
-
| [dpa_transaction_options.merchant_country_code] | <code>string</code> | Used to indicate the merchants country code. 2 letter ISO code format. |
|
|
6637
|
+
| [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. |
|
|
6638
|
+
| [dpa_transaction_options.dpa_billing_preference] | <code>string</code> | Billing preferences for DPA, options are 'FULL', 'POSTAL_COUNTRY', 'NONE'. |
|
|
6639
|
+
| [dpa_transaction_options.payment_options] | <code>Array.<object></code> | Payment options included in the transaction. |
|
|
6640
|
+
| [dpa_transaction_options.payment_options.dynamic_data_type] | <code>string</code> | Dynamic data types. |
|
|
6641
|
+
| [dpa_transaction_options.order_type] | <code>string</code> | Type of the order, options are 'SPLIT_SHIPMENT', 'PREFERRED_CARD'. |
|
|
6642
|
+
| [dpa_transaction_options.three_ds_preference] | <code>string</code> | Preference for 3DS usage in the transaction. |
|
|
6643
|
+
| [dpa_transaction_options.confirm_payment] | <code>boolean</code> | Indicates if payment confirmation is required. |
|
|
6644
|
+
| [dpa_transaction_options.consumer_name_requested] | <code>boolean</code> | Indicates if consumer name is requested. |
|
|
6645
|
+
| [dpa_transaction_options.consumer_email_address_requested] | <code>boolean</code> | Indicates if consumer email address is requested. |
|
|
6646
|
+
| [dpa_transaction_options.consumer_phone_number_requested] | <code>boolean</code> | Indicates if consumer phone number is requested. |
|
|
6647
|
+
| [dpa_transaction_options.transaction_amount] | <code>object</code> | Details of the transaction amount. |
|
|
6648
|
+
| [dpa_transaction_options.transaction_amount.transaction_amount] | <code>number</code> | Amount of the transaction. |
|
|
6649
|
+
| [dpa_transaction_options.transaction_amount.transaction_currency_code] | <code>string</code> | Currency code of the transaction in 3 letter ISO code format. |
|
|
6650
|
+
| [dpa_transaction_options.merchant_order_id] | <code>string</code> | Merchant's order ID. |
|
|
6651
|
+
| [dpa_transaction_options.merchant_category_code] | <code>string</code> | Merchant's category code. |
|
|
6652
|
+
| [dpa_transaction_options.merchant_country_code] | <code>string</code> | Merchant's country code in ISO 3166-1 alpha-2 format. |
|
|
6695
6653
|
| [customer] | <code>object</code> | Object where the customer data is stored to prefill in the checkout. |
|
|
6696
6654
|
| [customer.email] | <code>string</code> | Customer email. |
|
|
6697
6655
|
| [customer.first_name] | <code>string</code> | Customer first name. |
|
|
6698
6656
|
| [customer.last_name] | <code>string</code> | Customer last name. |
|
|
6699
6657
|
| [customer.phone] | <code>object</code> | Object where the customer phone is stored. |
|
|
6700
|
-
| [customer.phone.country_code] | <code>string</code> | Customer phone country code (example "1" for US). |
|
|
6658
|
+
| [customer.phone.country_code] | <code>string</code> | Customer phone country code (example "1" for US). // TODO: Confirm if it can be removed! |
|
|
6701
6659
|
| [customer.phone.phone] | <code>string</code> | Customer phone number. |
|
|
6702
|
-
| [
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
| [customer.payment_source.address_city] | <code>string</code> | Customer billing address city. |
|
|
6706
|
-
| [customer.payment_source.address_postcode] | <code>string</code> | Customer billing address postcode. |
|
|
6707
|
-
| [customer.payment_source.address_state] | <code>string</code> | Customer billing address state code (if applicable for the country, example "FL" for Florida). |
|
|
6708
|
-
| [customer.payment_source.address_country] | <code>string</code> | Customer billing address country code (example "US"). |
|
|
6660
|
+
| [unaccepted_card_type] | <code>string</code> | Used to block a specific card type. Options are 'CREDIT', 'DEBIT'. |
|
|
6661
|
+
|
|
6662
|
+
<a name="EventData" id="EventData" href="#EventData"> </a>
|
|
6709
6663
|
|
|
6710
|
-
|
|
6664
|
+
## EventData : <code>object</code>
|
|
6665
|
+
Interface for data returned in callbacks
|
|
6711
6666
|
|
|
6712
|
-
|
|
6713
|
-
|
|
6667
|
+
**Kind**: global interface
|
|
6668
|
+
|
|
6669
|
+
| Param | Type | Description |
|
|
6670
|
+
| --- | --- | --- |
|
|
6671
|
+
| type | [<code>EVENT\_DATA\_TYPE</code>](#EVENT_DATA_TYPE) | Event type of type [EVENT_DATA_TYPE](#EVENT_DATA_TYPE) |
|
|
6672
|
+
| data | <code>string</code> \| [<code>EventDataCheckoutCompletedData</code>](#EventDataCheckoutCompletedData) | optional data returning a string for checkoutError event or [EventDataCheckoutCompletedData](#EventDataCheckoutCompletedData) for checkoutCompleted |
|
|
6673
|
+
|
|
6674
|
+
<a name="EventDataCheckoutCompletedData" id="EventDataCheckoutCompletedData" href="#EventDataCheckoutCompletedData"> </a>
|
|
6675
|
+
|
|
6676
|
+
## EventDataCheckoutCompletedData : <code>object</code>
|
|
6677
|
+
Event data returned for checkoutCompleted callback, holding the One Time Token and the flow type completed.
|
|
6678
|
+
When the flow type is src, masked checkoutData available is also returned
|
|
6679
|
+
|
|
6680
|
+
**Kind**: global interface
|
|
6681
|
+
|
|
6682
|
+
| Param | Type | Description |
|
|
6683
|
+
| --- | --- | --- |
|
|
6684
|
+
| type | <code>string</code> | type of the checkout, can be `src` or `manual`. |
|
|
6685
|
+
| token | <code>string</code> | one time token value. |
|
|
6686
|
+
| [checkoutData] | <code>object</code> | Optional checkout data related to the checkout information. Only available on src flow. |
|
|
6687
|
+
| [checkoutData.card_number_bin] | <code>string</code> | The BIN of the card used for the transaction. |
|
|
6688
|
+
| [checkoutData.card_number_last4] | <code>string</code> | The last four digits of the card number. |
|
|
6689
|
+
| [checkoutData.card_scheme] | <code>string</code> | The card scheme. Values: visa, mastercard, amex, diners, discover. |
|
|
6690
|
+
| [checkoutData.card_type] | <code>string</code> | The type of card. Values: credit, debit, prepaid, combo, flex. |
|
|
6691
|
+
| [checkoutData.address_line1] | <code>string</code> | Address line 1 for billing address. |
|
|
6692
|
+
| [checkoutData.address_line2] | <code>string</code> | Address line 2 for billing address. |
|
|
6693
|
+
| [checkoutData.address_line3] | <code>string</code> | Address line 3 for billing address. |
|
|
6694
|
+
| [checkoutData.address_city] | <code>string</code> | City for billing address. |
|
|
6695
|
+
| [checkoutData.address_postcode] | <code>string</code> | Postal code for billing address. |
|
|
6696
|
+
| [checkoutData.address_state] | <code>string</code> | State or province for billing address. |
|
|
6697
|
+
| [checkoutData.address_country] | <code>string</code> | Country for billing address. |
|
|
6698
|
+
| [checkoutData.shipping] | <code>object</code> | Optional shipping information. |
|
|
6699
|
+
| [checkoutData.shipping.address_line1] | <code>string</code> | Address line 1 for shipping address. |
|
|
6700
|
+
| [checkoutData.shipping.address_line2] | <code>string</code> | Address line 2 for shipping address. |
|
|
6701
|
+
| [checkoutData.shipping.address_line3] | <code>string</code> | Address line 3 for shipping address. |
|
|
6702
|
+
| [checkoutData.shipping.address_city] | <code>string</code> | City for shipping address. |
|
|
6703
|
+
| [checkoutData.shipping.address_postcode] | <code>string</code> | Postal code for shipping address. |
|
|
6704
|
+
| [checkoutData.shipping.address_state] | <code>string</code> | State or province for shipping address. |
|
|
6705
|
+
| [checkoutData.shipping.address_country] | <code>string</code> | Country for shipping address. |
|
|
6706
|
+
|
|
6707
|
+
<a name="IStyles" id="IStyles" href="#IStyles"> </a>
|
|
6708
|
+
|
|
6709
|
+
## IStyles : <code>object</code>
|
|
6710
|
+
Interface for style configs inyected to the SRC checkout
|
|
6711
|
+
|
|
6712
|
+
**Kind**: global interface
|
|
6713
|
+
|
|
6714
|
+
| Param | Type | Description |
|
|
6715
|
+
| --- | --- | --- |
|
|
6716
|
+
| [primary_button_color] | <code>string</code> | Color Code for primary button. |
|
|
6717
|
+
| [primary_button_text_color] | <code>string</code> | Color Code for primary button text. |
|
|
6718
|
+
| [secondary_button_color] | <code>string</code> | Color Code for secondary button. |
|
|
6719
|
+
| [secondary_button_text_color] | <code>string</code> | Color Code for secondary button text. |
|
|
6720
|
+
| [font_family] | <code>string</code> | Font family to be used. |
|
|
6721
|
+
| [enable_src_popup] | <code>boolean</code> | Boolean flag to make the SRC checkout show in a popup window instead of embedded in iframe. |
|
|
6722
|
+
|
|
6723
|
+
<a name="MastercardSRCClickToPay" id="MastercardSRCClickToPay" href="#MastercardSRCClickToPay"> </a>
|
|
6724
|
+
|
|
6725
|
+
## MastercardSRCClickToPay ⇐ <code>SRC</code>
|
|
6726
|
+
Class MastercardSRCClickToPay include methods for interacting with the MastercardSRC checkout and Manual Card option
|
|
6714
6727
|
|
|
6715
6728
|
**Kind**: global class
|
|
6729
|
+
**Extends**: <code>SRC</code>
|
|
6716
6730
|
|
|
6717
|
-
* [
|
|
6718
|
-
* [new
|
|
6731
|
+
* [MastercardSRCClickToPay](#MastercardSRCClickToPay) ⇐ <code>SRC</code>
|
|
6732
|
+
* [new MastercardSRCClickToPay(iframe_selector, service_id, public_key_or_access_token, meta)](#new_MastercardSRCClickToPay_new)
|
|
6733
|
+
* [.load()](#MastercardSRCClickToPay+load)
|
|
6719
6734
|
* [.setStyles(fields)](#SRC+setStyles)
|
|
6720
|
-
* [.load()](#SRC+load)
|
|
6721
6735
|
* [.setEnv(env, [alias])](#SRC+setEnv)
|
|
6722
6736
|
* [.getEnv()](#SRC+getEnv)
|
|
6723
6737
|
* [.on(eventName, [cb])](#SRC+on) ⇒ <code>Promise.<any></code> \| <code>void</code>
|
|
6724
|
-
* [.hideButton([saveSize])](#SRC+hideButton)
|
|
6725
|
-
* [.showButton()](#SRC+showButton)
|
|
6726
6738
|
* [.hideCheckout([saveSize])](#SRC+hideCheckout)
|
|
6727
6739
|
* [.showCheckout()](#SRC+showCheckout)
|
|
6728
6740
|
* [.reload()](#SRC+reload)
|
|
6729
6741
|
* [.useAutoResize()](#SRC+useAutoResize)
|
|
6730
6742
|
|
|
6731
|
-
<a name="
|
|
6743
|
+
<a name="new_MastercardSRCClickToPay_new" id="new_MastercardSRCClickToPay_new" href="#new_MastercardSRCClickToPay_new"> </a>
|
|
6732
6744
|
|
|
6733
|
-
### new
|
|
6745
|
+
### new MastercardSRCClickToPay(iframe_selector, service_id, public_key_or_access_token, meta)
|
|
6734
6746
|
|
|
6735
6747
|
| Param | Type | Description |
|
|
6736
6748
|
| --- | --- | --- |
|
|
6737
|
-
| button_selector | <code>string</code> | Selector of html element. Container for SRC checkout button. |
|
|
6738
6749
|
| iframe_selector | <code>string</code> | Selector of html element. Container for SRC checkout iFrame. |
|
|
6739
6750
|
| service_id | <code>string</code> | Card Scheme Service ID |
|
|
6740
6751
|
| public_key_or_access_token | <code>string</code> | Paydock public key or Access Token |
|
|
6741
|
-
| meta | [<code>
|
|
6752
|
+
| meta | [<code>IMastercardSRCMeta</code>](#IMastercardSRCMeta) | Data that configures the SRC checkout |
|
|
6742
6753
|
|
|
6743
6754
|
**Example**
|
|
6744
6755
|
```js
|
|
6745
|
-
var
|
|
6756
|
+
var mastercardSRC = new MastercardSRCClickToPay('#checkoutIframe', 'service_id', 'public_key', {});
|
|
6746
6757
|
```
|
|
6758
|
+
<a name="MastercardSRCClickToPay+load" id="MastercardSRCClickToPay+load" href="#MastercardSRCClickToPay+load"> </a>
|
|
6759
|
+
|
|
6760
|
+
### mastercardSRCClickToPay.load()
|
|
6761
|
+
The final method after configuring the SRC to start the load process of SRC checkout
|
|
6762
|
+
|
|
6763
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
6747
6764
|
<a name="SRC+setStyles" id="SRC+setStyles" href="#SRC+setStyles"> </a>
|
|
6748
6765
|
|
|
6749
|
-
###
|
|
6766
|
+
### mastercardSRCClickToPay.setStyles(fields)
|
|
6750
6767
|
Object contain styles for widget - call before `.load()`.
|
|
6751
6768
|
|
|
6752
|
-
**Kind**: instance method of [<code>
|
|
6769
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
6770
|
+
**Overrides**: [<code>setStyles</code>](#SRC+setStyles)
|
|
6753
6771
|
|
|
6754
6772
|
| Param | Type | Description |
|
|
6755
6773
|
| --- | --- | --- |
|
|
6756
|
-
| fields | <code>IStyles</code> | name of styles which can be shown in widget [STYLE](STYLE) |
|
|
6774
|
+
| fields | [<code>IStyles</code>](#IStyles) | name of styles which can be shown in widget [STYLE](STYLE) |
|
|
6757
6775
|
|
|
6758
6776
|
**Example**
|
|
6759
6777
|
```js
|
|
6760
6778
|
widget.setStyles({
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6779
|
+
enable_src_popup: true
|
|
6780
|
+
primary_button_color: 'red',
|
|
6781
|
+
secondary_button_color: 'blue',
|
|
6782
|
+
primary_button_text_color: 'white',
|
|
6783
|
+
secondary_button_text_color: 'white',
|
|
6784
|
+
font_family: 'Arial',
|
|
6785
|
+
});
|
|
6766
6786
|
```
|
|
6767
|
-
<a name="SRC+load" id="SRC+load" href="#SRC+load"> </a>
|
|
6768
|
-
|
|
6769
|
-
### srC.load()
|
|
6770
|
-
The final method after configuring the SRC to start the load process of SRC checkout
|
|
6771
|
-
|
|
6772
|
-
**Kind**: instance method of [<code>SRC</code>](#SRC)
|
|
6773
6787
|
<a name="SRC+setEnv" id="SRC+setEnv" href="#SRC+setEnv"> </a>
|
|
6774
6788
|
|
|
6775
|
-
###
|
|
6789
|
+
### mastercardSRCClickToPay.setEnv(env, [alias])
|
|
6776
6790
|
Current method can change environment. By default environment = sandbox.
|
|
6777
6791
|
Also we can change domain alias for this environment. By default domain_alias = paydock.com
|
|
6778
6792
|
|
|
6779
|
-
**Kind**: instance method of [<code>
|
|
6793
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
6794
|
+
**Overrides**: [<code>setEnv</code>](#SRC+setEnv)
|
|
6780
6795
|
|
|
6781
6796
|
| Param | Type | Description |
|
|
6782
6797
|
| --- | --- | --- |
|
|
@@ -6789,25 +6804,27 @@ SRC.setEnv('production');
|
|
|
6789
6804
|
```
|
|
6790
6805
|
<a name="SRC+getEnv" id="SRC+getEnv" href="#SRC+getEnv"> </a>
|
|
6791
6806
|
|
|
6792
|
-
###
|
|
6807
|
+
### mastercardSRCClickToPay.getEnv()
|
|
6793
6808
|
Method to read the current environment
|
|
6794
6809
|
|
|
6795
|
-
**Kind**: instance method of [<code>
|
|
6810
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
6811
|
+
**Overrides**: [<code>getEnv</code>](#SRC+getEnv)
|
|
6796
6812
|
**Example**
|
|
6797
6813
|
```js
|
|
6798
6814
|
SRC.getEnv();
|
|
6799
6815
|
```
|
|
6800
6816
|
<a name="SRC+on" id="SRC+on" href="#SRC+on"> </a>
|
|
6801
6817
|
|
|
6802
|
-
###
|
|
6818
|
+
### mastercardSRCClickToPay.on(eventName, [cb]) ⇒ <code>Promise.<any></code> \| <code>void</code>
|
|
6803
6819
|
Listen to events of SRC
|
|
6804
6820
|
|
|
6805
|
-
**Kind**: instance method of [<code>
|
|
6821
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
6822
|
+
**Overrides**: [<code>on</code>](#SRC+on)
|
|
6806
6823
|
|
|
6807
6824
|
| Param | Type | Description |
|
|
6808
6825
|
| --- | --- | --- |
|
|
6809
6826
|
| eventName | <code>string</code> | Available event names [EVENT](#EVENT) |
|
|
6810
|
-
| [cb] | <code>listener</code> |
|
|
6827
|
+
| [cb] | <code>listener</code> | The callback to handle the event. When available, it will send back data of type [EventData](#EventData) |
|
|
6811
6828
|
|
|
6812
6829
|
**Example**
|
|
6813
6830
|
```js
|
|
@@ -6819,37 +6836,13 @@ SRC.on('checkoutCompleted').then(function (token) {
|
|
|
6819
6836
|
console.log(token);
|
|
6820
6837
|
});
|
|
6821
6838
|
```
|
|
6822
|
-
<a name="SRC+hideButton" id="SRC+hideButton" href="#SRC+hideButton"> </a>
|
|
6823
|
-
|
|
6824
|
-
### srC.hideButton([saveSize])
|
|
6825
|
-
Using this method you can hide button
|
|
6826
|
-
|
|
6827
|
-
**Kind**: instance method of [<code>SRC</code>](#SRC)
|
|
6828
|
-
|
|
6829
|
-
| Param | Type | Default | Description |
|
|
6830
|
-
| --- | --- | --- | --- |
|
|
6831
|
-
| [saveSize] | <code>boolean</code> | <code>false</code> | using this param you can save iframe's size (if applicable) |
|
|
6832
|
-
|
|
6833
|
-
**Example**
|
|
6834
|
-
```js
|
|
6835
|
-
SRC.hideButton();
|
|
6836
|
-
```
|
|
6837
|
-
<a name="SRC+showButton" id="SRC+showButton" href="#SRC+showButton"> </a>
|
|
6838
|
-
|
|
6839
|
-
### srC.showButton()
|
|
6840
|
-
Using this method you can show the SRC button after using hideButton method
|
|
6841
|
-
|
|
6842
|
-
**Kind**: instance method of [<code>SRC</code>](#SRC)
|
|
6843
|
-
**Example**
|
|
6844
|
-
```js
|
|
6845
|
-
SRC.showButton();
|
|
6846
|
-
```
|
|
6847
6839
|
<a name="SRC+hideCheckout" id="SRC+hideCheckout" href="#SRC+hideCheckout"> </a>
|
|
6848
6840
|
|
|
6849
|
-
###
|
|
6841
|
+
### mastercardSRCClickToPay.hideCheckout([saveSize])
|
|
6850
6842
|
Using this method you can hide checkout after load and button click
|
|
6851
6843
|
|
|
6852
|
-
**Kind**: instance method of [<code>
|
|
6844
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
6845
|
+
**Overrides**: [<code>hideCheckout</code>](#SRC+hideCheckout)
|
|
6853
6846
|
|
|
6854
6847
|
| Param | Type | Default | Description |
|
|
6855
6848
|
| --- | --- | --- | --- |
|
|
@@ -6861,30 +6854,33 @@ SRC.hideCheckout();
|
|
|
6861
6854
|
```
|
|
6862
6855
|
<a name="SRC+showCheckout" id="SRC+showCheckout" href="#SRC+showCheckout"> </a>
|
|
6863
6856
|
|
|
6864
|
-
###
|
|
6857
|
+
### mastercardSRCClickToPay.showCheckout()
|
|
6865
6858
|
Using this method you can show checkout after using hideCheckout method
|
|
6866
6859
|
|
|
6867
|
-
**Kind**: instance method of [<code>
|
|
6860
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
6861
|
+
**Overrides**: [<code>showCheckout</code>](#SRC+showCheckout)
|
|
6868
6862
|
**Example**
|
|
6869
6863
|
```js
|
|
6870
6864
|
SRC.showCheckout()
|
|
6871
6865
|
```
|
|
6872
6866
|
<a name="SRC+reload" id="SRC+reload" href="#SRC+reload"> </a>
|
|
6873
6867
|
|
|
6874
|
-
###
|
|
6868
|
+
### mastercardSRCClickToPay.reload()
|
|
6875
6869
|
Using this method you can reload the whole checkout
|
|
6876
6870
|
|
|
6877
|
-
**Kind**: instance method of [<code>
|
|
6871
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
6872
|
+
**Overrides**: [<code>reload</code>](#SRC+reload)
|
|
6878
6873
|
**Example**
|
|
6879
6874
|
```js
|
|
6880
6875
|
SRC.reload()
|
|
6881
6876
|
```
|
|
6882
6877
|
<a name="SRC+useAutoResize" id="SRC+useAutoResize" href="#SRC+useAutoResize"> </a>
|
|
6883
6878
|
|
|
6884
|
-
###
|
|
6879
|
+
### mastercardSRCClickToPay.useAutoResize()
|
|
6885
6880
|
Use this method for resize checkout iFrame according to content height, if applicable
|
|
6886
6881
|
|
|
6887
|
-
**Kind**: instance method of [<code>
|
|
6882
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
6883
|
+
**Overrides**: [<code>useAutoResize</code>](#SRC+useAutoResize)
|
|
6888
6884
|
**Example**
|
|
6889
6885
|
```js
|
|
6890
6886
|
SRC.useAutoResize();
|
|
@@ -6896,15 +6892,28 @@ List of available event's name in the SRC checkout lifecycle
|
|
|
6896
6892
|
|
|
6897
6893
|
**Kind**: global enum
|
|
6898
6894
|
|
|
6899
|
-
| Param | Type | Default |
|
|
6900
|
-
| --- | --- | --- |
|
|
6901
|
-
|
|
|
6902
|
-
|
|
|
6903
|
-
|
|
|
6904
|
-
|
|
|
6905
|
-
| CHECKOUT_COMPLETED | <code>string</code> | <code>"checkoutCompleted"</code> |
|
|
6906
|
-
| CHECKOUT_ERROR | <code>string</code> | <code>"checkoutError"</code> |
|
|
6895
|
+
| Param | Type | Default | Description |
|
|
6896
|
+
| --- | --- | --- | --- |
|
|
6897
|
+
| IFRAME_LOADED | <code>string</code> | <code>"iframeLoaded"</code> | Initial event sent when IFrame is initially loaded. |
|
|
6898
|
+
| 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). |
|
|
6899
|
+
| CHECKOUT_POPUP_OPEN | <code>string</code> | <code>"checkoutPopupOpen"</code> | Event sent when SRC Checkout flow is started, regardless of embedded or windowed mode. |
|
|
6900
|
+
| CHECKOUT_POPUP_CLOSE | <code>string</code> | <code>"checkoutPopupClose"</code> | Event sent when SRC Checkout flow is closed, regardless of embedded or windowed mode. |
|
|
6901
|
+
| CHECKOUT_COMPLETED | <code>string</code> | <code>"checkoutCompleted"</code> | Event sent on successful checkout by customer. Check [data](#EventDataCheckoutCompletedData) for more information. |
|
|
6902
|
+
| CHECKOUT_ERROR | <code>string</code> | <code>"checkoutError"</code> | Event sent on error checkout by customer. Check [data](#EventData) for more information. |
|
|
6903
|
+
|
|
6904
|
+
<a name="EVENT_DATA_TYPE" id="EVENT_DATA_TYPE" href="#EVENT_DATA_TYPE"> </a>
|
|
6905
|
+
|
|
6906
|
+
## EVENT\_DATA\_TYPE : <code>enum</code>
|
|
6907
|
+
List of available event data types
|
|
6908
|
+
|
|
6909
|
+
**Kind**: global enum
|
|
6910
|
+
|
|
6911
|
+
| Param | Type | Default | Description |
|
|
6912
|
+
| --- | --- | --- | --- |
|
|
6913
|
+
| 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 |
|
|
6914
|
+
| 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 |
|
|
6915
|
+
| SUCCESS | <code>string</code> | <code>"Success"</code> | |
|
|
6907
6916
|
|
|
6908
6917
|
|
|
6909
6918
|
## License
|
|
6910
|
-
Copyright (c)
|
|
6919
|
+
Copyright (c) 2024 paydock
|