From 047d65c6524665ad40f650abad79085fdf69cb1a Mon Sep 17 00:00:00 2001 From: Sayan Datta Date: Thu, 8 Feb 2024 21:21:47 +0530 Subject: [PATCH] added v1.2.1 --- CHANGELOG.md | 5 +++++ includes/class-payment.php | 32 +++++++++++++++++++++++++------- package.json | 2 +- readme.txt | 12 +++++++++--- rzp-woocommerce.php | 22 +++++++++++----------- 5 files changed, 51 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e39c8a3..395c472 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog All notable changes to this project will be documented in this file. +## 1.2.1 +Release Date: January 8, 2024 + +* Tweak: PHP 8.3 Support. + ## 1.2.0 Release Date: January 6, 2024 diff --git a/includes/class-payment.php b/includes/class-payment.php index 3f1a24d..e151358 100644 --- a/includes/class-payment.php +++ b/includes/class-payment.php @@ -31,7 +31,25 @@ class RZP_WC_Payment_Gateway extends \WC_Payment_Gateway { * @var WC_Logger */ public static $log = false; - + + protected $thank_you; + protected $api_type; + protected $test_mode; + protected $key_id; + protected $key_secret; + protected $webhook_enabled; + protected $webhook_secret; + protected $sms_notification; + protected $email_notification; + protected $reminder; + protected $link_expire; + protected $gateway_fee; + protected $instant_refund; + protected $debug; + protected $api_mode; + protected $ref; + protected $status; + /** * Class constructor */ @@ -59,9 +77,9 @@ public function __construct() { $this->description = $this->get_option( 'description' ); $this->thank_you = $this->get_option( 'thank_you' ); $this->api_type = $this->get_option( 'api_type', 'legacy' ); - $this->testmode = 'yes' === $this->get_option( 'testmode' ); - $this->key_id = $this->testmode ? $this->get_option( 'test_key_id' ) : $this->get_option( 'key_id' ); - $this->key_secret = $this->testmode ? $this->get_option( 'test_key_secret' ) : $this->get_option( 'key_secret' ); + $this->test_mode = 'yes' === $this->get_option( 'testmode' ); + $this->key_id = $this->test_mode ? $this->get_option( 'test_key_id' ) : $this->get_option( 'key_id' ); + $this->key_secret = $this->test_mode ? $this->get_option( 'test_key_secret' ) : $this->get_option( 'key_secret' ); $this->webhook_enabled = $this->get_option( 'webhook_enabled' ); $this->webhook_secret = $this->get_option( 'webhook_secret' ); $this->sms_notification = $this->get_option( 'sms_notification' ); @@ -73,7 +91,7 @@ public function __construct() { $this->debug = 'yes' === $this->get_option( 'debug_mode', 'no' ); self::$log_enabled = $this->debug; - if ( $this->testmode ) { + if ( $this->test_mode ) { $this->title .= ' ' . __( '(Test Mode)', 'rzp-woocommerce' ); /* translators: %s: Link to Razorpay testing guide page */ $this->description .= ' ' . sprintf( __( 'TESTING MODE ENABLED. You can use Razorpay testing accounts only. See the Razorpay Testing Guide for more details.', 'rzp-woocommerce' ), 'https://razorpay.com/docs/payment-gateway/test-card-details/' ); @@ -427,7 +445,7 @@ public function process_payment( $order_id ) { $args['expire_by'] = time() + ( absint( $held_duration ) * 60 ); } - $args = apply_filters( 'rzpwc_payment_init_payload', $args, $order, $this->testmode ); + $args = apply_filters( 'rzpwc_payment_init_payload', $args, $order, $this->test_mode ); $this->log( 'Data sent for creating Payment Link: ' . wc_print_r( $args, true ) ); @@ -497,7 +515,7 @@ public function process_payment( $order_id ) { public function can_refund_order( $order ) { $has_api_creds = false; - if ( $this->testmode ) { + if ( $this->test_mode ) { $has_api_creds = $this->get_option( 'test_key_id' ) && $this->get_option( 'test_key_secret' ); } else { $has_api_creds = $this->get_option( 'key_id' ) && $this->get_option( 'key_secret' ); diff --git a/package.json b/package.json index 100dc48..e832b70 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rzp-woocommerce", - "title": "UPI QR Code Payment Gateway for WooCommerce", + "title": "Razorpay Payment Links for WooCommerce", "version": "1.0.0", "author": "Sayan Datta", "license": "GPL-3.0+", diff --git a/readme.txt b/readme.txt index bd708c2..3888fb5 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: infosatech Tags: razorpay, qrcode, upi, woocommerce, debit card, credit card Requires at least: 4.6 Tested up to: 6.4 -Stable tag: 1.2.0 +Stable tag: 1.2.1 Requires PHP: 5.6 Donate link: https://www.sayandatta.co.in/donate License: GPLv3 @@ -21,6 +21,7 @@ It uses a Razorpay's Payment Link API integration, allowing the customer to pay #### Plugin Features +* WooCommerce High-Performance Order Storage (HPOS) Support. * Collect Payments using Razorpay Payment Links. * Ability to send Payment Links via SMS and Email notification to customers. * One time Payment for your website. @@ -32,7 +33,7 @@ It uses a Razorpay's Payment Link API integration, allowing the customer to pay * Easily Collect Gateway Fees from Customer. * Ability to send Payment Reminder automatically. * Secure Payment Capture Mechanism. -* 92 [Razorpay Currency](https://razorpay.com/docs/international-payments/#supported-currencies) Support. +* 94 [Razorpay Currency](https://razorpay.com/docs/international-payments/#supported-currencies) Support. * Order note for every Transaction related process. * Detailed Payment process Log via WooCommerce Logger. * Lots of filters available to customize the output. @@ -41,7 +42,7 @@ Like Razorpay Payment Links for WooCommerce plugin? Consider leaving a [5 star r #### Compatibility -* This plugin is fully compatible with WordPress Version 4.6 and WooCommerce v3.1.0 and beyond and also compatible with any WordPress theme. +* This plugin is fully compatible with WordPress Version 4.6 and beyond and also compatible with any WordPress theme. #### Support * Community support via the [support forums](https://wordpress.org/support/plugin/rzp-woocommerce) at WordPress.org. @@ -106,6 +107,11 @@ Post detailed information about the issue in the [support forum](https://wordpre If you like Razorpay Payment Links for WooCommerce, please take a moment to [give a 5-star rating](https://wordpress.org/support/plugin/rzp-woocommerce/reviews/?rate=5#new-post). It helps to keep development and support going strong. Thank you! += 1.2.1 = +Release Date: January 8, 2024 + +* Tweak: PHP 8.3 Support. + = 1.2.0 = Release Date: January 6, 2024 diff --git a/rzp-woocommerce.php b/rzp-woocommerce.php index ae8b0f0..a777b49 100644 --- a/rzp-woocommerce.php +++ b/rzp-woocommerce.php @@ -3,7 +3,7 @@ * Plugin Name: Razorpay Payment Links for WooCommerce * Plugin URI: https://wordpress.org/plugins/rzp-woocommerce/ * Description: The easiest and most secure solution to collect payments with WooCommerce. Allow customers to securely pay via Razorpay (Credit/Debit Cards, NetBanking, UPI, Wallets, QR Code). - * Version: 1.2.0 + * Version: 1.2.1 * Author: Sayan Datta * Author URI: https://www.sayandatta.co.in * License: GPLv3 @@ -48,7 +48,7 @@ final class RZPWC { * * @var string */ - public $version = '1.2.0'; + public $version = '1.2.1'; /** * Minimum version of WordPress required to run RZPWC. @@ -335,7 +335,7 @@ public function admin_notice() { } $show_rating = true; - if ( $this->calculate_time() > strtotime( '-10 days' ) + if ( $this->calculate_time() > strtotime( '-7 days' ) || '1' === get_option( 'rzpwc_plugin_dismiss_rating_notice' ) || apply_filters( 'rzpwc_hide_sticky_rating_notice', false ) ) { $show_rating = false; @@ -354,12 +354,12 @@ public function admin_notice() { calculate_time() > strtotime( '-15 days' ) - // || '1' === get_option( 'rzpwc_plugin_dismiss_donate_notice' ) - // || apply_filters( 'rzpwc_hide_sticky_donate_notice', false ) ) { - // $show_donate = false; - // } + $show_donate = true; + if ( $this->calculate_time() > strtotime( '-10 days' ) + || '1' === get_option( 'rzpwc_plugin_dismiss_donate_notice' ) + || apply_filters( 'rzpwc_hide_sticky_donate_notice', false ) ) { + $show_donate = false; + } if ( $show_donate ) { $dismiss = wp_nonce_url( add_query_arg( 'rzpwc_notice_action', 'dismiss_donate' ), 'rzpwc_notice_nonce' ); @@ -381,14 +381,14 @@ public function admin_notice() { public function dismiss_notice() { // Check for Rating Notice if ( get_option( 'rzpwc_plugin_no_thanks_rating_notice' ) === '1' - && get_option( 'rzpwc_plugin_dismissed_time' ) <= strtotime( '-14 days' ) ) { + && get_option( 'rzpwc_plugin_dismissed_time' ) <= strtotime( '-10 days' ) ) { delete_option( 'rzpwc_plugin_dismiss_rating_notice' ); delete_option( 'rzpwc_plugin_no_thanks_rating_notice' ); } // Check for Donate Notice if ( get_option( 'rzpwc_plugin_no_thanks_donate_notice' ) === '1' - && get_option( 'rzpwc_plugin_dismissed_time_donate' ) <= strtotime( '-15 days' ) ) { + && get_option( 'rzpwc_plugin_dismissed_time_donate' ) <= strtotime( '-14 days' ) ) { delete_option( 'rzpwc_plugin_dismiss_donate_notice' ); delete_option( 'rzpwc_plugin_no_thanks_donate_notice' ); }