@fat-zebra/sdk 1.5.5 → 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.d.ts +22 -7
- package/dist/applepay/applepay.js +99 -21
- package/dist/applepay/clients/apple-pay-client.d.ts +9 -5
- package/dist/applepay/clients/apple-pay-client.js +10 -4
- package/dist/applepay/clients/paynow-client.d.ts +4 -2
- package/dist/applepay/clients/paynow-client.js +2 -7
- package/dist/applepay/types.d.ts +15 -0
- package/dist/applepay/types.js +1 -0
- package/dist/click_to_pay/index.d.ts +1 -0
- package/dist/click_to_pay/index.js +39 -5
- package/dist/click_to_pay/types.d.ts +12 -2
- package/dist/fatzebra.css +91 -0
- package/dist/hpp/hpp.js +1 -0
- package/dist/local/fatzebra.js.map +1 -1
- package/dist/main.d.ts +2 -0
- package/dist/main.js +27 -5
- package/dist/react/ApplePayButton.d.ts +8 -0
- package/dist/react/ApplePayButton.js +18 -0
- package/dist/react/index.d.ts +2 -1
- package/dist/react/index.js +2 -1
- package/dist/react/useFatZebra.js +8 -57
- package/dist/react/useMessage.d.ts +10 -0
- package/dist/react/useMessage.js +70 -0
- package/dist/sandbox/fatzebra.css +91 -0
- package/dist/sandbox/fatzebra.js +2 -0
- package/dist/sandbox/fatzebra.js.LICENSE.txt +1 -0
- 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/env.development.d.ts +3 -3
- package/dist/shared/env.development.js +3 -3
- package/dist/shared/envs/local.d.ts +3 -3
- package/dist/shared/envs/local.js +3 -3
- package/dist/shared/event-manager.d.ts +1 -1
- package/dist/shared/post-message-client.d.ts +2 -0
- package/dist/shared/post-message-client.js +1 -1
- package/dist/shared/types.d.ts +29 -4
- package/dist/shared/types.js +11 -1
- package/dist/validation/schemas/applepay/load-params.json +31 -0
- package/dist/validation/schemas/applepay/options.json +115 -0
- package/dist/validation/schemas/applepay/payment-intent.json +42 -0
- package/dist/validation/schemas/click-to-pay/options.json +33 -3
- package/dist/validation/validators/apple-pay-load-params-button-validator.d.ts +3 -0
- package/dist/validation/validators/apple-pay-load-params-button-validator.js +12 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
|
package/dist/sca/index.js
CHANGED
|
@@ -93,8 +93,8 @@ class Sca {
|
|
|
93
93
|
this._cardinal.setup(cardinalJwt);
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
-
perform3DS(
|
|
97
|
-
return __awaiter(this,
|
|
96
|
+
perform3DS(_a) {
|
|
97
|
+
return __awaiter(this, arguments, void 0, function* ({ sessionID }) {
|
|
98
98
|
this.sessionId = sessionID;
|
|
99
99
|
// Register handler. Called after OTP is entered on challenge prompt.
|
|
100
100
|
this._cardinal.onPaymentValidated((data, error) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -178,6 +178,8 @@ class Sca {
|
|
|
178
178
|
session_id: this.sessionId,
|
|
179
179
|
challenge_window_size: this.challengeWindowSize,
|
|
180
180
|
hide_card_holder: this.paymentIntent.payment.hide_card_holder,
|
|
181
|
+
screen_height: window.screen.height,
|
|
182
|
+
screen_width: window.screen.width,
|
|
181
183
|
customer: this.customerProperties(this.customer),
|
|
182
184
|
})).data;
|
|
183
185
|
});
|
|
@@ -21,7 +21,7 @@ const enrollmentScenarios = [
|
|
|
21
21
|
veresEnrolled: VEResEnrolled.BYPASSED,
|
|
22
22
|
pares: null,
|
|
23
23
|
outcome: {
|
|
24
|
-
success: false,
|
|
24
|
+
success: false, // no liability shift
|
|
25
25
|
authenticationType: 'bypass',
|
|
26
26
|
errorCode: ScaErrorCode.BYPASSED_AUTHENTICATION
|
|
27
27
|
},
|
|
@@ -34,7 +34,7 @@ const enrollmentScenarios = [
|
|
|
34
34
|
veresEnrolled: VEResEnrolled.UNABLE,
|
|
35
35
|
pares: null,
|
|
36
36
|
outcome: {
|
|
37
|
-
success: false,
|
|
37
|
+
success: false, // no liability shift
|
|
38
38
|
errorCode: ScaErrorCode.AUTHENTICATION_NOT_AVAILABLE_ON_LOOKUP
|
|
39
39
|
}
|
|
40
40
|
},
|
|
@@ -34,7 +34,7 @@ const validationScenarios = [
|
|
|
34
34
|
pares: PARes.CANCELED,
|
|
35
35
|
outcome: {
|
|
36
36
|
authenticationType: 'challenge',
|
|
37
|
-
success: false,
|
|
37
|
+
success: false, // no liability shift
|
|
38
38
|
errorCode: ScaErrorCode.UNSUCCESSFUL_STEPUP_AUTHENTICATION
|
|
39
39
|
}
|
|
40
40
|
},
|
|
@@ -47,7 +47,7 @@ const validationScenarios = [
|
|
|
47
47
|
pares: PARes.NOT_COMPLETED,
|
|
48
48
|
outcome: {
|
|
49
49
|
authenticationType: 'challenge',
|
|
50
|
-
success: false,
|
|
50
|
+
success: false, // no liability shift
|
|
51
51
|
errorCode: ScaErrorCode.UNAVAILABLE_STEPUP_AUTHENTICATION
|
|
52
52
|
}
|
|
53
53
|
},
|
|
@@ -126,7 +126,7 @@ const validationScenarios = [
|
|
|
126
126
|
pares: null,
|
|
127
127
|
outcome: {
|
|
128
128
|
authenticationType: 'challenge',
|
|
129
|
-
success: false,
|
|
129
|
+
success: false, // no liability shift
|
|
130
130
|
errorCode: ScaErrorCode.UNSUCCESSFUL_STEPUP_AUTHENTICATION
|
|
131
131
|
}
|
|
132
132
|
},
|
package/dist/sca/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
declare const bridgeUrl = "
|
|
2
|
-
declare const apiUrl = "
|
|
3
|
-
declare const payNowUrl = "
|
|
1
|
+
declare const bridgeUrl = "https://paynow.test";
|
|
2
|
+
declare const apiUrl = "https://api.test/sdk";
|
|
3
|
+
declare const payNowUrl = "https://paynow.test";
|
|
4
4
|
declare const songbirdUrl = "https://songbirdstag.cardinalcommerce.com/edge/v1/songbird.js";
|
|
5
5
|
export { bridgeUrl, apiUrl, payNowUrl, songbirdUrl };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const bridgeUrl = "
|
|
2
|
-
const apiUrl = "
|
|
3
|
-
const payNowUrl = "
|
|
1
|
+
const bridgeUrl = "https://paynow.test";
|
|
2
|
+
const apiUrl = "https://api.test/sdk";
|
|
3
|
+
const payNowUrl = "https://paynow.test";
|
|
4
4
|
const songbirdUrl = "https://songbirdstag.cardinalcommerce.com/edge/v1/songbird.js";
|
|
5
5
|
export { bridgeUrl, apiUrl, payNowUrl, songbirdUrl };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
declare const bridgeUrl = "
|
|
2
|
-
declare const apiUrl = "
|
|
3
|
-
declare const payNowUrl = "
|
|
1
|
+
declare const bridgeUrl = "https://paynow.test";
|
|
2
|
+
declare const apiUrl = "https://api.test:3002/sdk";
|
|
3
|
+
declare const payNowUrl = "https://paynow.test";
|
|
4
4
|
declare const songbirdUrl = "https://songbirdstag.cardinalcommerce.com/edge/v1/songbird.js";
|
|
5
5
|
export { bridgeUrl, apiUrl, payNowUrl, songbirdUrl };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const bridgeUrl = "
|
|
2
|
-
const apiUrl = "
|
|
3
|
-
const payNowUrl = "
|
|
1
|
+
const bridgeUrl = "https://paynow.test";
|
|
2
|
+
const apiUrl = "https://api.test:3002/sdk";
|
|
3
|
+
const payNowUrl = "https://paynow.test";
|
|
4
4
|
const songbirdUrl = "https://songbirdstag.cardinalcommerce.com/edge/v1/songbird.js";
|
|
5
5
|
export { bridgeUrl, apiUrl, payNowUrl, songbirdUrl };
|
|
@@ -23,7 +23,7 @@ interface ErrorEventDetail {
|
|
|
23
23
|
errors: string[];
|
|
24
24
|
data: any;
|
|
25
25
|
}
|
|
26
|
-
declare const emit: (event: PublicEvent, data
|
|
26
|
+
declare const emit: (event: PublicEvent, data?: SuccessEventDetail | ErrorEventDetail, target?: HTMLElement | Window) => void;
|
|
27
27
|
declare const off: (event: PublicEvent, callback: (e: any) => void, target?: HTMLElement | Window) => void;
|
|
28
28
|
declare const onOnce: (event: PublicEvent, callback: (e: any) => void, target?: HTMLElement | Window) => void;
|
|
29
29
|
declare const on: (event: PublicEvent, callback: (e: any) => void, target?: HTMLElement | Window) => void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Environment } from "./env";
|
|
1
2
|
interface PostMessage {
|
|
2
3
|
channel: string;
|
|
3
4
|
subject: string;
|
|
@@ -11,6 +12,7 @@ interface PostMessageLegacy {
|
|
|
11
12
|
}
|
|
12
13
|
interface PostMessageClientConfig {
|
|
13
14
|
channel: string;
|
|
15
|
+
environment?: Environment;
|
|
14
16
|
target?: HTMLIFrameElement;
|
|
15
17
|
}
|
|
16
18
|
interface EventHandlers {
|
|
@@ -11,7 +11,7 @@ import env, { Environment } from "./env";
|
|
|
11
11
|
class PostMessageClient {
|
|
12
12
|
constructor(config) {
|
|
13
13
|
this.channel = config.channel;
|
|
14
|
-
this.fzEnv = process.env.API_ENV;
|
|
14
|
+
this.fzEnv = config.environment || process.env.API_ENV;
|
|
15
15
|
this.domain = env[this.fzEnv].payNowUrl;
|
|
16
16
|
this.target = config.target;
|
|
17
17
|
}
|
package/dist/shared/types.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { Environment } from './env';
|
|
2
|
+
import { MerchantCapability, SupportedNetwork } from "../applepay/clients/apple-pay-client";
|
|
3
|
+
declare enum Channel {
|
|
4
|
+
CLICK_TO_PAY = "click_to_pay"
|
|
5
|
+
}
|
|
2
6
|
declare enum PublicEvent {
|
|
7
|
+
HPP_READY = "fz.ready",
|
|
3
8
|
FORM_VALIDATION_ERROR = "fz.form_validation.error",
|
|
4
9
|
FORM_VALIDATION_SUCCESS = "fz.form_validation.success",
|
|
5
10
|
VALIDATION_ERROR = "fz.validation.error",
|
|
@@ -11,7 +16,10 @@ declare enum PublicEvent {
|
|
|
11
16
|
PAYMENT_ERROR = "fz.payment.error",
|
|
12
17
|
BIN_LOOKUP = "fz.bin.lookup",
|
|
13
18
|
CLICK_TO_PAY_TOKENIZATION_SUCCESS = "fz.click_to_pay.tokenization.success",
|
|
14
|
-
CLICK_TO_PAY_TOKENIZATION_ERROR = "fz.click_to_pay.tokenization.error"
|
|
19
|
+
CLICK_TO_PAY_TOKENIZATION_ERROR = "fz.click_to_pay.tokenization.error",
|
|
20
|
+
CLICK_TO_PAY_RESIZE = "fz.click_to_pay.resize",
|
|
21
|
+
CLICK_TO_PAY_DCF_LOADED = "fz.click_to_pay.dcf",
|
|
22
|
+
CLICK_TO_PAY_MRT = "fz.click_to_pay.mrt"
|
|
15
23
|
}
|
|
16
24
|
declare enum BridgeEvent {
|
|
17
25
|
TOKENIZE_CARD_REQUEST = "fzi.tc_req",
|
|
@@ -22,7 +30,9 @@ declare enum BridgeEvent {
|
|
|
22
30
|
FORM_VALIDATION_ERROR = "fzi.form_validation_error",
|
|
23
31
|
FORM_VALIDATION_SUCCESS = "fzi.form_validation_success",
|
|
24
32
|
BIN_LOOKUP = "fzi.bin_lookup",
|
|
25
|
-
CLICK_TO_PAY_TOKENIZATION = "fzi.c2p.tc_res"
|
|
33
|
+
CLICK_TO_PAY_TOKENIZATION = "fzi.c2p.tc_res",
|
|
34
|
+
CLICK_TO_PAY_REQUEST_MRT = "fzi.c2p.mrt_req",
|
|
35
|
+
CLICK_TO_PAY_RETURN_MRT = "fzi.c2p.mrt_ret"
|
|
26
36
|
}
|
|
27
37
|
declare enum PaymentMethodType {
|
|
28
38
|
CARD = "card",
|
|
@@ -85,16 +95,25 @@ export type PaymentConfig = {
|
|
|
85
95
|
paymentIntent: PaymentIntent;
|
|
86
96
|
options: OptionalUrlValues;
|
|
87
97
|
};
|
|
98
|
+
export type ApplePayButtonType = 'buy' | 'donate' | 'plain' | 'set-up' | 'book' | 'check-out' | 'subscribe' | 'add-money' | 'contribute' | 'order' | 'reload' | 'rent' | 'support' | 'tip' | 'top-up' | 'continue';
|
|
99
|
+
export type ApplePayButtonStyle = 'black' | 'white' | 'white-outline';
|
|
100
|
+
export type ApplePayButtonLocale = 'ar-AB' | 'ca-ES' | 'cs-CZ' | 'da-DK' | 'de-DE' | 'el-GR' | 'en-AU' | 'en-GB' | 'en-US' | 'es-ES' | 'es-MX' | 'fi-FI' | 'fr-CA' | 'fr-FR' | 'he-IL' | 'hi-IN' | 'hr-HR' | 'hu-HU' | 'id-ID' | 'it-IT' | 'ja-JP' | 'ko-KR' | 'ms-MY' | 'nb-NO' | 'nl-NL' | 'pl-PL' | 'pt-BR' | 'pt-PT' | 'ro-RO' | 'ru-RU' | 'sk-SK' | 'sv-SE' | 'th-TH' | 'tr-TR' | 'uk-UA' | 'vi-VN' | 'zh-CN' | 'zh-HK' | 'zh-TW';
|
|
88
101
|
export type OptionalUrlValues = {
|
|
89
102
|
hide_card_holder?: boolean;
|
|
90
103
|
hide_button?: boolean;
|
|
91
104
|
return_path?: string;
|
|
105
|
+
allowed_card_networks?: Array<SupportedNetwork>;
|
|
106
|
+
allowed_card_types?: Array<MerchantCapability>;
|
|
107
|
+
domain_name?: string;
|
|
92
108
|
card_types?: Array<string>;
|
|
93
109
|
surcharge_enabled?: string;
|
|
94
110
|
sca_enabled?: boolean;
|
|
95
111
|
css?: string;
|
|
96
112
|
css_signature?: string;
|
|
97
113
|
tokenize_only?: boolean;
|
|
114
|
+
apple_button_style?: ApplePayButtonStyle;
|
|
115
|
+
apple_button_type?: ApplePayButtonType;
|
|
116
|
+
apple_button_locale?: ApplePayButtonLocale;
|
|
98
117
|
};
|
|
99
118
|
declare global {
|
|
100
119
|
interface Window {
|
|
@@ -102,6 +121,7 @@ declare global {
|
|
|
102
121
|
Cardinal: any;
|
|
103
122
|
FatZebra: any;
|
|
104
123
|
HPP: any;
|
|
124
|
+
ApplePayButton: any;
|
|
105
125
|
MerchantUsername: string;
|
|
106
126
|
}
|
|
107
127
|
}
|
|
@@ -137,5 +157,10 @@ type TokenizeCardResponse = {
|
|
|
137
157
|
token: string;
|
|
138
158
|
errors?: Array<string>;
|
|
139
159
|
};
|
|
140
|
-
|
|
141
|
-
|
|
160
|
+
type ApplePayPaymentResponse = {
|
|
161
|
+
message: string;
|
|
162
|
+
errors?: Array<string>;
|
|
163
|
+
data?: string;
|
|
164
|
+
};
|
|
165
|
+
export { Channel, BridgeEvent, PublicEvent, PaymentMethodType, };
|
|
166
|
+
export type { PaymentMethod, PaymentIntent, Payment, Card, CardOnFile, CustomerSnakeCase, Customer, Handlers, ValidationResult, TokenizeCardResponse, ApplePayPaymentResponse };
|
package/dist/shared/types.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
var Channel;
|
|
2
|
+
(function (Channel) {
|
|
3
|
+
Channel["CLICK_TO_PAY"] = "click_to_pay";
|
|
4
|
+
})(Channel || (Channel = {}));
|
|
1
5
|
var PublicEvent;
|
|
2
6
|
(function (PublicEvent) {
|
|
7
|
+
PublicEvent["HPP_READY"] = "fz.ready";
|
|
3
8
|
PublicEvent["FORM_VALIDATION_ERROR"] = "fz.form_validation.error";
|
|
4
9
|
PublicEvent["FORM_VALIDATION_SUCCESS"] = "fz.form_validation.success";
|
|
5
10
|
PublicEvent["VALIDATION_ERROR"] = "fz.validation.error";
|
|
@@ -12,6 +17,9 @@ var PublicEvent;
|
|
|
12
17
|
PublicEvent["BIN_LOOKUP"] = "fz.bin.lookup";
|
|
13
18
|
PublicEvent["CLICK_TO_PAY_TOKENIZATION_SUCCESS"] = "fz.click_to_pay.tokenization.success";
|
|
14
19
|
PublicEvent["CLICK_TO_PAY_TOKENIZATION_ERROR"] = "fz.click_to_pay.tokenization.error";
|
|
20
|
+
PublicEvent["CLICK_TO_PAY_RESIZE"] = "fz.click_to_pay.resize";
|
|
21
|
+
PublicEvent["CLICK_TO_PAY_DCF_LOADED"] = "fz.click_to_pay.dcf";
|
|
22
|
+
PublicEvent["CLICK_TO_PAY_MRT"] = "fz.click_to_pay.mrt";
|
|
15
23
|
})(PublicEvent || (PublicEvent = {}));
|
|
16
24
|
var BridgeEvent;
|
|
17
25
|
(function (BridgeEvent) {
|
|
@@ -24,10 +32,12 @@ var BridgeEvent;
|
|
|
24
32
|
BridgeEvent["FORM_VALIDATION_SUCCESS"] = "fzi.form_validation_success";
|
|
25
33
|
BridgeEvent["BIN_LOOKUP"] = "fzi.bin_lookup";
|
|
26
34
|
BridgeEvent["CLICK_TO_PAY_TOKENIZATION"] = "fzi.c2p.tc_res";
|
|
35
|
+
BridgeEvent["CLICK_TO_PAY_REQUEST_MRT"] = "fzi.c2p.mrt_req";
|
|
36
|
+
BridgeEvent["CLICK_TO_PAY_RETURN_MRT"] = "fzi.c2p.mrt_ret";
|
|
27
37
|
})(BridgeEvent || (BridgeEvent = {}));
|
|
28
38
|
var PaymentMethodType;
|
|
29
39
|
(function (PaymentMethodType) {
|
|
30
40
|
PaymentMethodType["CARD"] = "card";
|
|
31
41
|
PaymentMethodType["CARD_ON_FILE"] = "card_on_file";
|
|
32
42
|
})(PaymentMethodType || (PaymentMethodType = {}));
|
|
33
|
-
export { BridgeEvent, PublicEvent, PaymentMethodType, };
|
|
43
|
+
export { Channel, BridgeEvent, PublicEvent, PaymentMethodType, };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "https://www.fatzebra.com/schemas/applepay/load-params.json",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"additionalProperties": false,
|
|
5
|
+
"required": [
|
|
6
|
+
"containerId",
|
|
7
|
+
"paymentIntent"
|
|
8
|
+
],
|
|
9
|
+
"properties": {
|
|
10
|
+
"containerId": {
|
|
11
|
+
"type": "string"
|
|
12
|
+
},
|
|
13
|
+
"environment": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"enum": [
|
|
16
|
+
"local",
|
|
17
|
+
"test",
|
|
18
|
+
"development",
|
|
19
|
+
"staging",
|
|
20
|
+
"sandbox",
|
|
21
|
+
"production"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"paymentIntent": {
|
|
25
|
+
"$ref": "payment-intent.json#/definitions/PaymentIntent"
|
|
26
|
+
},
|
|
27
|
+
"options": {
|
|
28
|
+
"$ref": "options.json#/definitions/Options"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "https://www.fatzebra.com/schemas/applepay/options.json",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"definitions": {
|
|
5
|
+
"Options": {
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"allowed_card_networks": {
|
|
9
|
+
"type": "array",
|
|
10
|
+
"items": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"enum": [
|
|
13
|
+
"amex",
|
|
14
|
+
"chinaUnionPay",
|
|
15
|
+
"discover",
|
|
16
|
+
"jcb",
|
|
17
|
+
"maestro",
|
|
18
|
+
"masterCard",
|
|
19
|
+
"visa"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"allowed_card_types": {
|
|
24
|
+
"type": "array",
|
|
25
|
+
"items": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"enum": [
|
|
28
|
+
"supports3DS",
|
|
29
|
+
"supportsCredit",
|
|
30
|
+
"supportsDebit",
|
|
31
|
+
"supportsEMV"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"apple_button_type": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"enum": [
|
|
38
|
+
"buy",
|
|
39
|
+
"donate",
|
|
40
|
+
"plain",
|
|
41
|
+
"set-up",
|
|
42
|
+
"book",
|
|
43
|
+
"check-out",
|
|
44
|
+
"subscribe",
|
|
45
|
+
"add-money",
|
|
46
|
+
"contribute",
|
|
47
|
+
"order",
|
|
48
|
+
"reload",
|
|
49
|
+
"rent",
|
|
50
|
+
"support",
|
|
51
|
+
"tip",
|
|
52
|
+
"top-up",
|
|
53
|
+
"continue"
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
"apple_button_style": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"enum": [
|
|
59
|
+
"black",
|
|
60
|
+
"white",
|
|
61
|
+
"white-outline"
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
"apple_button_locale": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"enum": [
|
|
67
|
+
"ar-AB",
|
|
68
|
+
"ca-ES",
|
|
69
|
+
"cs-CZ",
|
|
70
|
+
"da-DK",
|
|
71
|
+
"de-DE",
|
|
72
|
+
"el-GR",
|
|
73
|
+
"en-AU",
|
|
74
|
+
"en-GB",
|
|
75
|
+
"en-US",
|
|
76
|
+
"es-ES",
|
|
77
|
+
"es-MX",
|
|
78
|
+
"fi-FI",
|
|
79
|
+
"fr-CA",
|
|
80
|
+
"fr-FR",
|
|
81
|
+
"he-IL",
|
|
82
|
+
"hi-IN",
|
|
83
|
+
"hr-HR",
|
|
84
|
+
"hu-HU",
|
|
85
|
+
"id-ID",
|
|
86
|
+
"it-IT",
|
|
87
|
+
"ja-JP",
|
|
88
|
+
"ko-KR",
|
|
89
|
+
"ms-MY",
|
|
90
|
+
"nb-NO",
|
|
91
|
+
"nl-NL",
|
|
92
|
+
"pl-PL",
|
|
93
|
+
"pt-BR",
|
|
94
|
+
"pt-PT",
|
|
95
|
+
"ro-RO",
|
|
96
|
+
"ru-RU",
|
|
97
|
+
"sk-SK",
|
|
98
|
+
"sv-SE",
|
|
99
|
+
"th-TH",
|
|
100
|
+
"tr-TR",
|
|
101
|
+
"uk-UA",
|
|
102
|
+
"vi-VN",
|
|
103
|
+
"zh-CN",
|
|
104
|
+
"zh-HK",
|
|
105
|
+
"zh-TW"
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
"domain_name": {
|
|
109
|
+
"type": "string"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"additionalProperties": false
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "https://www.fatzebra.com/schemas/applepay/payment-intent.json",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"additionalProperties": false,
|
|
5
|
+
"definitions": {
|
|
6
|
+
"PaymentIntent": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"payment": {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"additionalProperties": false,
|
|
13
|
+
"required": [
|
|
14
|
+
"amount",
|
|
15
|
+
"currency",
|
|
16
|
+
"reference"
|
|
17
|
+
],
|
|
18
|
+
"properties": {
|
|
19
|
+
"amount": {
|
|
20
|
+
"type": "number",
|
|
21
|
+
"minimum": 0
|
|
22
|
+
},
|
|
23
|
+
"currency": {
|
|
24
|
+
"type": "string"
|
|
25
|
+
},
|
|
26
|
+
"reference": {
|
|
27
|
+
"type": "string"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"verification": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"minLength": 5
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"required": [
|
|
37
|
+
"payment",
|
|
38
|
+
"verification"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -5,17 +5,47 @@
|
|
|
5
5
|
"Options": {
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
|
-
"
|
|
8
|
+
"auth": {
|
|
9
9
|
"type": "boolean"
|
|
10
10
|
},
|
|
11
|
-
"
|
|
12
|
-
"type": "
|
|
11
|
+
"cardListButtonText": {
|
|
12
|
+
"type": "string"
|
|
13
13
|
},
|
|
14
14
|
"css": {
|
|
15
15
|
"type": "string"
|
|
16
16
|
},
|
|
17
17
|
"cssSignature": {
|
|
18
18
|
"type": "string"
|
|
19
|
+
},
|
|
20
|
+
"displayName": {
|
|
21
|
+
"type": "string"
|
|
22
|
+
},
|
|
23
|
+
"hideConfirmButton": {
|
|
24
|
+
"type": "boolean"
|
|
25
|
+
},
|
|
26
|
+
"hideManualEntryLink": {
|
|
27
|
+
"type": "boolean"
|
|
28
|
+
},
|
|
29
|
+
"mrt": {
|
|
30
|
+
"type": "string"
|
|
31
|
+
},
|
|
32
|
+
"returnPath": {
|
|
33
|
+
"type": "string"
|
|
34
|
+
},
|
|
35
|
+
"returnTarget": {
|
|
36
|
+
"type": "string"
|
|
37
|
+
},
|
|
38
|
+
"saveCard": {
|
|
39
|
+
"type": "boolean"
|
|
40
|
+
},
|
|
41
|
+
"sharedData": {
|
|
42
|
+
"type": "string"
|
|
43
|
+
},
|
|
44
|
+
"submitPaymentButtonText": {
|
|
45
|
+
"type": "string"
|
|
46
|
+
},
|
|
47
|
+
"tokenizeOnly": {
|
|
48
|
+
"type": "boolean"
|
|
19
49
|
}
|
|
20
50
|
}
|
|
21
51
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import Ajv from 'ajv';
|
|
2
|
+
import paymentIntentSchema from '../schemas/applepay/payment-intent.json';
|
|
3
|
+
import optionsSchema from '../schemas/applepay/options.json';
|
|
4
|
+
import loadParams from '../schemas/applepay/load-params.json';
|
|
5
|
+
const validator = new Ajv({
|
|
6
|
+
allErrors: true,
|
|
7
|
+
jsonPointers: true,
|
|
8
|
+
})
|
|
9
|
+
.addSchema(paymentIntentSchema)
|
|
10
|
+
.addSchema(optionsSchema)
|
|
11
|
+
.compile(loadParams);
|
|
12
|
+
export { validator as validateApplePayLoadParams };
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.5.
|
|
1
|
+
export declare const version = "1.5.6";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.5.
|
|
1
|
+
export const version = '1.5.6';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fat-zebra/sdk",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"author": "",
|
|
24
24
|
"license": "ISC",
|
|
25
25
|
"devDependencies": {
|
|
26
|
+
"@inquirer/prompts": "^5.3.8",
|
|
26
27
|
"@testing-library/dom": "^10.4.0",
|
|
27
28
|
"@testing-library/react": "^16.0.0",
|
|
28
29
|
"@testing-library/react-hooks": "^8.0.1",
|
|
@@ -30,6 +31,7 @@
|
|
|
30
31
|
"@types/ajv": "^1.0.0",
|
|
31
32
|
"@types/axios": "^0.14.0",
|
|
32
33
|
"@types/dotenv": "^8.2.0",
|
|
34
|
+
"@types/inquirer": "^9.0.7",
|
|
33
35
|
"@types/jest": "^24.0.23",
|
|
34
36
|
"@types/jsdom": "^21.1.1",
|
|
35
37
|
"@types/nock": "^11.1.0",
|
|
@@ -40,7 +42,6 @@
|
|
|
40
42
|
"dotenv-webpack": "^8.0.0",
|
|
41
43
|
"ejs": "^3.0.1",
|
|
42
44
|
"html-webpack-plugin": "^5.3.1",
|
|
43
|
-
"inquirer": "^10.0.1",
|
|
44
45
|
"jest": "^29.6.1",
|
|
45
46
|
"jest-environment-jsdom": "^29.6.1",
|
|
46
47
|
"jest-localstorage-mock": "^2.4.22",
|
|
@@ -71,4 +72,4 @@
|
|
|
71
72
|
"react": ">= 16",
|
|
72
73
|
"react-dom": ">= 16"
|
|
73
74
|
}
|
|
74
|
-
}
|
|
75
|
+
}
|