@opexa/portal-components 0.0.898 → 0.0.899
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/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/AurixPayQRPHDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/useAurixPayQRPHDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Withdrawal/VentajaWithdrawal/PaymentMethods.d.ts +10 -0
- package/dist/components/DepositWithdrawal/Withdrawal/VentajaWithdrawal/PaymentMethods.js +47 -0
- package/dist/components/DepositWithdrawal/Withdrawal/VentajaWithdrawal/VentajaWithdrawal.js +1 -1
- package/dist/components/DepositWithdrawal/utils.d.ts +2 -0
- package/dist/components/DepositWithdrawal/utils.js +11 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const AurixPayQRPHDepositContext: (props: {
|
|
2
2
|
value: {
|
|
3
|
-
status: "
|
|
3
|
+
status: "failed" | "idle" | "generating-qr-code" | "qr-code-generated" | "confirmed";
|
|
4
4
|
deposit: import("../../../../types").Deposit | null;
|
|
5
5
|
errorMessage: {
|
|
6
6
|
name: string;
|
|
@@ -13,7 +13,7 @@ export declare const AurixPayQRPHDepositContext: (props: {
|
|
|
13
13
|
} & {
|
|
14
14
|
children?: import("react").ReactNode | undefined;
|
|
15
15
|
}) => React.ReactNode, useAurixPayQRPHDepositContext: () => {
|
|
16
|
-
status: "
|
|
16
|
+
status: "failed" | "idle" | "generating-qr-code" | "qr-code-generated" | "confirmed";
|
|
17
17
|
deposit: import("../../../../types").Deposit | null;
|
|
18
18
|
errorMessage: {
|
|
19
19
|
name: string;
|
package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/useAurixPayQRPHDeposit.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export interface GenerateQRCodeInput {
|
|
|
5
5
|
promo?: string | null;
|
|
6
6
|
}
|
|
7
7
|
export declare function useAurixPayQRPHDeposit(): {
|
|
8
|
-
status: "
|
|
8
|
+
status: "failed" | "idle" | "generating-qr-code" | "qr-code-generated" | "confirmed";
|
|
9
9
|
deposit: Deposit | null;
|
|
10
10
|
errorMessage: {
|
|
11
11
|
name: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const QRPHDepositContext: (props: {
|
|
2
2
|
value: {
|
|
3
|
-
status: "
|
|
3
|
+
status: "failed" | "idle" | "generating-qr-code" | "qr-code-generated" | "confirmed";
|
|
4
4
|
deposit: import("../../../../types").Deposit | null;
|
|
5
5
|
errorMessage: {
|
|
6
6
|
name: string;
|
|
@@ -13,7 +13,7 @@ export declare const QRPHDepositContext: (props: {
|
|
|
13
13
|
} & {
|
|
14
14
|
children?: import("react").ReactNode | undefined;
|
|
15
15
|
}) => React.ReactNode, useQRPHDepositContext: () => {
|
|
16
|
-
status: "
|
|
16
|
+
status: "failed" | "idle" | "generating-qr-code" | "qr-code-generated" | "confirmed";
|
|
17
17
|
deposit: import("../../../../types").Deposit | null;
|
|
18
18
|
errorMessage: {
|
|
19
19
|
name: string;
|
|
@@ -5,7 +5,7 @@ export interface GenerateQRCodeInput {
|
|
|
5
5
|
promo?: string | null;
|
|
6
6
|
}
|
|
7
7
|
export declare function useQRPHDeposit(): {
|
|
8
|
-
status: "
|
|
8
|
+
status: "failed" | "idle" | "generating-qr-code" | "qr-code-generated" | "confirmed";
|
|
9
9
|
deposit: Deposit | null;
|
|
10
10
|
errorMessage: {
|
|
11
11
|
name: string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type PaymentMethodCrazywin } from '../../utils';
|
|
2
|
+
interface PaymentMethodsProps {
|
|
3
|
+
value?: PaymentMethodCrazywin;
|
|
4
|
+
onChange?: (value: PaymentMethodCrazywin) => void;
|
|
5
|
+
defaultValue?: PaymentMethodCrazywin;
|
|
6
|
+
options?: PaymentMethodCrazywin[];
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function PaymentMethods(props: PaymentMethodsProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Image from 'next/image';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
import { useControllableState } from '../../../../client/hooks/useControllableState.js';
|
|
5
|
+
import { CheckIcon } from '../../../../icons/CheckIcon.js';
|
|
6
|
+
import gcash from '../../../../images/gcash.png';
|
|
7
|
+
import instapay from '../../../../images/instapay.png';
|
|
8
|
+
import maya from '../../../../images/maya.png';
|
|
9
|
+
import { Checkbox } from '../../../../ui/Checkbox/index.js';
|
|
10
|
+
import { Field } from '../../../../ui/Field/index.js';
|
|
11
|
+
import { PaymentMethodDefinitionCrazywin, } from '../../utils.js';
|
|
12
|
+
const OPTIONS = [
|
|
13
|
+
{
|
|
14
|
+
value: 'INSTAPAY',
|
|
15
|
+
label: 'Instapay',
|
|
16
|
+
image: instapay,
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
value: 'GCASH',
|
|
20
|
+
label: 'GCash',
|
|
21
|
+
image: gcash,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
value: 'MAYA',
|
|
25
|
+
label: 'Maya',
|
|
26
|
+
image: maya,
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
export function PaymentMethods(props) {
|
|
30
|
+
const options = props.options?.length
|
|
31
|
+
? OPTIONS.filter((option) => props.options?.includes(option.value))
|
|
32
|
+
: OPTIONS;
|
|
33
|
+
const [value, setValue] = useControllableState({
|
|
34
|
+
value: props.value,
|
|
35
|
+
defaultValue: options[0].value,
|
|
36
|
+
onChange: props.onChange,
|
|
37
|
+
});
|
|
38
|
+
return (_jsxs("div", { className: "mb-6", children: [_jsx(Field.Label, { asChild: true, children: _jsx("div", { children: "Available payment methods" }) }), _jsx(Checkbox.Group, { value: [value], onValueChange: (newValue) => {
|
|
39
|
+
const lastValue = newValue.at(-1);
|
|
40
|
+
if (!lastValue)
|
|
41
|
+
return;
|
|
42
|
+
setValue(PaymentMethodDefinitionCrazywin.parse(lastValue));
|
|
43
|
+
}, className: "grid grid-cols-2 gap-x-4 gap-y-3", children: options.map((option) => (_jsxs(Checkbox.Root, { value: option.value, className: "flex cursor-pointer items-center justify-between rounded-xl border border-border-secondary ui-checked:border-border-brand-solid p-lg", children: [_jsx("div", { className: twMerge('rounded-xs bg-white px-sm py-[0.688rem]', option.value === 'GCASH' && 'bg-[#017EFF]'), children: _jsx(Image, { src: option.image, alt: "", width: 200, height: 40, className: twMerge('w-auto', option.value === 'LIBANGAN_PAY_IN' ||
|
|
44
|
+
option.value === 'VENTAJA_DISBURSEMENT'
|
|
45
|
+
? 'h-[2.5rem]'
|
|
46
|
+
: 'h-[1.063rem]'), draggable: false }) }), _jsx(Checkbox.Control, { className: "shrink-0", children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsx(Checkbox.HiddenInput, {})] }, option.value))) })] }));
|
|
47
|
+
}
|
|
@@ -29,10 +29,10 @@ import { Select } from '../../../../ui/Select/index.js';
|
|
|
29
29
|
import { parseDecimal } from '../../../../utils/parseDecimal.js';
|
|
30
30
|
import { AmountChoices } from '../../AmountChoices.js';
|
|
31
31
|
import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
|
|
32
|
-
import { PaymentMethods } from '../../PaymentMethods.js';
|
|
33
32
|
import { ActiveTurnoverRequirement } from '../ActiveTurnoverRequirement.js';
|
|
34
33
|
import { RequireFirstDeposit } from '../RequireFirstDeposit.js';
|
|
35
34
|
import { TransactionPasswordNotSet } from '../TransactionPasswordNotSet.js';
|
|
35
|
+
import { PaymentMethods } from './PaymentMethods.js';
|
|
36
36
|
export function VentajaWithdrawal() {
|
|
37
37
|
const depositWithdrawalProps = useDepositWithdrawalPropsContext();
|
|
38
38
|
const [paymentMethod, setPaymentMethod] = useState('INSTAPAY');
|
|
@@ -2,5 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import type { KnownDepositError, KnownWithdrawalError, WithdrawalError } from '../../types';
|
|
3
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", "INSTAPAY_GCASH", "INSTAPAY_PAYMAYA", "AURIX_PAY_GCASH", "AURIX_PAY_PAYMAYA", "AURIX_PAY_GRAB_PAY", "AURIX_PAY_QRPH"]>;
|
|
4
4
|
export type PaymentMethod = z.infer<typeof PaymentMethodDefinition>;
|
|
5
|
+
export declare const PaymentMethodDefinitionCrazywin: z.ZodEnum<["GCASH", "MAYA_APP", "MAYA", "ONLINE_BANK", "QRPH", "INSTAPAY", "LIBANGAN_PAY_IN", "VENTAJA_DISBURSEMENT", "PISO_PAY"]>;
|
|
6
|
+
export type PaymentMethodCrazywin = z.infer<typeof PaymentMethodDefinitionCrazywin>;
|
|
5
7
|
export type DepositWithdrawalErrors = KnownDepositError | KnownWithdrawalError | WithdrawalError | string;
|
|
6
8
|
export declare function explainError(error?: DepositWithdrawalErrors): string;
|
|
@@ -23,6 +23,17 @@ export const PaymentMethodDefinition = z.enum([
|
|
|
23
23
|
'AURIX_PAY_GRAB_PAY',
|
|
24
24
|
'AURIX_PAY_QRPH',
|
|
25
25
|
]);
|
|
26
|
+
export const PaymentMethodDefinitionCrazywin = z.enum([
|
|
27
|
+
'GCASH',
|
|
28
|
+
'MAYA_APP',
|
|
29
|
+
'MAYA',
|
|
30
|
+
'ONLINE_BANK',
|
|
31
|
+
'QRPH',
|
|
32
|
+
'INSTAPAY',
|
|
33
|
+
'LIBANGAN_PAY_IN',
|
|
34
|
+
'VENTAJA_DISBURSEMENT',
|
|
35
|
+
'PISO_PAY',
|
|
36
|
+
]);
|
|
26
37
|
const errorMap = {
|
|
27
38
|
DAILY_PURCHASE_OR_DEPOSIT_LIMIT_EXCEEDED: 'You have exceeded your daily purchase or deposit limit. Please try again tomorrow.',
|
|
28
39
|
INSUFFICIENT_BALANCE: 'You have insufficient balance for this transaction.',
|