Skip to content

Commit c1c0f32

Browse files
tubiztolu-paystack
andauthored
Version 5.6.4 release (#32)
Co-authored-by: Tolu Kalejaiye <60101507+tolu-paystack@users.noreply.github.com>
1 parent e140170 commit c1c0f32

10 files changed

Lines changed: 34 additions & 16 deletions

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
**Requires at least:** 4.7
1010

11-
**Tested up to:** 5.4
11+
**Tested up to:** 5.5
1212

13-
**Stable tag:** 5.6.3
13+
**Stable tag:** 5.6.4
1414

1515
**License:** GPLv2 or later
1616

@@ -145,6 +145,11 @@ To configure the plugin, go to __WooCommerce > Settings__ from the left hand men
145145

146146
## Changelog
147147

148+
### 5.6.4 - September 29, 2020 =
149+
* Fix: Use order currency when paying for an order and not the store currency
150+
* Fix: Test mode enabled admin notice not displayed properly
151+
* Misc: Add payment icon for South Africa
152+
148153
### 5.6.3 - July 27, 2020
149154
* New: Add support for ZAR as an accepted currency.
150155
* New: Add setting to remove "Cancel order & restore cart" button.
@@ -257,7 +262,7 @@ To configure the plugin, go to __WooCommerce > Settings__ from the left hand men
257262
## Upgrade Notice
258263

259264
### 5.6.3 ###
260-
* Fixes.
265+
* Add payment icon for South Africa. Use the order currency and not the store currency when paying for an order
261266

262267
## Screenshots ##
263268

assets/images/paystack-za.png

4.42 KB
Loading

includes/class-wc-gateway-paystack.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ public function get_icon() {
279279

280280
if ( 'GH' === $base_location['country'] ) {
281281
$icon = '<img src="' . WC_HTTPS::force_https_url( plugins_url( 'assets/images/paystack-gh.png', WC_PAYSTACK_MAIN_FILE ) ) . '" alt="Paystack Payment Options" />';
282+
} elseif ( 'ZA' === $base_location['country'] ) {
283+
$icon = '<img src="' . WC_HTTPS::force_https_url( plugins_url( 'assets/images/paystack-za.png', WC_PAYSTACK_MAIN_FILE ) ) . '" alt="Paystack Payment Options" />';
282284
} else {
283285
$icon = '<img src="' . WC_HTTPS::force_https_url( plugins_url( 'assets/images/paystack-wc.png', WC_PAYSTACK_MAIN_FILE ) ) . '" alt="Paystack Payment Options" />';
284286
}
@@ -652,14 +654,15 @@ public function payment_scripts() {
652654
$txnref = $order_id . '_' . time();
653655
$the_order_id = method_exists( $order, 'get_id' ) ? $order->get_id() : $order->id;
654656
$the_order_key = method_exists( $order, 'get_order_key' ) ? $order->get_order_key() : $order->order_key;
657+
$currency = method_exists( $order, 'get_currency' ) ? $order->get_currency() : $order->order_currency;
655658

656659
if ( $the_order_id == $order_id && $the_order_key == $order_key ) {
657660

658661
$paystack_params['email'] = $email;
659662
$paystack_params['amount'] = $amount;
660663
$paystack_params['txnref'] = $txnref;
661664
$paystack_params['pay_page'] = $this->payment_page;
662-
$paystack_params['currency'] = get_woocommerce_currency();
665+
$paystack_params['currency'] = $currency;
663666
$paystack_params['bank_channel'] = 'true';
664667
$paystack_params['card_channel'] = 'true';
665668

includes/custom-gateways/class-wc-gateway-paystack-five.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,15 @@ public function payment_scripts() {
208208

209209
$the_order_id = method_exists( $order, 'get_id' ) ? $order->get_id() : $order->id;
210210
$the_order_key = method_exists( $order, 'get_order_key' ) ? $order->get_order_key() : $order->order_key;
211+
$currency = method_exists( $order, 'get_currency' ) ? $order->get_currency() : $order->order_currency;
211212

212213
if ( $the_order_id == $order_id && $the_order_key == $order_key ) {
213214

214215
$paystack_params['email'] = $email;
215216
$paystack_params['amount'] = $amount;
216217
$paystack_params['txnref'] = $txnref;
217218
$paystack_params['pay_page'] = $this->payment_page;
218-
$paystack_params['currency'] = get_woocommerce_currency();
219+
$paystack_params['currency'] = $currency;
219220

220221
}
221222

includes/custom-gateways/class-wc-gateway-paystack-four.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,15 @@ public function payment_scripts() {
208208

209209
$the_order_id = method_exists( $order, 'get_id' ) ? $order->get_id() : $order->id;
210210
$the_order_key = method_exists( $order, 'get_order_key' ) ? $order->get_order_key() : $order->order_key;
211+
$currency = method_exists( $order, 'get_currency' ) ? $order->get_currency() : $order->order_currency;
211212

212213
if ( $the_order_id == $order_id && $the_order_key == $order_key ) {
213214

214215
$paystack_params['email'] = $email;
215216
$paystack_params['amount'] = $amount;
216217
$paystack_params['txnref'] = $txnref;
217218
$paystack_params['pay_page'] = $this->payment_page;
218-
$paystack_params['currency'] = get_woocommerce_currency();
219+
$paystack_params['currency'] = $currency;
219220

220221
}
221222

includes/custom-gateways/class-wc-gateway-paystack-one.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,15 @@ public function payment_scripts() {
199199

200200
$the_order_id = method_exists( $order, 'get_id' ) ? $order->get_id() : $order->id;
201201
$the_order_key = method_exists( $order, 'get_order_key' ) ? $order->get_order_key() : $order->order_key;
202+
$currency = method_exists( $order, 'get_currency' ) ? $order->get_currency() : $order->order_currency;
202203

203204
if ( $the_order_id == $order_id && $the_order_key == $order_key ) {
204205

205206
$paystack_params['email'] = $email;
206207
$paystack_params['amount'] = $amount;
207208
$paystack_params['txnref'] = $txnref;
208209
$paystack_params['pay_page'] = $this->payment_page;
209-
$paystack_params['currency'] = get_woocommerce_currency();
210+
$paystack_params['currency'] = $currency;
210211

211212
}
212213

includes/custom-gateways/class-wc-gateway-paystack-three.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,15 @@ public function payment_scripts() {
208208

209209
$the_order_id = method_exists( $order, 'get_id' ) ? $order->get_id() : $order->id;
210210
$the_order_key = method_exists( $order, 'get_order_key' ) ? $order->get_order_key() : $order->order_key;
211+
$currency = method_exists( $order, 'get_currency' ) ? $order->get_currency() : $order->order_currency;
211212

212213
if ( $the_order_id == $order_id && $the_order_key == $order_key ) {
213214

214215
$paystack_params['email'] = $email;
215216
$paystack_params['amount'] = $amount;
216217
$paystack_params['txnref'] = $txnref;
217218
$paystack_params['pay_page'] = $this->payment_page;
218-
$paystack_params['currency'] = get_woocommerce_currency();
219+
$paystack_params['currency'] = $currency;
219220

220221
}
221222

includes/custom-gateways/class-wc-gateway-paystack-two.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,15 @@ public function payment_scripts() {
208208

209209
$the_order_id = method_exists( $order, 'get_id' ) ? $order->get_id() : $order->id;
210210
$the_order_key = method_exists( $order, 'get_order_key' ) ? $order->get_order_key() : $order->order_key;
211+
$currency = method_exists( $order, 'get_currency' ) ? $order->get_currency() : $order->order_currency;
211212

212213
if ( $the_order_id == $order_id && $the_order_key == $order_key ) {
213214

214215
$paystack_params['email'] = $email;
215216
$paystack_params['amount'] = $amount;
216217
$paystack_params['txnref'] = $txnref;
217218
$paystack_params['pay_page'] = $this->payment_page;
218-
$paystack_params['currency'] = get_woocommerce_currency();
219+
$paystack_params['currency'] = $currency;
219220

220221
}
221222

readme.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Donate link: https://bosun.me/donate
44
Tags: paystack, woocommerce, payment gateway, tubiz plugins, verve, ghana, nigeria, mastercard, visa
55
Requires at least: 4.7
66
Tested up to: 5.5
7-
Stable tag: 5.6.3
7+
Stable tag: 5.6.4
88
Requires PHP: 5.6
99
License: GPLv2 or later
1010
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -125,6 +125,11 @@ To configure the plugin, go to __WooCommerce > Settings__ from the left hand me
125125

126126
== Changelog ==
127127

128+
= 5.6.4 - September 29, 2020 =
129+
* Fix: Use order currency when paying for an order and not the store currency
130+
* Misc: Test mode enabled admin notice not displayed properly
131+
* Misc: Add payment icon for South Africa
132+
128133
= 5.6.3 - July 27, 2020 =
129134
* New: Add support for ZAR as an accepted currency.
130135
* New: Add setting to remove "Cancel order & restore cart" button.
@@ -235,8 +240,8 @@ To configure the plugin, go to __WooCommerce > Settings__ from the left hand me
235240

236241
== Upgrade Notice ==
237242

238-
= 5.6.3
239-
* Fixes
243+
= 5.6.4
244+
* Add payment icon for South Africa. Use the order currency and not the store currency when paying for an order
240245

241246
== Screenshots ==
242247

woo-paystack.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
* Plugin Name: Paystack WooCommerce Payment Gateway
44
* Plugin URI: https://paystack.com
55
* Description: WooCommerce payment gateway for Paystack
6-
* Version: 5.6.3
6+
* Version: 5.6.4
77
* Author: Tunbosun Ayinla
88
* Author URI: https://bosun.me
99
* License: GPL-2.0+
1010
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
1111
* WC requires at least: 3.0.0
12-
* WC tested up to: 4.3
12+
* WC tested up to: 4.6
1313
* Text Domain: woo-paystack
1414
* Domain Path: /languages
1515
*/
@@ -21,7 +21,7 @@
2121
define( 'WC_PAYSTACK_MAIN_FILE', __FILE__ );
2222
define( 'WC_PAYSTACK_URL', untrailingslashit( plugins_url( '/', __FILE__ ) ) );
2323

24-
define( 'WC_PAYSTACK_VERSION', '5.6.3' );
24+
define( 'WC_PAYSTACK_VERSION', '5.6.4' );
2525

2626
/**
2727
* Initialize Paystack WooCommerce payment gateway.
@@ -152,6 +152,6 @@ function tbz_wc_paystack_testmode_notice() {
152152

153153
if ( 'yes' === $test_mode ) {
154154
/* translators: 1. Paystack settings page URL link. */
155-
echo '<div class="update-nag">' . sprintf( __( 'Paystack test mode is still enabled, Click <strong><a href="%s">here</a></strong> to disable it when you want to start accepting live payment on your site.', 'woo-paystack' ), esc_url( admin_url( 'admin.php?page=wc-settings&tab=checkout&section=paystack' ) ) ) . '</div>';
155+
echo '<div class="error"><p>' . sprintf( __( 'Paystack test mode is still enabled, Click <strong><a href="%s">here</a></strong> to disable it when you want to start accepting live payment on your site.', 'woo-paystack' ), esc_url( admin_url( 'admin.php?page=wc-settings&tab=checkout&section=paystack' ) ) ) . '</p></div>';
156156
}
157157
}

0 commit comments

Comments
 (0)