#Senhor-payment-methods
1 messages · Page 1 of 1 (latest)
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?
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
Ok
fair enough
when retrieving the subscriptions you can expand on the default_payment_method
https://stripe.com/docs/api/subscriptions/object#subscription_object-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.
This would give you the payment method used for this subscription
this is when i set the default payment method
i do it after the payment via webhook event
ok
i already tried the expand way
could you share your code for retrieving and expanding?
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
could you please send me the result?
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.
in fact in the customer object i find it
but there is only the last payment method used
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
but this way i will always get the last payment method, is that correct?
in my scenario i need all of the payment methods used for buying the associated subs
yes I see
in that case you should change the way you create the subscription
and add the default_payment_method for that subscription
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
Yes we have something called Checkout Sessions
Ok thank you
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.