Skip to content

Commit 0947e39

Browse files
committed
Version 5.2.0
1 parent b7820e4 commit 0947e39

7 files changed

Lines changed: 59 additions & 52 deletions

File tree

README.md

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
**Tested up to:** 4.9
1212

13-
**Stable tag:** 5.1.0
13+
**Stable tag:** 5.2.0
1414

1515
**License:** GPLv2 or later
1616

@@ -142,67 +142,66 @@ To configure the plugin, go to __WooCommerce > Settings__ from the left hand me
142142

143143
## Changelog
144144

145-
### 5.1.0, March 27, 2018 ###
145+
### 5.2.0 - May 18, 2018 ###
146+
* New: Add support for multiple subscriptions purchase using WooCommerce Subscriptions plugin
147+
* Fix: Deprecated functions in the Tbz_WC_Gateway_Paystack_Subscription class
148+
149+
### 5.1.0 - March 27, 2018 ###
146150
* New: Add support for GHS (Ghanaian cedi) currency
147151
* Fix: Deprecated WooCommerce 2.X functions
148152

149-
### 5.0.2, September 15, 2017 ###
153+
### 5.0.2 - September 15, 2017 ###
150154
* Fix: Illegal string offset warnings when plugin is newly installed
151155

152-
### 5.0.1, September 14, 2017 ###
156+
### 5.0.1 - September 14, 2017 ###
153157
* Fix: Fatal error on the checkout page if WooCommerce 2.6.14 and below is installed
154158

155-
### 5.0.0, August 29, 2017 ###
159+
### 5.0.0 - August 29, 2017 ###
156160
* New: Add support for Paystack custom filters
157161
* New: Create additional Paystack gateways (max of 5) using different custom filters. You can create a gateway that accepts only Verve cards, a gateway that accepts only bank account payments, a gateway that accepts only GTB issued Mastercard.
158162

159-
### 4.1.0, July 7, 2017 ###
163+
### 4.1.0 - July 7, 2017 ###
160164
* Fix: Deprecated WooCommerce 2.X functions
161165

162-
### 4.0.1, April 10, 2017 ###
166+
### 4.0.1 - April 10, 2017 ###
163167
* Fix: Fatal error if WooCommerce 2.6.14 and below is installed
164168

165-
### 4.0.0, April 10, 2017 ###
169+
### 4.0.0 - April 10, 2017 ###
166170
* New: Add support for Paystack Inline Embed.
167171
* New: Add support for sending additional order details to Paystack
168172

169-
### 3.1.1, February 13, 2017 ###
173+
### 3.1.1 - February 13, 2017 ###
170174
* New: Changed Paystack payment methods icon.
171175

172-
### 3.1.0, January 10, 2017 ###
176+
### 3.1.0 - January 10, 2017 ###
173177
* New: Add support for USD and GBP currency. Note this has to be enabled by Paystack for your account before it can be used on your site.
174178

175-
### 3.0.0, November 11, 2016
179+
### 3.0.0 - November 11, 2016
176180
* New: Add support for recurring payment using [WooCommerce Subscriptions](https://woocommerce.com/products/woocommerce-subscriptions/) plugin.
177181

178-
179-
### 2.1.0, October 15, 2016
182+
### 2.1.0 - October 15, 2016
180183
* New: Add support for confirming payment using the webhook url
181184

182-
183-
### 2.0.1, July 5, 2016
185+
### 2.0.1 - July 5, 2016
184186
* Fix: Paystack payment option and settings not available if Paystack WooCommerce Payment Gateway version 2.0.0 is installed and WooCommerce version 2.5.5 and below is installed
185187

186-
187-
### 2.0.0, June 28, 2016
188+
### 2.0.0 - June 28, 2016
188189
* New: Saved cards - allow store customers to save their card details and pay again using the same card. Card details are saved on Paystack servers and not on your store.
189190
* Fix: Change payment icon
190191

191-
192-
### 1.1.0, April 22, 2016
192+
### 1.1.0 - April 22, 2016
193193
* Fix: Fatal error if the WooCommerce plugin is deactivated while the Paystack plugin is active
194194

195-
196-
### 1.0.0, February 3, 2016
195+
### 1.0.0 - February 3, 2016
197196
* First release
198197

199198

200199

201200

202201
## Upgrade Notice
203202

204-
### 5.1.0 ###
205-
* Add support for GHS (Ghanaian cedi) currency for merchants in Ghana
203+
### 5.2.0 ###
204+
* Add support for multiple subscriptions purchase using WooCommerce Subscriptions plugin
206205

207206

208207
## Screenshots ##

assets/js/paystack.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,6 @@ jQuery( function( $ ) {
165165
}
166166
});
167167

