#waleed-khalid_api

1 messages · Page 1 of 1 (latest)

spring epochBOT
#

👋 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.

rotund river
#

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?

whole ingot
#

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

rotund river
#

Can you share the client-side code?

whole ingot
#

yes

#

{paymentIntentData?.paymentIntentClientSecret && (
<Elements
options={{
clientSecret: paymentIntentData?.paymentIntentClientSecret,
PaymentElementAppearance,
}}
stripe={loadStripe(paymentIntentData?.publishKey)}
>
<CheckoutForm />
</Elements>
)}

#

//element

rotund river
#

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:

whole ingot
#

through instant it will not require any next verification step right ?

rotund river
#

It may but that would be handled by PaymentElement automatically using financial connections

whole ingot
#

payment Element will handle that right ?

rotund river
#

Yup

whole ingot
#

we don't need any additional configuration

rotund river
#

Correct

whole ingot
#

it will save bank details for future use ?

rotund river
#

You'd need to either use SetupIntent or setup_future_usage parameter to save the bank details

whole ingot
#

can I use setup_future_usage parameter in same payment intent stripe api

#

?

rotund river
#

Yup

#

The instant only verification doc I shared has an example for that

whole ingot
#

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 ?

rotund river
#

Yup

#

Try it out

#

to be 100% certain