#akzentmayer_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1260392323158638602
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
hello! gimme a while to take a look
hrm, so that specific PaymentIntent from the Invoice doesn't actually have setup_future_usage set to off_session, that's why you can't save the corresponding PaymentMethod after. Let me think of what options are possible for you
thank you! no rush
ahhh, is that a configuration thing? i know that when we use confirmPayment from the front end (elements provider or something?) we don't have many config options. also at this point we assume the customer and subscription are already created
oh ok, it looks like before we call confirmPayment we pass in some StripeElementsOptions to <Elements> one of which is a payment intent
I assume when that's created, this is where I want to add setup_future_usage=on_session
hrm, gimme a while more, it's a bit odd, because my own PaymentIntent (from a Subscription update) does have setup_future_usage=off_session
you'll want off_session actually, not on_session
try using confirmPayment with setup_future_usage="off_session" and see if that works
then you should be able to update the customer's default payment method after payment has been made https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
const { error } = await stripe.confirmPayment({
elements,
confirmParams: {
return_url: ${window.location.origin}/billing/transactions?invoice_id=${invoiceId},
payment_method_data: {
billing_details: billingDetailsForStripe,
},
},
});
where in here does setup_future_usage belong? i didn't see it in the documentation
or did you mean when I create the SetupIntent
https://docs.stripe.com/api/setup_intents/object#setup_intent_object-usage
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
we're currently using stripe.SetupIntent.create without specifying usage and it says that's the default ๐ค
๐ฎโ๐จ sorry, you should update the Invoice's PaymentIntent setup_future_usage to off_session [0] before confirming payment
[0] https://docs.stripe.com/api/payment_intents/update#update_payment_intent-setup_future_usage
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
What i suggested previously won't work with confirmPayment
gotcha!
after more investigation, we're currently using stripe.SetupIntent.create without specifying usage and it says that's the default ๐ค
SetupIntents and PaymentIntents are two entirely different objects
you're attempting to collect payment for an Invoice using it's underlying PaymentIntent
you can tell which one it is based off the object id
for example a PaymentIntent starts with pi_
yes yes got that. sifting through our graphql
we can pick this up tomorrow too
i can try a couple things and get back to you if needed!
we have coverage close to 24/6 for this channel so we'll still be here ๐
oh wow ๐ฒ
the thread would be closed after a while of inactivity, but you can always refer back to it when you start a new thread
in case you haven't seen this yet, you can also use test clocks to mimic the passing of time : https://stripe.com/docs/billing/testing/test-clocks