#sssakama
1 messages · Page 1 of 1 (latest)
hello! you will receive a setup_intent.succeeded event which you would be able to find the payment method id
thank you for your reply!
Looking at this response, I can't get the payment method id, where can I get it?
is your SetupIntent in succeeded status?
Yes, setup_intent succeeded and id was obtained
alright, do you have any other questions that i can help with?
How do I get the payment method id?
Even if I generate setup_intent, I can't get the payment method id.
are you listening for the setup_intent.succeeded event on your webhook?
webhook is not connecting.
Hi @icy crypt I'm taking over.
Can you tell me more about the webhook connection problem? did you see any error messages?
Hi @cunning sphinx
Haven't tried webhooks yet.
Does it mean that you will receive a response via webhook after setting up payment on the payment sheet in the app?
It depends on what events your webhook endpoint is listening to
Is it this?
https://stripe.com/docs/payments/save-and-reuse?platform=ios&ui=payment-sheet#ios-set-up-return-url
This is not a webhook, this is the return URL to redirect back to your iOS app.
You mean this?
https://stripe.com/docs/payments/handling-payment-events
Based on your earlier discussions with alex. My understanding is that you want to get the payment_method ID from a SetupIntent, and you should listen to setup_intent.succeeded event as Alex suggested.
If you are new webhook, the best way to get started is by following this guide https://stripe.com/docs/webhooks/quickstart
yes i want to get payment_method id from setUpIntent.
Handle the event in this guide you sent me
So, should I listen to the setup_intent.succeeded event?
Yes you are right
I got it!
I understand, thank you!
Excuse me, is it a SetupIntent object that can be obtained by linstening the webhook?
Yes, if you are listening to setup_intent.succeeded event
Checking the documentation, the response when creating setup_intent is null for payment_method.
But when I listen on the webhook, does the payment_method come with a value?
{
"id": "seti_1N3Aw52eZvKYlo2CzhnmSbLw",
"object": "setup_intent",
"application": null,
"automatic_payment_methods": null,
"cancellation_reason": null,
"client_secret": "seti_1N3Aw52eZvKYlo2CzhnmSbLw_secret_NooZwYO9j8sTCbAdJ8GFEr1cjb6k5b0",
"created": 1683002133,
"customer": "cus_NooZ4zOpmE0gpW",
"description": null,
"flow_directions": null,
"last_setup_error": null,
"latest_attempt": null,
"livemode": false,
"mandate": null,
"metadata": {},
"next_action": null,
"on_behalf_of": null,
"payment_method": null,
"payment_method_options": {
"card": {
"mandate_options": null,
"network": null,
"request_three_d_secure": "automatic"
}
},
"payment_method_types": [
"card"
],
"redaction": null,
"single_use_mandate": null,
"status": "requires_payment_method",
"usage": "off_session"
}
The status of this SetupIntent is requires_payment_method and that's why its payment_method is null.
What I just sent is the response of this API.
curl https://api.stripe.com/v1/setup_intents\
Is this the same as requires_payment_method?
requires_payment_method is a status of SetupIntent. It means it's waiting for payment method to be collected. You can learn more about the event lifecycle here https://stripe.com/docs/payments/intents?intent=setup
I see,
requires_payment_method
Finally, the status changes to succeeded. So I can get the payment method id when successful.