@paydock/client-sdk 1.106.1-beta → 1.106.11-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 +68 -58
- package/bundles/widget.umd.js +26 -26
- package/bundles/widget.umd.min.js +1 -1
- package/lib/api/api-service-internal.d.ts +1 -1
- package/lib/api/api-service-internal.js +1 -1
- package/lib/api/api-service-internal.js.map +1 -1
- package/lib/configs/sdk.js +1 -1
- package/lib/secure-remote-commerce/click-to-pay-secure-remote-commerce.d.ts +30 -0
- package/lib/secure-remote-commerce/{mastercard-secure-remote-commerce.js → click-to-pay-secure-remote-commerce.js} +10 -10
- package/lib/secure-remote-commerce/click-to-pay-secure-remote-commerce.js.map +1 -0
- package/lib/secure-remote-commerce/index.d.ts +4 -4
- package/lib/secure-remote-commerce/index.js +4 -4
- package/lib/secure-remote-commerce/index.js.map +1 -1
- package/lib/secure-remote-commerce/interfaces.d.ts +4 -4
- package/lib/secure-remote-commerce/interfaces.js +3 -3
- package/lib/secure-remote-commerce/providers/mastercard-src/index.d.ts +1 -1
- package/lib/secure-remote-commerce/providers/mastercard-src/index.js +1 -1
- package/lib/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts +4 -4
- package/lib/secure-remote-commerce/providers/mastercard-src/mastercard-src.js +2 -2
- package/lib/secure-remote-commerce/providers/mastercard-src/mastercard-src.js.map +1 -1
- package/lib/secure-remote-commerce/secure-remote-commerce.d.ts +3 -3
- package/lib/secure-remote-commerce/secure-remote-commerce.js +2 -2
- package/lib/secure-remote-commerce/secure-remote-commerce.js.map +1 -1
- package/package.json +1 -1
- package/slate.md +28 -18
- package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.d.ts +0 -30
- package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.js.map +0 -1
|
@@ -13,7 +13,7 @@ export class ApiServiceInternal {
|
|
|
13
13
|
export var CARD_SCHEME_SERVICE;
|
|
14
14
|
(function (CARD_SCHEME_SERVICE) {
|
|
15
15
|
CARD_SCHEME_SERVICE["VISA_SRC"] = "VisaSRC";
|
|
16
|
-
CARD_SCHEME_SERVICE["MASTERCARD_SRC"] = "
|
|
16
|
+
CARD_SCHEME_SERVICE["MASTERCARD_SRC"] = "ClickToPay";
|
|
17
17
|
})(CARD_SCHEME_SERVICE || (CARD_SCHEME_SERVICE = {}));
|
|
18
18
|
;
|
|
19
19
|
//# sourceMappingURL=../../src/lib/api/api-service-internal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-service-internal.js","sourceRoot":"","sources":["../../api/api-service-internal.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAAG,iCAAiC,CAAC;AAErD,MAAM,OAAO,kBAAkB;IAC3B,YAAsB,GAAgB;QAAhB,QAAG,GAAH,GAAG,CAAa;IACtC,CAAC;IAED,SAAS,CAAC,UAAkB;QACxB,MAAM,GAAG,GAAG,UAAU,CAAC,OAAO,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;QAE1D,OAAO,IAAI,CAAC,GAAG;aACV,gBAAgB,CAAwB,KAAK,EAAE,GAAG,CAAC;aACnD,IAAI,CAAC,SAAS,CAAC,CAAC;IACzB,CAAC;CACJ;AAED,MAAM,CAAN,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC3B,2CAAoB,CAAA;IACpB,
|
|
1
|
+
{"version":3,"file":"api-service-internal.js","sourceRoot":"","sources":["../../api/api-service-internal.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAAG,iCAAiC,CAAC;AAErD,MAAM,OAAO,kBAAkB;IAC3B,YAAsB,GAAgB;QAAhB,QAAG,GAAH,GAAG,CAAa;IACtC,CAAC;IAED,SAAS,CAAC,UAAkB;QACxB,MAAM,GAAG,GAAG,UAAU,CAAC,OAAO,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;QAE1D,OAAO,IAAI,CAAC,GAAG;aACV,gBAAgB,CAAwB,KAAK,EAAE,GAAG,CAAC;aACnD,IAAI,CAAC,SAAS,CAAC,CAAC;IACzB,CAAC;CACJ;AAED,MAAM,CAAN,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC3B,2CAAoB,CAAA;IACpB,oDAA6B,CAAA;AACjC,CAAC,EAHW,mBAAmB,KAAnB,mBAAmB,QAG9B;AAAA,CAAC"}
|
package/lib/configs/sdk.js
CHANGED
|
@@ -12,5 +12,5 @@ SDK.headerKeys = Object.freeze({
|
|
|
12
12
|
// the empty string is set in case if version not provided.
|
|
13
13
|
//
|
|
14
14
|
// e.g: grunt build --sdk-version=v1.0.0
|
|
15
|
-
SDK._version = 'v1.106.
|
|
15
|
+
SDK._version = 'v1.106.11-beta';
|
|
16
16
|
//# sourceMappingURL=../../src/lib/configs/sdk.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { IClickToPayMeta } from './interfaces';
|
|
2
|
+
import { SRC } from './secure-remote-commerce';
|
|
3
|
+
/**
|
|
4
|
+
* Class ClickToPay include methods for interacting with the ClickToPay checkout and Manual Card option
|
|
5
|
+
*
|
|
6
|
+
* @extends SRC
|
|
7
|
+
*
|
|
8
|
+
* @constructor
|
|
9
|
+
*
|
|
10
|
+
* @param {string} iframe_selector - Selector of html element. Container for Click To Pay checkout iFrame.
|
|
11
|
+
* @param {string} service_id - Card Scheme Service ID
|
|
12
|
+
* @param {string} public_key_or_access_token - Paydock public key or Access Token
|
|
13
|
+
* @param {IClickToPayMeta} meta - Data that configures the Click To Pay checkout
|
|
14
|
+
* @example
|
|
15
|
+
* var mastercardSRC = new ClickToPay('#checkoutIframe', 'service_id', 'public_key', {});
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
declare class ClickToPay extends SRC {
|
|
19
|
+
protected iframe_selector: string;
|
|
20
|
+
protected service_id: string;
|
|
21
|
+
protected public_key_or_access_token: string;
|
|
22
|
+
protected meta: IClickToPayMeta;
|
|
23
|
+
/** @constructs */ constructor(iframe_selector: string, service_id: string, public_key_or_access_token: string, meta: IClickToPayMeta);
|
|
24
|
+
/**
|
|
25
|
+
* The final method after configuring the SRC to start the load process of Click To Pay checkout
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
load(): void;
|
|
29
|
+
}
|
|
30
|
+
export { ClickToPay };
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ClickToPaySRC } from './providers/mastercard-src/mastercard-src';
|
|
2
2
|
import { SRC } from './secure-remote-commerce';
|
|
3
3
|
/**
|
|
4
|
-
* Class
|
|
4
|
+
* Class ClickToPay include methods for interacting with the ClickToPay checkout and Manual Card option
|
|
5
5
|
*
|
|
6
6
|
* @extends SRC
|
|
7
7
|
*
|
|
8
8
|
* @constructor
|
|
9
9
|
*
|
|
10
|
-
* @param {string} iframe_selector - Selector of html element. Container for
|
|
10
|
+
* @param {string} iframe_selector - Selector of html element. Container for Click To Pay checkout iFrame.
|
|
11
11
|
* @param {string} service_id - Card Scheme Service ID
|
|
12
12
|
* @param {string} public_key_or_access_token - Paydock public key or Access Token
|
|
13
|
-
* @param {
|
|
13
|
+
* @param {IClickToPayMeta} meta - Data that configures the Click To Pay checkout
|
|
14
14
|
* @example
|
|
15
|
-
* var mastercardSRC = new
|
|
15
|
+
* var mastercardSRC = new ClickToPay('#checkoutIframe', 'service_id', 'public_key', {});
|
|
16
16
|
*
|
|
17
17
|
*/
|
|
18
|
-
class
|
|
18
|
+
class ClickToPay extends SRC {
|
|
19
19
|
/** @constructs */ // constructs added for correct parse classes jsdoc2md
|
|
20
20
|
constructor(iframe_selector, service_id, public_key_or_access_token, meta) {
|
|
21
21
|
super(iframe_selector, service_id, public_key_or_access_token, meta);
|
|
@@ -25,16 +25,16 @@ class MastercardSRCClickToPay extends SRC {
|
|
|
25
25
|
this.meta = meta;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
* The final method after configuring the SRC to start the load process of
|
|
28
|
+
* The final method after configuring the SRC to start the load process of Click To Pay checkout
|
|
29
29
|
*
|
|
30
30
|
*/
|
|
31
31
|
load() {
|
|
32
32
|
if (this.provider)
|
|
33
33
|
return;
|
|
34
34
|
this.meta.customizations = this.style;
|
|
35
|
-
this.provider = new
|
|
35
|
+
this.provider = new ClickToPaySRC(this.iframe_selector, this.service_id, this.public_key_or_access_token, this.meta, this.eventEmitter, this.autoResize, this.env, this.alias);
|
|
36
36
|
this.provider.load();
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
export {
|
|
40
|
-
//# sourceMappingURL=../../src/lib/secure-remote-commerce/
|
|
39
|
+
export { ClickToPay };
|
|
40
|
+
//# sourceMappingURL=../../src/lib/secure-remote-commerce/click-to-pay-secure-remote-commerce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"click-to-pay-secure-remote-commerce.js","sourceRoot":"","sources":["../../secure-remote-commerce/click-to-pay-secure-remote-commerce.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAW,SAAQ,GAAG;IACxB,kBAAkB,CAAC,sDAAsD;IACzE,YAAsB,eAAuB,EAAY,UAAkB,EAAY,0BAAkC,EAAY,IAAqB;QACtJ,KAAK,CAAC,eAAe,EAAE,UAAU,EAAE,0BAA0B,EAAE,IAAI,CAAC,CAAC;QADnD,oBAAe,GAAf,eAAe,CAAQ;QAAY,eAAU,GAAV,UAAU,CAAQ;QAAY,+BAA0B,GAA1B,0BAA0B,CAAQ;QAAY,SAAI,GAAJ,IAAI,CAAiB;IAE1J,CAAC;IAED;;;OAGG;IACI,IAAI;QACP,IAAI,IAAI,CAAC,QAAQ;YACb,OAAO;QAEX,IAAI,CAAC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC;QAEtC,IAAI,CAAC,QAAQ,GAAG,IAAI,aAAa,CAC7B,IAAI,CAAC,eAAe,EACpB,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,0BAA0B,EAC/B,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,GAAG,EACR,IAAI,CAAC,KAAK,CACb,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;CACJ;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ClickToPay } from './click-to-pay-secure-remote-commerce';
|
|
2
2
|
/**
|
|
3
3
|
* 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).
|
|
4
4
|
* @interface IMastercardSRCMeta
|
|
@@ -20,7 +20,7 @@ export { MastercardSRCClickToPay } from './mastercard-secure-remote-commerce';
|
|
|
20
20
|
* @param {string} [dpa_data.dpa_supported_phone_number.phone_number] The phone number part of the phone number.
|
|
21
21
|
* @param {string} [dpa_data.dpa_support_uri] URI for DPA support.
|
|
22
22
|
* @param {string} [dpa_data.application_type] Application type, either 'WEB_BROWSER' or 'MOBILE_APP'.
|
|
23
|
-
* @param {string[]} [co_brand_names] List of co-brand names associated with the
|
|
23
|
+
* @param {string[]} [co_brand_names] List of co-brand names associated with the Click to Pay experience.
|
|
24
24
|
* @param {string} [checkout_experience] Checkout experience type, either 'WITHIN_CHECKOUT' or 'PAYMENT_SETTINGS'.
|
|
25
25
|
* @param {string} [services] Services offered, such as 'INLINE_CHECKOUT' or 'INLINE_INSTALLMENTS'.
|
|
26
26
|
* @param {object} [dpa_transaction_options] Object that stores options for creating a transaction with DPA.
|
|
@@ -89,7 +89,7 @@ export { MastercardSRCClickToPay } from './mastercard-secure-remote-commerce';
|
|
|
89
89
|
* @param {string} [checkoutData.shipping.address_country] Country for shipping address.
|
|
90
90
|
*/
|
|
91
91
|
/**
|
|
92
|
-
* Interface for style configs inyected to the
|
|
92
|
+
* Interface for style configs inyected to the Click to Pay checkout
|
|
93
93
|
* @interface IStyles
|
|
94
94
|
*
|
|
95
95
|
* @type {object}
|
|
@@ -98,5 +98,5 @@ export { MastercardSRCClickToPay } from './mastercard-secure-remote-commerce';
|
|
|
98
98
|
* @param {string} [secondary_button_color] Color Code for secondary button.
|
|
99
99
|
* @param {string} [secondary_button_text_color] Color Code for secondary button text.
|
|
100
100
|
* @param {string} [font_family] Font family to be used.
|
|
101
|
-
* @param {boolean} [enable_src_popup] Boolean flag to make the
|
|
101
|
+
* @param {boolean} [enable_src_popup] Boolean flag to make the Click to Pay checkout show in a popup window instead of embedded in iframe.
|
|
102
102
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ClickToPay } from './click-to-pay-secure-remote-commerce';
|
|
2
2
|
/**
|
|
3
3
|
* 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).
|
|
4
4
|
* @interface IMastercardSRCMeta
|
|
@@ -20,7 +20,7 @@ export { MastercardSRCClickToPay } from './mastercard-secure-remote-commerce';
|
|
|
20
20
|
* @param {string} [dpa_data.dpa_supported_phone_number.phone_number] The phone number part of the phone number.
|
|
21
21
|
* @param {string} [dpa_data.dpa_support_uri] URI for DPA support.
|
|
22
22
|
* @param {string} [dpa_data.application_type] Application type, either 'WEB_BROWSER' or 'MOBILE_APP'.
|
|
23
|
-
* @param {string[]} [co_brand_names] List of co-brand names associated with the
|
|
23
|
+
* @param {string[]} [co_brand_names] List of co-brand names associated with the Click to Pay experience.
|
|
24
24
|
* @param {string} [checkout_experience] Checkout experience type, either 'WITHIN_CHECKOUT' or 'PAYMENT_SETTINGS'.
|
|
25
25
|
* @param {string} [services] Services offered, such as 'INLINE_CHECKOUT' or 'INLINE_INSTALLMENTS'.
|
|
26
26
|
* @param {object} [dpa_transaction_options] Object that stores options for creating a transaction with DPA.
|
|
@@ -89,7 +89,7 @@ export { MastercardSRCClickToPay } from './mastercard-secure-remote-commerce';
|
|
|
89
89
|
* @param {string} [checkoutData.shipping.address_country] Country for shipping address.
|
|
90
90
|
*/
|
|
91
91
|
/**
|
|
92
|
-
* Interface for style configs inyected to the
|
|
92
|
+
* Interface for style configs inyected to the Click to Pay checkout
|
|
93
93
|
* @interface IStyles
|
|
94
94
|
*
|
|
95
95
|
* @type {object}
|
|
@@ -98,6 +98,6 @@ export { MastercardSRCClickToPay } from './mastercard-secure-remote-commerce';
|
|
|
98
98
|
* @param {string} [secondary_button_color] Color Code for secondary button.
|
|
99
99
|
* @param {string} [secondary_button_text_color] Color Code for secondary button text.
|
|
100
100
|
* @param {string} [font_family] Font family to be used.
|
|
101
|
-
* @param {boolean} [enable_src_popup] Boolean flag to make the
|
|
101
|
+
* @param {boolean} [enable_src_popup] Boolean flag to make the Click to Pay checkout show in a popup window instead of embedded in iframe.
|
|
102
102
|
*/
|
|
103
103
|
//# sourceMappingURL=../../src/lib/secure-remote-commerce/index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../secure-remote-commerce/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../secure-remote-commerce/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH;;;;;;;;;;;GAWG"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* List of available event's name in the
|
|
2
|
+
* List of available event's name in the Click To Pay checkout lifecycle
|
|
3
3
|
* @enum EVENT
|
|
4
4
|
*
|
|
5
5
|
* @type {object}
|
|
6
6
|
* @param {string} IFRAME_LOADED=iframeLoaded Initial event sent when IFrame is initially loaded.
|
|
7
7
|
* @param {string} CHECKOUT_READY=checkoutReady Event sent when checkout is loaded and ready to be used by customer. Leverage alongside [showCheckout](#SRC+showCheckout) and [hideCheckout](#SRC+hideCheckout).
|
|
8
|
-
* @param {string} CHECKOUT_POPUP_OPEN=checkoutPopupOpen Event sent when
|
|
9
|
-
* @param {string} CHECKOUT_POPUP_CLOSE=checkoutPopupClose Event sent when
|
|
8
|
+
* @param {string} CHECKOUT_POPUP_OPEN=checkoutPopupOpen Event sent when Click To Pay checkout flow is started, regardless of embedded or windowed mode.
|
|
9
|
+
* @param {string} CHECKOUT_POPUP_CLOSE=checkoutPopupClose Event sent when Click To Pay checkout flow is closed, regardless of embedded or windowed mode.
|
|
10
10
|
* @param {string} CHECKOUT_COMPLETED=checkoutCompleted Event sent on successful checkout by customer. Check [data](#EventDataCheckoutCompletedData) for more information.
|
|
11
11
|
* @param {string} CHECKOUT_ERROR=checkoutError Event sent on error checkout by customer. Check [data](#EventData) for more information.
|
|
12
12
|
*/
|
|
@@ -96,7 +96,7 @@ interface Customer {
|
|
|
96
96
|
first_name?: string;
|
|
97
97
|
last_name?: string;
|
|
98
98
|
}
|
|
99
|
-
export interface
|
|
99
|
+
export interface IClickToPayMeta extends IBaseSRCMeta {
|
|
100
100
|
dpa_data?: IBaseSRCMeta['dpa_data'] & {
|
|
101
101
|
dpa_address?: string;
|
|
102
102
|
dpa_email_address?: string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* List of available event's name in the
|
|
2
|
+
* List of available event's name in the Click To Pay checkout lifecycle
|
|
3
3
|
* @enum EVENT
|
|
4
4
|
*
|
|
5
5
|
* @type {object}
|
|
6
6
|
* @param {string} IFRAME_LOADED=iframeLoaded Initial event sent when IFrame is initially loaded.
|
|
7
7
|
* @param {string} CHECKOUT_READY=checkoutReady Event sent when checkout is loaded and ready to be used by customer. Leverage alongside [showCheckout](#SRC+showCheckout) and [hideCheckout](#SRC+hideCheckout).
|
|
8
|
-
* @param {string} CHECKOUT_POPUP_OPEN=checkoutPopupOpen Event sent when
|
|
9
|
-
* @param {string} CHECKOUT_POPUP_CLOSE=checkoutPopupClose Event sent when
|
|
8
|
+
* @param {string} CHECKOUT_POPUP_OPEN=checkoutPopupOpen Event sent when Click To Pay checkout flow is started, regardless of embedded or windowed mode.
|
|
9
|
+
* @param {string} CHECKOUT_POPUP_CLOSE=checkoutPopupClose Event sent when Click To Pay checkout flow is closed, regardless of embedded or windowed mode.
|
|
10
10
|
* @param {string} CHECKOUT_COMPLETED=checkoutCompleted Event sent on successful checkout by customer. Check [data](#EventDataCheckoutCompletedData) for more information.
|
|
11
11
|
* @param {string} CHECKOUT_ERROR=checkoutError Event sent on error checkout by customer. Check [data](#EventData) for more information.
|
|
12
12
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ClickToPaySRC } from './mastercard-src';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ClickToPaySRC } from './mastercard-src';
|
|
2
2
|
//# sourceMappingURL=../../../../src/lib/secure-remote-commerce/providers/mastercard-src/index.js.map
|
|
@@ -4,16 +4,16 @@ import { IFrame } from '../../../components/iframe';
|
|
|
4
4
|
import { IFrameEvent } from '../../../components/iframe-event';
|
|
5
5
|
import { EventEmitter } from "../../../helper/event-emitter";
|
|
6
6
|
import { SRCProvider } from '../src-provider';
|
|
7
|
-
import {
|
|
8
|
-
export declare class
|
|
9
|
-
protected meta:
|
|
7
|
+
import { IClickToPayMeta } from '../../interfaces';
|
|
8
|
+
export declare class ClickToPaySRC implements SRCProvider {
|
|
9
|
+
protected meta: IClickToPayMeta;
|
|
10
10
|
protected eventEmitter: EventEmitter;
|
|
11
11
|
protected autoResize: any;
|
|
12
12
|
protected link: Link;
|
|
13
13
|
protected iFrameContainer: Container;
|
|
14
14
|
protected iFrame: IFrame;
|
|
15
15
|
protected iFrameEvent: IFrameEvent;
|
|
16
|
-
constructor(iframe_selector: string, service_id: string, public_key: string, meta:
|
|
16
|
+
constructor(iframe_selector: string, service_id: string, public_key: string, meta: IClickToPayMeta, eventEmitter: EventEmitter, autoResize: any, env: string, alias?: string);
|
|
17
17
|
private setupIFrameEvents;
|
|
18
18
|
load(): void;
|
|
19
19
|
getEnv(): string;
|
|
@@ -4,7 +4,7 @@ import { IFrame } from '../../../components/iframe';
|
|
|
4
4
|
import { IFrameEvent } from '../../../components/iframe-event';
|
|
5
5
|
import { EVENT } from '../../interfaces';
|
|
6
6
|
import { SDK } from '../../../configs/sdk';
|
|
7
|
-
export class
|
|
7
|
+
export class ClickToPaySRC {
|
|
8
8
|
constructor(iframe_selector, service_id, public_key, meta, eventEmitter, autoResize, env, alias) {
|
|
9
9
|
this.meta = meta;
|
|
10
10
|
this.eventEmitter = eventEmitter;
|
|
@@ -47,7 +47,7 @@ export class MastercardSRC {
|
|
|
47
47
|
this.useAutoResize(true);
|
|
48
48
|
}
|
|
49
49
|
load() {
|
|
50
|
-
this.iFrame.load(this.link.getUrl(), { title: '
|
|
50
|
+
this.iFrame.load(this.link.getUrl(), { title: 'Click To Pay checkout' });
|
|
51
51
|
const iframeElement = this.iFrame.getElement();
|
|
52
52
|
this.iFrame.setStyle('width', '100%');
|
|
53
53
|
if (iframeElement)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mastercard-src.js","sourceRoot":"","sources":["../../../../secure-remote-commerce/providers/mastercard-src/mastercard-src.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAc,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAG3E,OAAO,EAAE,KAAK,
|
|
1
|
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AU,GAAG,IAAI,CAAC;QAEvB,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;QACrC,IAAI,EAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,CAAA;YAClB,OAAO;QAEX,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,EAAE,IAAI,EAAc,EAAE,EAAE;;YACrE,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;YAC/C,IAAI,aAAa,EAAE;gBACf,aAAa,CAAC,SAAS,GAAG,IAAI,CAAC;gBAC/B,UAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,0CAAE,MAAM;oBAClB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,0CAAE,MAAM,IAAG,IAAI,CAAC,CAAC;aACjE;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACJ"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { EventEmitter } from '../helper/event-emitter';
|
|
2
2
|
import { ApiInternal } from '../api/api-internal';
|
|
3
3
|
import { SRCProvider } from './providers/src-provider';
|
|
4
|
-
import { IStyles,
|
|
4
|
+
import { IStyles, IClickToPayMeta } from './interfaces';
|
|
5
5
|
declare abstract class SRC {
|
|
6
6
|
protected iframe_selector: string;
|
|
7
7
|
protected service_id: string;
|
|
8
8
|
protected public_key_or_access_token: string;
|
|
9
|
-
protected meta:
|
|
9
|
+
protected meta: IClickToPayMeta;
|
|
10
10
|
protected eventEmitter: EventEmitter;
|
|
11
11
|
protected env: string;
|
|
12
12
|
protected alias?: string;
|
|
@@ -14,7 +14,7 @@ declare abstract class SRC {
|
|
|
14
14
|
protected provider: SRCProvider;
|
|
15
15
|
protected autoResize: boolean;
|
|
16
16
|
protected style: IStyles;
|
|
17
|
-
constructor(iframe_selector: string, service_id: string, public_key_or_access_token: string, meta:
|
|
17
|
+
constructor(iframe_selector: string, service_id: string, public_key_or_access_token: string, meta: IClickToPayMeta);
|
|
18
18
|
/**
|
|
19
19
|
* Object contain styles for widget - call before `.load()`.
|
|
20
20
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { API_AUTH_TYPE } from '../api/api-base';
|
|
2
2
|
import { CARD_SCHEME_SERVICE } from '../api/api-service-internal';
|
|
3
3
|
import { EventEmitter } from '../helper/event-emitter';
|
|
4
|
-
import {
|
|
4
|
+
import { ClickToPaySRC } from './providers/mastercard-src';
|
|
5
5
|
import { ApiInternal } from '../api/api-internal';
|
|
6
6
|
import { STYLE } from './interfaces';
|
|
7
7
|
import { ObjectHelper } from '../helper/object';
|
|
@@ -49,7 +49,7 @@ class SRC {
|
|
|
49
49
|
this.meta.customizations = this.style; // assign the style on the start of the widget
|
|
50
50
|
switch (type) {
|
|
51
51
|
case CARD_SCHEME_SERVICE.MASTERCARD_SRC:
|
|
52
|
-
this.provider = new
|
|
52
|
+
this.provider = new ClickToPaySRC(this.iframe_selector, this.service_id, this.public_key_or_access_token, this.meta, this.eventEmitter, this.autoResize, this.env, this.alias);
|
|
53
53
|
break;
|
|
54
54
|
}
|
|
55
55
|
;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secure-remote-commerce.js","sourceRoot":"","sources":["../../secure-remote-commerce/secure-remote-commerce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAW,KAAK,
|
|
1
|
+
{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/slate.md
CHANGED
|
@@ -1664,21 +1664,28 @@ Similarly, for **GooglePay via MPGS** you can initialize the `PaymentMethodSpeci
|
|
|
1664
1664
|
</html>
|
|
1665
1665
|
```
|
|
1666
1666
|
|
|
1667
|
-
#
|
|
1667
|
+
# Click To Pay
|
|
1668
|
+
|
|
1668
1669
|
## Overview
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1670
|
+
|
|
1671
|
+
Integrate with Click To Pay using Paydock's Click To Pay widget.
|
|
1672
|
+
For a full description of the methods and parameters, reference the [README file](https://www.npmjs.com/package/@paydock/client-sdk#ClickToPay).
|
|
1673
|
+
|
|
1674
|
+
## Click To Pay simple example
|
|
1675
|
+
|
|
1672
1676
|
The following section provides an example use case and integration for the widget.
|
|
1677
|
+
|
|
1673
1678
|
### Create a Container
|
|
1674
|
-
|
|
1679
|
+
|
|
1680
|
+
To integrate the Click To Pay checkout iFrame, create a container in your HTML code. This container serves as the placeholder for the iFrame.
|
|
1681
|
+
|
|
1675
1682
|
```html
|
|
1676
1683
|
<div id="checkoutIframe"></div>
|
|
1677
1684
|
```
|
|
1678
1685
|
### Initialize the Widget
|
|
1679
1686
|
Use the following code to initialize your widget:
|
|
1680
1687
|
```javascript
|
|
1681
|
-
var src = new paydock.
|
|
1688
|
+
var src = new paydock.ClickToPay(
|
|
1682
1689
|
"#checkoutIframe",
|
|
1683
1690
|
"service_id",
|
|
1684
1691
|
"paydock_public_key_or_access_token",
|
|
@@ -1688,8 +1695,8 @@ src.load();
|
|
|
1688
1695
|
```
|
|
1689
1696
|
```javascript--es2015
|
|
1690
1697
|
// ES2015 | TypeScript
|
|
1691
|
-
import {
|
|
1692
|
-
var src = new
|
|
1698
|
+
import { ClickToPay } from '@paydock/client-sdk';
|
|
1699
|
+
var src = new ClickToPay(
|
|
1693
1700
|
"#checkoutIframe",
|
|
1694
1701
|
"service_id",
|
|
1695
1702
|
"paydock_public_key_or_access_token",
|
|
@@ -1712,7 +1719,7 @@ A full example of the container and the initialized widget is as follows:
|
|
|
1712
1719
|
<div id="checkoutIframe"></div>
|
|
1713
1720
|
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
1714
1721
|
<script>
|
|
1715
|
-
var src = new paydock.
|
|
1722
|
+
var src = new paydock.ClickToPay(
|
|
1716
1723
|
"#checkoutIframe",
|
|
1717
1724
|
"service_id",
|
|
1718
1725
|
"paydock_public_key_or_access_token",
|
|
@@ -1723,7 +1730,9 @@ A full example of the container and the initialized widget is as follows:
|
|
|
1723
1730
|
</body>
|
|
1724
1731
|
</html>
|
|
1725
1732
|
```
|
|
1726
|
-
|
|
1733
|
+
|
|
1734
|
+
## Customize your Click To Pay Checkout
|
|
1735
|
+
|
|
1727
1736
|
The following is an advanced example that includes customization. You can use these methods to enhance your checkout experience.
|
|
1728
1737
|
### Settings
|
|
1729
1738
|
```javascript
|
|
@@ -1756,7 +1765,7 @@ src.on('checkoutError', (error) => {
|
|
|
1756
1765
|
<div id="checkoutIframe"></div>
|
|
1757
1766
|
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
1758
1767
|
<script>
|
|
1759
|
-
var src = new paydock.
|
|
1768
|
+
var src = new paydock.ClickToPay(
|
|
1760
1769
|
"#checkoutIframe",
|
|
1761
1770
|
"service_id",
|
|
1762
1771
|
"paydock_public_key_or_access_token",
|
|
@@ -1783,7 +1792,7 @@ src.on('checkoutError', (error) => {
|
|
|
1783
1792
|
To customize your billing address experience, Paydock uses a flag that manages whether a customer's billing address is mandatory.
|
|
1784
1793
|
The options for this customization are NONE (default option), and POSTAL_COUNTRY or FULL.
|
|
1785
1794
|
```
|
|
1786
|
-
var src = new paydock.
|
|
1795
|
+
var src = new paydock.ClickToPay(
|
|
1787
1796
|
"#checkoutIframe",
|
|
1788
1797
|
"service_id",
|
|
1789
1798
|
"paydock_public_key_or_access_token",
|
|
@@ -1794,10 +1803,11 @@ var src = new paydock.MastercardSRCClickToPay(
|
|
|
1794
1803
|
},
|
|
1795
1804
|
);
|
|
1796
1805
|
```
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1806
|
+
|
|
1807
|
+
The Click To Pay 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.
|
|
1808
|
+
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 Click To Pay checkout, you can provide it alongside other information at the charge creation step:
|
|
1809
|
+
1. Disable the billing address in Paydock's Click To Pay widget.
|
|
1810
|
+
2. Get your One Time Token from the Click To Pay widget alongside other details that may have been collected outside the Click To Pay checkout as the shipping address.
|
|
1801
1811
|
3. Send the billing address when creating the charge.
|
|
1802
1812
|
```
|
|
1803
1813
|
POST v1/charges
|
|
@@ -1832,7 +1842,7 @@ You can send a flag `unaccepted_card_type` to block the usage of a specific card
|
|
|
1832
1842
|
### Example code
|
|
1833
1843
|
The following example demonstrates how to block the card:
|
|
1834
1844
|
```
|
|
1835
|
-
var src = new paydock.
|
|
1845
|
+
var src = new paydock.ClickToPay(
|
|
1836
1846
|
"#checkoutIframe",
|
|
1837
1847
|
"service_id",
|
|
1838
1848
|
"paydock_public_key",
|
|
@@ -1845,7 +1855,7 @@ var src = new paydock.MastercardSRCClickToPay(
|
|
|
1845
1855
|
Customize the look and feel of your UI. The following example demonstrates changes in the styling of the buttons.
|
|
1846
1856
|
### Example code
|
|
1847
1857
|
```
|
|
1848
|
-
var src = new paydock.
|
|
1858
|
+
var src = new paydock.ClickToPay(
|
|
1849
1859
|
"#checkoutIframe",
|
|
1850
1860
|
"service_id",
|
|
1851
1861
|
"paydock_public_key",
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { IMastercardSRCMeta } from './interfaces';
|
|
2
|
-
import { SRC } from './secure-remote-commerce';
|
|
3
|
-
/**
|
|
4
|
-
* Class MastercardSRCClickToPay include methods for interacting with the MastercardSRC checkout and Manual Card option
|
|
5
|
-
*
|
|
6
|
-
* @extends SRC
|
|
7
|
-
*
|
|
8
|
-
* @constructor
|
|
9
|
-
*
|
|
10
|
-
* @param {string} iframe_selector - Selector of html element. Container for SRC checkout iFrame.
|
|
11
|
-
* @param {string} service_id - Card Scheme Service ID
|
|
12
|
-
* @param {string} public_key_or_access_token - Paydock public key or Access Token
|
|
13
|
-
* @param {IMastercardSRCMeta} meta - Data that configures the SRC checkout
|
|
14
|
-
* @example
|
|
15
|
-
* var mastercardSRC = new MastercardSRCClickToPay('#checkoutIframe', 'service_id', 'public_key', {});
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
declare class MastercardSRCClickToPay extends SRC {
|
|
19
|
-
protected iframe_selector: string;
|
|
20
|
-
protected service_id: string;
|
|
21
|
-
protected public_key_or_access_token: string;
|
|
22
|
-
protected meta: IMastercardSRCMeta;
|
|
23
|
-
/** @constructs */ constructor(iframe_selector: string, service_id: string, public_key_or_access_token: string, meta: IMastercardSRCMeta);
|
|
24
|
-
/**
|
|
25
|
-
* The final method after configuring the SRC to start the load process of SRC checkout
|
|
26
|
-
*
|
|
27
|
-
*/
|
|
28
|
-
load(): void;
|
|
29
|
-
}
|
|
30
|
-
export { MastercardSRCClickToPay };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mastercard-secure-remote-commerce.js","sourceRoot":"","sources":["../../secure-remote-commerce/mastercard-secure-remote-commerce.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C;;;;;;;;;;;;;;GAcG;AACH,MAAM,uBAAwB,SAAQ,GAAG;IACrC,kBAAkB,CAAC,sDAAsD;IACzE,YAAsB,eAAuB,EAAY,UAAkB,EAAY,0BAAkC,EAAY,IAAwB;QACzJ,KAAK,CAAC,eAAe,EAAE,UAAU,EAAE,0BAA0B,EAAE,IAAI,CAAC,CAAC;QADnD,oBAAe,GAAf,eAAe,CAAQ;QAAY,eAAU,GAAV,UAAU,CAAQ;QAAY,+BAA0B,GAA1B,0BAA0B,CAAQ;QAAY,SAAI,GAAJ,IAAI,CAAoB;IAE7J,CAAC;IAED;;;OAGG;IACI,IAAI;QACP,IAAI,IAAI,CAAC,QAAQ;YACb,OAAO;QAEX,IAAI,CAAC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC;QAEtC,IAAI,CAAC,QAAQ,GAAG,IAAI,aAAa,CAC7B,IAAI,CAAC,eAAe,EACpB,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,0BAA0B,EAC/B,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,GAAG,EACR,IAAI,CAAC,KAAK,CACb,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;CACJ;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|