@opexa/portal-components 0.0.793 → 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.
Files changed (90) hide show
  1. package/dist/client/hooks/useCreateGCashWebpayDepositMutation.js +2 -2
  2. package/dist/client/hooks/useCreateMayaWebpayDepositMutation.d.ts +4 -0
  3. package/dist/client/hooks/useCreateMayaWebpayDepositMutation.js +76 -0
  4. package/dist/components/DepositWithdrawal/Deposit/Deposit.js +7 -1
  5. package/dist/components/DepositWithdrawal/Deposit/MayaWebpayDeposit/MayaWebpayDeposit.d.ts +1 -0
  6. package/dist/components/DepositWithdrawal/Deposit/MayaWebpayDeposit/MayaWebpayDeposit.js +166 -0
  7. package/dist/components/DepositWithdrawal/PaymentMethods.js +5 -0
  8. package/dist/components/DepositWithdrawal/utils.d.ts +1 -1
  9. package/dist/components/DepositWithdrawal/utils.js +1 -0
  10. package/dist/components/KYC/KYCVerificationStatus.lazy.js +4 -7
  11. package/dist/components/TransactionRecords/TableFilters.js +1 -0
  12. package/dist/constants/EnvVar.d.ts +1 -1
  13. package/dist/services/queries.d.ts +2 -1
  14. package/dist/services/queries.js +48 -33
  15. package/dist/services/wallet.d.ts +13 -0
  16. package/dist/services/wallet.js +11 -1
  17. package/dist/types/index.d.ts +2 -1
  18. package/dist/ui/Carousel/Carousel.d.ts +45 -45
  19. package/dist/ui/Carousel/carousel.recipe.d.ts +5 -5
  20. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  21. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  22. package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
  23. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  24. package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
  25. package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
  26. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  27. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  28. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  29. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  30. package/dist/ui/Menu/Menu.d.ts +306 -306
  31. package/dist/ui/Menu/menu.recipe.d.ts +17 -17
  32. package/dist/ui/Popover/Popover.d.ts +55 -55
  33. package/dist/ui/Popover/popover.recipe.d.ts +5 -5
  34. package/dist/ui/Progress/Progress.d.ts +27 -27
  35. package/dist/ui/Progress/progress.recipe.d.ts +3 -3
  36. package/dist/ui/QrCode/QrCode.d.ts +25 -25
  37. package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
  38. package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
  39. package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
  40. package/dist/ui/Select/Select.d.ts +45 -45
  41. package/dist/ui/Select/select.recipe.d.ts +3 -3
  42. package/dist/ui/Table/Table.d.ts +21 -21
  43. package/dist/ui/Table/table.anatomy.d.ts +1 -1
  44. package/dist/ui/Table/table.recipe.d.ts +3 -3
  45. package/dist/ui/Tabs/Tabs.d.ts +15 -15
  46. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  47. package/dist/utils/mutationKeys.d.ts +3 -1
  48. package/dist/utils/mutationKeys.js +56 -48
  49. package/package.json +1 -1
  50. package/dist/components/Banner/Banner.client.d.ts +0 -12
  51. package/dist/components/Banner/Banner.client.js +0 -49
  52. package/dist/components/DigitainLauncher/Loading.d.ts +0 -1
  53. package/dist/components/DigitainLauncher/Loading.js +0 -5
  54. package/dist/components/KYC/BasicInformation.d.ts +0 -1
  55. package/dist/components/KYC/BasicInformation.js +0 -101
  56. package/dist/components/KYC/IdentityVerification.d.ts +0 -1
  57. package/dist/components/KYC/IdentityVerification.js +0 -120
  58. package/dist/components/KYC/Indicator.d.ts +0 -1
  59. package/dist/components/KYC/Indicator.js +0 -8
  60. package/dist/components/KYC/KYC.lazy.d.ts +0 -6
  61. package/dist/components/KYC/KYC.lazy.js +0 -45
  62. package/dist/components/KYC/KYCContext.d.ts +0 -6
  63. package/dist/components/KYC/KYCContext.js +0 -2
  64. package/dist/components/KYC/PersonalInformation.d.ts +0 -1
  65. package/dist/components/KYC/PersonalInformation.js +0 -122
  66. package/dist/components/KYC/useKYC.d.ts +0 -25
  67. package/dist/components/KYC/useKYC.js +0 -38
  68. package/dist/components/PortalProvider/AndroidOnlyComponents.d.ts +0 -1
  69. package/dist/components/PortalProvider/AndroidOnlyComponents.js +0 -12
  70. package/dist/components/PortalProvider/CXDTokenObserver.d.ts +0 -1
  71. package/dist/components/PortalProvider/CXDTokenObserver.js +0 -30
  72. package/dist/components/SignIn/utils.d.ts +0 -8
  73. package/dist/components/SignIn/utils.js +0 -26
  74. package/dist/constants/Branches.d.ts +0 -2
  75. package/dist/constants/Branches.js +0 -42
  76. package/dist/images/responsible-gaming-yellow.png +0 -0
  77. package/dist/third-parties/FacebookPixel/FacebookPixel.d.ts +0 -4
  78. package/dist/third-parties/FacebookPixel/FacebookPixel.js +0 -4
  79. package/dist/third-parties/FacebookPixel/api.d.ts +0 -0
  80. package/dist/third-parties/FacebookPixel/api.js +0 -1
  81. package/dist/third-parties/FacebookPixel/index.d.ts +0 -1
  82. package/dist/third-parties/FacebookPixel/index.js +0 -1
  83. package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.d.ts +0 -4
  84. package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.js +0 -4
  85. package/dist/third-parties/GoogleRecaptcha/api.d.ts +0 -0
  86. package/dist/third-parties/GoogleRecaptcha/api.js +0 -1
  87. package/dist/third-parties/GoogleRecaptcha/index.d.ts +0 -1
  88. package/dist/third-parties/GoogleRecaptcha/index.js +0 -1
  89. package/dist/third-parties/index.d.ts +0 -2
  90. package/dist/third-parties/index.js +0 -2
