#idhruv

1 messages · Page 1 of 1 (latest)

late egretBOT
proud flicker
#

it's because the amount_due on that Invoice is 0, so there is nothing to pay.

glacial knoll
#

okay so how can i solve this?

#

do i need to topup customer account?

#

not able to fully grasp this logic

proud flicker
#

there's nothing to solve really.

proud flicker
glacial knoll
#

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

proud flicker
#

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).

glacial knoll
#

okk leme check. thanks

glacial knoll
#

in the case of finalize invoice response i am getting status: 'open'

nova prism
#

Hey! Taking over for my colleague. Let me catch up.

glacial knoll
#

cool

nova prism
#

Sorry for my late reply,

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?
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

glacial knoll
#

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

nova prism
#

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

glacial knoll
#

ohhk

#

that too is correct!