Skip to content

Commit

Permalink
Merge pull request #6 from iamsayan/develop
Browse files Browse the repository at this point in the history
added v1.2.1
  • Loading branch information
iamsayan committed Feb 8, 2024
2 parents 1162b18 + 047d65c commit af14879
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 22 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
32 changes: 25 additions & 7 deletions includes/class-payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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' );
Expand All @@ -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 <a href="%s" target="_blank">Razorpay Testing Guide</a> for more details.', 'rzp-woocommerce' ), 'https://razorpay.com/docs/payment-gateway/test-card-details/' );
Expand Down Expand Up @@ -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 ) );

Expand Down Expand Up @@ -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' );
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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+",
Expand Down
12 changes: 9 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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

Expand Down
22 changes: 11 additions & 11 deletions rzp-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand All @@ -354,12 +354,12 @@ public function admin_notice() {
<?php
}

$show_donate = false;
// if ( $this->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' );
Expand All @@ -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' );
}
Expand Down

0 comments on commit af14879

Please sign in to comment.