Selected Payment Method as default in Pay Order again on Order Info page

If you have Administration>Settings>[Allow customers to pay order again if transaction was declined] checked The Payment Method the customer has selected on the Checkout page is not passed to the “Pay order again” section of the Order Confirmation Page (Order Info ).

Instead the payment method of lowest order value is selected by default. This causes confusion to customers when using “Direct Bank Deposit” offline payment method. To fix this I replaced the following code in \controllers\customers\orders.php

// Get payment method info
if (!empty($_REQUEST['payment_id'])) {
$order_payment_id = $_REQUEST['payment_id'];
} else {
$first = reset($payment_methods);
[B] $order_payment_id = $first['payment_id'];[/B]
}


with: // Get payment method info
if (!empty($_REQUEST['payment_id'])) {
$order_payment_id = $_REQUEST['payment_id'];
} else {
$first = reset($payment_methods);
[B] $order_payment_id = $order_info['payment_method']['payment_id'];[/B]
}