Skip to content

Commit 4a98818

Browse files
author
mayankamencherla
committed
Minor improvements
1 parent b428174 commit 4a98818

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

razorpay-payments.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -423,19 +423,18 @@ function check_razorpay_response()
423423
$order->update_status('failed');
424424
}
425425
}
426-
// We don't have a proper order id
427-
else if ($order_id !== null)
426+
else
428427
{
429428
$order = new WC_Order($order_id);
430429
$order->update_status('failed');
431430
$order->add_order_note('Customer cancelled the payment');
432431

433-
$this->msg['class'] = 'error';
434-
$this->msg['message'] = "An error occured while processing this payment";
435-
}
436-
else
437-
{
438-
if (isset($_POST['error']) === true)
432+
// We don't have a proper order id
433+
if ($order_id !== null)
434+
{
435+
$message = "An error occured while processing this payment";
436+
}
437+
else if (isset($_POST['error']) === true)
439438
{
440439
$error = $_POST['error'];
441440

@@ -451,7 +450,7 @@ function check_razorpay_response()
451450
$message = 'An error occured. Please contact administrator for assistance';
452451
}
453452

454-
$this->msg['class'] = 'Callback URL error';
453+
$this->msg['class'] = 'error';
455454
$this->msg['message'] = $message;
456455
}
457456

0 commit comments

Comments
 (0)