Skip to content

Commit 1bee268

Browse files
authored
Version 5.7.1 Release (#54)
1 parent c80aee3 commit 1bee268

15 files changed

Lines changed: 33 additions & 218 deletions

README.md

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

1111
**Tested up to:** 5.6
1212

13-
**Stable tag:** 5.7
13+
**Stable tag:** 5.7.1
1414

1515
**License:** GPLv2 or later
1616

@@ -148,6 +148,10 @@ To configure the plugin, go to __WooCommerce > Settings__ from the left hand men
148148

149149
## Changelog
150150

151+
### 5.7.1 - March 1, 2021
152+
* Removed: Remove inline embed payment option
153+
* Updated: Update payment method icon for South Africa
154+
151155
### 5.7 - January 13, 2021
152156
* New: Add additional payment channels to the custom gateways
153157
* New: Add redirect payment option
@@ -272,8 +276,8 @@ To configure the plugin, go to __WooCommerce > Settings__ from the left hand men
272276

273277
## Upgrade Notice
274278

275-
### 5.7 ###
276-
* Add redirect payment option. Add option to autocomplete order after payment. Add additional payment channels to the custom gateways.
279+
### 5.7.1 ###
280+
* Remove inline embed payment method and update payment method icon for South Africa.
277281

278282
## Screenshots ##
279283

@@ -291,12 +295,6 @@ To configure the plugin, go to __WooCommerce > Settings__ from the left hand men
291295
###
292296
![Screenshot 3](https://github.com/tubiz/woo-paystack/blob/master/assets/images/screenshot-3.png)
293297

294-
295-
### 4. Paystack inline embed payment page
296-
###
297-
![Screenshot 4](https://github.com/tubiz/woo-paystack/blob/master/assets/images/screenshot-4.png)
298-
299-
300-
### 5. Manage saved cards from your account page
298+
### 4. Manage saved cards from your account page
301299
###
302-
![Screenshot 5](https://github.com/tubiz/woo-paystack/blob/master/assets/images/screenshot-5.png)
300+
![Screenshot 4](https://github.com/tubiz/woo-paystack/blob/master/assets/images/screenshot-4.png)

assets/images/paystack-za.png

30 KB
Loading

assets/images/screenshot-4.png

-310 KB
Loading

assets/images/screenshot-5.png

-34.6 KB
Binary file not shown.

assets/js/paystack.js

Lines changed: 6 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,13 @@ jQuery( function( $ ) {
22

33
let paystack_submit = false;
44

5-
if ( 'embed' === wc_paystack_params.pay_page ) {
5+
jQuery( '#paystack-payment-button' ).click( function() {
6+
return wcPaystackFormHandler();
7+
} );
68

7-
wcPayStackEmbedFormHandler();
8-
9-
} else {
10-
11-
jQuery( '#paystack-payment-button' ).click( function() {
12-
return wcPaystackFormHandler();
13-
} );
14-
15-
jQuery( '#paystack_form form#order_review' ).submit( function() {
16-
return wcPaystackFormHandler();
17-
} );
18-
19-
}
9+
jQuery( '#paystack_form form#order_review' ).submit( function() {
10+
return wcPaystackFormHandler();
11+
} );
2012

2113
function wcPaystackCustomFields() {
2214

@@ -224,83 +216,4 @@ jQuery( function( $ ) {
224216

225217
}
226218

227-
function wcPayStackEmbedFormHandler() {
228-
229-
if ( paystack_submit ) {
230-
paystack_submit = false;
231-
return true;
232-
}
233-
234-
let $form = $( 'form#payment-form, form#order_review' ),
235-
paystack_txnref = $form.find( 'input.paystack_txnref' ),
236-
subaccount_code = '',
237-
charges_account = '',
238-
transaction_charges = '';
239-
240-
paystack_txnref.val( '' );
241-
242-
if ( wc_paystack_params.subaccount_code ) {
243-
subaccount_code = wc_paystack_params.subaccount_code;
244-
}
245-
246-
if ( wc_paystack_params.charges_account ) {
247-
charges_account = wc_paystack_params.charges_account;
248-
}
249-
250-
if ( wc_paystack_params.transaction_charges ) {
251-
transaction_charges = Number( wc_paystack_params.transaction_charges );
252-
}
253-
254-
let amount = Number( wc_paystack_params.amount );
255-
256-
let paystack_callback = function( response ) {
257-
258-
$form.append( '<input type="hidden" class="paystack_txnref" name="paystack_txnref" value="' + response.trxref + '"/>' );
259-
260-
$( '#paystack_form a' ).hide();
261-
262-
paystack_submit = true;
263-
264-
$form.submit();
265-
266-
$( 'body' ).block( {
267-
message: null,
268-
overlayCSS: {
269-
background: "#fff",
270-
opacity: 0.8
271-
},
272-
css: {
273-
cursor: "wait"
274-
}
275-
} );
276-
277-
};
278-
279-
let handler = PaystackPop.setup( {
280-
key: wc_paystack_params.key,
281-
email: wc_paystack_params.email,
282-
amount: amount,
283-
ref: wc_paystack_params.txnref,
284-
currency: wc_paystack_params.currency,
285-
container: "paystackWooCommerceEmbedContainer",
286-
callback: paystack_callback,
287-
channels: wcPaymentChannels(),
288-
subaccount: subaccount_code,
289-
bearer: charges_account,
290-
transaction_charge: transaction_charges,
291-
metadata: {
292-
custom_fields: wcPaystackCustomFields(),
293-
custom_filters: wcPaystackCustomFilters()
294-
},
295-
onClose: function() {
296-
$( this.el ).unblock();
297-
}
298-
} );
299-
300-
handler.openIframe();
301-
302-
return false;
303-
304-
}
305-
306219
} );

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-wc-gateway-custom-paystack.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,12 @@ public function init_form_fields() {
3737
'payment_page' => array(
3838
'title' => __( 'Payment Option', 'woo-paystack' ),
3939
'type' => 'select',
40-
'description' => __( 'Popup shows the payment popup on the page, Inline Embed shows the payment page directly on the page while Redirect will redirect the customer to Paystack to make payment.', 'woo-paystack' ),
40+
'description' => __( 'Popup shows the payment popup on the page while Redirect will redirect the customer to Paystack to make payment.', 'woo-paystack' ),
4141
'default' => '',
4242
'desc_tip' => false,
4343
'options' => array(
4444
'' => __( 'Select One', 'woo-paystack' ),
4545
'inline' => __( 'Popup', 'woo-paystack' ),
46-
'embed' => __( 'Inline Embed', 'woo-paystack' ),
4746
'redirect' => __( 'Redirect', 'woo-paystack' ),
4847
),
4948
),
@@ -473,7 +472,6 @@ public function payment_scripts() {
473472
$paystack_params['email'] = $email;
474473
$paystack_params['amount'] = $amount;
475474
$paystack_params['txnref'] = $txnref;
476-
$paystack_params['pay_page'] = $this->payment_page;
477475
$paystack_params['currency'] = $currency;
478476

479477
}

includes/class-wc-gateway-paystack.php

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,6 @@ public function __construct() {
178178

179179
$this->payment_page = $this->get_option( 'payment_page' );
180180

181-
if ( 'embed' === $this->payment_page ) {
182-
$this->method_description .= '<p style="color:red">You are using the Paystack <strong>Inline Embed</strong> payment option for this payment method, it will be removed in the next version of the Paystack WooCommerce plugin. Kindly switch to either the <strong>Popup</strong> or <strong>Redirect</strong> payment option by clicking on the <strong>Manage</strong> button on the right.</p>';
183-
}
184-
185181
$this->supports = array(
186182
'products',
187183
'refunds',
@@ -417,13 +413,12 @@ public function init_form_fields() {
417413
'payment_page' => array(
418414
'title' => __( 'Payment Option', 'woo-paystack' ),
419415
'type' => 'select',
420-
'description' => __( 'Popup shows the payment popup on the page, Inline Embed shows the payment page directly on the page while Redirect will redirect the customer to Paystack to make payment.', 'woo-paystack' ),
416+
'description' => __( 'Popup shows the payment popup on the page while Redirect will redirect the customer to Paystack to make payment.', 'woo-paystack' ),
421417
'default' => '',
422418
'desc_tip' => false,
423419
'options' => array(
424420
'' => __( 'Select One', 'woo-paystack' ),
425421
'inline' => __( 'Popup', 'woo-paystack' ),
426-
'embed' => __( 'Inline Embed', 'woo-paystack' ),
427422
'redirect' => __( 'Redirect', 'woo-paystack' ),
428423
),
429424
),
@@ -684,7 +679,6 @@ public function payment_scripts() {
684679
$paystack_params['email'] = $email;
685680
$paystack_params['amount'] = $amount;
686681
$paystack_params['txnref'] = $txnref;
687-
$paystack_params['pay_page'] = $this->payment_page;
688682
$paystack_params['currency'] = $currency;
689683

690684
}
@@ -1119,28 +1113,12 @@ public function receipt_page( $order_id ) {
11191113

11201114
$order = wc_get_order( $order_id );
11211115

1122-
if ( 'embed' === $this->payment_page ) {
1123-
1124-
echo '<p style="text-align: center; font-weight: bold;">' . __( 'Thank you for your order, please make payment below using Paystack.', 'woo-paystack' ) . '</p>';
1125-
1126-
echo '<div id="paystackWooCommerceEmbedContainer"></div>';
1127-
1128-
echo '<div id="paystack_form"><form id="order_review" method="post" action="' . WC()->api_request_url( 'WC_Gateway_Paystack' ) . '"></form>';
1129-
1130-
if ( ! $this->remove_cancel_order_button ) {
1131-
echo '<a href="' . esc_url( $order->get_cancel_order_url() ) . '" style="text-align:center; color: #ef3315; display: block; outline: none;">' . __( 'Cancel order &amp; restore cart', 'woo-paystack' ) . '</a></div>';
1132-
}
1133-
1134-
} else {
1116+
echo '<p>' . __( 'Thank you for your order, please click the button below to pay with Paystack.', 'woo-paystack' ) . '</p>';
11351117

1136-
echo '<p>' . __( 'Thank you for your order, please click the button below to pay with Paystack.', 'woo-paystack' ) . '</p>';
1137-
1138-
echo '<div id="paystack_form"><form id="order_review" method="post" action="' . WC()->api_request_url( 'WC_Gateway_Paystack' ) . '"></form><button class="button" id="paystack-payment-button">' . __( 'Pay Now', 'woo-paystack' ) . '</button>';
1139-
1140-
if ( ! $this->remove_cancel_order_button ) {
1141-
echo ' <a class="button cancel" id="paystack-cancel-payment-button" href="' . esc_url( $order->get_cancel_order_url() ) . '">' . __( 'Cancel order &amp; restore cart', 'woo-paystack' ) . '</a></div>';
1142-
}
1118+
echo '<div id="paystack_form"><form id="order_review" method="post" action="' . WC()->api_request_url( 'WC_Gateway_Paystack' ) . '"></form><button class="button" id="paystack-payment-button">' . __( 'Pay Now', 'woo-paystack' ) . '</button>';
11431119

1120+
if ( ! $this->remove_cancel_order_button ) {
1121+
echo ' <a class="button cancel" id="paystack-cancel-payment-button" href="' . esc_url( $order->get_cancel_order_url() ) . '">' . __( 'Cancel order &amp; restore cart', 'woo-paystack' ) . '</a></div>';
11441122
}
11451123

11461124
}

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ public function __construct() {
5555

5656
$this->payment_page = $this->get_option( 'payment_page' );
5757

58-
if ( 'embed' === $this->payment_page ) {
59-
$this->method_description .= '<p style="color:red">You are using the Paystack <strong>Inline Embed</strong> payment option for this payment method, it will be removed in the next version of the Paystack WooCommerce plugin. Kindly switch to either the <strong>Popup</strong> or <strong>Redirect</strong> payment option by clicking on the <strong>Manage</strong> button on the right.</p>';
60-
}
61-
6258
$this->has_fields = true;
6359

6460
$this->supports = array(

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ public function __construct() {
5555

5656
$this->payment_page = $this->get_option( 'payment_page' );
5757

58-
if ( 'embed' === $this->payment_page ) {
59-
$this->method_description .= '<p style="color:red">You are using the Paystack <strong>Inline Embed</strong> payment option for this payment method, it will be removed in the next version of the Paystack WooCommerce plugin. Kindly switch to either the <strong>Popup</strong> or <strong>Redirect</strong> payment option by clicking on the <strong>Manage</strong> button on the right.</p>';
60-
}
61-
6258
$this->has_fields = true;
6359

6460
$this->supports = array(

0 commit comments

Comments
 (0)