jeudi 13 avril 2023

Update a monthly payment subscription to a single payment after a failed payment? Or allowing the customer to do so or not

Let say my customer has to pay 10$ every month for 12 month. But the first payment, or second or any other payment among the 12, will fail for x reason.

I'd like to offer the possibility to pay the full subscription (or what's left to pay) as a single payment.

Unfortunately when i update my line_item with a single payment price object, Stripe raise this error:

Stripe::InvalidRequestError - You cannot update a subscription in incomplete status in a way that results in a new invoice or invoice items. Only minor attributes, like metadata or default_payment_method, can be updated on such subscriptions.:

The status of a subscription can't be access or changed via the API. I guess I'd have to create a new one and offer the possibility to keep monthly payments or single payment ?

Any idea or good practice in this case ?

Aucun commentaire:

Enregistrer un commentaire