#bachir_error
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1227635608298459205
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Do you have the ID of a time that this succeeded? As far as I know, you should need to verify the accounts each time
I can't find the attach query that succeeded in the logs, but you can see here that this ACH payment succeeded https://dashboard.stripe.com/payments/pi_3P3q4WH5tvrIOuhg1FbnmHo0
For that payment, it looks like the subscription was created with an already attached payment method https://dashboard.stripe.com/logs/req_YCaxI3MUlu2cqo
It does look like that PM was created and attached similarly to the request that you sent before, looking in to what the difference is
Can you send me your code for setting up the payment element and creating the payment method?
sure
I truncated what I could - code is way more complex so I hope this is helpful:
client:
import { PaymentElement as StripePaymentElement } from "@stripe/react-stripe-js";
const stripePaymentMethodTypes = listPaymentMethods(...)
const options: StripeElementsOptions = {
mode: stripeRecurrenceInterval ? ("subscription" as const) : ("payment" as const),
amount: displayedFormAmountWithTip || 100,
currency,
appearance: {},
paymentMethodTypes: stripePaymentMethodTypes,
// setupFutureUsage: "off_session" as const,
paymentMethodOptions: {
us_bank_account: {
financial_connections: { permissions: ["payment_method" as const] },
},
},
paymentMethodCreation: "manual" as const,
setupFutureUsage: isPadOrAch ? ("off_session" as const) : undefined,
};
return(
<Elements key={locale} stripe={stripeInstance} options={options}>
<StripePaymentElement
id="payment-element"
// When have a handler on our custom accordion, so this one becomes redundant
onChange={showCustomAccordion ? undefined : handleStripePaymentMethodChange}
options={paymentMethodOptions}
onLoaderStart={onLoaderStart}
onReady={onReady}
/>
</Elements>)
server:
this.getStripeProvider(organizationCountry).paymentMethods.attach(stripePaymentMethodId, {
customer: stripeCustomerId,
});
return this.getStripeProvider(country).subscriptions.create(params);
wait, I didn't send the create payment method part on the frontend
client (code is triggered on form submit):
const elements = useElements();
const res = await elements?.submit();
if (res.error) {
return;
}
const billing_details = getBillingDetails(submitCommandInput.paymentInput, organization);
let paymentMethod: StripePaymentMethod | null = null;
// Create the PaymentMethod using the details collected by the Payment Element
const { error, paymentMethod: paymentMethod } = await stripe.createPaymentMethod({
elements,
params: {
billing_details,
},
})
if (error) {
return;
}
// This calls the server and attaches the PM + creates the subscription when recurrent payment
const submitResponse = await handleSubmitCommand({
...submitCommandInput,
stripePaymentMethodId: paymentMethod.id,
});
Hello! I'm taking over and catching up...
I think this is because sometimes people choose to perform manual verification of bank accounts instead of instant verification. Manual verification takes several business days because it uses microdeposits: https://docs.stripe.com/payments/ach-debit/accept-a-payment?web-or-mobile=web&payments-ui-type=direct-api#web-verify-with-microdeposits
You can specify instant when creating the Payment Intent: https://docs.stripe.com/api/payment_intents/create#create_payment_intent-payment_method_options-us_bank_account-verification_method
That's not really recommended; it's going to prevent some people from paying (the ones who can't instantly verify their account).
They already can't pay because of the error I sent ๐ Or do you recommend another way for these users ?
Your integration should account for manual verification that takes several days to happen.