From 587f89467db56eb3d545734698e692ce9bc7be89 Mon Sep 17 00:00:00 2001 From: Razorpay Date: Thu, 2 Jan 2025 16:22:57 +0530 Subject: [PATCH] suffixed transient --- woo-razorpay.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/woo-razorpay.php b/woo-razorpay.php index b8aa5d10..2d9f06fa 100644 --- a/woo-razorpay.php +++ b/woo-razorpay.php @@ -456,9 +456,9 @@ public function __construct($hooks = true) $is1ccAvailable = false; $isAccCreationAvailable = false; $merchantPreferences = []; - $checkout360Available = get_option('rzp_checkout360_status'); + $checkout360Available = get_option('rzp_checkout360_status', ""); - $merchantPreferences = get_transient(self::ONE_CC_MERCHANT_PREF); + $merchantPreferences = get_transient(self::ONE_CC_MERCHANT_PREF . "_" . $checkout360Available); // Load preference API call only for administrative interface + razorpay payment settings page. if (current_user_can('administrator') && @@ -466,8 +466,7 @@ public function __construct($hooks = true) (isset($_GET['tab']) === true) && ($_GET['tab'] === 'checkout') && (isset($_GET['section']) === true) && - ($_GET['section'] === 'razorpay') && - ($checkout360Available !== 'yes')) + ($_GET['section'] === 'razorpay')) { if (!empty($this->getSetting('key_id')) && !empty($this->getSetting('key_secret'))) { @@ -475,7 +474,7 @@ public function __construct($hooks = true) $api = $this->getRazorpayApiInstance(); $merchantPreferences = $api->request->request('GET', 'merchant/1cc_preferences'); - set_transient( self::ONE_CC_MERCHANT_PREF, $merchantPreferences, 7200 ); + set_transient( self::ONE_CC_MERCHANT_PREF . "_" . $checkout360Available, $merchantPreferences, 7200 ); } catch (\Exception $e) { rzpLogError($e->getMessage());