@tap-payments/apple-pay-button 0.0.82-development → 0.0.84-development

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.
Files changed (43) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +240 -240
  3. package/build/@types/ApplePayButtonProps.d.ts +129 -129
  4. package/build/@types/ApplePayButtonProps.js +1 -1
  5. package/build/@types/charge.d.ts +57 -57
  6. package/build/@types/charge.js +1 -1
  7. package/build/@types/checkoutProfile.d.ts +216 -195
  8. package/build/@types/checkoutProfile.js +1 -1
  9. package/build/@types/enums.d.ts +65 -65
  10. package/build/@types/enums.js +76 -76
  11. package/build/@types/index.d.ts +6 -6
  12. package/build/@types/index.js +6 -6
  13. package/build/@types/tapLocalisation.d.ts +193 -193
  14. package/build/@types/tapLocalisation.js +1 -1
  15. package/build/@types/tapTheme.d.ts +842 -842
  16. package/build/@types/tapTheme.js +1 -1
  17. package/build/api.d.ts +29 -29
  18. package/build/api.js +244 -244
  19. package/build/constants/index.d.ts +3 -3
  20. package/build/constants/index.js +3 -3
  21. package/build/features/ApplePayButton/ApplePayButton.d.ts +4 -4
  22. package/build/features/ApplePayButton/ApplePayButton.js +49 -49
  23. package/build/features/ApplePayButton/index.d.ts +3 -3
  24. package/build/features/ApplePayButton/index.js +2 -2
  25. package/build/hooks/index.d.ts +1 -1
  26. package/build/hooks/index.js +1 -1
  27. package/build/hooks/useApplePay.d.ts +93 -93
  28. package/build/hooks/useApplePay.js +447 -447
  29. package/build/hooks/useMerchantApplePay.d.ts +20 -20
  30. package/build/hooks/useMerchantApplePay.js +188 -176
  31. package/build/index.d.ts +4 -4
  32. package/build/index.js +13 -13
  33. package/build/utils/config.d.ts +14 -14
  34. package/build/utils/config.js +65 -65
  35. package/build/utils/defaultValues.d.ts +2 -2
  36. package/build/utils/defaultValues.js +27 -27
  37. package/build/utils/html.d.ts +1 -1
  38. package/build/utils/html.js +9 -9
  39. package/build/utils/index.d.ts +4 -4
  40. package/build/utils/index.js +4 -4
  41. package/build/utils/theme.d.ts +12 -12
  42. package/build/utils/theme.js +61 -61
  43. package/package.json +109 -109
@@ -1,195 +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
- }
58
- interface Supportedcurrency {
59
- symbol: string;
60
- name: string;
61
- flag: string;
62
- decimal_digit: number;
63
- selected: boolean;
64
- rate: number;
65
- logos: Logos2;
66
- order_by: number;
67
- currency: string;
68
- amount: number;
69
- }
70
- interface Logos2 {
71
- dark: Disabled;
72
- light: Disabled;
73
- light_mono: Disabled;
74
- dark_colored: Disabled;
75
- }
76
- export interface PaymentMethod {
77
- id: string;
78
- name: string;
79
- name_ar: string;
80
- image: string;
81
- payment_type: string;
82
- supported_card_brands: SupportedNetworks[];
83
- supported_currencies: string[];
84
- order_by: number;
85
- cc_markup: number;
86
- asynchronous: boolean;
87
- threeDS: string;
88
- api_version: number;
89
- api_version_minor: number;
90
- logos: Logos;
91
- payment_order_type: string;
92
- button_style: Buttonstyle;
93
- display_name: string;
94
- default_currency: string;
95
- identifier?: string;
96
- }
97
- interface Buttonstyle {
98
- background: Background2;
99
- title_asset: 'https://tap-assets.b-cdn.net/action-button/{theme}/{lang}/mastercard';
100
- }
101
- interface Background2 {
102
- light: Light2;
103
- dark: Light2;
104
- light_mono: Light2;
105
- dark_colored: Light2;
106
- }
107
- interface Light2 {
108
- base_color: string;
109
- background_colors: string[];
110
- }
111
- interface Logos {
112
- dark: Dark2;
113
- light: Dark2;
114
- light_mono: Dark2;
115
- dark_colored: Dark2;
116
- }
117
- interface Dark2 {
118
- svg: string;
119
- png: string;
120
- disabled: Disabled;
121
- currency_widget: Disabled;
122
- card_icon: Disabled;
123
- }
124
- interface Disabled {
125
- svg: string;
126
- png: string;
127
- }
128
- interface Assests {
129
- localisation: Localisation;
130
- theme: Theme;
131
- web: Theme;
132
- }
133
- type Theme = Record<ThemeMode, string> & {
134
- card: {
135
- light: string;
136
- dark: string;
137
- };
138
- };
139
- interface Localisation {
140
- url: string;
141
- card: {
142
- url: string;
143
- };
144
- }
145
- interface MerchantResponse {
146
- id: string;
147
- api_version: string;
148
- live_mode: boolean;
149
- object: string;
150
- name: string;
151
- country_code: string;
152
- logo: string;
153
- background: Background;
154
- contact: any[];
155
- powered_by: boolean;
156
- sdk_settings: Sdksettings;
157
- session_token: string;
158
- key_type: string;
159
- encryption_key: string;
160
- permissions: string[];
161
- permission: Permission;
162
- }
163
- interface Permission {
164
- card_wallet: boolean;
165
- threeDSecure: boolean;
166
- pci_dss: boolean;
167
- }
168
- interface Sdksettings {
169
- status_display_duration: number;
170
- otp_resend_interval: number;
171
- otp_resend_attempts: number;
172
- }
173
- interface Background {
174
- url: string;
175
- mode: string;
176
- color: Color;
177
- }
178
- interface Color {
179
- dark: Dark;
180
- light: Light;
181
- }
182
- interface Light {
183
- color: string;
184
- rectangle: Rectangle;
185
- image: string;
186
- }
187
- interface Rectangle {
188
- background: string;
189
- 'backdrop-filter': string;
190
- }
191
- interface Dark {
192
- color: string;
193
- image: string;
194
- }
195
- export {};
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 {};
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,65 +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
- }
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
+ }