From bd90cb41bae5e431bdc33cd56412b163e4986b48 Mon Sep 17 00:00:00 2001 From: Ram Prakash Singh <45222925+ramth05@users.noreply.github.com> Date: Mon, 10 Jun 2024 13:53:30 +0530 Subject: [PATCH] 1cc fix version bump 4.6.7 (#559) * fixed variable check for 1cc flags and version bump 4.7.7 --- readme.txt | 6 +++++- woo-razorpay.php | 28 +++++++++++++++------------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/readme.txt b/readme.txt index a4c5b4a0..a8e5aa13 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: razorpay Tags: razorpay, payments, india, woocommerce, curlec, malaysia, ecommerce, international, cross border Requires at least: 3.9.2 Tested up to: 6.4.2 -Stable tag: 4.6.6 +Stable tag: 4.6.7 Requires PHP: 7.0 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -69,9 +69,13 @@ Razorpay is available for Store Owners and Merchants in == Changelog == += 4.6.7 = +* Fixed, Reduced 1cc preferences API features check. + = 4.6.6 = * Added, UT fixes. * Fixed, Reduced 1cc preferences API calls. +* ( Bug present, for 1cc settings, please use 4.6.7) = 4.6.5 = * Added, UT to SVN ignore list. diff --git a/woo-razorpay.php b/woo-razorpay.php index 26066d08..df1af7fd 100644 --- a/woo-razorpay.php +++ b/woo-razorpay.php @@ -3,8 +3,8 @@ * Plugin Name: 1 Razorpay: Signup for FREE PG * Plugin URI: https://razorpay.com * Description: Razorpay Payment Gateway Integration for WooCommerce.Razorpay Welcome Back Offer: New to Razorpay? Sign up to enjoy FREE payments* of INR 2 lakh till March 31st! Transact before January 10th to grab the offer. - * Version: 4.6.6 - * Stable tag: 4.6.6 + * Version: 4.6.7 + * Stable tag: 4.6.7 * Author: Team Razorpay * WC tested up to: 7.9.0 * Author URI: https://razorpay.com @@ -275,11 +275,11 @@ public function __construct($hooks = true) // Load preference API call only for administrative interface + razorpay payment settings page. if (current_user_can('administrator') && - empty($merchantPreferences) === true && - isset($_GET['tab']) === true && - $_GET['tab'] === 'checkout' && - isset($_GET['section']) === true && - $_GET['section'] === 'razorpay') + (empty($merchantPreferences['features']['one_click_checkout']) === true) && + (isset($_GET['tab']) === true) && + ($_GET['tab'] === 'checkout') && + (isset($_GET['section']) === true) && + ($_GET['section'] === 'razorpay')) { if (!empty($this->getSetting('key_id')) && !empty($this->getSetting('key_secret'))) { @@ -293,14 +293,16 @@ public function __construct($hooks = true) rzpLogError($e->getMessage()); } } - if (!empty($merchantPreferences['features']['one_click_checkout'])) { - $is1ccAvailable = true; - } + } - if (!empty($merchantPreferences['features']['one_cc_store_account'])) { - $isAccCreationAvailable = true; - } + if (!empty($merchantPreferences['features']['one_click_checkout'])) { + $is1ccAvailable = true; + } + + if (!empty($merchantPreferences['features']['one_cc_store_account'])) { + $isAccCreationAvailable = true; } + if ($is1ccAvailable) { $this->visibleSettings = array_merge($this->visibleSettings, array(