#Markan97

1 messages · Page 1 of 1 (latest)

heady lightBOT
blazing plume
#

I don't know how to get the payment intent object that paid for the subscription.

clever thunder
#

Hi there, apologies for the wait. Taking a look now

#

Can you be more explicit? What have you tried so far?

blazing plume
#

I want to cancel + refund subscriptions via API call.

#

I don't know how I can "pluck" the paymentIntent ID of a paid subscription Invoice.

#

When I expand latestInvoice, I get null as paymentIntent.

clever thunder
#

Interesting. Do you have an example ID I can look at?

blazing plume
#

yes

#

sub_1M4qMVC59TMCvkXUlPxRJC6u

#
"payment_intent": null,```
#

I used the trial period to charge in advance for the subscription. When I want to cancel/refund, I first end the trial period. Could the problem be because the invoice takes from the customer's credit balance?

#

But again, I should be able to access that data.

clever thunder
blazing plume
#

I know, but again how do I get the information(paymentIntent) I need for a refund?

clever thunder
#

It looks like the customer's balance paid for the invoice, so you can't refund it.

#

If there's no payment, there's no refund

blazing plume
#

So one of the solutions is that when I charge, I save that paymentIntent ID on my side.

#

I used the trial period to extend the subscription time. When I want to cancel/refund it (we do a full refund), I first have to cancel the trial period (if it's still in it) and do a full refund.
Since in that situation I can't get the paymentIntent object from Stripe with which it was charged, I assume that the only solution for me at the moment when I charge is to store that data on my side of the application (DB).

clever thunder
#

Yeah, you could do it that way. Another alternative would be not to use a trial to extend a subscription time

blazing plume
#

It certainly helped me a lot to brainstorm this with you. Thank you a lot.

clever thunder
#

Sure thing!