#Markan97
1 messages · Page 1 of 1 (latest)
I don't know how to get the payment intent object that paid for the subscription.
Hi there, apologies for the wait. Taking a look now
Can you be more explicit? What have you tried so far?
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.
Interesting. Do you have an example ID I can look at?
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.
Trial periods don't charge in advance on subscriptions. They create a $0 Invoice and no charges are created.
It looks like a similar thing is happening here, because the latest invoice has an amount of 0: https://dashboard.stripe.com/test/invoices/in_1M4qOmC59TMCvkXUYHrLXtDa
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I know, but again how do I get the information(paymentIntent) I need for a refund?
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
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).
Yeah, you could do it that way. Another alternative would be not to use a trial to extend a subscription time
It certainly helped me a lot to brainstorm this with you. Thank you a lot.
Sure thing!