@fat-zebra/sdk 1.5.5-beta.0 → 1.5.6
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/dist/applepay/applepay.js +10 -0
- package/dist/applepay/clients/apple-pay-client.js +1 -1
- package/dist/click_to_pay/index.d.ts +1 -0
- package/dist/click_to_pay/index.js +27 -5
- package/dist/click_to_pay/types.d.ts +1 -0
- package/dist/hpp/hpp.js +1 -0
- package/dist/local/fatzebra.js.map +1 -1
- package/dist/main.js +3 -3
- package/dist/paypal/paypal-button.d.ts +31 -0
- package/dist/paypal/paypal-button.js +199 -0
- package/dist/paypal/paypal-checkout.d.ts +21 -0
- package/dist/paypal/paypal-checkout.js +100 -0
- package/dist/paypal/types.d.ts +188 -0
- package/dist/paypal/types.js +5 -0
- package/dist/paypal/validation.d.ts +4 -0
- package/dist/paypal/validation.js +65 -0
- package/dist/react/{applePayUrl.d.ts → url.d.ts} +2 -2
- package/dist/react/url.js +33 -0
- package/dist/sandbox/fatzebra.js +1 -1
- package/dist/sandbox/fatzebra.js.LICENSE.txt +1 -1
- package/dist/sca/index.js +4 -2
- package/dist/sca/scenarios/enrollment.js +2 -2
- package/dist/sca/scenarios/validation.js +3 -3
- package/dist/sca/types.d.ts +2 -0
- package/dist/shared/event-manager.d.ts +1 -1
- package/dist/shared/types.d.ts +16 -3
- package/dist/shared/types.js +9 -1
- package/dist/src/paypal/paypal-button.js +311 -0
- package/dist/src/paypal/paypal-button.js.map +1 -0
- package/dist/src/paypal/paypal-button.test.js +41 -0
- package/dist/src/paypal/paypal-button.test.js.map +1 -0
- package/dist/src/paypal/paypal-checkout.js +111 -0
- package/dist/src/paypal/paypal-checkout.js.map +1 -0
- package/dist/src/paypal/paypal-checkout.test.js +167 -0
- package/dist/src/paypal/paypal-checkout.test.js.map +1 -0
- package/dist/src/paypal/types.js +9 -0
- package/dist/src/paypal/types.js.map +1 -0
- package/dist/src/paypal/validation.js +73 -0
- package/dist/src/paypal/validation.js.map +1 -0
- package/dist/src/react/{applePayUrl.js → url.js} +21 -7
- package/dist/src/react/url.js.map +1 -0
- package/dist/src/react/url.test.js +88 -0
- package/dist/src/react/url.test.js.map +1 -0
- package/dist/src/react/useFatZebra.js +56 -7
- package/dist/src/react/useFatZebra.js.map +1 -1
- package/dist/validation/schemas/applepay/options.json +73 -0
- package/dist/validation/schemas/click-to-pay/options.json +3 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -2
- package/.idea/fatzebra-js.iml +0 -12
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/dist/applepay/applepaymanager.d.ts +0 -28
- package/dist/applepay/applepaymanager.js +0 -115
- package/dist/local/fatzebra.js +0 -19565
- package/dist/production/fatzebra.css +0 -91
- package/dist/production/fatzebra.js +0 -2
- package/dist/react/ApplePay.d.ts +0 -9
- package/dist/react/ApplePay.js +0 -11
- package/dist/react/applePayUrl.js +0 -19
- package/dist/src/applepay/applepaymanager.js +0 -279
- package/dist/src/applepay/applepaymanager.js.map +0 -1
- package/dist/src/react/ApplePayButton.js +0 -56
- package/dist/src/react/ApplePayButton.js.map +0 -1
- package/dist/src/react/applePayUrl.js.map +0 -1
- package/dist/src/react/applePayUrl.test.js +0 -57
- package/dist/src/react/applePayUrl.test.js.map +0 -1
- package/dist/src/react/useMessage.js +0 -140
- package/dist/src/react/useMessage.js.map +0 -1
- package/dist/src/react/useMessage.test.js +0 -222
- package/dist/src/react/useMessage.test.js.map +0 -1
- package/dist/src/validation/validators/apple-pay-load-params-button-validator.js +0 -19
- package/dist/src/validation/validators/apple-pay-load-params-button-validator.js.map +0 -1
- package/dist/staging/fatzebra.css +0 -91
- package/dist/staging/fatzebra.js +0 -19565
- package/dist/staging/fatzebra.js.map +0 -1
- package/dist/staging/index.html +0 -247
|
@@ -32,6 +32,7 @@ export class ApplePay {
|
|
|
32
32
|
this.iframe.setAttribute("src", applePayUrl);
|
|
33
33
|
this.iframe.setAttribute("height", '100%');
|
|
34
34
|
this.iframe.setAttribute("width", '100%');
|
|
35
|
+
this.iframe.setAttribute('allow', 'payment');
|
|
35
36
|
this.postMessageClient = new PostMessageClient({
|
|
36
37
|
channel,
|
|
37
38
|
target: this.iframe,
|
|
@@ -60,6 +61,15 @@ export class ApplePay {
|
|
|
60
61
|
if (options === null || options === void 0 ? void 0 : options.allowed_card_types) {
|
|
61
62
|
query.append('allowed_card_types', options.allowed_card_types.toString());
|
|
62
63
|
}
|
|
64
|
+
if (options === null || options === void 0 ? void 0 : options.apple_button_type) {
|
|
65
|
+
query.append('apple_button_type', options.apple_button_type.toString());
|
|
66
|
+
}
|
|
67
|
+
if (options === null || options === void 0 ? void 0 : options.apple_button_style) {
|
|
68
|
+
query.append('apple_button_style', options.apple_button_style.toString());
|
|
69
|
+
}
|
|
70
|
+
if (options === null || options === void 0 ? void 0 : options.apple_button_locale) {
|
|
71
|
+
query.append('apple_button_locale', options.apple_button_locale.toString());
|
|
72
|
+
}
|
|
63
73
|
query.append('domain_name', this.domain_name);
|
|
64
74
|
return `${base}?${query.toString()}`;
|
|
65
75
|
}
|
|
@@ -30,6 +30,6 @@ const getEligibility = () => {
|
|
|
30
30
|
return window.ApplePaySession && window.ApplePaySession.canMakePayments();
|
|
31
31
|
};
|
|
32
32
|
const createSession = (payload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
-
return yield new window.ApplePaySession(
|
|
33
|
+
return yield new window.ApplePaySession(14, payload);
|
|
34
34
|
});
|
|
35
35
|
export { createSession, getEligibility, MerchantCapability, SupportedNetwork, };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PostMessageClient } from "../shared/post-message-client";
|
|
2
|
-
import { BridgeEvent, PublicEvent } from "../shared/types";
|
|
2
|
+
import { BridgeEvent, Channel, PublicEvent } from "../shared/types";
|
|
3
3
|
import * as util from '../shared/util';
|
|
4
4
|
import { emit } from "../shared/event-manager";
|
|
5
5
|
export const CLICK_TO_PAY_DEFAULT_OPTIONS = {
|
|
@@ -8,13 +8,23 @@ export const CLICK_TO_PAY_DEFAULT_OPTIONS = {
|
|
|
8
8
|
};
|
|
9
9
|
class ClickToPay {
|
|
10
10
|
constructor(config) {
|
|
11
|
+
this.addMRTListener = (mrt) => {
|
|
12
|
+
const handlers = {};
|
|
13
|
+
handlers[BridgeEvent.CLICK_TO_PAY_REQUEST_MRT] = (data) => {
|
|
14
|
+
const message = {
|
|
15
|
+
channel: Channel.CLICK_TO_PAY,
|
|
16
|
+
subject: BridgeEvent.CLICK_TO_PAY_RETURN_MRT,
|
|
17
|
+
data: {
|
|
18
|
+
mrt
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
this.postMessageClient.send(message);
|
|
22
|
+
};
|
|
23
|
+
this.postMessageClient.setEventListeners(handlers);
|
|
24
|
+
};
|
|
11
25
|
this.paymentIntent = config.paymentIntent;
|
|
12
26
|
this.username = config.username;
|
|
13
27
|
this.test = config.test;
|
|
14
|
-
this.postMessageClient = new PostMessageClient({
|
|
15
|
-
channel: 'click_to_pay',
|
|
16
|
-
target: this.iframe
|
|
17
|
-
});
|
|
18
28
|
}
|
|
19
29
|
load(config) {
|
|
20
30
|
this.options = config.options;
|
|
@@ -22,6 +32,12 @@ class ClickToPay {
|
|
|
22
32
|
document.getElementById(config.containerId).appendChild(this.iframe);
|
|
23
33
|
const payNowUrl = this.getPayNowUrl(config.options);
|
|
24
34
|
this.iframe.setAttribute("src", payNowUrl);
|
|
35
|
+
this.postMessageClient = new PostMessageClient({
|
|
36
|
+
channel: Channel.CLICK_TO_PAY,
|
|
37
|
+
target: this.iframe
|
|
38
|
+
});
|
|
39
|
+
// Adding this before other crossframe event listener setup as we miss handling the MRT request event if we wait for this.iframe.onload to trigger
|
|
40
|
+
this.addMRTListener(this.options.mrt);
|
|
25
41
|
this.iframe.onload = () => {
|
|
26
42
|
this.setCrossFramesEventListeners();
|
|
27
43
|
};
|
|
@@ -93,6 +109,12 @@ class ClickToPay {
|
|
|
93
109
|
data
|
|
94
110
|
});
|
|
95
111
|
};
|
|
112
|
+
handlers[PublicEvent.CLICK_TO_PAY_MRT] = (data) => {
|
|
113
|
+
emit(PublicEvent.CLICK_TO_PAY_MRT, {
|
|
114
|
+
message: 'MRT created.',
|
|
115
|
+
data
|
|
116
|
+
});
|
|
117
|
+
};
|
|
96
118
|
this.postMessageClient.setEventListeners(handlers);
|
|
97
119
|
}
|
|
98
120
|
purchase() {
|