168-
console.log( handler );
169-
170168
handler.openIframe();
171169

172170
return false;

assets/js/paystack.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

includes/class-paystack.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public function __construct() {
1818
'products',
1919
'tokenization',
2020
'subscriptions',
21+
'multiple_subscriptions',
2122
'subscription_cancellation',
2223
'subscription_suspension',
2324
'subscription_reactivation',
@@ -1097,7 +1098,9 @@ public function save_subscription_payment_token( $order_id, $paystack_response )
10971098

10981099
foreach ( $subscriptions as $subscription ) {
10991100

1100-
update_post_meta( $subscription->id, '_paystack_token', $auth_code );
1101+
$subscription_id = $subscription->get_id();
1102+
1103+
update_post_meta( $subscription_id, '_paystack_token', $auth_code );
11011104

11021105
}
11031106

includes/class-wc-subscriptions.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function process_payment( $order_id ) {
4242

4343
$order->payment_complete();
4444

45-
$order->add_order_note( 'This subscription has a free trial reason for the 0 amount' );
45+
$order->add_order_note( 'This subscription has a free trial, reason for the 0 amount' );
4646

4747
return array(
4848
'result' => 'success',
@@ -79,14 +79,17 @@ public function scheduled_subscription_payment( $amount_to_charge, $renewal_orde
7979
*/
8080
public function process_subscription_payment( $order = '', $amount = 0 ) {
8181

82-
$auth_code = get_post_meta( $order->id, '_paystack_token', true );
82+
$order_id = method_exists( $order, 'get_id' ) ? $order->get_id() : $order->id;
83+
84+
$auth_code = get_post_meta( $order_id, '_paystack_token', true );
8385

8486
if ( $auth_code ) {
8587

86-
$email = $order->billing_email;
87-
$order_amount = $amount * 100;
88+
$email = method_exists( $order, 'get_billing_email' ) ? $order->get_billing_email() : $order->billing_email;
89+
90+
$order_amount = $amount * 100;
8891

89-
$paystack_url = 'https://api.paystack.co/transaction/charge_authorization';
92+
$paystack_url = 'https://api.paystack.co/transaction/charge_authorization';
9093

9194
$headers = array(
9295
'Content-Type' => 'application/json',

readme.txt

Lines changed: 22 additions & 18 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, interswitch, tubiz plugins, verve, ghana, nigeria, mastercard, visa
55
Requires at least: 4.4
66
Tested up to: 4.9
7-
Stable tag: 5.1.0
7+
Stable tag: 5.2.0
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -121,61 +121,65 @@ To configure the plugin, go to __WooCommerce > Settings__ from the left hand me
121121

122122
== Changelog ==
123123

124-
= 5.1.0, March 27, 2018 =
124+
= 5.2.0 - May 18, 2018 =
125+
* New: Add support for multiple subscriptions purchase using WooCommerce Subscriptions plugin
126+
* Fix: Deprecated functions in the Tbz_WC_Gateway_Paystack_Subscription class
127+
128+
= 5.1.0 - March 27, 2018 =
125129
* New: Add support for GHS (Ghanaian cedi) currency
126130
* Fix: Deprecated WooCommerce 2.X functions
127131

128-
= 5.0.2, September 15, 2017 =
132+
= 5.0.2 - September 15, 2017 =
129133
* Fix: Illegal string offset warnings when plugin is newly installed
130134

131-
= 5.0.1, September 14, 2017 =
135+
= 5.0.1 - September 14, 2017 =
132136
* Fix: Fatal error on the checkout page if WooCommerce 2.6.14 and below is installed
133137

134-
= 5.0.0, August 29, 2017 =
138+
= 5.0.0 - August 29, 2017 =
135139
* New: Add support for Paystack custom filters
136140
* New: Create additional Paystack gateways (max of 5) using different custom filters. You can create a gateway that accepts only Verve cards, a gateway that accepts only bank account payments, a gateway that accepts only GTB issued Mastercard.
137141

138-
= 4.1.0, July 7, 2017 =
142+
= 4.1.0 - July 7, 2017 =
139143
* Fix: Deprecated WooCommerce 2.X functions
140144

141-
= 4.0.1, April 10, 2017 =
145+
= 4.0.1 - April 10, 2017 =
142146
* Fix: Fatal error if WooCommerce 2.6.14 and below is installed
143147

144-
= 4.0.0, April 10, 2017 =
148+
= 4.0.0 - April 10, 2017 =
145149
* New: Add support for Paystack Inline Embed.
146150
* New: Add support for sending additional order details to Paystack
147151

148-
= 3.1.1, February 13, 2017 =
152+
= 3.1.1 - February 13, 2017 =
149153
* New: Changed Paystack payment methods icon.
150154

151-
= 3.1.0, January 10, 2017 =
155+
= 3.1.0 - January 10, 2017 =
152156
* New: Add support for USD and GBP currency. Note this has to be enabled by Paystack for your account before it can be used on your site.
153157

154-
= 3.0.0, November 11, 2016 =
158+
= 3.0.0 - November 11, 2016 =
155159
* New: Add support for recurring payment using [WooCommerce Subscriptions](https://woocommerce.com/products/woocommerce-subscriptions/) plugin.
156160

157-
= 2.1.0, October 15, 2016 =
161+
= 2.1.0 - October 15, 2016 =
158162
* New: Add support for confirming payment using the webhook url
159163

160-
= 2.0.1, July 5, 2016 =
164+
= 2.0.1 - July 5, 2016 =
161165
* Fix: Paystack payment option and settings not available if Paystack WooCommerce Payment Gateway version 2.0.0 is installed and WooCommerce version 2.5.5 and below is installed
162166

163-
= 2.0.0, June 28, 2016 =
167+
= 2.0.0 - June 28, 2016 =
164168
* New: Saved cards - allow store customers to save their card details and pay again using the same card. Card details are saved on Paystack servers and not on your store.
165169
* Fix: Change payment icon
166170

167-
= 1.1.0, April 22, 2016 =
171+
= 1.1.0 - April 22, 2016 =
168172
* Fix: Fatal error if the WooCommerce plugin is deactivated while the Paystack plugin is active
169173

170-
= 1.0.0, February 3, 2016 =
174+
= 1.0.0 - February 3, 2016 =
171175
* First release
172176

173177

174178

175179
== Upgrade Notice ==
176180

177-
= 5.1.0 =
178-
* Add support for GHS (Ghanaian cedi) currency for merchants in Ghana
181+
= 5.2.0 =
182+
* Add support for multiple subscriptions purchase using WooCommerce Subscriptions plugin
179183

180184

181185
== Screenshots ==

woo-paystack.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: Paystack WooCommerce Payment Gateway
44
Plugin URI: https://paystack.com
55
Description: WooCommerce payment gateway for Paystack
6-
Version: 5.1.0
6+
Version: 5.2.0
77
Author: Tunbosun Ayinla
88
Author URI: https://bosun.me
99
License: GPL-2.0+
@@ -19,7 +19,7 @@
1919
define( 'WC_PAYSTACK_MAIN_FILE', __FILE__ );
2020
define( 'WC_PAYSTACK_URL', untrailingslashit( plugins_url( '/', __FILE__ ) ) );
2121

22-
define( 'WC_PAYSTACK_VERSION', '5.1.0' );
22+
define( 'WC_PAYSTACK_VERSION', '5.2.0' );
2323

2424
function tbz_wc_paystack_init() {
2525

0 commit comments

Comments
 (0)