@opexa/portal-components 0.0.792 → 0.0.794
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/dist/client/hooks/useCreateGCashWebpayDepositMutation.js +2 -2
- package/dist/client/hooks/useCreateMayaWebpayDepositMutation.d.ts +4 -0
- package/dist/client/hooks/useCreateMayaWebpayDepositMutation.js +76 -0
- package/dist/components/DepositWithdrawal/Deposit/Deposit.js +7 -1
- package/dist/components/DepositWithdrawal/Deposit/MayaWebpayDeposit/MayaWebpayDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/{GCashWebpayDeposit /GCashWebpayDeposit .js → MayaWebpayDeposit/MayaWebpayDeposit.js} +15 -40
- package/dist/components/DepositWithdrawal/PaymentMethods.js +5 -0
- package/dist/components/DepositWithdrawal/utils.d.ts +1 -1
- package/dist/components/DepositWithdrawal/utils.js +1 -0
- package/dist/components/TransactionRecords/TableFilters.js +1 -0
- package/dist/constants/EnvVar.d.ts +1 -1
- package/dist/handlers/postAuthenticate.js +2 -0
- package/dist/handlers/postSession.js +2 -0
- package/dist/services/queries.d.ts +2 -1
- package/dist/services/queries.js +48 -33
- package/dist/services/wallet.d.ts +13 -0
- package/dist/services/wallet.js +11 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/ui/AlertDialog/AlertDialog.d.ts +121 -121
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +11 -11
- package/dist/ui/Carousel/Carousel.d.ts +45 -45
- package/dist/ui/Carousel/carousel.recipe.d.ts +5 -5
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
- package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/ui/Dialog/Dialog.d.ts +33 -33
- package/dist/ui/Dialog/dialog.recipe.d.ts +3 -3
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Menu/Menu.d.ts +360 -360
- package/dist/ui/Menu/menu.recipe.d.ts +20 -20
- package/dist/ui/Popover/Popover.d.ts +55 -55
- package/dist/ui/Popover/popover.recipe.d.ts +5 -5
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- package/dist/ui/QrCode/QrCode.d.ts +25 -25
- package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Table/Table.d.ts +21 -21
- package/dist/ui/Table/table.anatomy.d.ts +1 -1
- package/dist/ui/Table/table.recipe.d.ts +3 -3
- package/dist/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/dist/utils/mutationKeys.d.ts +3 -1
- package/dist/utils/mutationKeys.js +56 -48
- package/package.json +1 -1
- package/dist/components/AccountInfo/GoogleDisconnect.d.ts +0 -7
- package/dist/components/AccountInfo/GoogleDisconnect.js +0 -11
- package/dist/components/DepositWithdrawal/Deposit/GCashWebpayDeposit /GCashWebpayDeposit .d.ts +0 -1
- package/dist/components/DigitainLauncher/Loading.d.ts +0 -1
- package/dist/components/DigitainLauncher/Loading.js +0 -5
- package/dist/components/KYC/BasicInformation.d.ts +0 -1
- package/dist/components/KYC/BasicInformation.js +0 -101
- package/dist/components/KYC/IdentityVerification.d.ts +0 -1
- package/dist/components/KYC/IdentityVerification.js +0 -120
- package/dist/components/KYC/Indicator.d.ts +0 -1
- package/dist/components/KYC/Indicator.js +0 -8
- package/dist/components/KYC/KYC.lazy.d.ts +0 -6
- package/dist/components/KYC/KYC.lazy.js +0 -45
- package/dist/components/KYC/KYCContext.d.ts +0 -6
- package/dist/components/KYC/KYCContext.js +0 -2
- package/dist/components/KYC/PersonalInformation.d.ts +0 -1
- package/dist/components/KYC/PersonalInformation.js +0 -122
- package/dist/components/KYC/useKYC.d.ts +0 -25
- package/dist/components/KYC/useKYC.js +0 -38
- package/dist/components/PortalProvider/CXDTokenObserver.d.ts +0 -1
- package/dist/components/PortalProvider/CXDTokenObserver.js +0 -30
- package/dist/icons/LinkBrokenIcon.d.ts +0 -2
- package/dist/icons/LinkBrokenIcon.js +0 -4
- package/dist/images/responsible-gaming-yellow.png +0 -0
|
@@ -6,7 +6,7 @@ import { ObjectType } from '../../services/ObjectType.js';
|
|
|
6
6
|
import { createGCashWebpayDeposit, getDeposit, } from '../../services/wallet.js';
|
|
7
7
|
import { createPoll } from '../../utils/createPoll.js';
|
|
8
8
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
9
|
-
import {
|
|
9
|
+
import { getCreateGCashWebpayDepositMutationKey } from '../../utils/mutationKeys.js';
|
|
10
10
|
import { parseDecimal } from '../../utils/parseDecimal.js';
|
|
11
11
|
import { getAvailableQuestsQueryKey, getDepositsCountQueryKey, } from '../../utils/queryKeys.js';
|
|
12
12
|
import { getSession } from '../services/getSession.js';
|
|
@@ -14,7 +14,7 @@ export const useCreateGCashWebpayDepositMutation = (config) => {
|
|
|
14
14
|
const queryClient = getQueryClient();
|
|
15
15
|
const mutation = useMutation({
|
|
16
16
|
...config,
|
|
17
|
-
mutationKey:
|
|
17
|
+
mutationKey: getCreateGCashWebpayDepositMutationKey(),
|
|
18
18
|
mutationFn: async (input) => {
|
|
19
19
|
const id = input.id ?? ObjectId.generate(ObjectType.Deposit).toString();
|
|
20
20
|
const session = await getSession();
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SetOptional } from 'type-fest';
|
|
2
|
+
import { type CreateMayaWebpayDepositInput } from '../../services/wallet';
|
|
3
|
+
import type { Deposit, Mutation } from '../../types';
|
|
4
|
+
export declare const useCreateMayaWebpayDepositMutation: Mutation<Deposit, SetOptional<CreateMayaWebpayDepositInput, 'id'>>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { ObjectId } from '@opexa/object-id';
|
|
2
|
+
import { useMutation } from '@tanstack/react-query';
|
|
3
|
+
import { clamp } from 'lodash-es';
|
|
4
|
+
import invariant from 'tiny-invariant';
|
|
5
|
+
import { ObjectType } from '../../services/ObjectType.js';
|
|
6
|
+
import { createMayaWebpayDeposit, getDeposit, } from '../../services/wallet.js';
|
|
7
|
+
import { createPoll } from '../../utils/createPoll.js';
|
|
8
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
9
|
+
import { getCreateMayaWebpayDepositMutationKey } from '../../utils/mutationKeys.js';
|
|
10
|
+
import { parseDecimal } from '../../utils/parseDecimal.js';
|
|
11
|
+
import { getAvailableQuestsQueryKey, getDepositsCountQueryKey, } from '../../utils/queryKeys.js';
|
|
12
|
+
import { getSession } from '../services/getSession.js';
|
|
13
|
+
export const useCreateMayaWebpayDepositMutation = (config) => {
|
|
14
|
+
const queryClient = getQueryClient();
|
|
15
|
+
const mutation = useMutation({
|
|
16
|
+
...config,
|
|
17
|
+
mutationKey: getCreateMayaWebpayDepositMutationKey(),
|
|
18
|
+
mutationFn: async (input) => {
|
|
19
|
+
const id = input.id ?? ObjectId.generate(ObjectType.Deposit).toString();
|
|
20
|
+
const session = await getSession();
|
|
21
|
+
invariant(session.status === 'authenticated');
|
|
22
|
+
await createMayaWebpayDeposit({
|
|
23
|
+
...input,
|
|
24
|
+
id,
|
|
25
|
+
}, {
|
|
26
|
+
headers: {
|
|
27
|
+
Authorization: `Bearer ${session.token}`,
|
|
28
|
+
...(session.domain && {
|
|
29
|
+
Domain: session.domain,
|
|
30
|
+
}),
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
const poll = createPoll(async () => {
|
|
34
|
+
const session = await getSession();
|
|
35
|
+
invariant(session.status === 'authenticated');
|
|
36
|
+
return await getDeposit(id, {
|
|
37
|
+
headers: {
|
|
38
|
+
Authorization: `Bearer ${session.token}`,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}, {
|
|
42
|
+
until(res) {
|
|
43
|
+
return (!!res?.checkoutUrl || !!res?.error || res?.status === 'FAILED');
|
|
44
|
+
},
|
|
45
|
+
interval: 1000,
|
|
46
|
+
maxAttempt: 20,
|
|
47
|
+
});
|
|
48
|
+
const res = await poll();
|
|
49
|
+
if (!res?.checkoutUrl) {
|
|
50
|
+
const error = new Error();
|
|
51
|
+
error.name = 'GCashDepositError';
|
|
52
|
+
error.message = 'Failed to process GCash deposit';
|
|
53
|
+
throw error;
|
|
54
|
+
}
|
|
55
|
+
const depositsCount = queryClient.getQueryData(getDepositsCountQueryKey()) ?? 0;
|
|
56
|
+
if (depositsCount <= 0) {
|
|
57
|
+
queryClient.setQueryData(getAvailableQuestsQueryKey(), (prev) => {
|
|
58
|
+
return prev?.map((quest) => {
|
|
59
|
+
const progressPercentage = clamp(parseDecimal(quest.progressPercentage, 0) + 50, 100);
|
|
60
|
+
if (quest.type === 'ONBOARDING') {
|
|
61
|
+
return {
|
|
62
|
+
...quest,
|
|
63
|
+
status: progressPercentage >= 100 ? 'COMPLETED' : quest.status,
|
|
64
|
+
progressPercentage: progressPercentage.toFixed(2),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
return quest;
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
queryClient.setQueryData(getDepositsCountQueryKey(), (prev) => prev ? prev + 1 : 1);
|
|
72
|
+
return res;
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
return mutation;
|
|
76
|
+
};
|
|
@@ -17,6 +17,7 @@ import { GCashWebpayDeposit } from './GCashWebpayDeposit/GCashWebpayDeposit.js';
|
|
|
17
17
|
import { LibanganDeposit } from './LibanganDeposit/LibanganDeposit.js';
|
|
18
18
|
import { MayaAppDeposit } from './MayaAppDeposit/MayaAppDeposit.js';
|
|
19
19
|
import { MayaDeposit } from './MayaDeposit/MayaDeposit.js';
|
|
20
|
+
import { MayaWebpayDeposit } from './MayaWebpayDeposit/MayaWebpayDeposit.js';
|
|
20
21
|
import { OnlineBankDeposit } from './OnlineBankDeposit/OnlineBankDeposit.js';
|
|
21
22
|
import { PisoPayDeposit } from './PisoPayDeposit/PisoPayDeposit.js';
|
|
22
23
|
import { QRPHDeposit } from './QRPHDeposit/QRPHDeposit.js';
|
|
@@ -79,6 +80,11 @@ export function Deposit() {
|
|
|
79
80
|
enabled: paymentSettings?.gcashWebpayDepositGatewaySettings?.[enabledKey] &&
|
|
80
81
|
featureFlag.enabled,
|
|
81
82
|
},
|
|
83
|
+
{
|
|
84
|
+
method: 'MAYA_WEBPAY',
|
|
85
|
+
enabled: paymentSettings?.mayaWebpayDepositGatewaySettings?.[enabledKey] &&
|
|
86
|
+
featureFlag.enabled,
|
|
87
|
+
},
|
|
82
88
|
];
|
|
83
89
|
paymentMethods.forEach((o) => {
|
|
84
90
|
if (o.enabled) {
|
|
@@ -104,7 +110,7 @@ export function Deposit() {
|
|
|
104
110
|
if (enabledPaymentMethods.length <= 0) {
|
|
105
111
|
return _jsx(NoAvailablePaymentMethods, {});
|
|
106
112
|
}
|
|
107
|
-
return (_jsxs(_Fragment, { children: [_jsx(PaymentMethods, { value: paymentMethod, onChange: setPaymentMethod, options: enabledPaymentMethods }), paymentMethod === 'QRPH' && _jsx(QRPHDeposit, {}), paymentMethod === 'GCASH' && _jsx(GCashDeposit, {}), paymentMethod === 'MAYA' && _jsx(MayaDeposit, {}), paymentMethod === 'MAYA_APP' && _jsx(MayaAppDeposit, {}), paymentMethod === 'ONLINE_BANK' && _jsx(OnlineBankDeposit, {}), paymentMethod === 'LIBANGAN_PAY_IN' && _jsx(LibanganDeposit, {}), paymentMethod === 'PISO_PAY' && _jsx(PisoPayDeposit, {}), paymentMethod === 'AIO_GCASH' && _jsx(AiOGCashDeposit, {}), paymentMethod === 'AIO_PAY_MAYA' && _jsx(AiOPayMayaDeposit, {}), paymentMethod === 'AIO_GRAB_PAY' && _jsx(AiOGrabPayDeposit, {}), paymentMethod === 'AIO_PALAWAN_PAY' && _jsx(AiOPalawanPayDeposit, {}), paymentMethod === 'GCASH_WEBPAY' && _jsx(GCashWebpayDeposit, {})] }));
|
|
113
|
+
return (_jsxs(_Fragment, { children: [_jsx(PaymentMethods, { value: paymentMethod, onChange: setPaymentMethod, options: enabledPaymentMethods }), paymentMethod === 'QRPH' && _jsx(QRPHDeposit, {}), paymentMethod === 'GCASH' && _jsx(GCashDeposit, {}), paymentMethod === 'MAYA' && _jsx(MayaDeposit, {}), paymentMethod === 'MAYA_APP' && _jsx(MayaAppDeposit, {}), paymentMethod === 'ONLINE_BANK' && _jsx(OnlineBankDeposit, {}), paymentMethod === 'LIBANGAN_PAY_IN' && _jsx(LibanganDeposit, {}), paymentMethod === 'PISO_PAY' && _jsx(PisoPayDeposit, {}), paymentMethod === 'AIO_GCASH' && _jsx(AiOGCashDeposit, {}), paymentMethod === 'AIO_PAY_MAYA' && _jsx(AiOPayMayaDeposit, {}), paymentMethod === 'AIO_GRAB_PAY' && _jsx(AiOGrabPayDeposit, {}), paymentMethod === 'AIO_PALAWAN_PAY' && _jsx(AiOPalawanPayDeposit, {}), paymentMethod === 'GCASH_WEBPAY' && _jsx(GCashWebpayDeposit, {}), paymentMethod === 'MAYA_WEBPAY' && _jsx(MayaWebpayDeposit, {})] }));
|
|
108
114
|
}
|
|
109
115
|
function MayaSessionSessionExpired() {
|
|
110
116
|
return (_jsxs("div", { className: "py-xl", children: [_jsx("div", { className: "mx-auto flex size-12 items-center justify-center rounded-full bg-bg-warning-secondary", children: _jsx(AlertCircleIcon, { className: "size-6 text-text-featured-icon-light-warning" }) }), _jsx("h2", { className: "mt-lg text-center font-semibold text-lg", children: "Session Expired" }), _jsx("p", { className: "mx-auto mt-xs max-w-[25rem] text-center text-sm text-text-tertiary-600", children: "Your session has timed out. To continue with deposits or withdrawals, Please try reloading the app." })] }));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function MayaWebpayDeposit(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
3
3
|
import Link from 'next/link';
|
|
4
4
|
import { useEffect, useState } from 'react';
|
|
@@ -7,8 +7,7 @@ import invariant from 'tiny-invariant';
|
|
|
7
7
|
import { z } from 'zod';
|
|
8
8
|
import { useShallow } from 'zustand/shallow';
|
|
9
9
|
import { useAvailablePromosQuery } from '../../../../client/hooks/useAvailablePromosQuery.js';
|
|
10
|
-
import {
|
|
11
|
-
import { useDepositQuery } from '../../../../client/hooks/useDepositQuery.js';
|
|
10
|
+
import { useCreateMayaWebpayDepositMutation } from '../../../../client/hooks/useCreateMayaWebpayDepositMutation.js';
|
|
12
11
|
import { useDepositsCountQuery } from '../../../../client/hooks/useDepositsCountQuery.js';
|
|
13
12
|
import { useDisclosure } from '../../../../client/hooks/useDisclosure.js';
|
|
14
13
|
import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
|
|
@@ -28,7 +27,7 @@ import { parseDecimal } from '../../../../utils/parseDecimal.js';
|
|
|
28
27
|
import { AmountChoices } from '../../AmountChoices.js';
|
|
29
28
|
import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
|
|
30
29
|
import { AvailablePromos } from '../AvailablePromos.js';
|
|
31
|
-
export function
|
|
30
|
+
export function MayaWebpayDeposit() {
|
|
32
31
|
const depositWithdrawalProps = useDepositWithdrawalPropsContext();
|
|
33
32
|
const disclosure = useDisclosure();
|
|
34
33
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
@@ -38,7 +37,7 @@ export function GCashWebpayDeposit() {
|
|
|
38
37
|
const verificationQuery = useMemberVerificationQuery();
|
|
39
38
|
const verificationStatus = verificationQuery.data?.status ?? 'UNVERIFIED';
|
|
40
39
|
const [status, setStatus] = useState('waiting');
|
|
41
|
-
const createDepositMutation =
|
|
40
|
+
const createDepositMutation = useCreateMayaWebpayDepositMutation({
|
|
42
41
|
onMutate() {
|
|
43
42
|
disclosure.setOpen(true);
|
|
44
43
|
setStatus('processing');
|
|
@@ -46,41 +45,17 @@ export function GCashWebpayDeposit() {
|
|
|
46
45
|
onSuccess(data) {
|
|
47
46
|
invariant(data.checkoutUrl);
|
|
48
47
|
window.open(data.checkoutUrl, '_blank', 'noopener,noreferrer');
|
|
49
|
-
|
|
50
|
-
disclosure.setOpen(false);
|
|
48
|
+
setStatus('success');
|
|
51
49
|
},
|
|
52
50
|
onError() {
|
|
53
|
-
disclosure.setOpen(true);
|
|
54
51
|
setStatus('failed');
|
|
55
52
|
},
|
|
56
53
|
});
|
|
57
|
-
const depositQuery = useDepositQuery(createDepositMutation.data?.id, {
|
|
58
|
-
enabled: createDepositMutation.data != null,
|
|
59
|
-
refetchInterval(ctx) {
|
|
60
|
-
if (ctx.state.data?.status === 'CANCELLED' ||
|
|
61
|
-
ctx.state.data?.status === 'CONFIRMED') {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
return 2500;
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
});
|
|
69
|
-
useEffect(() => {
|
|
70
|
-
if (depositQuery.data?.status === 'CANCELLED') {
|
|
71
|
-
disclosure.setOpen(true);
|
|
72
|
-
setStatus('failed');
|
|
73
|
-
}
|
|
74
|
-
else if (depositQuery.data?.status === 'CONFIRMED') {
|
|
75
|
-
disclosure.setOpen(true);
|
|
76
|
-
setStatus('success');
|
|
77
|
-
}
|
|
78
|
-
}, [depositQuery.data?.status, disclosure]);
|
|
79
54
|
const depositsCountQuery = useDepositsCountQuery();
|
|
80
55
|
const depositsCount = depositsCountQuery.data ?? 0;
|
|
81
56
|
const paymentSettingsQuery = usePaymentSettingsQuery();
|
|
82
57
|
const paymentSettings = paymentSettingsQuery.data;
|
|
83
|
-
const gatewaySettings = paymentSettings?.
|
|
58
|
+
const gatewaySettings = paymentSettings?.mayaWebpayDepositGatewaySettings;
|
|
84
59
|
const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
|
|
85
60
|
const minimumAmount = depositsCount <= 0
|
|
86
61
|
? parseDecimal(paymentSettingsQuery.data?.minimumFirstDepositAmount, 0)
|
|
@@ -149,7 +124,6 @@ export function GCashWebpayDeposit() {
|
|
|
149
124
|
}
|
|
150
125
|
}, [form, minimumAmount]);
|
|
151
126
|
return (_jsxs("form", { onSubmit: form.handleSubmit(async (data) => {
|
|
152
|
-
//handle new kyc process
|
|
153
127
|
if (verificationStatus === 'PENDING' ||
|
|
154
128
|
verificationStatus === 'UNVERIFIED' ||
|
|
155
129
|
verificationStatus === 'REJECTED' ||
|
|
@@ -162,15 +136,13 @@ export function GCashWebpayDeposit() {
|
|
|
162
136
|
createDepositMutation.mutate({
|
|
163
137
|
amount: data.amount.toString(),
|
|
164
138
|
promo: data.promo ?? undefined,
|
|
165
|
-
|
|
166
|
-
|
|
139
|
+
redirectUrl: window.location.origin.includes('localhost')
|
|
140
|
+
? 'https://uat.powerplay.ph'
|
|
141
|
+
: window.location.origin,
|
|
167
142
|
});
|
|
168
143
|
}
|
|
169
144
|
}), noValidate: true, children: [_jsx(Controller, { control: form.control, name: "amount", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, children: [_jsxs(NumberInput.Root, { min: 0, step: 1, value: o.field.value, onValueChange: (details) => {
|
|
170
145
|
o.field.onChange(details.value);
|
|
171
|
-
}, formatOptions: {
|
|
172
|
-
maximumFractionDigits: 2,
|
|
173
|
-
minimumFractionDigits: 0,
|
|
174
146
|
}, allowMouseWheel: true, children: [_jsx(NumberInput.Label, { children: "Enter amount you want to deposit" }), _jsxs(NumberInput.Control, { children: [_jsx(NumberInput.Input, {}), _jsx(NumberInput.IncrementTrigger, { children: _jsx(ChevronUpIcon, {}) }), _jsx(NumberInput.DecrementTrigger, { children: _jsx(ChevronDownIcon, {}) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.amount?.message })] })) }), _jsx(AmountChoices, { value: parseDecimal(form.watch('amount'), 0), onChange: (value) => {
|
|
175
147
|
form.setValue('amount', value.toString(), {
|
|
176
148
|
shouldTouch: true,
|
|
@@ -182,9 +154,12 @@ export function GCashWebpayDeposit() {
|
|
|
182
154
|
globalStore.depositWithdrawal.setPromo(null);
|
|
183
155
|
}, className: "mt-3xl" })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: createDepositMutation.isPending, children: "Deposit" }), _jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["By depositing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: disclosure.open, onOpenChange: (details) => {
|
|
184
156
|
disclosure.setOpen(details.open);
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
157
|
+
if (!details.open) {
|
|
158
|
+
setStatus('waiting');
|
|
159
|
+
form.reset();
|
|
160
|
+
}
|
|
161
|
+
}, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs(AlertDialog.Header, { children: [status === 'processing' && (_jsx(SpinnerIcon, { className: "size-12 text-text-brand-primary-600" })), status === 'success' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-success-secondary text-text-featured-icon-light-success", children: _jsx(AlertCircleIcon, {}) })), status === 'failed' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-error-secondary text-text-featured-icon-light-error", children: _jsx(AlertCircleIcon, {}) }))] }), _jsxs(AlertDialog.Body, { children: [_jsxs(AlertDialog.Title, { children: [status === 'processing' && 'Processing Deposit', status === 'success' && 'Deposit Successful', status === 'failed' && 'Deposit Failed'] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
|
|
162
|
+
"We're verifying your account and amount. Please hold a moment.", status === 'success' && (_jsxs(_Fragment, { children: ["Your deposit has been successfully processed. ", _jsx("br", {}), " If you are not redirected automatically, click", ' ', !!createDepositMutation.data?.checkoutUrl && (_jsx("a", { href: createDepositMutation.data?.checkoutUrl, target: "_blank", rel: "noopener noreferrer", className: "text-text-brand underline underline-offset-2", children: "here" })), "."] })), status === 'failed' &&
|
|
188
163
|
'Something went wrong while processing your deposit. Please try again or contact support.'] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
|
|
189
164
|
api.setOpen(false);
|
|
190
165
|
}, children: status === 'failed' ? 'Try Again' : 'Ok' })) }) }))] }) })] }) })] }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { KnownDepositError, KnownWithdrawalError, WithdrawalError } from '../../types';
|
|
3
|
-
export declare const PaymentMethodDefinition: z.ZodEnum<["GCASH", "GCASH_STANDARD_CASH_IN", "MAYA_APP", "MAYA", "ONLINE_BANK", "QRPH", "INSTAPAY", "LIBANGAN_PAY_IN", "VENTAJA_DISBURSEMENT", "PISO_PAY", "AIO_GCASH", "AIO_PAY_MAYA", "AIO_GRAB_PAY", "AIO_PALAWAN_PAY", "GCASH_WEBPAY"]>;
|
|
3
|
+
export declare const PaymentMethodDefinition: z.ZodEnum<["GCASH", "GCASH_STANDARD_CASH_IN", "MAYA_APP", "MAYA", "ONLINE_BANK", "QRPH", "INSTAPAY", "LIBANGAN_PAY_IN", "VENTAJA_DISBURSEMENT", "PISO_PAY", "AIO_GCASH", "AIO_PAY_MAYA", "AIO_GRAB_PAY", "AIO_PALAWAN_PAY", "GCASH_WEBPAY", "MAYA_WEBPAY"]>;
|
|
4
4
|
export type PaymentMethod = z.infer<typeof PaymentMethodDefinition>;
|
|
5
5
|
export type DepositWithdrawalErrors = KnownDepositError | KnownWithdrawalError | WithdrawalError | string;
|
|
6
6
|
export declare function explainError(error?: DepositWithdrawalErrors): string;
|
|
@@ -15,6 +15,7 @@ export const PaymentMethodDefinition = z.enum([
|
|
|
15
15
|
'AIO_GRAB_PAY',
|
|
16
16
|
'AIO_PALAWAN_PAY',
|
|
17
17
|
'GCASH_WEBPAY',
|
|
18
|
+
'MAYA_WEBPAY',
|
|
18
19
|
]);
|
|
19
20
|
const errorMap = {
|
|
20
21
|
DAILY_PURCHASE_OR_DEPOSIT_LIMIT_EXCEEDED: 'You have exceeded your daily purchase or deposit limit. Please try again tomorrow.',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const SITE_ID: string;
|
|
2
2
|
export declare const PLATFORM_ID: string;
|
|
3
3
|
export declare const PLATFORM_CODE: string;
|
|
4
|
-
export declare const ENVIRONMENT: "
|
|
4
|
+
export declare const ENVIRONMENT: "production" | "development";
|
|
5
5
|
export declare const INTERNALS__REPORT_WEB_VITALS: boolean;
|
|
@@ -13,6 +13,7 @@ export async function postAuthenticate(request) {
|
|
|
13
13
|
const parsed = AuthenticateDefinition.safeParse(body);
|
|
14
14
|
const userAgent = request.headers.get('user-agent');
|
|
15
15
|
const ipAddress = request.headers.get('x-forwarded-for')?.split(',').at(0);
|
|
16
|
+
const channel = request.headers.get('channel');
|
|
16
17
|
if (!parsed.success) {
|
|
17
18
|
return NextResponse.json({
|
|
18
19
|
ok: false,
|
|
@@ -30,6 +31,7 @@ export async function postAuthenticate(request) {
|
|
|
30
31
|
...(domain && {
|
|
31
32
|
[DOMAIN_HEADER_KEY]: domain,
|
|
32
33
|
}),
|
|
34
|
+
...(channel && { Channel: channel }),
|
|
33
35
|
...(userAgent && {
|
|
34
36
|
'User-Agent': userAgent,
|
|
35
37
|
}),
|
|
@@ -32,6 +32,7 @@ export async function postSession(request) {
|
|
|
32
32
|
const parsed = CreateSessionDefinition.safeParse(body);
|
|
33
33
|
const userAgent = request.headers.get('user-agent');
|
|
34
34
|
const ipAddress = request.headers.get('x-forwarded-for')?.split(',').at(0);
|
|
35
|
+
const channel = request.headers.get('channel');
|
|
35
36
|
if (!parsed.success) {
|
|
36
37
|
return NextResponse.json({
|
|
37
38
|
ok: false,
|
|
@@ -55,6 +56,7 @@ export async function postSession(request) {
|
|
|
55
56
|
...(ipAddress && {
|
|
56
57
|
'X-Forwarded-For': ipAddress,
|
|
57
58
|
}),
|
|
59
|
+
...(channel && { Channel: channel }),
|
|
58
60
|
},
|
|
59
61
|
});
|
|
60
62
|
if (res.authenticator) {
|
|
@@ -38,6 +38,7 @@ export declare const CREATE_GCASH_WEBPAY_DEPOSIT = "\n mutation CreateGCashWebp
|
|
|
38
38
|
export declare const CREATE_LIBANGAN_DEPOSIT = "\n mutation CreateLibanganPayInDeposit(\n $input: CreateLibanganPayInDepositInput!\n ) {\n createLibanganPayInDeposit(input: $input) {\n ... on DepositPromoMaximumAmountExceededError {\n name: __typename\n message\n }\n ... on DepositPromoMinimumAmountNotMetError {\n name: __typename\n message\n }\n ... on MaximumDepositAmountExceededError {\n name: __typename\n message\n }\n ... on MinimumDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on MinimumFirstDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on PromoNotEnabledError {\n name: __typename\n message\n }\n ... on WalletDoesNotExistError {\n name: __typename\n message\n }\n ... on ExpiredSessionError {\n name: __typename\n message\n }\n }\n }\n";
|
|
39
39
|
export declare const CREATE_PISO_PAY_DEPOSIT = "\n mutation CreatePisoPayDeposit($input: CreatePisoPayCheckoutDepositInput!) {\n createPisoPayCheckoutDeposit(input: $input) {\n ... on WalletDoesNotExistError {\n name: __typename\n message\n }\n ... on DepositPromoMinimumAmountNotMetError {\n name: __typename\n message\n }\n ... on DepositPromoMaximumAmountExceededError {\n name: __typename\n message\n }\n ... on MinimumFirstDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on MinimumDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on MaximumDepositAmountExceededError {\n name: __typename\n message\n }\n ... on PromoNotEnabledError {\n name: __typename\n message\n }\n }\n }\n";
|
|
40
40
|
export declare const CREATE_MAYA_DEPOSIT = "\n mutation CreateMayaDeposit($input: CreateMayaDepositInput!) {\n createMayaDeposit(input: $input) {\n ... on DepositPromoMaximumAmountExceededError {\n name: __typename\n message\n }\n ... on DepositPromoMinimumAmountNotMetError {\n name: __typename\n message\n }\n ... on MaximumDepositAmountExceededError {\n name: __typename\n message\n }\n ... on MinimumDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on MinimumFirstDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on PromoNotEnabledError {\n name: __typename\n message\n }\n ... on WalletDoesNotExistError {\n name: __typename\n message\n }\n }\n }\n";
|
|
41
|
+
export declare const CREATE_MAYA_WEBPAY_DEPOSIT = "\n mutation CreateMayaWebpayDeposit($input: CreateMayaWebpayDepositInput!) {\n createMayaWebpayDeposit(input: $input) {\n ... on DepositPromoMaximumAmountExceededError {\n name: __typename\n message\n }\n ... on DepositPromoMinimumAmountNotMetError {\n name: __typename\n message\n }\n ... on MaximumDepositAmountExceededError {\n name: __typename\n message\n }\n ... on MinimumDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on MinimumFirstDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on PromoNotEnabledError {\n name: __typename\n message\n }\n ... on WalletDoesNotExistError {\n name: __typename\n message\n }\n }\n }\n";
|
|
41
42
|
export declare const CREATE_MAYA_APP_DEPOSIT = "\n mutation CreateMayaAppDeposit($input: CreateMayaAppDepositInput!) {\n createMayaAppDeposit(input: $input) {\n ... on DepositPromoMaximumAmountExceededError {\n name: __typename\n message\n }\n ... on DepositPromoMinimumAmountNotMetError {\n name: __typename\n message\n }\n ... on MaximumDepositAmountExceededError {\n name: __typename\n message\n }\n ... on MinimumDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on MinimumFirstDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on PromoNotEnabledError {\n name: __typename\n message\n }\n ... on WalletDoesNotExistError {\n name: __typename\n message\n }\n }\n }\n";
|
|
42
43
|
export declare const CREATE_AIO_QRPH_DEPOSIT = "\n mutation CreateAIOQRPHDeposit($input: CreateAIOQRPHDepositInput!) {\n createAIOQRPHDeposit(input: $input) {\n ... on DepositPromoMaximumAmountExceededError {\n name: __typename\n message\n }\n ... on DepositPromoMinimumAmountNotMetError {\n name: __typename\n message\n }\n ... on MaximumDepositAmountExceededError {\n name: __typename\n message\n }\n ... on MinimumDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on MinimumFirstDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on PromoNotEnabledError {\n name: __typename\n message\n }\n ... on WalletDoesNotExistError {\n name: __typename\n message\n }\n ... on ReCAPTCHAVerificationFailedError {\n name: __typename\n message\n }\n }\n }\n";
|
|
43
44
|
export declare const CREATE_AIO_ONLINE_BANK_DEPOSIT = "\n mutation CreateAIOOnlineBankDeposit(\n $input: CreateAIOOnlineBankDepositInput!\n ) {\n createAIOOnlineBankDeposit(input: $input) {\n ... on DepositPromoMaximumAmountExceededError {\n name: __typename\n message\n }\n ... on DepositPromoMinimumAmountNotMetError {\n name: __typename\n message\n }\n ... on MaximumDepositAmountExceededError {\n name: __typename\n message\n }\n ... on MinimumDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on MinimumFirstDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on PromoNotEnabledError {\n name: __typename\n message\n }\n ... on WalletDoesNotExistError {\n name: __typename\n message\n }\n }\n }\n";
|
|
@@ -91,7 +92,7 @@ export declare const UPDATE_MEMBER_VERIFICATION__NEXT = "\n mutation UpdateMemb
|
|
|
91
92
|
export declare const PROFILE_COMPLETION = "\n query ProfileCompletion {\n profileCompletion {\n completionPercentage\n personalInformation\n accountVerification\n mobileNumberVerification\n transactionPassword\n accountPassword\n }\n }\n";
|
|
92
93
|
export declare const REGISTER_MEMBER_ACCOUNT_BY_MOBILE_NUMBER = "\n mutation RegisterMemberAccountByMobileNumber(\n $input: RegisterMemberAccountByMobileNumberInput!\n $mobileNumberVerificationCode: String!\n ) {\n registerMemberAccountByMobileNumber(\n input: $input\n mobileNumberVerificationCode: $mobileNumberVerificationCode\n ) {\n ... on MobileNumberNotAvailableError {\n name: __typename\n message\n }\n ... on InvalidSMSVerificationCodeError {\n name: __typename\n message\n }\n ... on InvalidPlatformError {\n name: __typename\n message\n }\n }\n }\n";
|
|
93
94
|
export declare const PLATFORM = "\n query Platform {\n timezone\n currency\n }\n";
|
|
94
|
-
export declare const PAYMENT_SETTINGS = "\n fragment DepositGatewaySettingsCoreData on DepositGatewaySettings {\n minimumAmount\n maximumAmount\n webEnabled\n mobileWebEnabled\n androidEnabled\n iosEnabled\n bankAccountName\n bankAccountNumber\n bankIFSCCode\n upiId\n upiQRCode {\n id\n url\n }\n }\n\n fragment WithdrawalGatewaySettingsCoreData on WithdrawalGatewaySettings {\n minimumAmount\n maximumAmount\n webEnabled\n mobileWebEnabled\n androidEnabled\n iosEnabled\n }\n\n query PaymentSettings {\n minimumFirstDepositAmount\n restrictWithdrawalsToVerifiedMembers\n bankDepositGatewaySettings: depositGatewaySettings(gateway: BANK) {\n ...DepositGatewaySettingsCoreData\n }\n libanganDepositGatewaySettings: depositGatewaySettings(
|
|
95
|
+
export declare const PAYMENT_SETTINGS = "\n fragment DepositGatewaySettingsCoreData on DepositGatewaySettings {\n minimumAmount\n maximumAmount\n webEnabled\n mobileWebEnabled\n androidEnabled\n iosEnabled\n bankAccountName\n bankAccountNumber\n bankIFSCCode\n upiId\n upiQRCode {\n id\n url\n }\n }\n\n fragment WithdrawalGatewaySettingsCoreData on WithdrawalGatewaySettings {\n minimumAmount\n maximumAmount\n webEnabled\n mobileWebEnabled\n androidEnabled\n iosEnabled\n }\n\n query PaymentSettings {\n minimumFirstDepositAmount\n restrictWithdrawalsToVerifiedMembers\n bankDepositGatewaySettings: depositGatewaySettings(gateway: BANK) {\n ...DepositGatewaySettingsCoreData\n }\n libanganDepositGatewaySettings: depositGatewaySettings(gateway: LIBANGAN_PAY_IN) {\n ...DepositGatewaySettingsCoreData\n }\n gcashDepositGatewaySettings: depositGatewaySettings(gateway: GCASH) {\n ...DepositGatewaySettingsCoreData\n }\n gcashWebpayDepositGatewaySettings: depositGatewaySettings(gateway: GCASH_WEBPAY) {\n ...DepositGatewaySettingsCoreData\n }\n aioGCashDepositGatewaySettings: depositGatewaySettings(gateway: AIO_GCASH) {\n ...DepositGatewaySettingsCoreData\n }\n aioPayMayaDepositGatewaySettings: depositGatewaySettings(gateway: AIO_PAY_MAYA) {\n ...DepositGatewaySettingsCoreData\n }\n aioGrabPayDepositGatewaySettings: depositGatewaySettings(gateway: AIO_GRAB_PAY) {\n ...DepositGatewaySettingsCoreData\n }\n aioPalawanPayDepositGatewaySettings: depositGatewaySettings(gateway: AIO_PALAWAN_PAY) {\n ...DepositGatewaySettingsCoreData\n }\n mayaDepositGatewaySettings: depositGatewaySettings(gateway: MAYA) {\n ...DepositGatewaySettingsCoreData\n }\n mayaAppDepositGatewaySettings: depositGatewaySettings(gateway: MAYA_APP) {\n ...DepositGatewaySettingsCoreData\n }\n mayaWebpayDepositGatewaySettings: depositGatewaySettings(gateway: MAYA_WEBPAY) {\n ...DepositGatewaySettingsCoreData\n }\n onlineBankDepositGatewaySettings: depositGatewaySettings(gateway: ONLINE_BANK) {\n ...DepositGatewaySettingsCoreData\n }\n qrphDepositGatewaySettings: depositGatewaySettings(gateway: QR_PH) {\n ...DepositGatewaySettingsCoreData\n }\n manualBankDepositGatewaySettings: depositGatewaySettings(gateway: MANUAL_BANK) {\n ...DepositGatewaySettingsCoreData\n }\n manualUPIDepositGatewaySettings: depositGatewaySettings(gateway: MANUAL_UPI) {\n ...DepositGatewaySettingsCoreData\n }\n pisoPayDepositGatewaySettings: depositGatewaySettings(gateway: PISO_PAY_CHECKOUT) {\n ...DepositGatewaySettingsCoreData\n }\n bankWithdrawalGatewaySettings: withdrawalGatewaySettings(gateway: BANK) {\n ...WithdrawalGatewaySettingsCoreData\n }\n gcashWithdrawalGatewaySettings: withdrawalGatewaySettings(gateway: GCASH) {\n ...WithdrawalGatewaySettingsCoreData\n }\n gcashStandardCashInWithdrawalGatewaySettings: withdrawalGatewaySettings(gateway: GCASH_STANDARD_CASH_IN) {\n ...WithdrawalGatewaySettingsCoreData\n }\n mayaWithdrawalGatewaySettings: withdrawalGatewaySettings(gateway: MAYA) {\n ...WithdrawalGatewaySettingsCoreData\n }\n mayaAppWithdrawalGatewaySettings: withdrawalGatewaySettings(gateway: MAYA_APP) {\n ...WithdrawalGatewaySettingsCoreData\n }\n instapayWithdrawalGatewaySettings: withdrawalGatewaySettings(gateway: INSTAPAY) {\n ...WithdrawalGatewaySettingsCoreData\n }\n manualBankWithdrawalGatewaySettings: withdrawalGatewaySettings(gateway: MANUAL_BANK) {\n ...WithdrawalGatewaySettingsCoreData\n }\n manualUPIWithdrawalGatewaySettings: withdrawalGatewaySettings(gateway: MANUAL_UPI) {\n ...WithdrawalGatewaySettingsCoreData\n }\n ventajaWithdrawalGatewaySettings: withdrawalGatewaySettings(gateway: VENTAJA_DISBURSEMENT) {\n ...WithdrawalGatewaySettingsCoreData\n }\n pisoPayWithdrawalGatewaySettings: withdrawalGatewaySettings(gateway: PISO_PAY_REMITTANCE) {\n ...WithdrawalGatewaySettingsCoreData\n }\n }\n";
|
|
95
96
|
export declare const MAYA_SESSION = "\n query MayaSession($id: ObjectId!) {\n mayaSession(id: $id) {\n id\n member\n dateTimeCreated\n }\n }\n";
|
|
96
97
|
export declare const VALIDATE_MAYA_SESSION = "\n mutation ValidateMayaSession {\n validateMayaSession: validMayaSession\n }\n";
|
|
97
98
|
export declare const ACTIVITY_RECORDS = "\n query ActivityRecords(\n $after: Cursor\n $first: Int\n $filter: ActivityRecordsFilterInput\n ) {\n member {\n activityRecords(after: $after, first: $first, filter: $filter) {\n edges {\n cursor\n node {\n ... on MemberActivity {\n id\n type\n amount\n details\n dateTimeCreated\n }\n }\n }\n totalCount\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n }\n";
|
package/dist/services/queries.js
CHANGED
|
@@ -1227,6 +1227,40 @@ export const CREATE_MAYA_DEPOSIT = /* GraphQL */ `
|
|
|
1227
1227
|
}
|
|
1228
1228
|
}
|
|
1229
1229
|
`;
|
|
1230
|
+
export const CREATE_MAYA_WEBPAY_DEPOSIT = /* GraphQL */ `
|
|
1231
|
+
mutation CreateMayaWebpayDeposit($input: CreateMayaWebpayDepositInput!) {
|
|
1232
|
+
createMayaWebpayDeposit(input: $input) {
|
|
1233
|
+
... on DepositPromoMaximumAmountExceededError {
|
|
1234
|
+
name: __typename
|
|
1235
|
+
message
|
|
1236
|
+
}
|
|
1237
|
+
... on DepositPromoMinimumAmountNotMetError {
|
|
1238
|
+
name: __typename
|
|
1239
|
+
message
|
|
1240
|
+
}
|
|
1241
|
+
... on MaximumDepositAmountExceededError {
|
|
1242
|
+
name: __typename
|
|
1243
|
+
message
|
|
1244
|
+
}
|
|
1245
|
+
... on MinimumDepositAmountNotMetError {
|
|
1246
|
+
name: __typename
|
|
1247
|
+
message
|
|
1248
|
+
}
|
|
1249
|
+
... on MinimumFirstDepositAmountNotMetError {
|
|
1250
|
+
name: __typename
|
|
1251
|
+
message
|
|
1252
|
+
}
|
|
1253
|
+
... on PromoNotEnabledError {
|
|
1254
|
+
name: __typename
|
|
1255
|
+
message
|
|
1256
|
+
}
|
|
1257
|
+
... on WalletDoesNotExistError {
|
|
1258
|
+
name: __typename
|
|
1259
|
+
message
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
`;
|
|
1230
1264
|
export const CREATE_MAYA_APP_DEPOSIT = /* GraphQL */ `
|
|
1231
1265
|
mutation CreateMayaAppDeposit($input: CreateMayaAppDepositInput!) {
|
|
1232
1266
|
createMayaAppDeposit(input: $input) {
|
|
@@ -2329,9 +2363,7 @@ export const PAYMENT_SETTINGS = /* GraphQL */ `
|
|
|
2329
2363
|
bankDepositGatewaySettings: depositGatewaySettings(gateway: BANK) {
|
|
2330
2364
|
...DepositGatewaySettingsCoreData
|
|
2331
2365
|
}
|
|
2332
|
-
libanganDepositGatewaySettings: depositGatewaySettings(
|
|
2333
|
-
gateway: LIBANGAN_PAY_IN
|
|
2334
|
-
) {
|
|
2366
|
+
libanganDepositGatewaySettings: depositGatewaySettings(gateway: LIBANGAN_PAY_IN) {
|
|
2335
2367
|
...DepositGatewaySettingsCoreData
|
|
2336
2368
|
}
|
|
2337
2369
|
gcashDepositGatewaySettings: depositGatewaySettings(gateway: GCASH) {
|
|
@@ -2358,27 +2390,22 @@ export const PAYMENT_SETTINGS = /* GraphQL */ `
|
|
|
2358
2390
|
mayaAppDepositGatewaySettings: depositGatewaySettings(gateway: MAYA_APP) {
|
|
2359
2391
|
...DepositGatewaySettingsCoreData
|
|
2360
2392
|
}
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2393
|
+
mayaWebpayDepositGatewaySettings: depositGatewaySettings(gateway: MAYA_WEBPAY) {
|
|
2394
|
+
...DepositGatewaySettingsCoreData
|
|
2395
|
+
}
|
|
2396
|
+
onlineBankDepositGatewaySettings: depositGatewaySettings(gateway: ONLINE_BANK) {
|
|
2364
2397
|
...DepositGatewaySettingsCoreData
|
|
2365
2398
|
}
|
|
2366
2399
|
qrphDepositGatewaySettings: depositGatewaySettings(gateway: QR_PH) {
|
|
2367
2400
|
...DepositGatewaySettingsCoreData
|
|
2368
2401
|
}
|
|
2369
|
-
manualBankDepositGatewaySettings: depositGatewaySettings(
|
|
2370
|
-
gateway: MANUAL_BANK
|
|
2371
|
-
) {
|
|
2402
|
+
manualBankDepositGatewaySettings: depositGatewaySettings(gateway: MANUAL_BANK) {
|
|
2372
2403
|
...DepositGatewaySettingsCoreData
|
|
2373
2404
|
}
|
|
2374
|
-
manualUPIDepositGatewaySettings: depositGatewaySettings(
|
|
2375
|
-
gateway: MANUAL_UPI
|
|
2376
|
-
) {
|
|
2405
|
+
manualUPIDepositGatewaySettings: depositGatewaySettings(gateway: MANUAL_UPI) {
|
|
2377
2406
|
...DepositGatewaySettingsCoreData
|
|
2378
2407
|
}
|
|
2379
|
-
pisoPayDepositGatewaySettings: depositGatewaySettings(
|
|
2380
|
-
gateway: PISO_PAY_CHECKOUT
|
|
2381
|
-
) {
|
|
2408
|
+
pisoPayDepositGatewaySettings: depositGatewaySettings(gateway: PISO_PAY_CHECKOUT) {
|
|
2382
2409
|
...DepositGatewaySettingsCoreData
|
|
2383
2410
|
}
|
|
2384
2411
|
bankWithdrawalGatewaySettings: withdrawalGatewaySettings(gateway: BANK) {
|
|
@@ -2393,34 +2420,22 @@ export const PAYMENT_SETTINGS = /* GraphQL */ `
|
|
|
2393
2420
|
mayaWithdrawalGatewaySettings: withdrawalGatewaySettings(gateway: MAYA) {
|
|
2394
2421
|
...WithdrawalGatewaySettingsCoreData
|
|
2395
2422
|
}
|
|
2396
|
-
mayaAppWithdrawalGatewaySettings: withdrawalGatewaySettings(
|
|
2397
|
-
gateway: MAYA_APP
|
|
2398
|
-
) {
|
|
2423
|
+
mayaAppWithdrawalGatewaySettings: withdrawalGatewaySettings(gateway: MAYA_APP) {
|
|
2399
2424
|
...WithdrawalGatewaySettingsCoreData
|
|
2400
2425
|
}
|
|
2401
|
-
instapayWithdrawalGatewaySettings: withdrawalGatewaySettings(
|
|
2402
|
-
gateway: INSTAPAY
|
|
2403
|
-
) {
|
|
2426
|
+
instapayWithdrawalGatewaySettings: withdrawalGatewaySettings(gateway: INSTAPAY) {
|
|
2404
2427
|
...WithdrawalGatewaySettingsCoreData
|
|
2405
2428
|
}
|
|
2406
|
-
manualBankWithdrawalGatewaySettings: withdrawalGatewaySettings(
|
|
2407
|
-
gateway: MANUAL_BANK
|
|
2408
|
-
) {
|
|
2429
|
+
manualBankWithdrawalGatewaySettings: withdrawalGatewaySettings(gateway: MANUAL_BANK) {
|
|
2409
2430
|
...WithdrawalGatewaySettingsCoreData
|
|
2410
2431
|
}
|
|
2411
|
-
manualUPIWithdrawalGatewaySettings: withdrawalGatewaySettings(
|
|
2412
|
-
gateway: MANUAL_UPI
|
|
2413
|
-
) {
|
|
2432
|
+
manualUPIWithdrawalGatewaySettings: withdrawalGatewaySettings(gateway: MANUAL_UPI) {
|
|
2414
2433
|
...WithdrawalGatewaySettingsCoreData
|
|
2415
2434
|
}
|
|
2416
|
-
ventajaWithdrawalGatewaySettings: withdrawalGatewaySettings(
|
|
2417
|
-
gateway: VENTAJA_DISBURSEMENT
|
|
2418
|
-
) {
|
|
2435
|
+
ventajaWithdrawalGatewaySettings: withdrawalGatewaySettings(gateway: VENTAJA_DISBURSEMENT) {
|
|
2419
2436
|
...WithdrawalGatewaySettingsCoreData
|
|
2420
2437
|
}
|
|
2421
|
-
pisoPayWithdrawalGatewaySettings: withdrawalGatewaySettings(
|
|
2422
|
-
gateway: PISO_PAY_REMITTANCE
|
|
2423
|
-
) {
|
|
2438
|
+
pisoPayWithdrawalGatewaySettings: withdrawalGatewaySettings(gateway: PISO_PAY_REMITTANCE) {
|
|
2424
2439
|
...WithdrawalGatewaySettingsCoreData
|
|
2425
2440
|
}
|
|
2426
2441
|
}
|
|
@@ -254,6 +254,19 @@ export interface CreateMayaDepositMutationVariables {
|
|
|
254
254
|
}
|
|
255
255
|
export type CreateMayaDepositInput = Simplify<CreateMayaDepositMutationVariables['input']>;
|
|
256
256
|
export declare const createMayaDeposit: (input: CreateMayaDepositInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
257
|
+
export interface CreateMayaWebpayDepositMutation {
|
|
258
|
+
createMayaWebpayDeposit?: null | CreateDepositError;
|
|
259
|
+
}
|
|
260
|
+
export interface CreateMayaWebpayDepositMutationVariables {
|
|
261
|
+
input: {
|
|
262
|
+
id: string;
|
|
263
|
+
amount: string;
|
|
264
|
+
promo?: string;
|
|
265
|
+
redirectUrl: string;
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
export type CreateMayaWebpayDepositInput = Simplify<CreateMayaWebpayDepositMutationVariables['input']>;
|
|
269
|
+
export declare const createMayaWebpayDeposit: (input: CreateMayaWebpayDepositInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
257
270
|
export interface CreateAIOQRPHDepositMutation {
|
|
258
271
|
createAIOQRPHDeposit?: null | CreateDepositError;
|
|
259
272
|
}
|
package/dist/services/wallet.js
CHANGED
|
@@ -2,7 +2,7 @@ import { cache } from 'react';
|
|
|
2
2
|
import { WALLET_GRAPHQL_ENDPOINT } from '../constants/index.js';
|
|
3
3
|
import { parseDecimal } from '../utils/parseDecimal.js';
|
|
4
4
|
import { graphqlRequest } from './graphqlRequest.js';
|
|
5
|
-
import { AVAILABLE_PROMOS, BONUS, BONUS_BALANCES, BONUS_IDS, BONUSES, CASHBACK, CASHBACK_BONUS, CASHBACK_BONUS_IDS, CASHBACK_BONUSES, CASHBACKS, CLAIM_CASHBACK_BONUS, CLAIM_SPOT_BONUS, CREATE_AIO_GCASH_DEPOSIT, CREATE_AIO_GRAB_PAY_DEPOSIT, CREATE_AIO_INSTAPAY_WITHDRAWAL, CREATE_AIO_INSTAPAY_WITHDRAWAL_NEXT, CREATE_AIO_ONLINE_BANK_DEPOSIT, CREATE_AIO_PALAWAN_PAY_DEPOSIT, CREATE_AIO_PAY_MAYA_DEPOSIT, CREATE_AIO_QRPH_DEPOSIT, CREATE_BANK_WITHDRAWAL, CREATE_GAME_SESSION, CREATE_GCASH_DEPOSIT, CREATE_GCASH_STANDARD_CASH_IN_WITHDRAWAL, CREATE_GCASH_WEBPAY_DEPOSIT, CREATE_GCASH_WITHDRAWAL, CREATE_LIBANGAN_DEPOSIT, CREATE_MANUAL_BANK_DEPOSIT, CREATE_MANUAL_BANK_WITHDRAWAL, CREATE_MANUAL_UPI_DEPOSIT, CREATE_MANUAL_UPI_WITHDRAWAL, CREATE_MAYA_APP_DEPOSIT, CREATE_MAYA_APP_WITHDRAWAL, CREATE_MAYA_DEPOSIT, CREATE_MAYA_WITHDRAWAL, CREATE_PISO_PAY_DEPOSIT, CREATE_PISO_PAY_WITHDRAWAL, CREATE_VENTAJA_WITHDRAWAL, DEPOSIT, END_GAME_SESSION, FAVORITE_GAMES, GAME_SESSION, INSTAPAY_BANK_LIST, MARK_GAME_AS_FAVORITE, MAYA_SESSION, POINTS_WALLET, PROMO, PROMOS, REDEEM_POINTS_TO_CASH, REMAINING_DAILY_WITHDRAWALS_COUNT, TOUCH_GCASH_DEPOSIT, TOUCH_QRPH_DEPOSIT, UNMARK_GAME_AS_FAVORITE, VALIDATE_MAYA_SESSION, WALLET, } from './queries.js';
|
|
5
|
+
import { AVAILABLE_PROMOS, BONUS, BONUS_BALANCES, BONUS_IDS, BONUSES, CASHBACK, CASHBACK_BONUS, CASHBACK_BONUS_IDS, CASHBACK_BONUSES, CASHBACKS, CLAIM_CASHBACK_BONUS, CLAIM_SPOT_BONUS, CREATE_AIO_GCASH_DEPOSIT, CREATE_AIO_GRAB_PAY_DEPOSIT, CREATE_AIO_INSTAPAY_WITHDRAWAL, CREATE_AIO_INSTAPAY_WITHDRAWAL_NEXT, CREATE_AIO_ONLINE_BANK_DEPOSIT, CREATE_AIO_PALAWAN_PAY_DEPOSIT, CREATE_AIO_PAY_MAYA_DEPOSIT, CREATE_AIO_QRPH_DEPOSIT, CREATE_BANK_WITHDRAWAL, CREATE_GAME_SESSION, CREATE_GCASH_DEPOSIT, CREATE_GCASH_STANDARD_CASH_IN_WITHDRAWAL, CREATE_GCASH_WEBPAY_DEPOSIT, CREATE_GCASH_WITHDRAWAL, CREATE_LIBANGAN_DEPOSIT, CREATE_MANUAL_BANK_DEPOSIT, CREATE_MANUAL_BANK_WITHDRAWAL, CREATE_MANUAL_UPI_DEPOSIT, CREATE_MANUAL_UPI_WITHDRAWAL, CREATE_MAYA_APP_DEPOSIT, CREATE_MAYA_APP_WITHDRAWAL, CREATE_MAYA_DEPOSIT, CREATE_MAYA_WEBPAY_DEPOSIT, CREATE_MAYA_WITHDRAWAL, CREATE_PISO_PAY_DEPOSIT, CREATE_PISO_PAY_WITHDRAWAL, CREATE_VENTAJA_WITHDRAWAL, DEPOSIT, END_GAME_SESSION, FAVORITE_GAMES, GAME_SESSION, INSTAPAY_BANK_LIST, MARK_GAME_AS_FAVORITE, MAYA_SESSION, POINTS_WALLET, PROMO, PROMOS, REDEEM_POINTS_TO_CASH, REMAINING_DAILY_WITHDRAWALS_COUNT, TOUCH_GCASH_DEPOSIT, TOUCH_QRPH_DEPOSIT, UNMARK_GAME_AS_FAVORITE, VALIDATE_MAYA_SESSION, WALLET, } from './queries.js';
|
|
6
6
|
import { sha256 } from './sha256.js';
|
|
7
7
|
export const getPromos = cache(async (options) => {
|
|
8
8
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, PROMOS, undefined, {
|
|
@@ -195,6 +195,16 @@ export const createMayaDeposit = async (input, options) => {
|
|
|
195
195
|
throw error;
|
|
196
196
|
}
|
|
197
197
|
};
|
|
198
|
+
export const createMayaWebpayDeposit = async (input, options) => {
|
|
199
|
+
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CREATE_MAYA_WEBPAY_DEPOSIT, { input }, options);
|
|
200
|
+
if (res.createMayaWebpayDeposit) {
|
|
201
|
+
const error = new Error();
|
|
202
|
+
error.name = res.createMayaWebpayDeposit.name;
|
|
203
|
+
error.message = ERROR_CODES_MESSAGE_MAP[res.createMayaWebpayDeposit.name];
|
|
204
|
+
Error.captureStackTrace?.(error, createMayaWebpayDeposit);
|
|
205
|
+
throw error;
|
|
206
|
+
}
|
|
207
|
+
};
|
|
198
208
|
export const createAIOQRPHDeposit = async (input, options) => {
|
|
199
209
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CREATE_AIO_QRPH_DEPOSIT, { input }, options);
|
|
200
210
|
if (res.createAIOQRPHDeposit) {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -255,7 +255,7 @@ export interface LatestBetRecord {
|
|
|
255
255
|
dateTimeSettled: string;
|
|
256
256
|
dateTimeCreated: string;
|
|
257
257
|
}
|
|
258
|
-
export type DepositType = 'BANK' | 'GCASH' | 'MANUAL' | 'MAYA' | 'MAYA_APP' | 'QR_PH' | 'ONLINE_BANK' | 'MANUAL_BANK' | 'MANUAL_UPI' | 'PISO_PAY_CHECKOUT' | 'AIO_GCASH' | 'AIO_PAY_MAYA' | 'AIO_GRAB_PAY' | 'AIO_PALAWAN_PAY' | 'LIBANGAN_PAY_IN';
|
|
258
|
+
export type DepositType = 'BANK' | 'GCASH' | 'MANUAL' | 'MAYA' | 'MAYA_APP' | 'MAYA_WEBPAY' | 'QR_PH' | 'ONLINE_BANK' | 'MANUAL_BANK' | 'MANUAL_UPI' | 'PISO_PAY_CHECKOUT' | 'AIO_GCASH' | 'AIO_PAY_MAYA' | 'AIO_GRAB_PAY' | 'AIO_PALAWAN_PAY' | 'LIBANGAN_PAY_IN';
|
|
259
259
|
export type DepositStatus = 'PENDING' | 'ACCEPTED' | 'APPROVED' | 'REJECTED' | 'CONFIRMED' | 'CANCELLED' | 'FAILED';
|
|
260
260
|
export type KnownDepositError = 'INSUFFICIENT_BALANCE' | 'DEPOSIT_CREATION_REQUEST_FAILED' | 'DEPOSIT_EXECUTION_REQUEST_FAILED' | 'REQUEST_SESSION_EXPIRED' | 'REQUEST_TIMEOUT' | 'SYSTEM_CANCELLATION' | 'UNEXPECTED_ERROR' | 'FAILED_TO_PROCESS_PAYMENT' | 'MINIMUM_DEPOSIT_AMOUNT_NOT_MET' | 'UNTOUCHED';
|
|
261
261
|
export interface DepositRecord {
|
|
@@ -535,6 +535,7 @@ export interface PaymentSettings {
|
|
|
535
535
|
aioPalawanPayDepositGatewaySettings?: DepositGatewaySettings | null;
|
|
536
536
|
mayaDepositGatewaySettings?: DepositGatewaySettings | null;
|
|
537
537
|
mayaAppDepositGatewaySettings?: DepositGatewaySettings | null;
|
|
538
|
+
mayaWebpayDepositGatewaySettings?: DepositGatewaySettings | null;
|
|
538
539
|
onlineBankDepositGatewaySettings?: DepositGatewaySettings | null;
|
|
539
540
|
libanganDepositGatewaySettings?: DepositGatewaySettings | null;
|
|
540
541
|
pisoPayDepositGatewaySettings?: DepositGatewaySettings | null;
|