@eventlook/sdk 1.7.2 → 1.7.3-beta.0
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/.prettierignore +3 -0
- package/CLAUDE.md +33 -0
- package/dist/cjs/{index-D1KZ-2U1.js → index-CXsZ9BsP.js} +26476 -25947
- package/dist/cjs/index-CXsZ9BsP.js.map +1 -0
- package/dist/cjs/index-DgOx9uHQ.js +41917 -0
- package/dist/cjs/index-DgOx9uHQ.js.map +1 -0
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/{index.umd-C2KzR75H.js → index.umd-DR37hmpO.js} +2 -2
- package/dist/cjs/{index.umd-C2KzR75H.js.map → index.umd-DR37hmpO.js.map} +1 -1
- package/dist/cjs/index.umd-TbjzhsUx.js +13397 -0
- package/dist/cjs/index.umd-TbjzhsUx.js.map +1 -0
- package/dist/cjs/{mui-tel-input.es-Bjml407E.js → mui-tel-input.es-Dk9M_v4X.js} +6 -6
- package/dist/{esm/mui-tel-input.es-Bt2rE3An.js.map → cjs/mui-tel-input.es-Dk9M_v4X.js.map} +1 -1
- package/dist/esm/index-Ds-63DcA.js +41896 -0
- package/dist/esm/index-Ds-63DcA.js.map +1 -0
- package/dist/esm/{index-DRYwiFvp.js → index-z31XSEKz.js} +26751 -26240
- package/dist/esm/index-z31XSEKz.js.map +1 -0
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/{index.umd-BXOC8cuK.js → index.umd-5znOX_Ww.js} +4 -4
- package/dist/esm/{index.umd-BXOC8cuK.js.map → index.umd-5znOX_Ww.js.map} +1 -1
- package/dist/esm/index.umd-ddggyAGa.js +13395 -0
- package/dist/esm/index.umd-ddggyAGa.js.map +1 -0
- package/dist/esm/{mui-tel-input.es-Bt2rE3An.js → mui-tel-input.es-Cb4Lpqx7.js} +21 -21
- package/dist/{cjs/mui-tel-input.es-Bjml407E.js.map → esm/mui-tel-input.es-Cb4Lpqx7.js.map} +1 -1
- package/dist/types/form/Payment.d.ts +1 -0
- package/dist/types/form/paydroid/PaydroidCashlessSection.d.ts +7 -0
- package/dist/types/form/paydroid/PaydroidError.d.ts +3 -0
- package/dist/types/form/paydroid/PaydroidErrorAccount.d.ts +3 -0
- package/dist/types/form/paydroid/PaydroidErrorTicket.d.ts +3 -0
- package/dist/types/form/paydroid/PaydroidPage.d.ts +6 -0
- package/dist/types/form/paydroid/PaydroidStatusCard.d.ts +10 -0
- package/dist/types/form/paydroid/PaydroidSuccess.d.ts +3 -0
- package/dist/types/form/paydroid/PaydroidSuccessTopup.d.ts +3 -0
- package/dist/types/form/payment/StripeCheckoutProvider.d.ts +36 -0
- package/dist/types/hooks/data/useStripeConfig.d.ts +3 -0
- package/dist/types/locales/cs.d.ts +34 -0
- package/dist/types/locales/en.d.ts +34 -0
- package/dist/types/locales/es.d.ts +34 -0
- package/dist/types/locales/pl.d.ts +34 -0
- package/dist/types/locales/sk.d.ts +34 -0
- package/dist/types/locales/uk.d.ts +34 -0
- package/dist/types/modules/order.d.ts +3 -0
- package/dist/types/modules/paydroid.d.ts +4 -0
- package/dist/types/utils/data/page.d.ts +7 -0
- package/dist/types/utils/page.d.ts +1 -0
- package/dist/types/utils/paydroid.d.ts +6 -0
- package/dist/types/utils/types/global.type.d.ts +1 -0
- package/dist/types/utils/types/order.type.d.ts +4 -0
- package/dist/types/utils/types/paydroid.d.ts +23 -0
- package/dist/types/utils/types/payment-method.type.d.ts +1 -0
- package/package.json +6 -2
- package/src/form/Payment.tsx +42 -3
- package/src/form/PaymentOverviewBox.tsx +20 -7
- package/src/form/PaymentSuccess.tsx +6 -2
- package/src/form/TicketForm.tsx +269 -168
- package/src/form/paydroid/PaydroidCashlessSection.tsx +311 -0
- package/src/form/paydroid/PaydroidError.tsx +26 -0
- package/src/form/paydroid/PaydroidErrorAccount.tsx +26 -0
- package/src/form/paydroid/PaydroidErrorTicket.tsx +26 -0
- package/src/form/paydroid/PaydroidPage.tsx +22 -0
- package/src/form/paydroid/PaydroidStatusCard.tsx +91 -0
- package/src/form/paydroid/PaydroidSuccess.tsx +26 -0
- package/src/form/paydroid/PaydroidSuccessTopup.tsx +26 -0
- package/src/form/payment/StripeCheckoutProvider.tsx +154 -0
- package/src/hooks/data/useStripeConfig.ts +14 -0
- package/src/locales/cs.tsx +40 -0
- package/src/locales/en.tsx +38 -0
- package/src/locales/es.tsx +39 -0
- package/src/locales/pl.tsx +38 -0
- package/src/locales/sk.tsx +40 -0
- package/src/locales/uk.tsx +38 -0
- package/src/modules/order.ts +3 -0
- package/src/modules/paydroid.ts +33 -0
- package/src/utils/data/page.ts +7 -0
- package/src/utils/page.ts +4 -0
- package/src/utils/paydroid.ts +35 -0
- package/src/utils/types/global.type.ts +1 -0
- package/src/utils/types/order.type.ts +7 -0
- package/src/utils/types/paydroid.ts +26 -0
- package/src/utils/types/payment-method.type.ts +1 -0
- package/dist/cjs/index-D1KZ-2U1.js.map +0 -1
- package/dist/esm/index-DRYwiFvp.js.map +0 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React, { MutableRefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Imperative handle the order form uses to drive the inline Stripe payment from
|
|
4
|
+
* its own submit handler (which lives outside the <Elements> tree).
|
|
5
|
+
*/
|
|
6
|
+
export interface StripeCheckoutApi {
|
|
7
|
+
ready: boolean;
|
|
8
|
+
/** Validate + collect the card fields. Returns an error message, or null. */
|
|
9
|
+
submit: () => Promise<string | null>;
|
|
10
|
+
/** Confirm the server-created PaymentIntent. */
|
|
11
|
+
confirm: (clientSecret: string, returnUrl: string) => Promise<{
|
|
12
|
+
ok: boolean;
|
|
13
|
+
error?: string;
|
|
14
|
+
}>;
|
|
15
|
+
}
|
|
16
|
+
interface Props {
|
|
17
|
+
/** Mount Elements only when a Stripe method is offered and the key is loaded. */
|
|
18
|
+
active: boolean;
|
|
19
|
+
publishableKey: string | null;
|
|
20
|
+
/** 'payment' for paid orders, 'setup' for free (0-amount) card verification. */
|
|
21
|
+
mode: 'payment' | 'setup';
|
|
22
|
+
/** Charge amount in minor units (used by Elements; the server intent is authoritative). */
|
|
23
|
+
amount: number;
|
|
24
|
+
currency: string;
|
|
25
|
+
locale: string;
|
|
26
|
+
apiRef: MutableRefObject<StripeCheckoutApi | null>;
|
|
27
|
+
children: React.ReactNode;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Wraps the order form in a deferred-mode <Elements> provider so the Payment
|
|
31
|
+
* Element can be shown inline (expanded under the selected method) before the
|
|
32
|
+
* order — and its PaymentIntent — exists. When no Stripe method is on offer it
|
|
33
|
+
* renders children untouched and loads nothing.
|
|
34
|
+
*/
|
|
35
|
+
declare const StripeCheckoutProvider: React.FC<Props>;
|
|
36
|
+
export default StripeCheckoutProvider;
|
|
@@ -44,6 +44,9 @@ declare const cs: {
|
|
|
44
44
|
total: string;
|
|
45
45
|
with_fee: string;
|
|
46
46
|
service_fee: string;
|
|
47
|
+
payment_processing_fee: string;
|
|
48
|
+
card_payment_title: string;
|
|
49
|
+
card_payment_error: string;
|
|
47
50
|
shipping_fee: string;
|
|
48
51
|
ticket_insurance: string;
|
|
49
52
|
price_including_service_fee: string;
|
|
@@ -62,6 +65,7 @@ declare const cs: {
|
|
|
62
65
|
primary_ticket_number_hint: string;
|
|
63
66
|
primary_ticket_dialog_title: string;
|
|
64
67
|
primary_ticket_dialog_input_label: string;
|
|
68
|
+
amount: string;
|
|
65
69
|
};
|
|
66
70
|
validation: {
|
|
67
71
|
required: string;
|
|
@@ -167,6 +171,36 @@ declare const cs: {
|
|
|
167
171
|
button: string;
|
|
168
172
|
products: string;
|
|
169
173
|
};
|
|
174
|
+
paydroid: {
|
|
175
|
+
label: string;
|
|
176
|
+
heading: string;
|
|
177
|
+
heading_cta: string;
|
|
178
|
+
subtitle: string;
|
|
179
|
+
amount_label: string;
|
|
180
|
+
amount_placeholder: string;
|
|
181
|
+
promo: string;
|
|
182
|
+
terms_prefix: string;
|
|
183
|
+
terms_conditions: string;
|
|
184
|
+
terms_middle: string;
|
|
185
|
+
terms_privacy: string;
|
|
186
|
+
terms: string;
|
|
187
|
+
skip: string;
|
|
188
|
+
submit: string;
|
|
189
|
+
success_title: string;
|
|
190
|
+
success_subtitle: string;
|
|
191
|
+
topup_success_title: string;
|
|
192
|
+
topup_success_subtitle: string;
|
|
193
|
+
error_title: string;
|
|
194
|
+
error_subtitle: string;
|
|
195
|
+
error_account_title: string;
|
|
196
|
+
error_account_subtitle: string;
|
|
197
|
+
error_account_button: string;
|
|
198
|
+
error_ticket_title: string;
|
|
199
|
+
error_ticket_subtitle: string;
|
|
200
|
+
faq_button: string;
|
|
201
|
+
retry_button: string;
|
|
202
|
+
missing_api_key: string;
|
|
203
|
+
};
|
|
170
204
|
unpaid: string;
|
|
171
205
|
unpaid_description: string;
|
|
172
206
|
};
|
|
@@ -44,6 +44,9 @@ declare const en: {
|
|
|
44
44
|
total: string;
|
|
45
45
|
with_fee: string;
|
|
46
46
|
service_fee: string;
|
|
47
|
+
payment_processing_fee: string;
|
|
48
|
+
card_payment_title: string;
|
|
49
|
+
card_payment_error: string;
|
|
47
50
|
shipping_fee: string;
|
|
48
51
|
ticket_insurance: string;
|
|
49
52
|
price_including_service_fee: string;
|
|
@@ -62,6 +65,7 @@ declare const en: {
|
|
|
62
65
|
primary_ticket_number_hint: string;
|
|
63
66
|
primary_ticket_dialog_title: string;
|
|
64
67
|
primary_ticket_dialog_input_label: string;
|
|
68
|
+
amount: string;
|
|
65
69
|
};
|
|
66
70
|
validation: {
|
|
67
71
|
required: string;
|
|
@@ -167,6 +171,36 @@ declare const en: {
|
|
|
167
171
|
button: string;
|
|
168
172
|
products: string;
|
|
169
173
|
};
|
|
174
|
+
paydroid: {
|
|
175
|
+
label: string;
|
|
176
|
+
heading: string;
|
|
177
|
+
heading_cta: string;
|
|
178
|
+
subtitle: string;
|
|
179
|
+
amount_label: string;
|
|
180
|
+
amount_placeholder: string;
|
|
181
|
+
promo: string;
|
|
182
|
+
terms_prefix: string;
|
|
183
|
+
terms_conditions: string;
|
|
184
|
+
terms_middle: string;
|
|
185
|
+
terms_privacy: string;
|
|
186
|
+
terms: string;
|
|
187
|
+
skip: string;
|
|
188
|
+
submit: string;
|
|
189
|
+
success_title: string;
|
|
190
|
+
success_subtitle: string;
|
|
191
|
+
topup_success_title: string;
|
|
192
|
+
topup_success_subtitle: string;
|
|
193
|
+
error_title: string;
|
|
194
|
+
error_subtitle: string;
|
|
195
|
+
error_account_title: string;
|
|
196
|
+
error_account_subtitle: string;
|
|
197
|
+
error_account_button: string;
|
|
198
|
+
error_ticket_title: string;
|
|
199
|
+
error_ticket_subtitle: string;
|
|
200
|
+
faq_button: string;
|
|
201
|
+
retry_button: string;
|
|
202
|
+
missing_api_key: string;
|
|
203
|
+
};
|
|
170
204
|
unpaid: string;
|
|
171
205
|
unpaid_description: string;
|
|
172
206
|
};
|
|
@@ -44,6 +44,9 @@ declare const es: {
|
|
|
44
44
|
total: string;
|
|
45
45
|
with_fee: string;
|
|
46
46
|
service_fee: string;
|
|
47
|
+
payment_processing_fee: string;
|
|
48
|
+
card_payment_title: string;
|
|
49
|
+
card_payment_error: string;
|
|
47
50
|
shipping_fee: string;
|
|
48
51
|
ticket_insurance: string;
|
|
49
52
|
price_including_service_fee: string;
|
|
@@ -62,6 +65,7 @@ declare const es: {
|
|
|
62
65
|
primary_ticket_number_hint: string;
|
|
63
66
|
primary_ticket_dialog_title: string;
|
|
64
67
|
primary_ticket_dialog_input_label: string;
|
|
68
|
+
amount: string;
|
|
65
69
|
};
|
|
66
70
|
validation: {
|
|
67
71
|
required: string;
|
|
@@ -167,6 +171,36 @@ declare const es: {
|
|
|
167
171
|
button: string;
|
|
168
172
|
products: string;
|
|
169
173
|
};
|
|
174
|
+
paydroid: {
|
|
175
|
+
label: string;
|
|
176
|
+
heading: string;
|
|
177
|
+
heading_cta: string;
|
|
178
|
+
subtitle: string;
|
|
179
|
+
amount_label: string;
|
|
180
|
+
amount_placeholder: string;
|
|
181
|
+
promo: string;
|
|
182
|
+
terms_prefix: string;
|
|
183
|
+
terms_conditions: string;
|
|
184
|
+
terms_middle: string;
|
|
185
|
+
terms_privacy: string;
|
|
186
|
+
terms: string;
|
|
187
|
+
skip: string;
|
|
188
|
+
submit: string;
|
|
189
|
+
success_title: string;
|
|
190
|
+
success_subtitle: string;
|
|
191
|
+
topup_success_title: string;
|
|
192
|
+
topup_success_subtitle: string;
|
|
193
|
+
error_title: string;
|
|
194
|
+
error_subtitle: string;
|
|
195
|
+
error_account_title: string;
|
|
196
|
+
error_account_subtitle: string;
|
|
197
|
+
error_account_button: string;
|
|
198
|
+
error_ticket_title: string;
|
|
199
|
+
error_ticket_subtitle: string;
|
|
200
|
+
faq_button: string;
|
|
201
|
+
retry_button: string;
|
|
202
|
+
missing_api_key: string;
|
|
203
|
+
};
|
|
170
204
|
unpaid: string;
|
|
171
205
|
unpaid_description: string;
|
|
172
206
|
};
|
|
@@ -44,6 +44,9 @@ declare const pl: {
|
|
|
44
44
|
total: string;
|
|
45
45
|
with_fee: string;
|
|
46
46
|
service_fee: string;
|
|
47
|
+
payment_processing_fee: string;
|
|
48
|
+
card_payment_title: string;
|
|
49
|
+
card_payment_error: string;
|
|
47
50
|
shipping_fee: string;
|
|
48
51
|
ticket_insurance: string;
|
|
49
52
|
price_including_service_fee: string;
|
|
@@ -62,6 +65,7 @@ declare const pl: {
|
|
|
62
65
|
primary_ticket_number_hint: string;
|
|
63
66
|
primary_ticket_dialog_title: string;
|
|
64
67
|
primary_ticket_dialog_input_label: string;
|
|
68
|
+
amount: string;
|
|
65
69
|
};
|
|
66
70
|
validation: {
|
|
67
71
|
required: string;
|
|
@@ -167,6 +171,36 @@ declare const pl: {
|
|
|
167
171
|
button: string;
|
|
168
172
|
products: string;
|
|
169
173
|
};
|
|
174
|
+
paydroid: {
|
|
175
|
+
label: string;
|
|
176
|
+
heading: string;
|
|
177
|
+
heading_cta: string;
|
|
178
|
+
subtitle: string;
|
|
179
|
+
amount_label: string;
|
|
180
|
+
amount_placeholder: string;
|
|
181
|
+
promo: string;
|
|
182
|
+
terms_prefix: string;
|
|
183
|
+
terms_conditions: string;
|
|
184
|
+
terms_middle: string;
|
|
185
|
+
terms_privacy: string;
|
|
186
|
+
terms: string;
|
|
187
|
+
skip: string;
|
|
188
|
+
submit: string;
|
|
189
|
+
success_title: string;
|
|
190
|
+
success_subtitle: string;
|
|
191
|
+
topup_success_title: string;
|
|
192
|
+
topup_success_subtitle: string;
|
|
193
|
+
error_title: string;
|
|
194
|
+
error_subtitle: string;
|
|
195
|
+
error_account_title: string;
|
|
196
|
+
error_account_subtitle: string;
|
|
197
|
+
error_account_button: string;
|
|
198
|
+
error_ticket_title: string;
|
|
199
|
+
error_ticket_subtitle: string;
|
|
200
|
+
faq_button: string;
|
|
201
|
+
retry_button: string;
|
|
202
|
+
missing_api_key: string;
|
|
203
|
+
};
|
|
170
204
|
unpaid: string;
|
|
171
205
|
unpaid_description: string;
|
|
172
206
|
};
|
|
@@ -44,6 +44,9 @@ declare const sk: {
|
|
|
44
44
|
total: string;
|
|
45
45
|
with_fee: string;
|
|
46
46
|
service_fee: string;
|
|
47
|
+
payment_processing_fee: string;
|
|
48
|
+
card_payment_title: string;
|
|
49
|
+
card_payment_error: string;
|
|
47
50
|
shipping_fee: string;
|
|
48
51
|
ticket_insurance: string;
|
|
49
52
|
price_including_service_fee: string;
|
|
@@ -62,6 +65,7 @@ declare const sk: {
|
|
|
62
65
|
primary_ticket_number_hint: string;
|
|
63
66
|
primary_ticket_dialog_title: string;
|
|
64
67
|
primary_ticket_dialog_input_label: string;
|
|
68
|
+
amount: string;
|
|
65
69
|
};
|
|
66
70
|
validation: {
|
|
67
71
|
required: string;
|
|
@@ -167,6 +171,36 @@ declare const sk: {
|
|
|
167
171
|
button: string;
|
|
168
172
|
products: string;
|
|
169
173
|
};
|
|
174
|
+
paydroid: {
|
|
175
|
+
label: string;
|
|
176
|
+
heading: string;
|
|
177
|
+
heading_cta: string;
|
|
178
|
+
subtitle: string;
|
|
179
|
+
amount_label: string;
|
|
180
|
+
amount_placeholder: string;
|
|
181
|
+
promo: string;
|
|
182
|
+
terms_prefix: string;
|
|
183
|
+
terms_conditions: string;
|
|
184
|
+
terms_middle: string;
|
|
185
|
+
terms_privacy: string;
|
|
186
|
+
terms: string;
|
|
187
|
+
skip: string;
|
|
188
|
+
submit: string;
|
|
189
|
+
success_title: string;
|
|
190
|
+
success_subtitle: string;
|
|
191
|
+
topup_success_title: string;
|
|
192
|
+
topup_success_subtitle: string;
|
|
193
|
+
error_title: string;
|
|
194
|
+
error_subtitle: string;
|
|
195
|
+
error_account_title: string;
|
|
196
|
+
error_account_subtitle: string;
|
|
197
|
+
error_account_button: string;
|
|
198
|
+
error_ticket_title: string;
|
|
199
|
+
error_ticket_subtitle: string;
|
|
200
|
+
faq_button: string;
|
|
201
|
+
retry_button: string;
|
|
202
|
+
missing_api_key: string;
|
|
203
|
+
};
|
|
170
204
|
unpaid: string;
|
|
171
205
|
unpaid_description: string;
|
|
172
206
|
};
|
|
@@ -44,6 +44,9 @@ declare const uk: {
|
|
|
44
44
|
total: string;
|
|
45
45
|
with_fee: string;
|
|
46
46
|
service_fee: string;
|
|
47
|
+
payment_processing_fee: string;
|
|
48
|
+
card_payment_title: string;
|
|
49
|
+
card_payment_error: string;
|
|
47
50
|
shipping_fee: string;
|
|
48
51
|
ticket_insurance: string;
|
|
49
52
|
price_including_service_fee: string;
|
|
@@ -62,6 +65,7 @@ declare const uk: {
|
|
|
62
65
|
primary_ticket_number_hint: string;
|
|
63
66
|
primary_ticket_dialog_title: string;
|
|
64
67
|
primary_ticket_dialog_input_label: string;
|
|
68
|
+
amount: string;
|
|
65
69
|
};
|
|
66
70
|
validation: {
|
|
67
71
|
required: string;
|
|
@@ -167,6 +171,36 @@ declare const uk: {
|
|
|
167
171
|
button: string;
|
|
168
172
|
products: string;
|
|
169
173
|
};
|
|
174
|
+
paydroid: {
|
|
175
|
+
label: string;
|
|
176
|
+
heading: string;
|
|
177
|
+
heading_cta: string;
|
|
178
|
+
subtitle: string;
|
|
179
|
+
amount_label: string;
|
|
180
|
+
amount_placeholder: string;
|
|
181
|
+
promo: string;
|
|
182
|
+
terms_prefix: string;
|
|
183
|
+
terms_conditions: string;
|
|
184
|
+
terms_middle: string;
|
|
185
|
+
terms_privacy: string;
|
|
186
|
+
terms: string;
|
|
187
|
+
skip: string;
|
|
188
|
+
submit: string;
|
|
189
|
+
success_title: string;
|
|
190
|
+
success_subtitle: string;
|
|
191
|
+
topup_success_title: string;
|
|
192
|
+
topup_success_subtitle: string;
|
|
193
|
+
error_title: string;
|
|
194
|
+
error_subtitle: string;
|
|
195
|
+
error_account_title: string;
|
|
196
|
+
error_account_subtitle: string;
|
|
197
|
+
error_account_button: string;
|
|
198
|
+
error_ticket_title: string;
|
|
199
|
+
error_ticket_subtitle: string;
|
|
200
|
+
faq_button: string;
|
|
201
|
+
retry_button: string;
|
|
202
|
+
missing_api_key: string;
|
|
203
|
+
};
|
|
170
204
|
unpaid: string;
|
|
171
205
|
unpaid_description: string;
|
|
172
206
|
};
|
|
@@ -5,3 +5,6 @@ import { Currencies } from '@utils/data/currency';
|
|
|
5
5
|
export declare const postOrder: (data: ITicketBody) => Promise<IResponse<IOrderCreate>>;
|
|
6
6
|
export declare const getAllowedPaymentMethods: (currency: Currencies, eventId?: number) => Promise<any>;
|
|
7
7
|
export declare const postOrderPaid: (data: IOrderPaidData) => Promise<IResponse<IOrderPaid>>;
|
|
8
|
+
export declare const getStripeConfig: () => Promise<{
|
|
9
|
+
publishableKey: string | null;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IResponse } from '@utils/types/global.type';
|
|
2
|
+
import { IPaydroidCreateAccountData, IPaydroidTopupAccountData, IPaydroidTopupAccountResponse } from '@utils/types/paydroid';
|
|
3
|
+
export declare const postPaydroidCreateAccount: (apiKey: string, data: IPaydroidCreateAccountData) => Promise<IResponse<null>>;
|
|
4
|
+
export declare const postPaydroidTopupAccount: (apiKey: string, data: IPaydroidTopupAccountData) => Promise<IResponse<IPaydroidTopupAccountResponse>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isPaydroidPage: (page: string | null) => boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Page } from '@utils/data/page';
|
|
2
|
+
import { IOrderPaid } from '@utils/types/order.type';
|
|
3
|
+
import { IPaydroidCreateAccountData, IPaydroidTopupAccountData } from '@utils/types/paydroid';
|
|
4
|
+
export declare const getRedirectUrl: (page: Page) => string;
|
|
5
|
+
export declare const transformToCreateAccountData: (data: IOrderPaid) => IPaydroidCreateAccountData;
|
|
6
|
+
export declare const transformToTopupAccountData: (amount: string, data: IOrderPaid) => IPaydroidTopupAccountData;
|
|
@@ -21,6 +21,8 @@ export interface IOrder extends IBase {
|
|
|
21
21
|
}
|
|
22
22
|
export interface IOrderCreate {
|
|
23
23
|
gwUrl: string;
|
|
24
|
+
clientSecret: string | null;
|
|
25
|
+
publishableKey: string | null;
|
|
24
26
|
tickets: ICreateTicket[];
|
|
25
27
|
orderEntity: IOrder;
|
|
26
28
|
customer: ICustomer;
|
|
@@ -36,9 +38,11 @@ export interface IOrderPaid {
|
|
|
36
38
|
orderNumber: number;
|
|
37
39
|
tickets: IPaidTicket[];
|
|
38
40
|
products: IPaidProduct[];
|
|
41
|
+
customer: ICustomer;
|
|
39
42
|
extraFee: number;
|
|
40
43
|
currency: Currencies;
|
|
41
44
|
promoCodes: IPromoCode[] | null;
|
|
45
|
+
paydroidEventId: string | null;
|
|
42
46
|
}
|
|
43
47
|
export interface IAllowedPaymentMethod {
|
|
44
48
|
enabledPaymentInstruments: IPaymentInstrument[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface IPaydroidCreateAccountTicket {
|
|
2
|
+
number: string;
|
|
3
|
+
category?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface IPaydroidCreateAccountData {
|
|
6
|
+
first_name: string;
|
|
7
|
+
last_name: string;
|
|
8
|
+
email: string;
|
|
9
|
+
phone_number: string;
|
|
10
|
+
event_id: string;
|
|
11
|
+
tickets: IPaydroidCreateAccountTicket[];
|
|
12
|
+
date_of_birth?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface IPaydroidTopupAccountData {
|
|
15
|
+
email: string;
|
|
16
|
+
event_id: string;
|
|
17
|
+
amount: number;
|
|
18
|
+
success_url: string;
|
|
19
|
+
failure_url: string;
|
|
20
|
+
}
|
|
21
|
+
export interface IPaydroidTopupAccountResponse {
|
|
22
|
+
url: string;
|
|
23
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eventlook/sdk",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.3-beta.0",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"watch:push": "chokidar 'dist/**/*' -c 'yalc push --changed --force'",
|
|
23
23
|
"dev": "concurrently --kill-others-on-fail --kill-others \"yarn watch:rollup\" \"yarn watch:types\" \"yarn watch:push\"",
|
|
24
24
|
"dev:simple": "concurrently --kill-others-on-fail \"yarn watch:rollup\" \"yarn watch:types\"",
|
|
25
|
-
"
|
|
25
|
+
"release": "npm publish",
|
|
26
26
|
"lint": "eslint .",
|
|
27
27
|
"lint:fix": "eslint --fix .",
|
|
28
28
|
"prettier": "prettier --write 'src/**/*.{js,jsx,ts,tsx}'",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"@emotion/react": "^11.14.0",
|
|
33
33
|
"@emotion/styled": "^11.14.1",
|
|
34
|
+
"@mui/lab": "^7.0.0",
|
|
34
35
|
"@mui/material": "^7.0.0",
|
|
35
36
|
"@mui/x-date-pickers": "^8.0.0",
|
|
36
37
|
"motion": "^12.12.1",
|
|
@@ -44,6 +45,7 @@
|
|
|
44
45
|
"@hookform/resolvers": "^5.2.2",
|
|
45
46
|
"@iconify/icons-carbon": "^1.2.20",
|
|
46
47
|
"@iconify/react": "^6.0.2",
|
|
48
|
+
"@mui/lab": "^7.0.0",
|
|
47
49
|
"@mui/material": "^7.3.8",
|
|
48
50
|
"@mui/system": "^7.3.9",
|
|
49
51
|
"@mui/x-date-pickers": "^8.27.2",
|
|
@@ -54,6 +56,8 @@
|
|
|
54
56
|
"@rollup/plugin-replace": "^6.0.3",
|
|
55
57
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
56
58
|
"@seat-picker/seat-picker-sdk": "^1.2.0",
|
|
59
|
+
"@stripe/react-stripe-js": "^6.6.0",
|
|
60
|
+
"@stripe/stripe-js": "^9.7.0",
|
|
57
61
|
"@types/js-cookie": "^3.0.6",
|
|
58
62
|
"@types/lodash": "^4.17.24",
|
|
59
63
|
"@types/numeral": "^2.0.5",
|
package/src/form/Payment.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import React, { KeyboardEvent, useEffect, useMemo, useState } from 'react';
|
|
|
2
2
|
import {
|
|
3
3
|
Box,
|
|
4
4
|
Button,
|
|
5
|
+
CircularProgress,
|
|
5
6
|
Divider,
|
|
6
7
|
FormControl,
|
|
7
8
|
FormControlLabel,
|
|
@@ -19,6 +20,7 @@ import { PaymentItem, PaymentWrapper, PaymentSwiftWrapper } from '@form/style';
|
|
|
19
20
|
import Image from '@components/Image';
|
|
20
21
|
import Label from '@components/Label';
|
|
21
22
|
import PaymentSkeleton from '@form/payment/PaymentSkeleton';
|
|
23
|
+
import { PaymentElement } from '@stripe/react-stripe-js';
|
|
22
24
|
import { RHFRadioGroup } from '@components/hook-form';
|
|
23
25
|
import { postPromoCodeApply } from '@modules/promo-code';
|
|
24
26
|
import { IEvent } from '@utils/types/event.type';
|
|
@@ -32,9 +34,12 @@ import { IEventProductForm } from '@utils/types/product.type';
|
|
|
32
34
|
|
|
33
35
|
interface Props {
|
|
34
36
|
event: IEvent;
|
|
37
|
+
// True once the Stripe Elements provider is mounted (key loaded), so the
|
|
38
|
+
// inline Payment Element can render under the selected Stripe method.
|
|
39
|
+
stripeReady?: boolean;
|
|
35
40
|
}
|
|
36
41
|
|
|
37
|
-
const Payment: React.FC<Props> = ({ event }) => {
|
|
42
|
+
const Payment: React.FC<Props> = ({ event, stripeReady }) => {
|
|
38
43
|
const { t, lang } = useGlobal();
|
|
39
44
|
const { showSnackbar } = useGlobal();
|
|
40
45
|
const { data, isLoading } = useAllowedPaymentMethods(event.currency, event.id);
|
|
@@ -174,8 +179,12 @@ const Payment: React.FC<Props> = ({ event }) => {
|
|
|
174
179
|
|
|
175
180
|
if (total === 0 && (hasTickets || hasProducts)) {
|
|
176
181
|
setValue('isPaymentVerify', true);
|
|
177
|
-
|
|
178
|
-
|
|
182
|
+
// Free orders only offer card-verification methods (incl. Stripe, which
|
|
183
|
+
// verifies via a SetupIntent) — bot protection without a charge.
|
|
184
|
+
return data.filter(
|
|
185
|
+
(payment) =>
|
|
186
|
+
['PAYMENT_CARD', 'APPLE_PAY', 'GPAY', 'CLICK_TO_PAY'].includes(payment.type) ||
|
|
187
|
+
payment.provider === 'STRIPE'
|
|
179
188
|
);
|
|
180
189
|
} else {
|
|
181
190
|
setValue('isPaymentVerify', false);
|
|
@@ -334,6 +343,36 @@ const Payment: React.FC<Props> = ({ event }) => {
|
|
|
334
343
|
/>
|
|
335
344
|
</PaymentSwiftWrapper>
|
|
336
345
|
)}
|
|
346
|
+
{payment.provider === 'STRIPE' &&
|
|
347
|
+
!!paymentMethodId &&
|
|
348
|
+
Number(paymentMethodId) === payment.id && (
|
|
349
|
+
<PaymentSwiftWrapper sx={{ pb: 3 }}>
|
|
350
|
+
<Divider sx={{ mb: 2 }} />
|
|
351
|
+
{stripeReady ? (
|
|
352
|
+
<PaymentElement options={{ layout: 'tabs' }} />
|
|
353
|
+
) : Number(total) > 0 ? (
|
|
354
|
+
<Stack alignItems="center" sx={{ py: 3 }}>
|
|
355
|
+
<CircularProgress size={26} />
|
|
356
|
+
</Stack>
|
|
357
|
+
) : (
|
|
358
|
+
<Stack
|
|
359
|
+
alignItems="center"
|
|
360
|
+
spacing={1}
|
|
361
|
+
sx={{ py: 3, px: 2, textAlign: 'center' }}
|
|
362
|
+
>
|
|
363
|
+
<Iconify
|
|
364
|
+
icon="carbon:shopping-cart"
|
|
365
|
+
width={28}
|
|
366
|
+
height={28}
|
|
367
|
+
sx={{ color: 'text.disabled' }}
|
|
368
|
+
/>
|
|
369
|
+
<Typography variant="body2" sx={{ color: 'text.secondary' }}>
|
|
370
|
+
{t('form.validation.count_tickets_or_products')}
|
|
371
|
+
</Typography>
|
|
372
|
+
</Stack>
|
|
373
|
+
)}
|
|
374
|
+
</PaymentSwiftWrapper>
|
|
375
|
+
)}
|
|
337
376
|
</PaymentItem>
|
|
338
377
|
))}
|
|
339
378
|
</RadioGroup>
|