#Jasuno
1 messages ยท Page 1 of 1 (latest)
hey there, how are you triggering this confirmation? Can you share your client code and the call that leads to this?
const processPayment = async () => {
let response;
if (paymentRef.current.payWithBank) {
response = await paymentRef.current.payWithBank();
}
if (paymentRef.current.payWithCard) {
response = await paymentRef.current.payWithCard();
}
const { error, setupIntent } = response || {};
if (error) {
return toast({
title: "Error",
position: "top-right",
description: error.message,
status: "error",
duration: 5000,
isClosable: true,
});
} else {
if (response?.setupIntent && paymentIntent) {
await confirmPayment({
payment_intent_id: paymentIntent?.id,
payment_method: setupIntent?.payment_method,
});
}
if (
response?.isAutoChargeEnabled &&
invoice?.lines?.data[0]?.subscription
) {
await setDefaultPaymentMethod({
subscription_id: invoice.lines.data[0].subscription,
payment_method: setupIntent?.payment_method,
});
}
toast({
title: "Success",
position: "top-right",
description: "Your payment was processed successfully",
status: "success",
duration: 5000,
isClosable: true,
});
router.push(TenantRouterPaths.PAYMENTS);
}
};
and this is whats going on in confirm payment intent
const { payment_intent_id, payment_method } = data;
const payment = await stripe.paymentIntents.confirm(payment_intent_id, {
payment_method: payment_method,
});
return payment;
this is in the backend
Hello?
Hello ๐
Give me a moment to take a look
Ok thanks
The request you shared initially is a setup intent confirmation ( https://dashboard.stripe.com/test/logs/req_7VExtpJBnSAasY ) but the code you're showing is focused on payments. Is there setup-specific code that might be more relevant here?
So the process is that we first set up the payment method and then we use that payment method and the we use the payment method id to process the transaction
also it looks like the test account number you're using relies on micro-deposit verification
https://stripe.com/docs/payments/acss-debit/accept-a-payment?platform=web#test-account-numbers
Since you have the verification set to instant only, I wonder if that's causing the API to return an error
Can you try removing verification_method: "instant" from SetupIntent creation?
we are trying to use the verification_method: "instant" to bypass the micro transactions which take a long time this is the way i was told to do that after a few conversations here and with customer support
I see. Hmm ๐ค
I can link the other conversations if you like
All good. Can you confirm if omitting the parameter fixes the error?
I'll look around to see if this is expected behaviour or not
It probably will since thats what caused the error, it was working fine before
Can you share the code you're using to Setup the payment method?
I don't see it above
here it is without the verification methos
const userId = context.auth?.uid;
const UserSecret = (
await admin
.firestore()
.collection("collection")
.doc(userId || "")
.get()
).data() as UserPrivate;
const setupIntent = await stripe.setupIntents.create({
customer: UserSecret.stripeCustomerId,
payment_method_types: ["acss_debit", "card"],
payment_method_options: {
acss_debit: {
currency: "cad",
mandate_options: {
payment_schedule: "interval",
interval_description:
"Same day every month since the start of the lease agreement",
transaction_type: "business",
},
},
},
});
return setupIntent.client_secret;
}
And the code that confirms the SetupIntent client-side?
No that just create the client token to be used, the setup stuff are being done by stripe.js which is in the client side code i sent earlier
for SetupIntents, you'd need to use confirmSetup(...) function and not confirmPayment
I don't see a confirmSetup call in the code you've shared thus far
Oooooh ok yeah i forgot to send that give me a sec
thats here
const onSubmit = async (values: {
accountNumber: string;
institutionNumber: string;
transitNumber: string;
}) => {
const stripe = await stripePromise;
const bankData = {
payment_method: {
acss_debit: {
account_number: values.accountNumber,
institution_number: values.institutionNumber,
transit_number: values.transitNumber,
},
billing_details: {
email: authData?.email || "",
name: authData?.displayName || "",
},
},
};
const response = await stripe?.confirmAcssDebitSetup(clientKey, bankData);
return {
...response,
isAutoChargeEnabled: true,
};
};
Hmm, okay! let me see if I can reproduce this on my end..
All good, I was able to reproduce this on my end
Looks like we're testing this flow incorrectly
You shouldn't be passing payment_method.acss_debit hash when calling confirmAcssDebitSetup
If you omit that, financial connections UI should take over and collect that information for you
Here is the thing we are in canada so finacial connections are not supported here which was the problem i had in my first thread
OH I see
Lol this escalated
My understanding is that we do support Financial Connections in Canada
Can you share the link to the previous thread where you were told we don't?
thanks, can you quickly give financial connections a try?
Financial Connections has many different components apart from just verification
Some of it are US only
However, ACSS verification should work
try omitting
account_number: values.accountNumber,
institution_number: values.institutionNumber,
transit_number: values.transitNumber,
},```
I did, you can see here req_3TutVnG6JyEURl when i tried to create the client token if throws an error
Ah you don't need to create a session separately.
confirmAcssDebitSetup would handle this automatically
interesting, but confirmAcssDebitSetup takes a client id as the first param i believe
It would take a SetupIntent client-secret
So the same exact code you currently have should work if you just remove following
account_number: values.accountNumber,
institution_number: values.institutionNumber,
transit_number: values.transitNumber,
},```
ok give me one sec ill try that out
๐
THAT WORKS ๐๐ thanks been at this all day you are like the 4th support person i talked to
Glad it worked ๐
Apologies for the confusion earlier.
No don't worry about it everyone i spoked to was really nice and tried their best, i guess there was missing context, but thank you all so much
NP! Happy to help
the funny to think that the problem was removing 3 lines ๐