@tap-payments/apple-pay-button 0.0.2 → 0.0.3-staging
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/LICENSE +21 -21
- package/README.md +240 -194
- package/build/@types/ApplePayButtonProps.d.ts +129 -0
- package/build/@types/ApplePayButtonProps.js +1 -0
- package/build/@types/charge.d.ts +57 -0
- package/build/@types/charge.js +1 -0
- package/build/@types/checkoutProfile.d.ts +216 -0
- package/build/@types/checkoutProfile.js +1 -0
- package/build/@types/enums.d.ts +65 -0
- package/build/@types/enums.js +76 -0
- package/build/@types/index.d.ts +6 -82
- package/build/@types/index.js +6 -1
- package/build/@types/tapLocalisation.d.ts +193 -0
- package/build/@types/tapLocalisation.js +1 -0
- package/build/@types/tapTheme.d.ts +842 -0
- package/build/@types/tapTheme.js +1 -0
- package/build/api.d.ts +29 -0
- package/build/{api/app.service.js → api.js} +244 -253
- package/build/constants/index.d.ts +3 -51
- package/build/constants/index.js +3 -51
- package/build/features/ApplePayButton/ApplePayButton.d.ts +4 -6
- package/build/features/ApplePayButton/ApplePayButton.js +49 -80
- package/build/features/ApplePayButton/index.d.ts +3 -3
- package/build/features/ApplePayButton/index.js +2 -2
- package/build/hooks/index.d.ts +1 -1
- package/build/hooks/index.js +1 -1
- package/build/hooks/useApplePay.d.ts +93 -9
- package/build/hooks/useApplePay.js +447 -243
- package/build/hooks/useMerchantApplePay.d.ts +20 -0
- package/build/hooks/useMerchantApplePay.js +188 -0
- package/build/index.d.ts +4 -4
- package/build/index.js +13 -10
- package/build/utils/config.d.ts +14 -11
- package/build/utils/config.js +65 -72
- package/build/utils/defaultValues.d.ts +2 -0
- package/build/utils/defaultValues.js +27 -0
- package/build/utils/html.d.ts +1 -1
- package/build/utils/html.js +9 -9
- package/build/utils/index.d.ts +4 -1
- package/build/utils/index.js +4 -1
- package/build/utils/theme.d.ts +12 -0
- package/build/utils/theme.js +61 -0
- package/package.json +109 -104
- package/build/api/app.service.d.ts +0 -23
- package/build/api/base.d.ts +0 -9
- package/build/api/base.js +0 -45
- package/build/api/httpClient.d.ts +0 -8
- package/build/api/httpClient.js +0 -33
- package/build/features/ApplePayButton/ApplePayButton.css +0 -21
- package/build/hooks/useScript.d.ts +0 -1
- package/build/hooks/useScript.js +0 -39
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export interface ChargeRequestBody {
|
|
2
|
+
source: {
|
|
3
|
+
id: string;
|
|
4
|
+
};
|
|
5
|
+
ipaddress?: string;
|
|
6
|
+
amount: number;
|
|
7
|
+
currency: string;
|
|
8
|
+
selected_amount?: number;
|
|
9
|
+
selected_currency?: string;
|
|
10
|
+
product: string;
|
|
11
|
+
threeDSecure?: boolean;
|
|
12
|
+
save_card: boolean;
|
|
13
|
+
fee: number;
|
|
14
|
+
customer: {
|
|
15
|
+
id?: string;
|
|
16
|
+
first_name?: string;
|
|
17
|
+
middle_name?: string;
|
|
18
|
+
last_name?: string;
|
|
19
|
+
email?: string;
|
|
20
|
+
phone?: {
|
|
21
|
+
country_code: string;
|
|
22
|
+
number: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
hashstring?: string;
|
|
26
|
+
metadata?: Record<string, string>;
|
|
27
|
+
post?: {
|
|
28
|
+
url: string;
|
|
29
|
+
};
|
|
30
|
+
redirect?: {
|
|
31
|
+
url: string;
|
|
32
|
+
};
|
|
33
|
+
merchant?: {
|
|
34
|
+
id: string;
|
|
35
|
+
};
|
|
36
|
+
order?: {
|
|
37
|
+
id: string;
|
|
38
|
+
};
|
|
39
|
+
payment_agreement?: {
|
|
40
|
+
id: string;
|
|
41
|
+
contract?: {
|
|
42
|
+
id: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
destinations?: Record<string, any>;
|
|
46
|
+
reference?: {
|
|
47
|
+
order?: string;
|
|
48
|
+
transaction?: string;
|
|
49
|
+
};
|
|
50
|
+
description?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface AuthorizeRequestBody extends ChargeRequestBody {
|
|
53
|
+
auto?: {
|
|
54
|
+
type: string;
|
|
55
|
+
time: number;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { SupportedNetworks, ThemeMode } from '..';
|
|
2
|
+
export interface CheckoutProfileRequest {
|
|
3
|
+
supported_payment_methods: string[];
|
|
4
|
+
supported_currencies: string[];
|
|
5
|
+
transaction_mode: string;
|
|
6
|
+
currency: string;
|
|
7
|
+
merchant_id: string;
|
|
8
|
+
total_amount: number;
|
|
9
|
+
order: {
|
|
10
|
+
id?: string;
|
|
11
|
+
amount: number;
|
|
12
|
+
currency: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
metadata?: Record<string, string>;
|
|
15
|
+
customer?: {
|
|
16
|
+
id?: string;
|
|
17
|
+
email?: string;
|
|
18
|
+
first_name?: string;
|
|
19
|
+
last_name?: string;
|
|
20
|
+
phone?: {
|
|
21
|
+
country_code: string;
|
|
22
|
+
number: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
items: {
|
|
26
|
+
quantity: number;
|
|
27
|
+
amount: number;
|
|
28
|
+
currency: string;
|
|
29
|
+
name: string;
|
|
30
|
+
description: string;
|
|
31
|
+
}[];
|
|
32
|
+
merchant: {
|
|
33
|
+
id: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface CheckoutProfileResponse {
|
|
38
|
+
status: string;
|
|
39
|
+
merchant: MerchantResponse;
|
|
40
|
+
assests: Assests;
|
|
41
|
+
payment_options: Paymentoptions;
|
|
42
|
+
session: string;
|
|
43
|
+
}
|
|
44
|
+
interface Paymentoptions {
|
|
45
|
+
id: string;
|
|
46
|
+
object: string;
|
|
47
|
+
payment_methods: PaymentMethod[];
|
|
48
|
+
currency: string;
|
|
49
|
+
country: string;
|
|
50
|
+
settlement_currency: string;
|
|
51
|
+
supported_currencies: Supportedcurrency[];
|
|
52
|
+
api_version: string;
|
|
53
|
+
order: Order;
|
|
54
|
+
}
|
|
55
|
+
interface Order {
|
|
56
|
+
id: string;
|
|
57
|
+
amount: number;
|
|
58
|
+
currency: string;
|
|
59
|
+
customer: {
|
|
60
|
+
id?: string;
|
|
61
|
+
email: string;
|
|
62
|
+
phone?: {
|
|
63
|
+
country_code: string;
|
|
64
|
+
number: string;
|
|
65
|
+
};
|
|
66
|
+
first_name?: string;
|
|
67
|
+
last_name?: string;
|
|
68
|
+
};
|
|
69
|
+
items: Array<OrderItem>;
|
|
70
|
+
}
|
|
71
|
+
interface OrderItem {
|
|
72
|
+
name: string;
|
|
73
|
+
amount: number;
|
|
74
|
+
currency: string;
|
|
75
|
+
quantity: number;
|
|
76
|
+
requires_shipping: boolean;
|
|
77
|
+
description: string;
|
|
78
|
+
}
|
|
79
|
+
interface Supportedcurrency {
|
|
80
|
+
symbol: string;
|
|
81
|
+
name: string;
|
|
82
|
+
flag: string;
|
|
83
|
+
decimal_digit: number;
|
|
84
|
+
selected: boolean;
|
|
85
|
+
rate: number;
|
|
86
|
+
logos: Logos2;
|
|
87
|
+
order_by: number;
|
|
88
|
+
currency: string;
|
|
89
|
+
amount: number;
|
|
90
|
+
}
|
|
91
|
+
interface Logos2 {
|
|
92
|
+
dark: Disabled;
|
|
93
|
+
light: Disabled;
|
|
94
|
+
light_mono: Disabled;
|
|
95
|
+
dark_colored: Disabled;
|
|
96
|
+
}
|
|
97
|
+
export interface PaymentMethod {
|
|
98
|
+
id: string;
|
|
99
|
+
name: string;
|
|
100
|
+
name_ar: string;
|
|
101
|
+
image: string;
|
|
102
|
+
payment_type: string;
|
|
103
|
+
supported_card_brands: SupportedNetworks[];
|
|
104
|
+
supported_currencies: string[];
|
|
105
|
+
order_by: number;
|
|
106
|
+
cc_markup: number;
|
|
107
|
+
asynchronous: boolean;
|
|
108
|
+
threeDS: string;
|
|
109
|
+
api_version: number;
|
|
110
|
+
api_version_minor: number;
|
|
111
|
+
logos: Logos;
|
|
112
|
+
payment_order_type: string;
|
|
113
|
+
button_style: Buttonstyle;
|
|
114
|
+
display_name: string;
|
|
115
|
+
default_currency: string;
|
|
116
|
+
identifier?: string;
|
|
117
|
+
}
|
|
118
|
+
interface Buttonstyle {
|
|
119
|
+
background: Background2;
|
|
120
|
+
title_asset: 'https://tap-assets.b-cdn.net/action-button/{theme}/{lang}/mastercard';
|
|
121
|
+
}
|
|
122
|
+
interface Background2 {
|
|
123
|
+
light: Light2;
|
|
124
|
+
dark: Light2;
|
|
125
|
+
light_mono: Light2;
|
|
126
|
+
dark_colored: Light2;
|
|
127
|
+
}
|
|
128
|
+
interface Light2 {
|
|
129
|
+
base_color: string;
|
|
130
|
+
background_colors: string[];
|
|
131
|
+
}
|
|
132
|
+
interface Logos {
|
|
133
|
+
dark: Dark2;
|
|
134
|
+
light: Dark2;
|
|
135
|
+
light_mono: Dark2;
|
|
136
|
+
dark_colored: Dark2;
|
|
137
|
+
}
|
|
138
|
+
interface Dark2 {
|
|
139
|
+
svg: string;
|
|
140
|
+
png: string;
|
|
141
|
+
disabled: Disabled;
|
|
142
|
+
currency_widget: Disabled;
|
|
143
|
+
card_icon: Disabled;
|
|
144
|
+
}
|
|
145
|
+
interface Disabled {
|
|
146
|
+
svg: string;
|
|
147
|
+
png: string;
|
|
148
|
+
}
|
|
149
|
+
interface Assests {
|
|
150
|
+
localisation: Localisation;
|
|
151
|
+
theme: Theme;
|
|
152
|
+
web: Theme;
|
|
153
|
+
}
|
|
154
|
+
type Theme = Record<ThemeMode, string> & {
|
|
155
|
+
card: {
|
|
156
|
+
light: string;
|
|
157
|
+
dark: string;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
interface Localisation {
|
|
161
|
+
url: string;
|
|
162
|
+
card: {
|
|
163
|
+
url: string;
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
interface MerchantResponse {
|
|
167
|
+
id: string;
|
|
168
|
+
api_version: string;
|
|
169
|
+
live_mode: boolean;
|
|
170
|
+
object: string;
|
|
171
|
+
name: string;
|
|
172
|
+
country_code: string;
|
|
173
|
+
logo: string;
|
|
174
|
+
background: Background;
|
|
175
|
+
contact: any[];
|
|
176
|
+
powered_by: boolean;
|
|
177
|
+
sdk_settings: Sdksettings;
|
|
178
|
+
session_token: string;
|
|
179
|
+
key_type: string;
|
|
180
|
+
encryption_key: string;
|
|
181
|
+
permissions: string[];
|
|
182
|
+
permission: Permission;
|
|
183
|
+
}
|
|
184
|
+
interface Permission {
|
|
185
|
+
card_wallet: boolean;
|
|
186
|
+
threeDSecure: boolean;
|
|
187
|
+
pci_dss: boolean;
|
|
188
|
+
}
|
|
189
|
+
interface Sdksettings {
|
|
190
|
+
status_display_duration: number;
|
|
191
|
+
otp_resend_interval: number;
|
|
192
|
+
otp_resend_attempts: number;
|
|
193
|
+
}
|
|
194
|
+
interface Background {
|
|
195
|
+
url: string;
|
|
196
|
+
mode: string;
|
|
197
|
+
color: Color;
|
|
198
|
+
}
|
|
199
|
+
interface Color {
|
|
200
|
+
dark: Dark;
|
|
201
|
+
light: Light;
|
|
202
|
+
}
|
|
203
|
+
interface Light {
|
|
204
|
+
color: string;
|
|
205
|
+
rectangle: Rectangle;
|
|
206
|
+
image: string;
|
|
207
|
+
}
|
|
208
|
+
interface Rectangle {
|
|
209
|
+
background: string;
|
|
210
|
+
'backdrop-filter': string;
|
|
211
|
+
}
|
|
212
|
+
interface Dark {
|
|
213
|
+
color: string;
|
|
214
|
+
image: string;
|
|
215
|
+
}
|
|
216
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export declare enum Locale {
|
|
2
|
+
EN = "en",
|
|
3
|
+
AR = "ar",
|
|
4
|
+
DYNAMIC = "dynamic"
|
|
5
|
+
}
|
|
6
|
+
export declare enum ThemeMode {
|
|
7
|
+
DARK = "dark",
|
|
8
|
+
LIGHT = "light",
|
|
9
|
+
DYNAMIC = "dynamic"
|
|
10
|
+
}
|
|
11
|
+
export declare enum Edges {
|
|
12
|
+
STRAIGHT = "straight",
|
|
13
|
+
CURVED = "curved",
|
|
14
|
+
CIRCULAR = "circular"
|
|
15
|
+
}
|
|
16
|
+
export declare enum ColorStyle {
|
|
17
|
+
COLORED = "colored",
|
|
18
|
+
MONOCHROME = "monochrome"
|
|
19
|
+
}
|
|
20
|
+
export declare enum Scope {
|
|
21
|
+
CHARGE = "charge",
|
|
22
|
+
AUTHORIZE = "authorize",
|
|
23
|
+
TAP_TOKEN = "taptoken",
|
|
24
|
+
APPLE_PAY_TOKEN = "applepaytoken"
|
|
25
|
+
}
|
|
26
|
+
export declare enum ButtonStyle {
|
|
27
|
+
Black = "black",
|
|
28
|
+
White = "white",
|
|
29
|
+
WhiteOutline = "white-outline"
|
|
30
|
+
}
|
|
31
|
+
export declare enum FullThemeMode {
|
|
32
|
+
DARK = "dark",
|
|
33
|
+
LIGHT = "light",
|
|
34
|
+
LIGHT_MONO = "light_mono",
|
|
35
|
+
DARK_COLORED = "dark_colored"
|
|
36
|
+
}
|
|
37
|
+
export declare enum ButtonType {
|
|
38
|
+
BOOK = "book",
|
|
39
|
+
BUY = "buy",
|
|
40
|
+
CHECK_OUT = "check-out",
|
|
41
|
+
PAY = "pay",
|
|
42
|
+
PLAIN = "plain",
|
|
43
|
+
SUBSCRIBE = "subscribe"
|
|
44
|
+
}
|
|
45
|
+
export declare enum CHARGE_CODE {
|
|
46
|
+
SUCCESS = "000",
|
|
47
|
+
AUTHORIZED = "001",
|
|
48
|
+
IN_PROGRESS = "200"
|
|
49
|
+
}
|
|
50
|
+
export declare enum MerchantCapabilities {
|
|
51
|
+
Supports3DS = "supports3DS",
|
|
52
|
+
SupportsCredit = "supportsCredit",
|
|
53
|
+
SupportsDebit = "supportsDebit"
|
|
54
|
+
}
|
|
55
|
+
export declare enum SupportedNetworks {
|
|
56
|
+
Amex = "amex",
|
|
57
|
+
Mada = "mada",
|
|
58
|
+
MasterCard = "masterCard",
|
|
59
|
+
Visa = "visa",
|
|
60
|
+
ChinaUnionPay = "chinaUnionPay",
|
|
61
|
+
Discover = "discover",
|
|
62
|
+
Electron = "electron",
|
|
63
|
+
Jcb = "jcb",
|
|
64
|
+
Maestro = "maestro"
|
|
65
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export var Locale;
|
|
2
|
+
(function (Locale) {
|
|
3
|
+
Locale["EN"] = "en";
|
|
4
|
+
Locale["AR"] = "ar";
|
|
5
|
+
Locale["DYNAMIC"] = "dynamic";
|
|
6
|
+
})(Locale || (Locale = {}));
|
|
7
|
+
export var ThemeMode;
|
|
8
|
+
(function (ThemeMode) {
|
|
9
|
+
ThemeMode["DARK"] = "dark";
|
|
10
|
+
ThemeMode["LIGHT"] = "light";
|
|
11
|
+
ThemeMode["DYNAMIC"] = "dynamic";
|
|
12
|
+
})(ThemeMode || (ThemeMode = {}));
|
|
13
|
+
export var Edges;
|
|
14
|
+
(function (Edges) {
|
|
15
|
+
Edges["STRAIGHT"] = "straight";
|
|
16
|
+
Edges["CURVED"] = "curved";
|
|
17
|
+
Edges["CIRCULAR"] = "circular";
|
|
18
|
+
})(Edges || (Edges = {}));
|
|
19
|
+
export var ColorStyle;
|
|
20
|
+
(function (ColorStyle) {
|
|
21
|
+
ColorStyle["COLORED"] = "colored";
|
|
22
|
+
ColorStyle["MONOCHROME"] = "monochrome";
|
|
23
|
+
})(ColorStyle || (ColorStyle = {}));
|
|
24
|
+
export var Scope;
|
|
25
|
+
(function (Scope) {
|
|
26
|
+
Scope["CHARGE"] = "charge";
|
|
27
|
+
Scope["AUTHORIZE"] = "authorize";
|
|
28
|
+
Scope["TAP_TOKEN"] = "taptoken";
|
|
29
|
+
Scope["APPLE_PAY_TOKEN"] = "applepaytoken";
|
|
30
|
+
})(Scope || (Scope = {}));
|
|
31
|
+
export var ButtonStyle;
|
|
32
|
+
(function (ButtonStyle) {
|
|
33
|
+
ButtonStyle["Black"] = "black";
|
|
34
|
+
ButtonStyle["White"] = "white";
|
|
35
|
+
ButtonStyle["WhiteOutline"] = "white-outline";
|
|
36
|
+
})(ButtonStyle || (ButtonStyle = {}));
|
|
37
|
+
export var FullThemeMode;
|
|
38
|
+
(function (FullThemeMode) {
|
|
39
|
+
FullThemeMode["DARK"] = "dark";
|
|
40
|
+
FullThemeMode["LIGHT"] = "light";
|
|
41
|
+
FullThemeMode["LIGHT_MONO"] = "light_mono";
|
|
42
|
+
FullThemeMode["DARK_COLORED"] = "dark_colored";
|
|
43
|
+
})(FullThemeMode || (FullThemeMode = {}));
|
|
44
|
+
export var ButtonType;
|
|
45
|
+
(function (ButtonType) {
|
|
46
|
+
ButtonType["BOOK"] = "book";
|
|
47
|
+
ButtonType["BUY"] = "buy";
|
|
48
|
+
ButtonType["CHECK_OUT"] = "check-out";
|
|
49
|
+
ButtonType["PAY"] = "pay";
|
|
50
|
+
ButtonType["PLAIN"] = "plain";
|
|
51
|
+
ButtonType["SUBSCRIBE"] = "subscribe";
|
|
52
|
+
})(ButtonType || (ButtonType = {}));
|
|
53
|
+
export var CHARGE_CODE;
|
|
54
|
+
(function (CHARGE_CODE) {
|
|
55
|
+
CHARGE_CODE["SUCCESS"] = "000";
|
|
56
|
+
CHARGE_CODE["AUTHORIZED"] = "001";
|
|
57
|
+
CHARGE_CODE["IN_PROGRESS"] = "200";
|
|
58
|
+
})(CHARGE_CODE || (CHARGE_CODE = {}));
|
|
59
|
+
export var MerchantCapabilities;
|
|
60
|
+
(function (MerchantCapabilities) {
|
|
61
|
+
MerchantCapabilities["Supports3DS"] = "supports3DS";
|
|
62
|
+
MerchantCapabilities["SupportsCredit"] = "supportsCredit";
|
|
63
|
+
MerchantCapabilities["SupportsDebit"] = "supportsDebit";
|
|
64
|
+
})(MerchantCapabilities || (MerchantCapabilities = {}));
|
|
65
|
+
export var SupportedNetworks;
|
|
66
|
+
(function (SupportedNetworks) {
|
|
67
|
+
SupportedNetworks["Amex"] = "amex";
|
|
68
|
+
SupportedNetworks["Mada"] = "mada";
|
|
69
|
+
SupportedNetworks["MasterCard"] = "masterCard";
|
|
70
|
+
SupportedNetworks["Visa"] = "visa";
|
|
71
|
+
SupportedNetworks["ChinaUnionPay"] = "chinaUnionPay";
|
|
72
|
+
SupportedNetworks["Discover"] = "discover";
|
|
73
|
+
SupportedNetworks["Electron"] = "electron";
|
|
74
|
+
SupportedNetworks["Jcb"] = "jcb";
|
|
75
|
+
SupportedNetworks["Maestro"] = "maestro";
|
|
76
|
+
})(SupportedNetworks || (SupportedNetworks = {}));
|
package/build/@types/index.d.ts
CHANGED
|
@@ -1,82 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
billingContact?: {
|
|
8
|
-
phoneNumber: string;
|
|
9
|
-
emailAddress: string;
|
|
10
|
-
givenName: string;
|
|
11
|
-
familyName: string;
|
|
12
|
-
};
|
|
13
|
-
total: {
|
|
14
|
-
label: string;
|
|
15
|
-
amount: number;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
export interface ApplePayButtonProps {
|
|
19
|
-
publicKey: string;
|
|
20
|
-
environment: typeof Environment[keyof typeof Environment];
|
|
21
|
-
merchantIdentifier: string;
|
|
22
|
-
merchant: {
|
|
23
|
-
id?: string;
|
|
24
|
-
domain: string;
|
|
25
|
-
};
|
|
26
|
-
scope?: typeof Scope[keyof typeof Scope];
|
|
27
|
-
supportedNetworks?: Array<typeof SupportedNetworks[keyof typeof SupportedNetworks]>;
|
|
28
|
-
buttonStyle?: typeof ButtonStyle[keyof typeof ButtonStyle];
|
|
29
|
-
billingContact?: {
|
|
30
|
-
name: {
|
|
31
|
-
first: string;
|
|
32
|
-
middle?: string;
|
|
33
|
-
last: string;
|
|
34
|
-
};
|
|
35
|
-
email: {
|
|
36
|
-
address: string;
|
|
37
|
-
};
|
|
38
|
-
phone: {
|
|
39
|
-
code: string;
|
|
40
|
-
number: string;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
transaction: {
|
|
44
|
-
amount: string;
|
|
45
|
-
currency: string;
|
|
46
|
-
};
|
|
47
|
-
onCancel?: () => void;
|
|
48
|
-
onError?: (error: any) => void;
|
|
49
|
-
onSuccess?: (data: Record<string, any>) => Promise<void>;
|
|
50
|
-
onClick?: () => void;
|
|
51
|
-
onReady?: () => void;
|
|
52
|
-
metaData?: MetaData;
|
|
53
|
-
type?: typeof ButtonType[keyof typeof ButtonType];
|
|
54
|
-
locale?: typeof Locale[keyof typeof Locale];
|
|
55
|
-
debug?: boolean;
|
|
56
|
-
}
|
|
57
|
-
export interface MerchantResponse {
|
|
58
|
-
id: string;
|
|
59
|
-
name: string;
|
|
60
|
-
country_code: string;
|
|
61
|
-
session_token: string;
|
|
62
|
-
[other: string]: string;
|
|
63
|
-
}
|
|
64
|
-
export interface PaymentMethod {
|
|
65
|
-
id: string;
|
|
66
|
-
image: string;
|
|
67
|
-
name: string;
|
|
68
|
-
payment_type: string;
|
|
69
|
-
supported_card_brands: Array<typeof SupportedNetworks[keyof typeof SupportedNetworks]>;
|
|
70
|
-
supported_currencies: string[];
|
|
71
|
-
}
|
|
72
|
-
export interface PaymentOptionsResponse {
|
|
73
|
-
id: string;
|
|
74
|
-
country: string;
|
|
75
|
-
currency: string;
|
|
76
|
-
payment_methods: PaymentMethod[];
|
|
77
|
-
}
|
|
78
|
-
export interface MetaData {
|
|
79
|
-
merchant: MerchantResponse;
|
|
80
|
-
payment_options: PaymentOptionsResponse;
|
|
81
|
-
headers: Record<string, string>;
|
|
82
|
-
}
|
|
1
|
+
export * from './charge';
|
|
2
|
+
export * from './checkoutProfile';
|
|
3
|
+
export * from './ApplePayButtonProps';
|
|
4
|
+
export * from './enums';
|
|
5
|
+
export * from './tapLocalisation';
|
|
6
|
+
export * from './tapTheme';
|
package/build/@types/index.js
CHANGED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
export type TapLocalizationResponse = Record<string, TapLocalization>;
|
|
2
|
+
export interface TapLocalization {
|
|
3
|
+
ActionButton: ActionButton;
|
|
4
|
+
Common: Common;
|
|
5
|
+
CurrencyChangeWidget: CurrencyChangeWidget;
|
|
6
|
+
DeleteCard: DeleteCard;
|
|
7
|
+
ExtraFees: DeleteCard;
|
|
8
|
+
GoPay: GoPay;
|
|
9
|
+
Hints: Hints;
|
|
10
|
+
HorizontalHeaders: HorizontalHeaders;
|
|
11
|
+
ItemList: ItemList;
|
|
12
|
+
NFC: NFC;
|
|
13
|
+
TapAsyncSection: TapAsyncSection;
|
|
14
|
+
TapCardInputKit: TapCardInputKit;
|
|
15
|
+
TapLoyaltySection: TapLoyaltySection;
|
|
16
|
+
TapMerchantSection: TapMerchantSection;
|
|
17
|
+
TapOtpView: TapOtpView;
|
|
18
|
+
TapSwitchView: TapSwitchView;
|
|
19
|
+
}
|
|
20
|
+
interface TapSwitchView {
|
|
21
|
+
goPay: GoPay2;
|
|
22
|
+
mainCards: MainCards;
|
|
23
|
+
mainTelecom: MainCards;
|
|
24
|
+
merchant: GoPay2;
|
|
25
|
+
}
|
|
26
|
+
interface MainCards {
|
|
27
|
+
notes: string;
|
|
28
|
+
subtitle: string;
|
|
29
|
+
titleEmpty: string;
|
|
30
|
+
titleValid: string;
|
|
31
|
+
}
|
|
32
|
+
interface GoPay2 {
|
|
33
|
+
notes: string;
|
|
34
|
+
subtitle: string;
|
|
35
|
+
title: string;
|
|
36
|
+
}
|
|
37
|
+
interface TapOtpView {
|
|
38
|
+
Message: Message;
|
|
39
|
+
}
|
|
40
|
+
interface Message {
|
|
41
|
+
Expired: string;
|
|
42
|
+
Invalid: string;
|
|
43
|
+
Ready: string;
|
|
44
|
+
}
|
|
45
|
+
interface TapMerchantSection {
|
|
46
|
+
paymentFor: string;
|
|
47
|
+
}
|
|
48
|
+
interface TapLoyaltySection {
|
|
49
|
+
amountView: AmountView;
|
|
50
|
+
footerView: FooterView;
|
|
51
|
+
headerView: HeaderView;
|
|
52
|
+
hintView: HintView;
|
|
53
|
+
}
|
|
54
|
+
interface HintView {
|
|
55
|
+
minimumWarning: string;
|
|
56
|
+
}
|
|
57
|
+
interface HeaderView {
|
|
58
|
+
balance: string;
|
|
59
|
+
lessThanMinimum: string;
|
|
60
|
+
redeem: string;
|
|
61
|
+
tc: string;
|
|
62
|
+
}
|
|
63
|
+
interface FooterView {
|
|
64
|
+
amount: string;
|
|
65
|
+
points: string;
|
|
66
|
+
}
|
|
67
|
+
interface AmountView {
|
|
68
|
+
title: string;
|
|
69
|
+
}
|
|
70
|
+
interface TapCardInputKit {
|
|
71
|
+
additionalLinePlaceHolder: string;
|
|
72
|
+
cardCVVPlaceHolder: string;
|
|
73
|
+
cardExpiryPlaceHolder: string;
|
|
74
|
+
cardNamePlaceHolder: string;
|
|
75
|
+
cardNumberPlaceHolder: string;
|
|
76
|
+
cardSaveForTapInfoMessage: string;
|
|
77
|
+
cardSaveForTapInfoTitle: string;
|
|
78
|
+
cardSaveForTapLabel: string;
|
|
79
|
+
cardSaveLabel: string;
|
|
80
|
+
cardSectionTitle: string;
|
|
81
|
+
cardSectionTitleOr: string;
|
|
82
|
+
cityPlaceHolder: string;
|
|
83
|
+
emailPlaceHolder: string;
|
|
84
|
+
flatPlaceHolder: string;
|
|
85
|
+
savedCardSectionTitle: string;
|
|
86
|
+
weSupport: string;
|
|
87
|
+
}
|
|
88
|
+
interface TapAsyncSection {
|
|
89
|
+
paymentCodeTitleLabel: string;
|
|
90
|
+
paymentExpiryTitleLabel: string;
|
|
91
|
+
paymentProgressLabel: string;
|
|
92
|
+
paymentRecieptEmail: string;
|
|
93
|
+
paymentRecieptLabel: string;
|
|
94
|
+
paymentRecieptSms: string;
|
|
95
|
+
paymentReferenceTitleLabel: string;
|
|
96
|
+
paymentVisitBranchesLabel: string;
|
|
97
|
+
}
|
|
98
|
+
interface NFC {
|
|
99
|
+
disabledNFC: string;
|
|
100
|
+
enableNFC: string;
|
|
101
|
+
nfcDescription: string;
|
|
102
|
+
nfcUnsupported: string;
|
|
103
|
+
scan: string;
|
|
104
|
+
scanSuccess: string;
|
|
105
|
+
}
|
|
106
|
+
interface ItemList {
|
|
107
|
+
Discount: string;
|
|
108
|
+
hideDesc: string;
|
|
109
|
+
showDesc: string;
|
|
110
|
+
}
|
|
111
|
+
interface HorizontalHeaders {
|
|
112
|
+
GatewayHeader: GatewayHeader;
|
|
113
|
+
SaveCardHeader: SaveCardHeader;
|
|
114
|
+
}
|
|
115
|
+
interface SaveCardHeader {
|
|
116
|
+
contactCountryPickerHeader: string;
|
|
117
|
+
contactDetailsSectionTitle: string;
|
|
118
|
+
shippingSectionTitle: string;
|
|
119
|
+
}
|
|
120
|
+
interface GatewayHeader {
|
|
121
|
+
leftTitle: string;
|
|
122
|
+
rightTitle: string;
|
|
123
|
+
webViewTitle: string;
|
|
124
|
+
}
|
|
125
|
+
interface Hints {
|
|
126
|
+
Default: Default;
|
|
127
|
+
Error: Error;
|
|
128
|
+
GoPayLogin: GoPayLogin;
|
|
129
|
+
Scanned: Scanned;
|
|
130
|
+
Warning: Warning;
|
|
131
|
+
}
|
|
132
|
+
interface Warning {
|
|
133
|
+
missingCVV: string;
|
|
134
|
+
missingExpiryCVV: string;
|
|
135
|
+
missingName: string;
|
|
136
|
+
}
|
|
137
|
+
interface Scanned {
|
|
138
|
+
successFullScan: string;
|
|
139
|
+
}
|
|
140
|
+
interface GoPayLogin {
|
|
141
|
+
otp: string;
|
|
142
|
+
password: string;
|
|
143
|
+
}
|
|
144
|
+
interface Error {
|
|
145
|
+
wrongCardNumber: string;
|
|
146
|
+
}
|
|
147
|
+
interface Default {
|
|
148
|
+
scan: string;
|
|
149
|
+
}
|
|
150
|
+
interface GoPay {
|
|
151
|
+
HintLabel: string;
|
|
152
|
+
}
|
|
153
|
+
interface DeleteCard {
|
|
154
|
+
cancel: string;
|
|
155
|
+
confirm: string;
|
|
156
|
+
message: string;
|
|
157
|
+
title: string;
|
|
158
|
+
}
|
|
159
|
+
interface CurrencyChangeWidget {
|
|
160
|
+
confirmButton: string;
|
|
161
|
+
enabledHeader: string;
|
|
162
|
+
header: string;
|
|
163
|
+
}
|
|
164
|
+
interface Common {
|
|
165
|
+
availableInOtherCurrencies: string;
|
|
166
|
+
back: string;
|
|
167
|
+
cancel: string;
|
|
168
|
+
change: string;
|
|
169
|
+
close: string;
|
|
170
|
+
confirm: string;
|
|
171
|
+
currencyAlert: string;
|
|
172
|
+
done: string;
|
|
173
|
+
edit: string;
|
|
174
|
+
email: string;
|
|
175
|
+
item: string;
|
|
176
|
+
items: string;
|
|
177
|
+
next: string;
|
|
178
|
+
password: string;
|
|
179
|
+
phone: string;
|
|
180
|
+
previous: string;
|
|
181
|
+
recent: string;
|
|
182
|
+
}
|
|
183
|
+
interface ActionButton {
|
|
184
|
+
cancel: string;
|
|
185
|
+
close: string;
|
|
186
|
+
confirm: string;
|
|
187
|
+
next: string;
|
|
188
|
+
now: string;
|
|
189
|
+
pay: string;
|
|
190
|
+
resend: string;
|
|
191
|
+
signin: string;
|
|
192
|
+
}
|
|
193
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|