@@ -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 { getCreateGCashDepositMutationKey } from '../../utils/mutationKeys.js';
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: getCreateGCashDepositMutationKey(),
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;
@@ -0,0 +1,166 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { zodResolver } from '@hookform/resolvers/zod';
3
+ import Link from 'next/link';
4
+ import { useEffect, useState } from 'react';
5
+ import { Controller, useForm } from 'react-hook-form';
6
+ import invariant from 'tiny-invariant';
7
+ import { z } from 'zod';
8
+ import { useShallow } from 'zustand/shallow';
9
+ import { useAvailablePromosQuery } from '../../../../client/hooks/useAvailablePromosQuery.js';
10
+ import { useCreateMayaWebpayDepositMutation } from '../../../../client/hooks/useCreateMayaWebpayDepositMutation.js';
11
+ import { useDepositsCountQuery } from '../../../../client/hooks/useDepositsCountQuery.js';
12
+ import { useDisclosure } from '../../../../client/hooks/useDisclosure.js';
13
+ import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
14
+ import { useMemberVerificationQuery } from '../../../../client/hooks/useMemberVerificationQuery.js';
15
+ import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
16
+ import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
17
+ import { ChevronDownIcon } from '../../../../icons/ChevronDownIcon.js';
18
+ import { ChevronUpIcon } from '../../../../icons/ChevronUpIcon.js';
19
+ import { SpinnerIcon } from '../../../../icons/SpinnerIcon.js';
20
+ import { XIcon } from '../../../../icons/XIcon.js';
21
+ import { AlertDialog } from '../../../../ui/AlertDialog/index.js';
22
+ import { Button } from '../../../../ui/Button/index.js';
23
+ import { Field } from '../../../../ui/Field/index.js';
24
+ import { NumberInput } from '../../../../ui/NumberInput/index.js';
25
+ import { Portal } from '../../../../ui/Portal/index.js';
26
+ import { parseDecimal } from '../../../../utils/parseDecimal.js';
27
+ import { AmountChoices } from '../../AmountChoices.js';
28
+ import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
29
+ import { AvailablePromos } from '../AvailablePromos.js';
30
+ export function MayaWebpayDeposit() {
31
+ const depositWithdrawalProps = useDepositWithdrawalPropsContext();
32
+ const disclosure = useDisclosure();
33
+ const globalStore = useGlobalStore(useShallow((ctx) => ({
34
+ depositWithdrawal: ctx.depositWithdrawal,
35
+ kycVerificationStatus: ctx.kycVerificationStatus,
36
+ })));
37
+ const verificationQuery = useMemberVerificationQuery();
38
+ const verificationStatus = verificationQuery.data?.status ?? 'UNVERIFIED';
39
+ const [status, setStatus] = useState('waiting');
40
+ const createDepositMutation = useCreateMayaWebpayDepositMutation({
41
+ onMutate() {
42
+ disclosure.setOpen(true);
43
+ setStatus('processing');
44
+ },
45
+ onSuccess(data) {
46
+ invariant(data.checkoutUrl);
47
+ window.open(data.checkoutUrl, '_blank', 'noopener,noreferrer');
48
+ setStatus('success');
49
+ },
50
+ onError() {
51
+ setStatus('failed');
52
+ },
53
+ });
54
+ const depositsCountQuery = useDepositsCountQuery();
55
+ const depositsCount = depositsCountQuery.data ?? 0;
56
+ const paymentSettingsQuery = usePaymentSettingsQuery();
57
+ const paymentSettings = paymentSettingsQuery.data;
58
+ const gatewaySettings = paymentSettings?.mayaWebpayDepositGatewaySettings;
59
+ const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
60
+ const minimumAmount = depositsCount <= 0
61
+ ? parseDecimal(paymentSettingsQuery.data?.minimumFirstDepositAmount, 0)
62
+ : parseDecimal(gatewaySettings?.minimumAmount, 0);
63
+ const promosQuery = useAvailablePromosQuery();
64
+ const promos = promosQuery.data ?? [];
65
+ const definition = z
66
+ .object({
67
+ amount: z.string().superRefine((val, ctx) => {
68
+ const n = parseDecimal(val, 0);
69
+ if (n < minimumAmount) {
70
+ ctx.addIssue({
71
+ type: 'number',
72
+ code: z.ZodIssueCode.too_small,
73
+ inclusive: true,
74
+ minimum: minimumAmount,
75
+ message: `Minimum amount is ${minimumAmount.toLocaleString()}`,
76
+ });
77
+ }
78
+ if (n > maximumAmount) {
79
+ ctx.addIssue({
80
+ type: 'number',
81
+ code: z.ZodIssueCode.too_big,
82
+ inclusive: true,
83
+ maximum: maximumAmount,
84
+ message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
85
+ });
86
+ }
87
+ }),
88
+ promo: z.string().optional().nullable(),
89
+ })
90
+ .superRefine((value, ctx) => {
91
+ const promo = promos.find((o) => o.id === value.promo);
92
+ const promoMinAmount = parseDecimal(promo?.minimumDepositAmount, 0);
93
+ const promoMaxAmount = parseDecimal(promo?.maximumDepositAmount, 0);
94
+ const amount = parseDecimal(value.amount, 0);
95
+ if (promo && amount < promoMinAmount) {
96
+ ctx.addIssue({
97
+ path: ['amount'],
98
+ code: z.ZodIssueCode.custom,
99
+ message: `Minimum amount for this promo is ${promoMinAmount.toLocaleString()}`,
100
+ });
101
+ }
102
+ if (promo && amount > promoMaxAmount) {
103
+ ctx.addIssue({
104
+ path: ['amount'],
105
+ code: z.ZodIssueCode.custom,
106
+ message: `Maximum amount for this promo is ${promoMaxAmount}`,
107
+ });
108
+ }
109
+ });
110
+ const form = useForm({
111
+ mode: 'all',
112
+ resolver: zodResolver(definition),
113
+ defaultValues: {
114
+ amount: '0',
115
+ promo: globalStore.depositWithdrawal.promo ?? null,
116
+ },
117
+ });
118
+ useEffect(() => {
119
+ if (minimumAmount) {
120
+ form.reset({
121
+ amount: minimumAmount.toString(),
122
+ promo: form.getValues('promo') ?? null,
123
+ });
124
+ }
125
+ }, [form, minimumAmount]);
126
+ return (_jsxs("form", { onSubmit: form.handleSubmit(async (data) => {
127
+ if (verificationStatus === 'PENDING' ||
128
+ verificationStatus === 'UNVERIFIED' ||
129
+ verificationStatus === 'REJECTED' ||
130
+ verificationStatus === 'CREATED') {
131
+ globalStore.kycVerificationStatus.setOpen(true);
132
+ return;
133
+ }
134
+ else {
135
+ createDepositMutation.reset();
136
+ createDepositMutation.mutate({
137
+ amount: data.amount.toString(),
138
+ promo: data.promo ?? undefined,
139
+ redirectUrl: window.location.origin.includes('localhost')
140
+ ? 'https://uat.powerplay.ph'
141
+ : window.location.origin,
142
+ });
143
+ }
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) => {
145
+ o.field.onChange(details.value);
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) => {
147
+ form.setValue('amount', value.toString(), {
148
+ shouldTouch: true,
149
+ shouldDirty: true,
150
+ shouldValidate: true,
151
+ });
152
+ }, min: minimumAmount, max: maximumAmount, className: "mt-lg" }), _jsx(Controller, { control: form.control, name: "promo", render: (o) => (_jsx(AvailablePromos, { value: o.field.value, onChange: (value) => {
153
+ o.field.onChange(value);
154
+ globalStore.depositWithdrawal.setPromo(null);
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) => {
156
+ disclosure.setOpen(details.open);
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' &&
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: () => {
164
+ api.setOpen(false);
165
+ }, children: status === 'failed' ? 'Try Again' : 'Ok' })) }) }))] }) })] }) })] }));
166
+ }
@@ -91,6 +91,11 @@ const OPTIONS = [
91
91
  label: 'GCash Standard Cash In',
92
92
  image: gcash,
93
93
  },
