diff --git a/readme.txt b/readme.txt index 185522a9..8ff208ed 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: razorpay Tags: razorpay, payments, india, woocommerce, ecommerce Requires at least: 3.9.2 Tested up to: 5.7.2 -Stable tag: 2.8.0 +Stable tag: 2.8.1 Requires PHP: 5.6 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -41,6 +41,10 @@ This is compatible with WooCommerce>=2.4, including the new 3.0 release. It has == Changelog == += 2.8.1 = +* Bug fix in custom woocommerce order number issue. +* Tested up to Woocommerce 5.9.0 + = 2.8.0 = * Added Route module to split payments and transfer funds to Linked accounts. * Tested up to Woocommerce 5.8.0 diff --git a/woo-razorpay.php b/woo-razorpay.php index 6a52f2bf..b73d1f72 100644 --- a/woo-razorpay.php +++ b/woo-razorpay.php @@ -3,10 +3,10 @@ * Plugin Name: Razorpay for WooCommerce * Plugin URI: https://razorpay.com * Description: Razorpay Payment Gateway Integration for WooCommerce - * Version: 2.8.0 - * Stable tag: 2.8.0 + * Version: 2.8.1 + * Stable tag: 2.8.1 * Author: Team Razorpay - * WC tested up to: 5.8.0 + * WC tested up to: 5.9.0 * Author URI: https://razorpay.com */ @@ -586,7 +586,9 @@ private function getDefaultCheckoutArguments($order) $orderId = $order->get_order_number(); - $callbackUrl = $this->getRedirectUrl($orderId); + $wcOrderId = $order->get_id(); + + $callbackUrl = $this->getRedirectUrl($wcOrderId); $sessionKey = $this->getOrderSessionKey($orderId); $razorpayOrderId = get_transient($sessionKey); @@ -599,7 +601,8 @@ private function getDefaultCheckoutArguments($order) 'currency' => self::INR, 'description' => $productinfo, 'notes' => array( - self::WC_ORDER_ID => $orderId + self::WC_ORDER_ID => $orderId, + self::WC_ORDER_NUMBER => $wcOrderId ), 'order_id' => $razorpayOrderId, 'callback_url' => $callbackUrl, @@ -819,7 +822,7 @@ function generateOrderForm($data) { $data["_"] = $this->getVersionMetaInfo($data); - $wooOrderId = $data['notes']['woocommerce_order_id']; + $wooOrderId = $data['notes']['woocommerce_order_number']; $redirectUrl = $this->getRedirectUrl($wooOrderId); @@ -1116,7 +1119,10 @@ public function updateOrder(& $order, $success, $errorMessage, $razorpayPaymentI if($this->getSetting('route_enable') == 'yes') { $razorpayRoute = new RZP_Route_Action(); - $razorpayRoute->transferFromPayment($orderId, $razorpayPaymentId); // creates transfers from payment + + $wcOrderId = $order->get_id(); + + $razorpayRoute->transferFromPayment($wcOrderId, $razorpayPaymentId); // creates transfers from payment } if($virtualAccountId != null)