Repay The Decline Order (Storefront_Rest_Api)

How can I redirect the failed order to the payment processor without creating a new order.

order_id : 232 (failed payment transaction)

order_id : 232 (repay payment transaction)

Because every time an unsuccessful order is requested to be paid again, a new order number is received.

The short gist is to redirect the same order back to the payment processor.

https://docs.cs-cart.com/latest/user_guide/orders/order_statuses/allow_repay.html

how can I do it.

Repay function should not create new order. Something is wrong on your CS-Cart installation

Let me update my question as follows.

How can I pay again for the rejected order in the mobile application.

because I don't want a new order to be created every time.

This works fine on web side but I don't know how to do it with mobile app api.

IRedirectionPayment (payment method is used.)

.

.

.

. Something like this code should work.

.

    // Remove previous failed order
    if (!empty($cart['failed_order_id']) || !empty($cart['processed_order_id'])) {
        $_order_ids = !empty($cart['failed_order_id']) ? $cart['failed_order_id'] : $cart['processed_order_id'];
    foreach ($_order_ids as $_order_id) {
        fn_delete_order($_order_id);
    }
    /**
     * Executes when placing an order on checkout after failed orders are deleted.
     *
     * @param array $cart     Cart data
     * @param array $auth     Authentication data
     * @param array $params   Request parameters
     * @param int   $order_id Deleted order ID
     */
    fn_set_hook('checkout_place_order_delete_orders', $cart, $auth, $params, $_order_ids);

    $cart['rewrite_order_id'] = $_order_ids;
    unset($cart['failed_order_id'], $cart['processed_order_id']);
}

How can we delete the failed order and create a new order?

How can we do this with rest api.

Anyone have knowledge?

Sorry, I cannot help you without detailed examination