Sep 10, 2022
0
Level 1
How to cancel a Stripe subscription price change?
The client, through the checkout page, subscribes to the product at "price 1". He has 3D confirmation on the card!!! He later states his desire to change the price to "price 2". I use the following code to implement this:
try {
$subscription->anchorBillingCycleOn()->swapAndInvoice($plan_id);
} catch (IncompletePayment $exception) {
return redirect()->route('cashier.payment', [$exception->payment->id, 'redirect' => route('subscription.success')]);
}
The subscription price is updated and the invoice is marked as "pending", and the client is redirected to the payment confirmation page. And then the client changed his mind and did not confirm the payment. The subscription is considered inactive.
How can I cancel/delete the last invoice and return to the previous subscription price?
Please or to participate in this conversation.