#idhruv
1 messages · Page 1 of 1 (latest)
it's because the amount_due on that Invoice is 0, so there is nothing to pay.
it's 0 because the customer had an existing positive balance(from e.g paying previous negative invoices due to prorated changes) so it was applied. (https://dashboard.stripe.com/test/customers/cus_MLtD4v7ngE4tw6/balance_transactions)
okay so how can i solve this?
do i need to topup customer account?
not able to fully grasp this logic
there's nothing to solve really.
read https://stripe.com/docs/billing/customer/balance and then let us know what is unclear!
my problem is i am utilizing the payment_intent value that i normally get after finalizing the invoice generated by subscription schedule
in this case getting null value entirely breaks my workflow
i want to always return a value for payment_intent
you should change your flow to be able to handle it being null, instead.
It can be null if the customer had a negative balance, or if the schedule created the subscription as a trial period, or if a coupon was used. It would be more correct and robust for your code to handle that case! (if you finalize the invoice and the amount_due is 0 and there's no PaymentIntent, you can check if the status is paid already and if not, call the Invoice Pay endpoint, which will just activate the subscription without needing to do anything else on the frontend; for example).
okk leme check. thanks
as per your response could you please tell me which status should i check if the amount_due is 0 and the payment_intent is null. Is it the status of finalize invoice response?
in the case of finalize invoice response i am getting status: 'open'
Hey! Taking over for my colleague. Let me catch up.
cool
Sorry for my late reply,
could you please tell me which
statusshould i check if the amount_due is 0 and the payment_intent is null. Is it the status of finalize invoice response?
when the invoice is finalized, the status in the invoice should be open, then you check if its amount=0 and payment_intent==null, if so you you call the invoice Pay endpoint, which will activate the subscription as my colleague mentioned above
https://stripe.com/docs/api/invoices/pay
okay
let me check this
okay so if i directly call invoice pay endpoint without checking if the card requires 3ds authentication then also the workflow is not correct.
for e.g. if the customer uses card which is 3ds enabled to start monthly subscription on our service, then we must always get payment intent to know if the card requires further action
if I directly activate subscription by invoice pay method that is mentioned above i will have to skip this step right
Actually if the invoice has amount=0 that means no PaymentIntent was genrerate, then no action will be done on the connected PaymentMethod, even if the card requires 3DS. In other words the invoice pay action will be transaprent