Hi,
My subscription cancels immediately when there is a chargeback, which is by design. Users can then press "retry" to retry the payment.
I am using retryNow() in Laravel Mollie Cashier v2 and it correctly generates a new payment for the requested, code as such:
public function retryPayment(string $orderId): Redirector|RedirectResponse|Application
{
$order = Order::find($orderId);
if (!$order) {
$this->dispatch('banner_message', [
'type' => 'error',
'message' => __('Order not found.'),
]);
return redirect()->route('orders.index');
}
$order->retryNow();
$this->dispatch('banner_message', [
'type' => 'success',
'message' => __('Payment retry initiated.'),
]);
return redirect()->route('orders.show', $orderId);
}```
Upon succeeding this payment my subscription automatically gets put back on active, as preferred - but the new order_item that is created for its next payment has a process_at of now(). Seeing as Laravel Mollie Cashier v2 is optimistic this is now what happens:
Month starts, user gets payment (march)
User does chargeback the next day
User tries again in the same day and gets a new payment (march)
User succeeds and month starts
cashier command checks order_items
cashier charges user again
So now the user is charged twice in the same month and the next order_item is set for in two months (june).
The next payment should not be now() but be the next month, correct? How can I fix this.
I am using v2.12.1