94
+ {
95
+ value: 'MAYA_WEBPAY',
96
+ label: 'Maya Webpay',
97
+ image: maya,
98
+ },
94
99
  ];
95
100
  export function PaymentMethods(props) {
96
101
  const options = props.options?.length
@@ -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.',
@@ -19,18 +19,15 @@ export function KYCVerificationStatus() {
19
19
  const icons = status === 'PENDING' ? bellIcon : alertIcon;
20
20
  return (_jsx(Dialog.Root, { open: globalStore.kycVerificationStatus.open, onOpenChange: (details) => {
21
21
  globalStore.kycVerificationStatus.setOpen(details.open);
22
- }, closeOnEscape: false, closeOnInteractOutside: false, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+3)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+4)] flex items-center justify-center", children: _jsx(Dialog.Content, { className: "mx-auto h-fit w-[450px] overflow-y-auto rounded-lg bg-bg-primary", children: _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mb-3xl grid h-[200px] w-full place-items-center rounded-xl bg-radial from-40% from-button-primary-bg to-bg-brand-solid", children: _jsx(Image, { src: icons, alt: "icon", className: "w-60 object-contain", draggable: false, width: 120, height: 120 }) }), _jsxs("h1", { className: "font-semibold text-lg text-white", children: [status === 'PENDING' && 'Verification in Progress', status === 'REJECTED' && 'Verification Rejected', status === 'UNVERIFIED' ||
23
- (status === 'CREATED' && 'Verification Required')] }), _jsxs("p", { className: "mb-4xl text-[#94969C] text-base", children: [status === 'PENDING' &&
22
+ }, closeOnEscape: false, closeOnInteractOutside: false, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+3)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+4)] flex items-center justify-center", children: _jsx(Dialog.Content, { className: "mx-auto h-fit w-[450px] overflow-y-auto rounded-lg bg-bg-primary", children: _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mb-3xl grid h-[200px] w-full place-items-center rounded-xl bg-radial from-40% from-button-primary-bg to-bg-brand-solid", children: _jsx(Image, { src: icons, alt: "icon", className: "w-60 object-contain", draggable: false, width: 120, height: 120 }) }), _jsxs("h1", { className: "font-semibold text-lg text-white", children: [status === 'PENDING' && 'Verification in Progress', status === 'REJECTED' && 'Verification Rejected', status === 'UNVERIFIED' && 'Verification Required'] }), _jsxs("p", { className: "mb-4xl text-[#94969C] text-base", children: [status === 'PENDING' &&
24
23
  `Your account verification is still under review. Please wait
25
24
  until it's approved before you can continue playing or
26
25
  depositing.`, status === 'REJECTED' &&
27
- 'Your account verification was not approved. Please resubmit your verification to regain full access.', status === 'UNVERIFIED' ||
28
- (status === 'CREATED' &&
29
- 'Your account is not yet verified. Please complete the verification process to continue playing or depositing.')] }), _jsxs(Button, { variant: "solid", className: twMerge('mb-2 w-full', status === 'PENDING' && 'hidden'), onClick: () => {
26
+ 'Your account verification was not approved. Please resubmit your verification to regain full access.', status === 'UNVERIFIED' &&
27
+ 'Your account is not yet verified. Please complete the verification process to continue playing or depositing.'] }), _jsxs(Button, { variant: "solid", className: twMerge('mb-2 w-full', status === 'PENDING' && 'hidden'), onClick: () => {
30
28
  globalStore.kycVerificationStatus.setOpen(false);
31
29
  globalStore.kyc.setOpen(true);
32
- }, children: [status === 'REJECTED' && 'Resubmit Verification', status === 'UNVERIFIED' ||
33
- (status === 'CREATED' && 'Verify Now')] }), _jsx(Button, { type: "button", variant: "outline", onClick: () => {
30
+ }, children: [status === 'REJECTED' && 'Resubmit Verification', status === 'UNVERIFIED' && 'Verify Now'] }), _jsx(Button, { type: "button", variant: "outline", onClick: () => {
34
31
  globalStore.kycVerificationStatus.setOpen(false);
35
32
  }, children: "Close" })] }) }) })] }) }));
