#excid3-subscription-save
1 messages ยท Page 1 of 1 (latest)
@cobalt quest you don't need to do anything specific, it does this for you no?
Are you seeing otherwise?
I am seeing otherwise. The payment_intent generated from the subscription has setup_future_usage=nil
I'm trying to create a subscription, get the payment intent, render that in the browser, let the user confirm, then mark their payment method as default
on their Customer (not just the subscription)
the payment_intent.created event shows that setup_future_usage is null, after being auto-generated by the Subscription#create call
sure, but it still will work
like did you try to complete that PaymentIntent? Does it not save the PaymentMethod automatically?
"save_default_payment_method": "off"
still
Stripe Ruby is submitting it as off now on the latest API version
you're just looking at raw JSON and likely misunderstanding
did you try to complete that PaymentIntent?
It's completed
I'll complete checkout with the Payment Element
then on the redirect, I look up the PaymentIntent and the PaymentMethod
in order to mark that payment method as teh default invoice settings
and I get an error that I can't attach the PaymentMethod to the Customer
customer is null on the PaymentMethod, but it's set on the PaymentIntent
Sure, can you please share exact/detailed information?
Like exact PaymentIntent id you completed
What would you like? I can send you the API logs from Stripe
Let me find one that was failing that process
pi_3LpE3NKXBGcbgpbZ08Bc5LEq
Steps I took on this:
- PaymentIntent was generated by a subscription
- Add payment method
- Confirm payment intent
- Payment succeeds
- PaymentMethod is not attached to a customer
(looking)
ah I think it's because you passed off_session: true in that Subscription creation
do you know why you do that?
Always have
it doesn't make sense honestly, you're defaulting to incomplete, you're going to complete it on session
so you shouldn't be setting this at all
Gotcha. It's something we've just always had in there since the SCA stuff came out.
Let me comment that out and give it a try
๐
keep me posted
I agree it's quite confusing this behaviour and it's partly why we built the "save" behaviour
I think that did the trick ๐
yay!
It's been pretty confusing, for sure
One of the pain points I've been facing is trying to create a Checkout-like experience on a single page in-app. Adding billing and promo codes to a customer / subscription ideally updates that payment intent automatically to recalculate the tax and total price.
Hopefully that'll be doable soon. Right now we've got it split into two pages so that we can collect billing address before creating the subscription
Yeah that's unfortunately not possible for now though it's something we want to fix.
Subscription creation kind of "lock" everything on creation and the underlying Invoice is immutable
That's what I figured. Will be nice to have that!
Thanks for your help today! I don't think I would have figured out it was off_session ๐คช
yeah I was writing the question to my team because I was so confused myself
I was like "come on I know this works" so I was summarizing all I could find in your request
LOL
and literally saw off_session: true as I was going to post my question internally