#waleed-khalid_api
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/1280609101834883155
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello
The PaymentElement should automatically take care of redirecting the user to the authentication page and confirm their payment method.
Can you share the exact code you're using and what are you seeing on the client-side?
yes sure, lemme share payment intent code with you
const paymentIntent = await stripe.paymentIntents.create({
amount: netAmount.amountInCents,
currency: 'usd',
customer: user?.stripeCustomerId,
automatic_payment_methods: {
enabled: true,
},
});
this is the code to create payment intent
I am using stripe payment element
on frontend side its showing nothing
on frontend side it redirects me to the success url
payment_intent=pi_3Pv2EHRqbp84r6xN0P58RwV6&payment_intent_client_secret=pi_3Pv2EHRqbp84r6xN0P58RwV6_secret_Fv7acQWlXU9Dv0rsIwLbCyzrP&redirect_status=succeeded
Can you share the client-side code?
yes
{paymentIntentData?.paymentIntentClientSecret && (
<Elements
options={{
clientSecret: paymentIntentData?.paymentIntentClientSecret,
PaymentElementAppearance,
}}
stripe={loadStripe(paymentIntentData?.publishKey)}
>
<CheckoutForm />
</Elements>
)}
//element
checkout form
Ah hmm. So looking at the PaymentIntent status here: https://dashboard.stripe.com/test/logs/req_zKIwzir0g2xdKj
next action is
type: "verify_with_microdeposits",
verify_with_microdeposits: {
...
meaning customer would need to provide the descriptor code to verify their bank account. There are two options here:
- You can redirect the customer to
hosted_verification_urland have them provide the descriptor code - Or you can add your own UI to handle verification yourself: https://docs.stripe.com/payments/ach-debit/accept-a-payment?web-or-mobile=web&payments-ui-type=direct-api#microdeposit-only-verification
You can also choose to disable microdeposit verification and use instant only verification: https://docs.stripe.com/payments/ach-debit/accept-a-payment?web-or-mobile=web&payments-ui-type=direct-api#instant-only-verification
through instant it will not require any next verification step right ?
It may but that would be handled by PaymentElement automatically using financial connections
payment Element will handle that right ?
Yup
we don't need any additional configuration
Correct
it will save bank details for future use ?
You'd need to either use SetupIntent or setup_future_usage parameter to save the bank details
const paymentIntent = await stripe.paymentIntents.create({
amount: 1099,
currency: 'usd',
setup_future_usage: 'off_session',
customer: '{{CUSTOMER_ID}}',
payment_method_types: ['us_bank_account'],
payment_method_options: {
us_bank_account: {
verification_method: 'instant',
financial_connections: {
permissions: ['payment_method', 'balances'],
},
},
},
});
it will save bank details against customer and next time when I will send customer id it will show saved bank details
correct ?