36
33
  }
@@ -42,6 +42,7 @@ const DEPOSIT_TYPES_MAP = {
42
42
  AIO_PAY_MAYA: 'AiO Maya',
43
43
  AIO_GRAB_PAY: 'AiO Grab Pay',
44
44
  AIO_PALAWAN_PAY: 'AiO Palawan Pay',
45
+ MAYA_WEBPAY: 'Maya WebPay',
45
46
  };
46
47
  const DEPOSIT_STATUSES = [
47
48
  'ACCEPTED',
@@ -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: "development" | "production";
4
+ export declare const ENVIRONMENT: "production" | "development";
5
5
  export declare const INTERNALS__REPORT_WEB_VITALS: boolean;
@@ -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(\n gateway: LIBANGAN_PAY_IN\n ) {\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 onlineBankDepositGatewaySettings: depositGatewaySettings(\n gateway: ONLINE_BANK\n ) {\n ...DepositGatewaySettingsCoreData\n }\n qrphDepositGatewaySettings: depositGatewaySettings(gateway: QR_PH) {\n ...DepositGatewaySettingsCoreData\n }\n manualBankDepositGatewaySettings: depositGatewaySettings(\n gateway: MANUAL_BANK\n ) {\n ...DepositGatewaySettingsCoreData\n }\n manualUPIDepositGatewaySettings: depositGatewaySettings(\n gateway: MANUAL_UPI\n ) {\n ...DepositGatewaySettingsCoreData\n }\n pisoPayDepositGatewaySettings: depositGatewaySettings(\n gateway: PISO_PAY_CHECKOUT\n ) {\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(\n gateway: MAYA_APP\n ) {\n ...WithdrawalGatewaySettingsCoreData\n }\n instapayWithdrawalGatewaySettings: withdrawalGatewaySettings(\n gateway: INSTAPAY\n ) {\n ...WithdrawalGatewaySettingsCoreData\n }\n manualBankWithdrawalGatewaySettings: withdrawalGatewaySettings(\n gateway: MANUAL_BANK\n ) {\n ...WithdrawalGatewaySettingsCoreData\n }\n manualUPIWithdrawalGatewaySettings: withdrawalGatewaySettings(\n gateway: MANUAL_UPI\n ) {\n ...WithdrawalGatewaySettingsCoreData\n }\n ventajaWithdrawalGatewaySettings: withdrawalGatewaySettings(\n gateway: VENTAJA_DISBURSEMENT\n ) {\n ...WithdrawalGatewaySettingsCoreData\n }\n pisoPayWithdrawalGatewaySettings: withdrawalGatewaySettings(\n gateway: PISO_PAY_REMITTANCE\n ) {\n ...WithdrawalGatewaySettingsCoreData\n }\n }\n";
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";
@@ -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
- onlineBankDepositGatewaySettings: depositGatewaySettings(
2362
- gateway: ONLINE_BANK
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
  }
@@ -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) {