How to cancel a Stripe subscription price change?

Viewed 22

The customer, 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 customer is redirected to the payment confirmation page. And then the customer changed his mind and did not confirm the payment. For example, he saw that he chose the wrong price. The subscription is considered inactive.

How can I cancel/delete the last invoice and return to the previous subscription price?

0 Answers
Related