#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/1281620722342428815
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- waleed-khalid_api, 1 minute ago, 14 messages
- waleed-khalid_api, 2 days ago, 15 messages
- waleed-khalid_api, 2 days ago, 35 messages
hye
Hello
I wanted to ask about this
https://docs.stripe.com/payments/ach-debit/set-up-payment?platform=web&payment-ui=stripe-hosted#web-create-customer
I have created checkout session to get customer details from customer
can you please confirm webhook is the one through which I will get checkout result, which should include payment method id
?
The recommended webhook is checkout.session.completed and then to expand details as necessary from there
If you are specifically setting up a PaymentMethod here then when you receive that Event you would expand setup_intent: https://docs.stripe.com/api/checkout/sessions/object#checkout_session_object-setup_intent
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Or even expand setup_intent.payment_method if you want the full details of the PaymentMethod beyond just its ID
great great lemme just check this one. I have to enable this event checkout.session.completed on stripe webhooks right ?
Yes
Yeah after you receive the Event you have to retreive the Checkout Session and expand the setup_intent.payment_method
See: https://docs.stripe.com/expand for info on how expansion works
lemme check
it will be like this ?
const session = await stripe.checkout.sessions.retrieve(
'cs_test_c1ZxMIaEDOCbxaigQy3NDxRtH1fynNTF3kSna8JGizb7Gtb4o8BwAgpmL7',
{
expand: ['setup_intent.payment_method'],
}
);
Yep
I got this pm_1Pw3IFRqbp84r6xNpK8so0kk id
now if I want to do the payment, what I need to do is passing customer id and payment id in payment intent right ?
Yep
lemme try that
hi
after expansion I got payment method id. After that I am using payment element with payment intent id. Look what I got on payment element
const paymentIntent = await stripe.paymentIntents.create({
amount: netAmount.amountInCents,
currency: 'usd',
customer: 'cus_QnenVkFTyBpbRe',
payment_method: 'pm_1Pw3mNRqbp84r6xNC5TMvga2',
setup_future_usage: 'off_session',
payment_method_types: ['us_bank_account'],
payment_method_options: {
us_bank_account: {
verification_method: 'instant',
financial_connections: {
permissions: ['payment_method', 'balances'],
},
},
},
});
this is my payment intent object, can you please help me out in this ?