#mtanzi
1 messages · Page 1 of 1 (latest)
Hey Soma, yes let me do a quick summary!
We have a subscription based product, we initialize the subscription using the checkout session and then the customer can cancel and the subscription will end at the end of the billing period.
on top of that we have extra products that are charged by metering, at the end of the billing period if they exceed the allowance given we charge the overages, that works great within the subscription lifecycle.
The issue we have is when a subscription is cancelled... when the customer.subscription.deleted event is sent by Stripe, we listen to it and we calculate the final overage, then we create a one-off invoice (since the subscription is already terminated) for the customer to pay the overage of the last period.
The issue I found is that the payment method associated to the payment_intent is set to none even if the customer has a valid CC associated
If you need I can give you a PI id so that you can take a look
The issue I found is that the payment method associated to the payment_intent is set to none even if the customer has a valid CC associated
Is the customer having a default payment method set? https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method
If not, it's expected that the invoice will have no payment method.
the customer enter the payment method during the checkout session
isn't that set as a default payment method?
Can you share the customer ID (cus_xxx)?
sure.. here is an example cus_MWUQsCIJDYYzQf
Hey! Taking over for my colleague. Let me catch up.
sure!
Sorry for keeping you waiting
But for that customer, in fact there is an attached PaymentMethod but it's not set as default_payment_method in the customer invoice_settings:
You need to update the customer invoice_settings and set that PaymentMethod as default :
https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method