Commit 846560d4 by Arjun Jhukal

user update validation and fortpay error

parent 26f803b2
......@@ -20,7 +20,7 @@ export const PlayerValidationSchema = (isEdit: boolean) => Yup.object().shape({
// wallet_address: Yup.string().nullable(),
// address: Yup.string().required("Address is required"),
// city: Yup.string().required("City is required"),
postal_code: Yup.string().required("Zip code is required"),
// postal_code: Yup.string().required("Zip code is required"),
state: Yup.string().required("State is required"),
// ssn: Yup.string().required("SSN is required"),
gender: Yup.string().required("Gender is required"),
......
......@@ -98,6 +98,8 @@ export default function EditUserProfile({ id, buttonLabel }: { id: string, butto
}
})
console.log("User Data:", formik.errors);
const formattedData = user
? {
data: {
......
......@@ -106,6 +106,7 @@ export default function PaymentForm({ id, amount, type }: DepositProps & { type:
exp: response.card.exp,
number: response.card.number,
hash: response.card.hash,
status:"success",
}).unwrap();
// Backup auth before redirecting to success page
......@@ -113,6 +114,17 @@ export default function PaymentForm({ id, amount, type }: DepositProps & { type:
router.push(`/buy-coins/${id}/success`);
} catch (e: any) {
await payViaFortPay({
id,
amount,
type: type as PaymentModeProps,
payment_token: response.token,
bin: response.card.bin,
exp: response.card.exp,
number: response.card.number,
hash: response.card.hash,
status: "failed",
}).unwrap()
dispatch(
showToast({
message: e?.data?.message || 'Unable to deposit',
......
......@@ -72,10 +72,10 @@ export const transactionApi = createApi({
}),
deposit: builder.mutation<DepositResponseProps, DepositProps>({
query: ({ id, amount, type, payment_token, number, hash, exp, bin }) => ({
query: ({ id, amount, type, payment_token, number, hash, exp, bin, status }) => ({
url: `/api/payment/${id}`,
method: "POST",
body: { amount: amount, type: type, payment_token, number, hash, exp, bin }
body: { amount: amount, type: type, payment_token, number, hash, exp, bin ,status}
}),
invalidatesTags: ["Deposit"]
}),
......
......@@ -11,6 +11,7 @@ export interface DepositProps {
exp?: string;
number?: string;
hash?: string;
status?: "success" | "failed";
// type: response.card.type
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment