@tap-payments/apple-pay-button 0.0.89-development → 0.0.91-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 (41) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +240 -240
  3. package/build/@types/ApplePayButtonProps.d.ts +56 -56
  4. package/build/@types/ApplePayButtonProps.js +1 -1
  5. package/build/@types/charge.d.ts +56 -57
  6. package/build/@types/charge.js +1 -1
  7. package/build/@types/checkoutProfile.d.ts +216 -216
  8. package/build/@types/checkoutProfile.js +1 -1
  9. package/build/@types/enums.d.ts +44 -45
  10. package/build/@types/enums.js +51 -52
  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 +31 -31
  18. package/build/api.js +236 -236
  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 +48 -48
  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 +81 -21
  28. package/build/hooks/useApplePay.js +424 -422
  29. package/build/hooks/useMerchantApplePay.d.ts +22 -21
  30. package/build/hooks/useMerchantApplePay.js +190 -189
  31. package/build/index.d.ts +5 -5
  32. package/build/index.js +14 -14
  33. package/build/utils/config.d.ts +14 -14
  34. package/build/utils/config.js +59 -65
  35. package/build/utils/defaultValues.d.ts +2 -2
  36. package/build/utils/defaultValues.js +27 -27
  37. package/build/utils/index.d.ts +3 -3
  38. package/build/utils/index.js +3 -3
  39. package/build/utils/theme.d.ts +13 -13
  40. package/build/utils/theme.js +62 -62
  41. package/package.json +109 -109
@@ -1,57 +1,56 @@
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: string;
56
- };
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
+ customer: {
14
+ id?: string;
15
+ first_name?: string;
16
+ middle_name?: string;
17
+ last_name?: string;
18
+ email?: string;
19
+ phone?: {
20
+ country_code: string;
21
+ number: string;
22
+ };
23
+ };
24
+ hashstring?: string;
25
+ metadata?: Record<string, string>;
26
+ post?: {
27
+ url: string;
28
+ };
29
+ redirect?: {
30
+ url: string;
31
+ };
32
+ merchant?: {
33
+ id: string;
34
+ };
35
+ order?: {
36
+ id: string;
37
+ };
38
+ payment_agreement?: {
39
+ id: string;
40
+ contract?: {
41
+ id: string;
42
+ };
43
+ };
44
+ destinations?: Record<string, any>;
45
+ reference?: {
46
+ order?: string;
47
+ transaction?: string;
48
+ };
49
+ description?: string;
50
+ }
51
+ export interface AuthorizeRequestBody extends ChargeRequestBody {
52
+ auto?: {
53
+ type: string;
54
+ time: string;
55
+ };
56
+ }
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,216 +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 {};
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,45 +1,44 @@
1
- export declare enum ButtonStyle {
2
- Black = "black",
3
- White = "white",
4
- WhiteOutline = "white-outline"
5
- }
6
- export declare enum FullThemeMode {
7
- DARK = "dark",
8
- LIGHT = "light",
9
- LIGHT_MONO = "light_mono",
10
- DARK_COLORED = "dark_colored"
11
- }
12
- export declare enum ButtonType {
13
- BOOK = "book",
14
- BUY = "buy",
15
- CHECK_OUT = "check-out",
16
- PAY = "pay",
17
- PLAIN = "plain",
18
- SUBSCRIBE = "subscribe"
19
- }
20
- export declare enum CHARGE_CODE {
21
- SUCCESS = "000",
22
- AUTHORIZED = "001",
23
- IN_PROGRESS = "200"
24
- }
25
- export declare enum MerchantCapabilities {
26
- Supports3DS = "supports3DS",
27
- SupportsCredit = "supportsCredit",
28
- SupportsDebit = "supportsDebit"
29
- }
30
- export declare enum SupportedNetworks {
31
- Amex = "amex",
32
- Mada = "mada",
33
- MasterCard = "masterCard",
34
- Visa = "visa",
35
- ChinaUnionPay = "chinaUnionPay",
36
- Discover = "discover",
37
- Electron = "electron",
38
- Jcb = "jcb",
39
- Maestro = "maestro"
40
- }
41
- export declare enum IntegrationType {
42
- SDK = "sdk",
43
- IFRAME = "iframe",
44
- WEBVIEW = "webview"
45
- }
1
+ export declare enum ButtonStyle {
2
+ Black = "black",
3
+ White = "white",
4
+ WhiteOutline = "white-outline"
5
+ }
6
+ export declare enum FullThemeMode {
7
+ DARK = "dark",
8
+ LIGHT = "light",
9
+ LIGHT_MONO = "light_mono",
10
+ DARK_COLORED = "dark_colored"
11
+ }
12
+ export declare enum ButtonType {
13
+ BOOK = "book",
14
+ BUY = "buy",
15
+ CHECK_OUT = "check-out",
16
+ PAY = "pay",
17
+ PLAIN = "plain",
18
+ SUBSCRIBE = "subscribe"
19
+ }
20
+ export declare enum CHARGE_CODE {
21
+ SUCCESS = "000",
22
+ AUTHORIZED = "001",
23
+ IN_PROGRESS = "200"
24
+ }
25
+ export declare enum MerchantCapabilities {
26
+ Supports3DS = "supports3DS",
27
+ SupportsCredit = "supportsCredit",
28
+ SupportsDebit = "supportsDebit"
29
+ }
30
+ export declare enum SupportedNetworks {
31
+ Amex = "amex",
32
+ Mada = "mada",
33
+ MasterCard = "masterCard",
34
+ Visa = "visa",
35
+ ChinaUnionPay = "chinaUnionPay",
36
+ Discover = "discover",
37
+ Electron = "electron",
38
+ Jcb = "jcb",
39
+ Maestro = "maestro"
40
+ }
41
+ export declare enum IntegrationType {
42
+ SDK = "sdk",
43
+ IFRAME = "iframe"
44
+ }