@eventlook/sdk 1.7.3 → 1.7.4

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 (38) hide show
  1. package/dist/cjs/index-EJYDEfV5.js +41925 -0
  2. package/dist/cjs/index-EJYDEfV5.js.map +1 -0
  3. package/dist/cjs/index.js +1 -1
  4. package/dist/cjs/index.umd-CfKeY_Zj.js +13397 -0
  5. package/dist/cjs/index.umd-CfKeY_Zj.js.map +1 -0
  6. package/dist/esm/index-CAjHrQdF.js +41904 -0
  7. package/dist/esm/index-CAjHrQdF.js.map +1 -0
  8. package/dist/esm/index.js +1 -1
  9. package/dist/esm/index.umd-DjIEPZqJ.js +13395 -0
  10. package/dist/esm/index.umd-DjIEPZqJ.js.map +1 -0
  11. package/dist/types/form/Payment.d.ts +1 -0
  12. package/dist/types/form/payment/StripeCheckoutProvider.d.ts +36 -0
  13. package/dist/types/hooks/data/useStripeConfig.d.ts +3 -0
  14. package/dist/types/locales/cs.d.ts +3 -0
  15. package/dist/types/locales/en.d.ts +3 -0
  16. package/dist/types/locales/es.d.ts +3 -0
  17. package/dist/types/locales/pl.d.ts +3 -0
  18. package/dist/types/locales/sk.d.ts +3 -0
  19. package/dist/types/locales/uk.d.ts +3 -0
  20. package/dist/types/modules/order.d.ts +3 -0
  21. package/dist/types/utils/types/order.type.d.ts +2 -0
  22. package/dist/types/utils/types/payment-method.type.d.ts +1 -0
  23. package/package.json +3 -1
  24. package/src/form/Payment.tsx +42 -3
  25. package/src/form/PaymentOverviewBox.tsx +28 -9
  26. package/src/form/TicketForm.tsx +262 -167
  27. package/src/form/payment/StripeCheckoutProvider.tsx +154 -0
  28. package/src/form/tickets/TicketSelectionMobile.tsx +1 -1
  29. package/src/hooks/data/useStripeConfig.ts +14 -0
  30. package/src/locales/cs.tsx +3 -0
  31. package/src/locales/en.tsx +3 -0
  32. package/src/locales/es.tsx +3 -0
  33. package/src/locales/pl.tsx +3 -0
  34. package/src/locales/sk.tsx +3 -0
  35. package/src/locales/uk.tsx +3 -0
  36. package/src/modules/order.ts +3 -0
  37. package/src/utils/types/order.type.ts +5 -0
  38. package/src/utils/types/payment-method.type.ts +1 -0
