@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.
Files changed (84) hide show
  1. package/.prettierignore +3 -0
  2. package/CLAUDE.md +33 -0
  3. package/dist/cjs/{index-D1KZ-2U1.js → index-CXsZ9BsP.js} +26476 -25947
  4. package/dist/cjs/index-CXsZ9BsP.js.map +1 -0
  5. package/dist/cjs/index-DgOx9uHQ.js +41917 -0
  6. package/dist/cjs/index-DgOx9uHQ.js.map +1 -0
  7. package/dist/cjs/index.js +3 -1
  8. package/dist/cjs/index.js.map +1 -1
  9. package/dist/cjs/{index.umd-C2KzR75H.js → index.umd-DR37hmpO.js} +2 -2
  10. package/dist/cjs/{index.umd-C2KzR75H.js.map → index.umd-DR37hmpO.js.map} +1 -1
  11. package/dist/cjs/index.umd-TbjzhsUx.js +13397 -0
  12. package/dist/cjs/index.umd-TbjzhsUx.js.map +1 -0
  13. package/dist/cjs/{mui-tel-input.es-Bjml407E.js → mui-tel-input.es-Dk9M_v4X.js} +6 -6
  14. package/dist/{esm/mui-tel-input.es-Bt2rE3An.js.map → cjs/mui-tel-input.es-Dk9M_v4X.js.map} +1 -1
  15. package/dist/esm/index-Ds-63DcA.js +41896 -0
  16. package/dist/esm/index-Ds-63DcA.js.map +1 -0
  17. package/dist/esm/{index-DRYwiFvp.js → index-z31XSEKz.js} +26751 -26240
  18. package/dist/esm/index-z31XSEKz.js.map +1 -0
  19. package/dist/esm/index.js +3 -1
  20. package/dist/esm/index.js.map +1 -1
  21. package/dist/esm/{index.umd-BXOC8cuK.js → index.umd-5znOX_Ww.js} +4 -4
  22. package/dist/esm/{index.umd-BXOC8cuK.js.map → index.umd-5znOX_Ww.js.map} +1 -1
  23. package/dist/esm/index.umd-ddggyAGa.js +13395 -0
  24. package/dist/esm/index.umd-ddggyAGa.js.map +1 -0
  25. package/dist/esm/{mui-tel-input.es-Bt2rE3An.js → mui-tel-input.es-Cb4Lpqx7.js} +21 -21
  26. package/dist/{cjs/mui-tel-input.es-Bjml407E.js.map → esm/mui-tel-input.es-Cb4Lpqx7.js.map} +1 -1
  27. package/dist/types/form/Payment.d.ts +1 -0
  28. package/dist/types/form/paydroid/PaydroidCashlessSection.d.ts +7 -0
  29. package/dist/types/form/paydroid/PaydroidError.d.ts +3 -0
  30. package/dist/types/form/paydroid/PaydroidErrorAccount.d.ts +3 -0
  31. package/dist/types/form/paydroid/PaydroidErrorTicket.d.ts +3 -0
  32. package/dist/types/form/paydroid/PaydroidPage.d.ts +6 -0
  33. package/dist/types/form/paydroid/PaydroidStatusCard.d.ts +10 -0
  34. package/dist/types/form/paydroid/PaydroidSuccess.d.ts +3 -0
  35. package/dist/types/form/paydroid/PaydroidSuccessTopup.d.ts +3 -0
  36. package/dist/types/form/payment/StripeCheckoutProvider.d.ts +36 -0
  37. package/dist/types/hooks/data/useStripeConfig.d.ts +3 -0
  38. package/dist/types/locales/cs.d.ts +34 -0
  39. package/dist/types/locales/en.d.ts +34 -0
  40. package/dist/types/locales/es.d.ts +34 -0
  41. package/dist/types/locales/pl.d.ts +34 -0
  42. package/dist/types/locales/sk.d.ts +34 -0
  43. package/dist/types/locales/uk.d.ts +34 -0
  44. package/dist/types/modules/order.d.ts +3 -0
  45. package/dist/types/modules/paydroid.d.ts +4 -0
  46. package/dist/types/utils/data/page.d.ts +7 -0
  47. package/dist/types/utils/page.d.ts +1 -0
  48. package/dist/types/utils/paydroid.d.ts +6 -0
  49. package/dist/types/utils/types/global.type.d.ts +1 -0
  50. package/dist/types/utils/types/order.type.d.ts +4 -0
  51. package/dist/types/utils/types/paydroid.d.ts +23 -0
  52. package/dist/types/utils/types/payment-method.type.d.ts +1 -0
  53. package/package.json +6 -2
  54. package/src/form/Payment.tsx +42 -3
  55. package/src/form/PaymentOverviewBox.tsx +20 -7
  56. package/src/form/PaymentSuccess.tsx +6 -2
  57. package/src/form/TicketForm.tsx +269 -168
  58. package/src/form/paydroid/PaydroidCashlessSection.tsx +311 -0
  59. package/src/form/paydroid/PaydroidError.tsx +26 -0
  60. package/src/form/paydroid/PaydroidErrorAccount.tsx +26 -0
  61. package/src/form/paydroid/PaydroidErrorTicket.tsx +26 -0
  62. package/src/form/paydroid/PaydroidPage.tsx +22 -0
  63. package/src/form/paydroid/PaydroidStatusCard.tsx +91 -0
  64. package/src/form/paydroid/PaydroidSuccess.tsx +26 -0
  65. package/src/form/paydroid/PaydroidSuccessTopup.tsx +26 -0
  66. package/src/form/payment/StripeCheckoutProvider.tsx +154 -0
  67. package/src/hooks/data/useStripeConfig.ts +14 -0
  68. package/src/locales/cs.tsx +40 -0
  69. package/src/locales/en.tsx +38 -0
  70. package/src/locales/es.tsx +39 -0
  71. package/src/locales/pl.tsx +38 -0
  72. package/src/locales/sk.tsx +40 -0
  73. package/src/locales/uk.tsx +38 -0
  74. package/src/modules/order.ts +3 -0
  75. package/src/modules/paydroid.ts +33 -0
  76. package/src/utils/data/page.ts +7 -0
  77. package/src/utils/page.ts +4 -0
  78. package/src/utils/paydroid.ts +35 -0
  79. package/src/utils/types/global.type.ts +1 -0
  80. package/src/utils/types/order.type.ts +7 -0
  81. package/src/utils/types/paydroid.ts +26 -0
  82. package/src/utils/types/payment-method.type.ts +1 -0
  83. package/dist/cjs/index-D1KZ-2U1.js.map +0 -1
  84. package/dist/esm/index-DRYwiFvp.js.map +0 -1
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { IEvent } from '@utils/types/event.type';
3
3
  interface Props {
4
4
  event: IEvent;
5
+ stripeReady?: boolean;
5
6
  }
