#Senhor-payment-methods

1 messages · Page 1 of 1 (latest)

stuck raft
#

Hi Senhor, I'll be there shortly with you with an answer

#

Just a quick question

#

when your user buys your monthly subscription do you use his default payment method?

hybrid timber
#

my flow is the following:
i have my subscription product created on stripe
i create a stripe customer
i create a subscription for that given customer
the customer pays via card

stuck raft
#

Ok

#

fair enough

#

This would give you the payment method used for this subscription

hybrid timber
#

this is when i set the default payment method

#

i do it after the payment via webhook event

stuck raft
#

ok

hybrid timber
#

i already tried the expand way

stuck raft
#

could you share your code for retrieving and expanding?

hybrid timber
#

i will try one more time live now, but yesterday i tried and nothing was returned

#

it was set to null

#

nothing

#

they are all set to nulol

#

null*

#

even with the expand

stuck raft
#

could you please send me the result?

hybrid timber
stuck raft
#

as per the documentation I sent you
ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over default_source. If neither are set, invoices will use the customer’s invoice_settings.default_payment_method or default_source.

hybrid timber
#

in fact in the customer object i find it

#

but there is only the last payment method used

stuck raft
#

So you should look in a null coalesce way for default_payment_method then default_source and if both are null than you find the invoice_settings.default_payment_method on the customer's object

#

Oh I see what you mean

hybrid timber
#

but this way i will always get the last payment method, is that correct?

stuck raft
#

yes

#

if he changes his

hybrid timber
#

in my scenario i need all of the payment methods used for buying the associated subs

stuck raft
#

yes I see

#

in that case you should change the way you create the subscription

#

and add the default_payment_method for that subscription

hybrid timber
#

i thought so

#

thanks, i got another question

#

i have also another subscription, but i don't want the customer to follow the front end payment flow; i have a "contact us" box where he can write to us and we'll negotiate the price.
My question is: is there a way to obtain a link from stripe, in order to send it to the customer, and when he opens it he can pay for the product?

#

like a one pager checkout form

stuck raft
#

Yes we have something called Checkout Sessions

hybrid timber
#

ok, i'll look it up; any specific resource to point me to?

#

resources*

stuck raft
hybrid timber
#

Ok thank you

stuck raft
hybrid timber
#

Thanks for the support and your time

#

have a nice day