Skip to content

Commit

Permalink
Merge pull request #212 from razorpay/success-msg-bug-fix
Browse files Browse the repository at this point in the history
Bug fix for success message in case of guest user checkout
  • Loading branch information
ChetanGN committed Dec 20, 2021
2 parents 08cf2a0 + 3c10738 commit 400c228
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: razorpay
Tags: razorpay, payments, india, woocommerce, ecommerce
Requires at least: 3.9.2
Tested up to: 5.8.2
Stable tag: 2.8.3
Stable tag: 2.8.4
Requires PHP: 5.6
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -41,6 +41,9 @@ This is compatible with WooCommerce>=2.4, including the new 3.0 release. It has

== Changelog ==

= 2.8.4 =
* Bug fix for guest checkout thank you message in order summary page.

= 2.8.3 =
* Updated Route module settings and added a note for creating reverse transfer.
* Tested up to Woocommerce 5.9.0
Expand Down
14 changes: 9 additions & 5 deletions woo-razorpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Plugin Name: Razorpay for WooCommerce
* Plugin URI: https://razorpay.com
* Description: Razorpay Payment Gateway Integration for WooCommerce
* Version: 2.8.3
* Stable tag: 2.8.3
* Version: 2.8.4
* Stable tag: 2.8.4
* Author: Team Razorpay
* WC tested up to: 5.9.0
* Author URI: https://razorpay.com
Expand Down Expand Up @@ -176,6 +176,8 @@ protected function initHooks()
add_action('woocommerce_update_options_payment_gateways', $cb);
add_action( "woocommerce_update_options_payment_gateways", array($this, 'autoEnableWebhook'));
}

add_filter( 'woocommerce_thankyou_order_received_text', array($this, 'rzpThankYouMessage'), 20, 2 );
}

public function init_form_fields()
Expand Down Expand Up @@ -1066,6 +1068,11 @@ protected function verifySignature($orderId)
$api->utility->verifyPaymentSignature($attributes);
}

public function rzpThankYouMessage( $thank_you_title, $order )
{
return self::DEFAULT_SUCCESS_MESSAGE;
}

protected function getErrorMessage($orderId)
{
// We don't have a proper order id
Expand Down Expand Up @@ -1109,9 +1116,6 @@ public function updateOrder(& $order, $success, $errorMessage, $razorpayPaymentI

if (($success === true) and ($order->needs_payment() === true))
{
$this->msg['message'] = $this->getCustomOrdercreationMessage() . "  Order Id: $orderId";
$this->msg['class'] = 'success';

$order->payment_complete($razorpayPaymentId);
$order->add_order_note("Razorpay payment successful <br/>Razorpay Id: $razorpayPaymentId");

Expand Down

0 comments on commit 400c228

Please sign in to comment.