6
7
  declare const Payment: React.FC<Props>;
7
8
  export default Payment;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { IOrderPaid } from '@utils/types/order.type';
3
+ interface Props {
4
+ data: IOrderPaid;
5
+ }
6
+ declare const PaydroidCashlessSection: React.FC<Props>;
7
+ export default PaydroidCashlessSection;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const PaydroidError: React.FC;
3
+ export default PaydroidError;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const PaydroidErrorAccount: React.FC;
3
+ export default PaydroidErrorAccount;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const PaydroidErrorTicket: React.FC;
3
+ export default PaydroidErrorTicket;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ page: string | null;
4
+ }
5
+ declare const PaydroidPage: React.FC<Props>;
6
+ export default PaydroidPage;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ icon: React.ReactNode;
4
+ heading: string;
5
+ subtitle: string;
6
+ buttonLabel: string;
7
+ onButtonClick: () => void;
8
+ }
9
+ declare const PaydroidStatusCard: React.FC<Props>;
10
+ export default PaydroidStatusCard;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const PaydroidSuccess: React.FC;
3
+ export default PaydroidSuccess;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const PaydroidSuccessTopup: React.FC;
3
+ export default PaydroidSuccessTopup;
@@ -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;
@@ -0,0 +1,3 @@
1
+ export default function useStripeConfig(enabled: boolean): {
2
+ publishableKey: string | null;
3
+ };
@@ -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,7 @@
1
+ export declare enum Page {
2
+ PAYDROID_SUCCESS = "paydroid-success",
3
+ PAYDROID_TOPUP_SUCCESS = "paydroid-topup-success",
4
+ PAYDROID_ERROR = "paydroid-error",
5
+ PAYDROID_ERROR_ACCOUNT = "paydroid-error-account",
6
+ PAYDROID_ERROR_TICKET = "paydroid-error-ticket"
7
+ }
@@ -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;
@@ -34,6 +34,7 @@ export interface IGlobalContextOptions {
34
34
  termsAndConditionsCompanies?: string[];
35
35
  autoscrollAfterViewChange?: boolean;
36
36
  hasGopayId?: boolean;
37
+ paydroidApiKey?: string;
37
38
  }
38
39
  export interface IBase {
39
40
  id: number;
@@ -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
+ }
@@ -12,6 +12,7 @@ export interface IPaymentMethod extends IBase {
12
12
  image: IFile;
13
13
  feeType: string;
14
14
  feeValue: number;
15
+ feeFixedValue: number;
15
16
  }
16
17
  export interface IPaymentOption extends IBase {
17
18
  category: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eventlook/sdk",
3
- "version": "1.7.2",
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
- "publish": "npm publish",
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",
@@ -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
- return data.filter((payment) =>
178
- ['PAYMENT_CARD', 'APPLE_PAY', 'GPAY', 'CLICK_TO_PAY'].includes(payment.type)
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>