#fdc8cd4cff2c19e0d1022e78481ddf36

1 messages ยท Page 1 of 1 (latest)

wise pollenBOT
ebon light
#

this is how it looks from stripe dashboard, no default payment method

#

However in the detail of customer:

hearty estuary
ebon light
#

Whats the proper way to retrieve it off the customer then?

#

Do I just pick a random one of those? I suppose there is a better way to do it ๐Ÿ™‚

hearty estuary
#

Well that's up to you and your integration. I recommend giving your customer the choice to select the one they want to use

ebon light
#

Well the flow I got advised is to create a checkout session with initial payment + after such payment create a subscription with trial till the first day of month after next month (without user's choice)

#

Since the user already chosen this path beforee...

hearty estuary
#

Well you can use the payment method from their checkout session then

ebon light
#

Is there any ttl of such session?

hearty estuary
#

What do you mean?

ebon light
#

I am trying to get the payment method id from session as you said, however it seems like its not there. Do I have to wait for it? If so, how long?

#

"livemode": false,
"locale": null,
"metadata": {},
"mode": "payment",
"object": "checkout.session",
"payment_intent": "pi_xxx",
"payment_link": null,
"payment_method_collection": "always",
"payment_method_options": {},
"payment_method_types": [
"card",
"link"
],
"payment_status": "paid",

This is what I am receiving from such checkout session. There is no payment method id I can reuse, only payment intent id, which throws this:
No such PaymentMethod: 'pi_xxx'

(redacted)

hearty estuary
#

You'll need to get it off the associated payment intent

#

No such PaymentMethod: 'pi_xxx'

#

That's because you're trying to retrieve the payment intent as if it were a payment method but it's not

#

And the payment method will be on that object

ebon light
#

Alright ๐Ÿ‘ What happens if such payment method expires / is removed by user?

#
  • I assume such checkout session should be only used for those 2 actions and not reused in the future?
#

Does user receive any email / can update his subscription payment method or does such subscription just expire?

hearty estuary
#

If payment method is removed by the user you will have to collect another one. There's not a way around that. Checkout sessions aren't reusable. The payment method created is though because you passed setup_future_usage: off_session.

#

Does user receive any email / can update his subscription payment method or does such subscription just expire?
What do you mean?

ebon light
#

I was thinking maybe his card will expire in few days while he has it attached to the subscription. Will the user receive any notification from Stripe - maybe offering to update his payment method?

#

Or the payment will just fail -> subscription will expire?

hearty estuary
#

Under prevent failed payments

ebon light
#

Alright ๐Ÿ‘ I will implement the information gained during today and get in touch tomorrow if there is anything else. Thanks for your help!