@eventlook/sdk 1.7.2 → 1.7.3
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.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/{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-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/{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/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/locales/cs.d.ts +31 -0
- package/dist/types/locales/en.d.ts +31 -0
- package/dist/types/locales/es.d.ts +31 -0
- package/dist/types/locales/pl.d.ts +31 -0
- package/dist/types/locales/sk.d.ts +31 -0
- package/dist/types/locales/uk.d.ts +31 -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 +2 -0
- package/dist/types/utils/types/paydroid.d.ts +23 -0
- package/package.json +4 -2
- package/src/form/PaymentSuccess.tsx +6 -2
- package/src/form/TicketForm.tsx +7 -1
- 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/locales/cs.tsx +37 -0
- package/src/locales/en.tsx +35 -0
- package/src/locales/es.tsx +36 -0
- package/src/locales/pl.tsx +35 -0
- package/src/locales/sk.tsx +37 -0
- package/src/locales/uk.tsx +35 -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 +2 -0
- package/src/utils/types/paydroid.ts +26 -0
- package/dist/cjs/index-D1KZ-2U1.js.map +0 -1
- package/dist/esm/index-DRYwiFvp.js.map +0 -1
|
@@ -62,6 +62,7 @@ declare const cs: {
|
|
|
62
62
|
primary_ticket_number_hint: string;
|
|
63
63
|
primary_ticket_dialog_title: string;
|
|
64
64
|
primary_ticket_dialog_input_label: string;
|
|
65
|
+
amount: string;
|
|
65
66
|
};
|
|
66
67
|
validation: {
|
|
67
68
|
required: string;
|
|
@@ -167,6 +168,36 @@ declare const cs: {
|
|
|
167
168
|
button: string;
|
|
168
169
|
products: string;
|
|
169
170
|
};
|
|
171
|
+
paydroid: {
|
|
172
|
+
label: string;
|
|
173
|
+
heading: string;
|
|
174
|
+
heading_cta: string;
|
|
175
|
+
subtitle: string;
|
|
176
|
+
amount_label: string;
|
|
177
|
+
amount_placeholder: string;
|
|
178
|
+
promo: string;
|
|
179
|
+
terms_prefix: string;
|
|
180
|
+
terms_conditions: string;
|
|
181
|
+
terms_middle: string;
|
|
182
|
+
terms_privacy: string;
|
|
183
|
+
terms: string;
|
|
184
|
+
skip: string;
|
|
185
|
+
submit: string;
|
|
186
|
+
success_title: string;
|
|
187
|
+
success_subtitle: string;
|
|
188
|
+
topup_success_title: string;
|
|
189
|
+
topup_success_subtitle: string;
|
|
190
|
+
error_title: string;
|
|
191
|
+
error_subtitle: string;
|
|
192
|
+
error_account_title: string;
|
|
193
|
+
error_account_subtitle: string;
|
|
194
|
+
error_account_button: string;
|
|
195
|
+
error_ticket_title: string;
|
|
196
|
+
error_ticket_subtitle: string;
|
|
197
|
+
faq_button: string;
|
|
198
|
+
retry_button: string;
|
|
199
|
+
missing_api_key: string;
|
|
200
|
+
};
|
|
170
201
|
unpaid: string;
|
|
171
202
|
unpaid_description: string;
|
|
172
203
|
};
|
|
@@ -62,6 +62,7 @@ declare const en: {
|
|
|
62
62
|
primary_ticket_number_hint: string;
|
|
63
63
|
primary_ticket_dialog_title: string;
|
|
64
64
|
primary_ticket_dialog_input_label: string;
|
|
65
|
+
amount: string;
|
|
65
66
|
};
|
|
66
67
|
validation: {
|
|
67
68
|
required: string;
|
|
@@ -167,6 +168,36 @@ declare const en: {
|
|
|
167
168
|
button: string;
|
|
168
169
|
products: string;
|
|
169
170
|
};
|
|
171
|
+
paydroid: {
|
|
172
|
+
label: string;
|
|
173
|
+
heading: string;
|
|
174
|
+
heading_cta: string;
|
|
175
|
+
subtitle: string;
|
|
176
|
+
amount_label: string;
|
|
177
|
+
amount_placeholder: string;
|
|
178
|
+
promo: string;
|
|
179
|
+
terms_prefix: string;
|
|
180
|
+
terms_conditions: string;
|
|
181
|
+
terms_middle: string;
|
|
182
|
+
terms_privacy: string;
|
|
183
|
+
terms: string;
|
|
184
|
+
skip: string;
|
|
185
|
+
submit: string;
|
|
186
|
+
success_title: string;
|
|
187
|
+
success_subtitle: string;
|
|
188
|
+
topup_success_title: string;
|
|
189
|
+
topup_success_subtitle: string;
|
|
190
|
+
error_title: string;
|
|
191
|
+
error_subtitle: string;
|
|
192
|
+
error_account_title: string;
|
|
193
|
+
error_account_subtitle: string;
|
|
194
|
+
error_account_button: string;
|
|
195
|
+
error_ticket_title: string;
|
|
196
|
+
error_ticket_subtitle: string;
|
|
197
|
+
faq_button: string;
|
|
198
|
+
retry_button: string;
|
|
199
|
+
missing_api_key: string;
|
|
200
|
+
};
|
|
170
201
|
unpaid: string;
|
|
171
202
|
unpaid_description: string;
|
|
172
203
|
};
|
|
@@ -62,6 +62,7 @@ declare const es: {
|
|
|
62
62
|
primary_ticket_number_hint: string;
|
|
63
63
|
primary_ticket_dialog_title: string;
|
|
64
64
|
primary_ticket_dialog_input_label: string;
|
|
65
|
+
amount: string;
|
|
65
66
|
};
|
|
66
67
|
validation: {
|
|
67
68
|
required: string;
|
|
@@ -167,6 +168,36 @@ declare const es: {
|
|
|
167
168
|
button: string;
|
|
168
169
|
products: string;
|
|
169
170
|
};
|
|
171
|
+
paydroid: {
|
|
172
|
+
label: string;
|
|
173
|
+
heading: string;
|
|
174
|
+
heading_cta: string;
|
|
175
|
+
subtitle: string;
|
|
176
|
+
amount_label: string;
|
|
177
|
+
amount_placeholder: string;
|
|
178
|
+
promo: string;
|
|
179
|
+
terms_prefix: string;
|
|
180
|
+
terms_conditions: string;
|
|
181
|
+
terms_middle: string;
|
|
182
|
+
terms_privacy: string;
|
|
183
|
+
terms: string;
|
|
184
|
+
skip: string;
|
|
185
|
+
submit: string;
|
|
186
|
+
success_title: string;
|
|
187
|
+
success_subtitle: string;
|
|
188
|
+
topup_success_title: string;
|
|
189
|
+
topup_success_subtitle: string;
|
|
190
|
+
error_title: string;
|
|
191
|
+
error_subtitle: string;
|
|
192
|
+
error_account_title: string;
|
|
193
|
+
error_account_subtitle: string;
|
|
194
|
+
error_account_button: string;
|
|
195
|
+
error_ticket_title: string;
|
|
196
|
+
error_ticket_subtitle: string;
|
|
197
|
+
faq_button: string;
|
|
198
|
+
retry_button: string;
|
|
199
|
+
missing_api_key: string;
|
|
200
|
+
};
|
|
170
201
|
unpaid: string;
|
|
171
202
|
unpaid_description: string;
|
|
172
203
|
};
|
|
@@ -62,6 +62,7 @@ declare const pl: {
|
|
|
62
62
|
primary_ticket_number_hint: string;
|
|
63
63
|
primary_ticket_dialog_title: string;
|
|
64
64
|
primary_ticket_dialog_input_label: string;
|
|
65
|
+
amount: string;
|
|
65
66
|
};
|
|
66
67
|
validation: {
|
|
67
68
|
required: string;
|
|
@@ -167,6 +168,36 @@ declare const pl: {
|
|
|
167
168
|
button: string;
|
|
168
169
|
products: string;
|
|
169
170
|
};
|
|
171
|
+
paydroid: {
|
|
172
|
+
label: string;
|
|
173
|
+
heading: string;
|
|
174
|
+
heading_cta: string;
|
|
175
|
+
subtitle: string;
|
|
176
|
+
amount_label: string;
|
|
177
|
+
amount_placeholder: string;
|
|
178
|
+
promo: string;
|
|
179
|
+
terms_prefix: string;
|
|
180
|
+
terms_conditions: string;
|
|
181
|
+
terms_middle: string;
|
|
182
|
+
terms_privacy: string;
|
|
183
|
+
terms: string;
|
|
184
|
+
skip: string;
|
|
185
|
+
submit: string;
|
|
186
|
+
success_title: string;
|
|
187
|
+
success_subtitle: string;
|
|
188
|
+
topup_success_title: string;
|
|
189
|
+
topup_success_subtitle: string;
|
|
190
|
+
error_title: string;
|
|
191
|
+
error_subtitle: string;
|
|
192
|
+
error_account_title: string;
|
|
193
|
+
error_account_subtitle: string;
|
|
194
|
+
error_account_button: string;
|
|
195
|
+
error_ticket_title: string;
|
|
196
|
+
error_ticket_subtitle: string;
|
|
197
|
+
faq_button: string;
|
|
198
|
+
retry_button: string;
|
|
199
|
+
missing_api_key: string;
|
|
200
|
+
};
|
|
170
201
|
unpaid: string;
|
|
171
202
|
unpaid_description: string;
|
|
172
203
|
};
|
|
@@ -62,6 +62,7 @@ declare const sk: {
|
|
|
62
62
|
primary_ticket_number_hint: string;
|
|
63
63
|
primary_ticket_dialog_title: string;
|
|
64
64
|
primary_ticket_dialog_input_label: string;
|
|
65
|
+
amount: string;
|
|
65
66
|
};
|
|
66
67
|
validation: {
|
|
67
68
|
required: string;
|
|
@@ -167,6 +168,36 @@ declare const sk: {
|
|
|
167
168
|
button: string;
|
|
168
169
|
products: string;
|
|
169
170
|
};
|
|
171
|
+
paydroid: {
|
|
172
|
+
label: string;
|
|
173
|
+
heading: string;
|
|
174
|
+
heading_cta: string;
|
|
175
|
+
subtitle: string;
|
|
176
|
+
amount_label: string;
|
|
177
|
+
amount_placeholder: string;
|
|
178
|
+
promo: string;
|
|
179
|
+
terms_prefix: string;
|
|
180
|
+
terms_conditions: string;
|
|
181
|
+
terms_middle: string;
|
|
182
|
+
terms_privacy: string;
|
|
183
|
+
terms: string;
|
|
184
|
+
skip: string;
|
|
185
|
+
submit: string;
|
|
186
|
+
success_title: string;
|
|
187
|
+
success_subtitle: string;
|
|
188
|
+
topup_success_title: string;
|
|
189
|
+
topup_success_subtitle: string;
|
|
190
|
+
error_title: string;
|
|
191
|
+
error_subtitle: string;
|
|
192
|
+
error_account_title: string;
|
|
193
|
+
error_account_subtitle: string;
|
|
194
|
+
error_account_button: string;
|
|
195
|
+
error_ticket_title: string;
|
|
196
|
+
error_ticket_subtitle: string;
|
|
197
|
+
faq_button: string;
|
|
198
|
+
retry_button: string;
|
|
199
|
+
missing_api_key: string;
|
|
200
|
+
};
|
|
170
201
|
unpaid: string;
|
|
171
202
|
unpaid_description: string;
|
|
172
203
|
};
|
|
@@ -62,6 +62,7 @@ declare const uk: {
|
|
|
62
62
|
primary_ticket_number_hint: string;
|
|
63
63
|
primary_ticket_dialog_title: string;
|
|
64
64
|
primary_ticket_dialog_input_label: string;
|
|
65
|
+
amount: string;
|
|
65
66
|
};
|
|
66
67
|
validation: {
|
|
67
68
|
required: string;
|
|
@@ -167,6 +168,36 @@ declare const uk: {
|
|
|
167
168
|
button: string;
|
|
168
169
|
products: string;
|
|
169
170
|
};
|
|
171
|
+
paydroid: {
|
|
172
|
+
label: string;
|
|
173
|
+
heading: string;
|
|
174
|
+
heading_cta: string;
|
|
175
|
+
subtitle: string;
|
|
176
|
+
amount_label: string;
|
|
177
|
+
amount_placeholder: string;
|
|
178
|
+
promo: string;
|
|
179
|
+
terms_prefix: string;
|
|
180
|
+
terms_conditions: string;
|
|
181
|
+
terms_middle: string;
|
|
182
|
+
terms_privacy: string;
|
|
183
|
+
terms: string;
|
|
184
|
+
skip: string;
|
|
185
|
+
submit: string;
|
|
186
|
+
success_title: string;
|
|
187
|
+
success_subtitle: string;
|
|
188
|
+
topup_success_title: string;
|
|
189
|
+
topup_success_subtitle: string;
|
|
190
|
+
error_title: string;
|
|
191
|
+
error_subtitle: string;
|
|
192
|
+
error_account_title: string;
|
|
193
|
+
error_account_subtitle: string;
|
|
194
|
+
error_account_button: string;
|
|
195
|
+
error_ticket_title: string;
|
|
196
|
+
error_ticket_subtitle: string;
|
|
197
|
+
faq_button: string;
|
|
198
|
+
retry_button: string;
|
|
199
|
+
missing_api_key: string;
|
|
200
|
+
};
|
|
170
201
|
unpaid: string;
|
|
171
202
|
unpaid_description: string;
|
|
172
203
|
};
|
|
@@ -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;
|
|
@@ -36,9 +36,11 @@ export interface IOrderPaid {
|
|
|
36
36
|
orderNumber: number;
|
|
37
37
|
tickets: IPaidTicket[];
|
|
38
38
|
products: IPaidProduct[];
|
|
39
|
+
customer: ICustomer;
|
|
39
40
|
extraFee: number;
|
|
40
41
|
currency: Currencies;
|
|
41
42
|
promoCodes: IPromoCode[] | null;
|
|
43
|
+
paydroidEventId: string | null;
|
|
42
44
|
}
|
|
43
45
|
export interface IAllowedPaymentMethod {
|
|
44
46
|
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",
|
|
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",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Iconify, Image, MotionContainer, varBounce } from '@components';
|
|
2
2
|
import { Box, Button, Card, Grid, LinearProgress, Link, Typography } from '@mui/material';
|
|
3
|
+
import PaydroidCashlessSection from '@form/paydroid/PaydroidCashlessSection';
|
|
3
4
|
import React, { Dispatch, SetStateAction, useEffect, useState } from 'react';
|
|
4
5
|
import { getSearchParamsInObject } from '@utils/url';
|
|
5
6
|
import { postOrderPaid } from '@modules/order';
|
|
@@ -17,6 +18,7 @@ import useGlobal from '@hooks/useGlobal';
|
|
|
17
18
|
import { Trans } from '@components/Trans';
|
|
18
19
|
import { getGtmPurchasePaid, gtmPurchasePaid, mapUserToUserData } from '@utils/gtm';
|
|
19
20
|
import { IPixels } from '@utils/types/gtm.type';
|
|
21
|
+
import { IOrderPaid } from '@utils/types/order.type';
|
|
20
22
|
|
|
21
23
|
interface Props {
|
|
22
24
|
setIsPaying: Dispatch<SetStateAction<boolean>>;
|
|
@@ -31,6 +33,7 @@ const PaymentSuccess: React.FC<Props> = ({ setIsPaying, isIframe, pixels }) => {
|
|
|
31
33
|
const errorState = 'ERROR';
|
|
32
34
|
const [tickets, setTickets] = useState<IPaidTicket[]>([]);
|
|
33
35
|
const [products, setProducts] = useState<IPaidProduct[]>([]);
|
|
36
|
+
const [data, setData] = useState<IOrderPaid | null>(null);
|
|
34
37
|
const [state, setState] = useState<string>(defaultState);
|
|
35
38
|
const [title, setTitle] = useState<string>(t('event.tickets.payment_success.loading'));
|
|
36
39
|
const [description, setDescription] = useState<string | null>(null);
|
|
@@ -50,12 +53,12 @@ const PaymentSuccess: React.FC<Props> = ({ setIsPaying, isIframe, pixels }) => {
|
|
|
50
53
|
const { data } = await postOrderPaid({
|
|
51
54
|
gopayId: Number(paymentId),
|
|
52
55
|
});
|
|
53
|
-
const { tickets } = data;
|
|
56
|
+
const { tickets, products } = data;
|
|
54
57
|
setTickets(tickets);
|
|
55
|
-
const { products } = data;
|
|
56
58
|
setProducts(products);
|
|
57
59
|
setState(data.state);
|
|
58
60
|
setGwUrl(data.gwUrl);
|
|
61
|
+
setData(data);
|
|
59
62
|
|
|
60
63
|
const items = [
|
|
61
64
|
...data.tickets.map((ticket) => ({
|
|
@@ -329,6 +332,7 @@ const PaymentSuccess: React.FC<Props> = ({ setIsPaying, isIframe, pixels }) => {
|
|
|
329
332
|
</Grid>
|
|
330
333
|
</>
|
|
331
334
|
)}
|
|
335
|
+
{data?.paydroidEventId && <PaydroidCashlessSection data={data} />}
|
|
332
336
|
{!isIframe && (
|
|
333
337
|
<Box textAlign="center">
|
|
334
338
|
<CustomButton
|
package/src/form/TicketForm.tsx
CHANGED
|
@@ -61,6 +61,8 @@ import TicketSelectionMap from '@form/tickets/TicketSelectionMap';
|
|
|
61
61
|
import PaymentOverviewDrawer from './PaymentOverviewDrawer';
|
|
62
62
|
import { getPlaceAsString } from '@utils/place';
|
|
63
63
|
import Services from '@form/services';
|
|
64
|
+
import PaydroidPage from './paydroid/PaydroidPage';
|
|
65
|
+
import { isPaydroidPage } from '@utils/page';
|
|
64
66
|
|
|
65
67
|
interface Props {
|
|
66
68
|
event: IEvent;
|
|
@@ -102,6 +104,7 @@ const TicketForm: React.FC<Props> = ({
|
|
|
102
104
|
const { data: eventProducts, isLoading } = useActiveEventProducts(event.id);
|
|
103
105
|
const [paymentRedirect, setPaymentRedirect] = useState<string | null>(null);
|
|
104
106
|
const [hasGopayId, setHasGopayId] = useState<boolean>(hasGopayIdSsr);
|
|
107
|
+
const [page, setPage] = useState<string | null>(null);
|
|
105
108
|
const [isPaying, setIsPaying] = useState<boolean>(false);
|
|
106
109
|
const [formStep, setFormStep] = useState<number>(1);
|
|
107
110
|
const [isPaymentOverviewDrawerOpen, setIsPaymentOverviewDrawerOpen] = useState<boolean>(false);
|
|
@@ -513,6 +516,7 @@ const TicketForm: React.FC<Props> = ({
|
|
|
513
516
|
const paymentId = searchParams.id;
|
|
514
517
|
const iframeCampaignId = Number(searchParams.iframeCampaignId);
|
|
515
518
|
setHasGopayId(!!paymentId);
|
|
519
|
+
setPage(searchParams.page || null);
|
|
516
520
|
if (!isNaN(iframeCampaignId)) {
|
|
517
521
|
methods.setValue('iframeCampaignId', iframeCampaignId);
|
|
518
522
|
}
|
|
@@ -559,7 +563,9 @@ const TicketForm: React.FC<Props> = ({
|
|
|
559
563
|
|
|
560
564
|
return (
|
|
561
565
|
<Box id={EVENTLOOK_ORDER_FORM_CONTAINER_ID}>
|
|
562
|
-
{
|
|
566
|
+
{isPaydroidPage(page) ? (
|
|
567
|
+
<PaydroidPage page={page} />
|
|
568
|
+
) : hasGopayId ? (
|
|
563
569
|
<PaymentSuccess setIsPaying={setIsPaying} isIframe={isIframe} pixels={pixels} />
|
|
564
570
|
) : isPaying ? (
|
|
565
571
|
<PaymentPending />
|