#rasparac-Subscription
1 messages · Page 1 of 1 (latest)
You should still able to use the method above, when an event invoice.payment_succeeded arrives on a real payment (not trial one)
yep, but do i need to set default payment before trial ends?
how user will be charged when trial ends?
When trial_end is approaching, you will receive a invoice.created event. You would want to collect your customer Payment around that time
is there an easier way? We have also subscriptions without trial and those will get invoice.created.
Can i use single event to set payment method for subscriptions with trial and without trial?
Can i use fore example,
setup_intent.succeeded for tiral and payment_intent.succeeded without trial?
I believe invoice.created is fired in both cases, no?
yes, it's fired in both cases.
but i'm already listen for payment_intent and setup_intent succeeded and if i can use those two events i would use them.
Hey there! Taking over from @carmine salmon – just catching up
oke :). If something is not clear i can explain.
For a Subscription where there is no immediate payment (i.e. a trial) then there will be a Setup Intent to authorise the payment method for the off-session payments. So you should see setup_intent.succeeded events yes
You can get the Payment Method object ID from that event: https://stripe.com/docs/api/setup_intents/object#setup_intent_object-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.
nice. When that happens i can set default payment for the subscription. And when trials end i will get payment_intent.succeeded for new invoice which will be generated the start of billing period? In that case i will again update payment method? Can something go wrong if i update update subscription payment method two times with same payment_method id?
I'm asking this because users are also able to buy subscription without trial which will fire payment_intent.succeeded event and plan is to set payment method for the users who bought subscriptions without trial.
sorry for this questions but we wanna make sure that everything is ok with payments.
In that case i will again update payment method? Can something go wrong if i update update subscription payment method two times with same payment_method id?
I don't think anything will go wrong, the API may just error. You should be able to test this out
Otherwise just write logic in your application to check if the default_payment_method field is set on the Subscription
why asking this is because in some cases stripe dashboard does not show payment method when i go to customers and list all the customers.
Is that because i did not set default payment method?
If there's no payment methods listed on a Customer object then it sounds like they weren't attached. Do you have an example?
what example?
i do not attach payment method customer.
Flow is this:
- create customer
- create subscription
- insert credit card details and confirm subscription
i can see in dashboard that subscription has payment method, but it's not listed in customer object list
Do i need to also attach payment method to the customer?
An example Customer object
It's not really important if its set on the Subscription. Just means you'll need to collect payment data again for any future payments/subscriptions
Complete reference documentation for the Stripe JavaScript SDK.
is this the problem, we do not send anything
we want to attach payment method to the customer and not worry about that, later users can update that in billing portal
No, that's taken care of via the initial Setup Intent/Payment Intent. There's no problem per se. The subscription will be renewed using the payment method set on that object
You'll need to make a separate API call to do that then: https://stripe.com/docs/api/payment_methods/attach
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ok, that's nice. Only thing that i need to to is attach payment method to the customer.