@@ -0,0 +1,14 @@
1
+ import useSWR from 'swr';
2
+ import { getStripeConfig } from '@modules/order';
3
+
4
+ // Fetches the public Stripe publishable key, only when a Stripe method is on
5
+ // offer (pass enabled=false to skip the request entirely). Cached for the
6
+ // session — the key never changes.
7
+ export default function useStripeConfig(enabled: boolean) {
8
+ const { data } = useSWR(enabled ? ['stripe-config'] : null, () => getStripeConfig(), {
9
+ revalidateOnFocus: false,
10
+ revalidateIfStale: false,
11
+ });
12
+
13
+ return { publishableKey: data?.publishableKey ?? null };
14
+ }
@@ -44,6 +44,9 @@ const cs = {
44
44
  total: 'Celkem',
45
45
  with_fee: 'vč. servisního poplatku',
46
46
  service_fee: 'Servisní poplatek',
47
+ payment_processing_fee: 'Poplatek za platbu kartou',
48
+ card_payment_title: 'Platba kartou',
49
+ card_payment_error: 'Platbu se nepodařilo dokončit. Zkuste to prosím znovu.',
47
50
  shipping_fee: 'Doprava',
48
51
  ticket_insurance: 'Pojištění vstupenek',
49
52
  price_including_service_fee: 'Cena zahrnuje servisní poplatek v hodnotě {{fee}}.',
@@ -44,6 +44,9 @@ const en = {
44
44
  total: 'Total',
45
45
  with_fee: 'incl. service fee',
46
46
  service_fee: 'Service fee',
47
+ payment_processing_fee: 'Card processing fee',
48
+ card_payment_title: 'Card payment',
49
+ card_payment_error: 'The payment could not be completed. Please try again.',
47
50
  shipping_fee: 'Shipping',
48
51
  ticket_insurance: 'Ticket insurance',
49
52
  price_including_service_fee: 'The price includes a service fee of {{fee}}.',
@@ -44,6 +44,9 @@ const es = {
44
44
  total: 'Total',
45
45
  with_fee: 'incl. tarifa de servicio',
46
46
  service_fee: 'Tarifa de servicio',
47
+ payment_processing_fee: 'Comisión por pago con tarjeta',
48
+ card_payment_title: 'Pago con tarjeta',
49
+ card_payment_error: 'No se pudo completar el pago. Inténtalo de nuevo.',
47
50
  shipping_fee: 'Envío',
48
51
  ticket_insurance: 'Seguro de entrada',
49
52
  price_including_service_fee: 'El precio incluye una tarifa de servicio de {{fee}}.',
@@ -44,6 +44,9 @@ const pl = {
44
44
  total: 'Razem',
45
45
  with_fee: 'z opłatą serwisową',
46
46
  service_fee: 'Opłata serwisowa',
47
+ payment_processing_fee: 'Opłata za obsługę karty',
48
+ card_payment_title: 'Płatność kartą',
49
+ card_payment_error: 'Nie udało się zrealizować płatności. Spróbuj ponownie.',
47
50
  shipping_fee: 'Wysyłka',
48
51
  ticket_insurance: 'Ubezpieczenie biletu',
49
52
  price_including_service_fee: 'Cena zawiera opłatę serwisową {{fee}}.',
@@ -44,6 +44,9 @@ const sk = {
44
44
  total: 'Spolu',
45
45
  with_fee: 'vrátane servisného poplatku',
46
46
  service_fee: 'Servisný poplatok',
47
+ payment_processing_fee: 'Poplatok za platbu kartou',
48
+ card_payment_title: 'Platba kartou',
49
+ card_payment_error: 'Platbu sa nepodarilo dokončiť. Skúste to znova.',
47
50
  shipping_fee: 'Doručenie',
48
51
  ticket_insurance: 'Poistenie vstupenky',
49
52
  price_including_service_fee: 'Cena zahŕňa servisný poplatok {{fee}}.',
@@ -44,6 +44,9 @@ const uk = {
44
44
  total: 'Всього',
45
45
  with_fee: 'вкл. сервісний збір',
46
46
  service_fee: 'Сервісний збір',
47
+ payment_processing_fee: 'Комісія за оплату карткою',
48
+ card_payment_title: 'Оплата карткою',
49
+ card_payment_error: 'Не вдалося завершити оплату. Спробуйте ще раз.',
47
50
  shipping_fee: 'Доставка',
48
51
  ticket_insurance: 'Страхування квитка',
49
52
  price_including_service_fee: 'Ціна включає сервісний збір {{fee}}.',
@@ -18,3 +18,6 @@ export const getAllowedPaymentMethods = (currency: Currencies, eventId?: number)
18
18
 
19
19
  export const postOrderPaid = (data: IOrderPaidData): Promise<IResponse<IOrderPaid>> =>
20
20
  api.post('/v1/orders/paid', data).then((res) => res.data.data);
21
+
22
+ export const getStripeConfig = (): Promise<{ publishableKey: string | null }> =>
23
+ api.get('/v1/orders/stripe/config').then((res) => res.data.data.data);
@@ -23,6 +23,11 @@ export interface IOrder extends IBase {
23
23
 
24
24
  export interface IOrderCreate {
25
25
  gwUrl: string;
26
+ // Inline Stripe (Payment Element): set when the selected method confirms
27
+ // in-page instead of redirecting; the publishable key is returned alongside
28
+ // so the SDK can mount Elements without host-app configuration.
29
+ clientSecret: string | null;
30
+ publishableKey: string | null;
26
31
  tickets: ICreateTicket[];
27
32
  orderEntity: IOrder;
28
33
  customer: ICustomer;
@@ -14,6 +14,7 @@ export interface IPaymentMethod extends IBase {
14
14
  image: IFile;
15
15
  feeType: string;
16
16
  feeValue: number;
17
+ feeFixedValue: number;
17
18
  }
18
19
 
19
20
  export interface IPaymentOption extends IBase {