#david_setupintent-paymentmethod
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/1283930255303774208
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
I'm looking at this documentation: https://docs.stripe.com/payments/save-and-reuse?platform=ios&mobile-ui=payment-element#charge-saved-payment-method
I asked our iOS developer if they could send the payment_method_id to our server when the user agrees to pay later but they're not sure if it's possible.
@amber surge What I'd recommend is to store in your database the id of the PaymentMethod after the SetupIntent is successfully confirmed. Server-side in the API when you look at the SetupIntent object it has the payment_method property: https://docs.stripe.com/api/setup_intents/object#setup_intent_object-payment_method
that's what you'd save in your database for future payments
david_setupintent-paymentmethod
Okay I'm seeing null for payment_method, though on additional reading, it's saying that payment_method will be stored in customer?
{
id: 'seti_1PyMVAGh7cRmN2H01IqvLpzR',
object: 'setup_intent',
application: null,
automatic_payment_methods: { allow_redirects: 'always', enabled: true },
cancellation_reason: null,
client_secret: 'seti_1PyMVAGh7cRmN2H01IqvLpzR_secret_Qq2aym9dEz8eAynGrkB0ANXHEli0BNL',
created: 1726183960,
customer: 'cus_PqeYGHzNQrUKnC',
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_configuration_details: { id: 'pmc_1M4cUtGh7cRmN2H08KJveH4N', parent: null },
payment_method_options: {
card: {
mandate_options: null,
network: null,
request_three_d_secure: 'automatic'
}
},
payment_method_types: [ 'card', 'bancontact', 'ideal', 'link', 'cashapp' ],
single_use_mandate: null,
status: 'requires_payment_method',
usage: 'off_session'
}
I'm looking at the docs for customer and I don't see a payment_method there
that SetupIntent hasn't been confirmed successfully yet though
it has status: 'requires_payment_method'
okay I think the problem is this is the original response when you created the SetupIntent. You didn't retrieve it after the confirmation
Use this after the user confirms?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
๐ hi there, yes after confirm you can use that API, or get it via the setup_intent.succeeded webhook event