Plugin Directory

Changeset 3446121


Ignore:
Timestamp:
01/24/2026 12:42:20 PM (7 weeks ago)
Author:
razorpay
Message:

Update: 4.8.0

Location:
woo-razorpay/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • woo-razorpay/trunk/readme.txt

    r3436262 r3446121  
    44Requires at least: 3.9.2
    55Tested up to: 6.9
    6 Stable tag: 4.7.9
     6Stable tag: 4.8.0
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    6969
    7070== Changelog ==
     71
     72= 4.8.0 =
     73* Store location–specific title and description configuration.
    7174
    7275= 4.7.9 =
  • woo-razorpay/trunk/woo-razorpay.php

    r3436262 r3446121  
    44 * Plugin URI: https://razorpay.com
    55 * 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.
    6  * Version: 4.7.9
    7  * Stable tag: 4.7.9
     6 * Version: 4.8.0
     7 * Stable tag: 4.8.0
    88 * Author: Team Razorpay
    99 * WC tested up to: 10.3.4
     
    217217        const WC_ORDER_NUMBER                = 'woocommerce_order_number';
    218218
    219         const DEFAULT_LABEL                  = 'Credit Card/Debit Card/NetBanking';
    220         const DEFAULT_DESCRIPTION            = 'Pay securely by Credit or Debit card or Internet Banking through Razorpay.';
     219        const DEFAULT_LABEL                  = 'UPI, Cards, NetBanking';
     220        const DEFAULT_DESCRIPTION            = 'Pay securely via UPI, Credit/Debit Card, or Internet Banking through Razorpay.';
    221221        const DEFAULT_SUCCESS_MESSAGE        = 'Thank you for shopping with us. Your account has been charged and your transaction is successful. We will be processing your order soon.';
    222222
     
    453453            add_filter( 'woocommerce_thankyou_order_received_text', array($this, 'getCustomOrdercreationMessage'), 20, 2 );
    454454        }
     455       
     456        private function getGeoBasedTitleAndDescription($key)
     457        {
     458            $dbValue = ($key === 'label')
     459                ? $this->getSetting('title')
     460                : (($key === 'description') ? $this->getSetting('description') : '');
     461           
     462            if (empty($dbValue) === false)
     463            {
     464                return $dbValue;
     465            }
     466           
     467            $locBasedTitleDes = [
     468                'US'    => ['label' => 'Cards', 'description' => 'Pay securely via Razorpay.'],
     469                'MY'    => ['label' => 'Cards, FPX, Wallets', 'description' => 'Pay securely via Razorpay.'],
     470                'SG'    => ['label' => 'Cards, ApplePay, PayNow, Wallets', 'description' => 'Pay securely via Razorpay.']
     471            ];
     472           
     473            if (function_exists('wc_get_base_location'))
     474            {
     475                $baseLocation = wc_get_base_location();
     476                $country = isset($baseLocation['country']) ? strtoupper($baseLocation['country']) : '';
     477                if (isset($locBasedTitleDes[$country][$key]))
     478                {
     479                    return $locBasedTitleDes[$country][$key];
     480                }
     481            }
     482           
     483            // Fallback to class defaults
     484            if ($key === 'label')
     485            {
     486                return static::DEFAULT_LABEL;
     487            }
     488            return static::DEFAULT_DESCRIPTION;
     489        }
    455490
    456491        public function init_form_fields()
     
    469504                    'type'=> 'text',
    470505                    'description' => __('This controls the title which the user sees during checkout.', $this->id),
    471                     'default' => __(static::DEFAULT_LABEL, $this->id)
     506                    'default' => __($this->getGeoBasedTitleAndDescription('label'), $this->id)
    472507                ),
    473508                'description' => array(
     
    475510                    'type' => 'textarea',
    476511                    'description' => __('This controls the description which the user sees during checkout.', $this->id),
    477                     'default' => __(static::DEFAULT_DESCRIPTION, $this->id)
     512                    'default' => __($this->getGeoBasedTitleAndDescription('description'), $this->id)
    478513                ),
    479514                'key_id' => array(
Note: See TracChangeset for help on using the changeset viewer.