Skip to content

Commit ea43ed9

Browse files
committed
Version 5.4.2
Misc: Remove Paystack fee and Paystack payout amount on the order details page
1 parent c2cbfc6 commit ea43ed9

5 files changed

Lines changed: 14 additions & 160 deletions

File tree

README.md

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

1111
**Tested up to:** 5.0
1212

13-
**Stable tag:** 5.4.1
13+
**Stable tag:** 5.4.2
1414

1515
**License:** GPLv2 or later
1616

@@ -144,6 +144,9 @@ To configure the plugin, go to __WooCommerce > Settings__ from the left hand me
144144

145145
## Changelog
146146

147+
### 5.4.2 - February 13, 2019 =
148+
* Misc: Remove Paystack fee and Paystack payout amount on the order details page
149+
147150
### 5.4.1 - February 1, 2019 ###
148151
* Fix: Split payment not working properly when the split payment transaction charge setting field is empty
149152

@@ -223,9 +226,8 @@ To configure the plugin, go to __WooCommerce > Settings__ from the left hand me
223226

224227
## Upgrade Notice
225228

226-
### 5.4.1 ###
227-
* Fix: Split payment not working properly when the split payment transaction charge setting field is empty
228-
229+
### 5.4.2 ###
230+
* Misc: Remove Paystack fee and Paystack payout amount on the order details page
229231

230232
## Screenshots ##
231233

includes/class-paystack.php

Lines changed: 0 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ public function __construct() {
7676
add_action( 'admin_notices', array( $this, 'admin_notices' ) );
7777
add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );
7878

79-
add_action( 'woocommerce_admin_order_totals_after_total', array( $this, 'display_paystack_fee' ) );
80-
add_action( 'woocommerce_admin_order_totals_after_total', array( $this, 'display_order_payout' ), 20 );
81-
8279
add_action( 'woocommerce_receipt_' . $this->id, array( $this, 'receipt_page' ) );
8380

8481
// Payment listener/API hook
@@ -620,87 +617,6 @@ public function admin_scripts() {
620617

621618
}
622619

623-
624-
/**
625-
* Displays the Paystack fee
626-
*
627-
* @since 5.4.0
628-
*
629-
* @param int $order_id
630-
*/
631-
public function display_paystack_fee( $order_id ) {
632-
633-
$order = wc_get_order( $order_id );
634-
635-
if ( $this->is_wc_lt( '3.0' ) ) {
636-
$fee = get_post_meta( $order_id, '_paystack_fee', true );
637-
$currency = get_post_meta( $order_id, '_paystack_currency', true );
638-
} else {
639-
$fee = $order->get_meta( '_paystack_fee', true );
640-
$currency = $order->get_meta( '_paystack_currency', true );
641-
}
642-
643-
if ( ! $fee || ! $currency ) {
644-
return;
645-
}
646-
647-
?>
648-
649-
<tr>
650-
<td class="label paystack-fee">
651-
<?php echo wc_help_tip( 'This represents the fee Paystack collects for the transaction.' ); ?>
652-
<?php esc_html_e( 'Paystack Fee:' ); ?>
653-
</td>
654-
<td width="1%"></td>
655-
<td class="total">
656-
-&nbsp;<?php echo wc_price( $fee, array( 'currency' => $currency ) ); ?>
657-
</td>
658-
</tr>
659-
660-
<?php
661-
}
662-
663-
664-
/**
665-
* Displays the net total of the transaction without the charges of Paystack.
666-
*
667-
* @since 5.4.0
668-
*
669-
* @param int $order_id
670-
*/
671-
public function display_order_payout( $order_id ) {
672-
673-
$order = wc_get_order( $order_id );
674-
675-
if ( $this->is_wc_lt( '3.0' ) ) {
676-
$net = get_post_meta( $order_id, '_paystack_net', true );
677-
$currency = get_post_meta( $order_id, '_paystack_currency', true );
678-
} else {
679-
$net = $order->get_meta( '_paystack_net', true );
680-
$currency = $order->get_meta( '_paystack_currency', true );
681-
}
682-
683-
if ( ! $net || ! $currency ) {
684-
return;
685-
}
686-
687-
?>
688-
689-
<tr>
690-
<td class="label paystack-payout">
691-
<?php echo wc_help_tip( 'This represents the net total that will be credited to your bank account for this order.' ); ?>
692-
<?php esc_html_e( 'Paystack Payout:' ); ?>
693-
</td>
694-
<td width="1%"></td>
695-
<td class="total">
696-
<?php echo wc_price( $net, array( 'currency' => $currency ) ); ?>
697-
</td>
698-
</tr>
699-
700-
<?php
701-
}
702-
703-
704620
/**
705621
* Process the payment
706622
*/
@@ -816,21 +732,6 @@ public function process_token_payment( $token, $order_id ) {
816732

817733
$payment_currency = $paystack_response->data->currency;
818734

819-
$paystack_fee = $paystack_response->data->fees / 100;
820-
821-
$paystack_net = $paystack_response->data->amount - $paystack_response->data->fees;
822-
$paystack_net = $paystack_net / 100;
823-
824-
if ( $this->is_wc_lt( '3.0' ) ) {
825-
update_post_meta( $order_id, '_paystack_fee', $paystack_fee );
826-
update_post_meta( $order_id, '_paystack_net', $paystack_net );
827-
update_post_meta( $order_id, '_paystack_currency', $payment_currency );
828-
} else {
829-
$order->update_meta_data( '_paystack_fee', $paystack_fee );
830-
$order->update_meta_data( '_paystack_net', $paystack_net );
831-
$order->update_meta_data( '_paystack_currency', $payment_currency );
832-
}
833-
834735
$gateway_symbol = get_woocommerce_currency_symbol( $payment_currency );
835736

836737
// check if the amount paid is equal to the order amount.
@@ -1013,21 +914,6 @@ public function verify_paystack_transaction() {
1013914

1014915
$payment_currency = $paystack_response->data->currency;
1015916

1016-
$paystack_fee = $paystack_response->data->fees / 100;
1017-
1018-
$paystack_net = $paystack_response->data->amount - $paystack_response->data->fees;
1019-
$paystack_net = $paystack_net / 100;
1020-
1021-
if ( $this->is_wc_lt( '3.0' ) ) {
1022-
update_post_meta( $order_id, '_paystack_fee', $paystack_fee );
1023-
update_post_meta( $order_id, '_paystack_net', $paystack_net );
1024-
update_post_meta( $order_id, '_paystack_currency', $payment_currency );
1025-
} else {
1026-
$order->update_meta_data( '_paystack_fee', $paystack_fee );
1027-
$order->update_meta_data( '_paystack_net', $paystack_net );
1028-
$order->update_meta_data( '_paystack_currency', $payment_currency );
1029-
}
1030-
1031917
$gateway_symbol = get_woocommerce_currency_symbol( $payment_currency );
1032918

1033919
// check if the amount paid is equal to the order amount.
@@ -1161,21 +1047,6 @@ public function process_webhooks() {
11611047

11621048
$payment_currency = $event->data->currency;
11631049

1164-
$paystack_fee = $event->data->fees / 100;
1165-
1166-
$paystack_net = $event->data->amount - $event->data->fees;
1167-
$paystack_net = $paystack_net / 100;
1168-
1169-
if ( $this->is_wc_lt( '3.0' ) ) {
1170-
update_post_meta( $order_id, '_paystack_fee', $paystack_fee );
1171-
update_post_meta( $order_id, '_paystack_net', $paystack_net );
1172-
update_post_meta( $order_id, '_paystack_currency', $payment_currency );
1173-
} else {
1174-
$order->update_meta_data( '_paystack_fee', $paystack_fee );
1175-
$order->update_meta_data( '_paystack_net', $paystack_net );
1176-
$order->update_meta_data( '_paystack_currency', $payment_currency );
1177-
}
1178-
11791050
$gateway_symbol = get_woocommerce_currency_symbol( $payment_currency );
11801051

11811052
// check if the amount paid is equal to the order amount.

includes/class-wc-subscriptions.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ public function delete_renewal_meta( $renewal_order ) {
3636
$order_id = $renewal_order->get_id();
3737
}
3838

39-
delete_post_meta( $order_id, '_paystack_fee' );
40-
delete_post_meta( $order_id, '_paystack_net' );
41-
delete_post_meta( $order_id, '_paystack_currency' );
42-
4339
return $renewal_order;
4440
}
4541

@@ -142,23 +138,6 @@ public function process_subscription_payment( $order = '', $amount = 0 ) {
142138

143139
$paystack_ref = $paystack_response->data->reference;
144140

145-
$payment_currency = $paystack_response->data->currency;
146-
147-
$paystack_fee = $paystack_response->data->fees / 100;
148-
149-
$paystack_net = $paystack_response->data->amount - $paystack_response->data->fees;
150-
$paystack_net = $paystack_net / 100;
151-
152-
if ( $this->is_wc_lt( '3.0' ) ) {
153-
update_post_meta( $order_id, '_paystack_fee', $paystack_fee );
154-
update_post_meta( $order_id, '_paystack_net', $paystack_net );
155-
update_post_meta( $order_id, '_paystack_currency', $payment_currency );
156-
} else {
157-
$order->update_meta_data( '_paystack_fee', $paystack_fee );
158-
$order->update_meta_data( '_paystack_net', $paystack_net );
159-
$order->update_meta_data( '_paystack_currency', $payment_currency );
160-
}
161-
162141
$order->payment_complete( $paystack_ref );
163142

164143
$message = sprintf( 'Payment via Paystack successful (Transaction Reference: %s)', $paystack_ref );

readme.txt

Lines changed: 6 additions & 4 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.0
7-
Stable tag: 5.4.1
7+
Stable tag: 5.4.2
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -123,6 +123,9 @@ To configure the plugin, go to __WooCommerce > Settings__ from the left hand me
123123

124124
== Changelog ==
125125

126+
= 5.4.2 - February 13, 2019 =
127+
* Misc: Remove Paystack fee and Paystack payout amount on the order details page
128+
126129
= 5.4.1 - February 1, 2019 =
127130
* Fix: Split payment not working properly when the split payment transaction charge setting field is empty
128131

@@ -201,9 +204,8 @@ To configure the plugin, go to __WooCommerce > Settings__ from the left hand me
201204

202205
== Upgrade Notice ==
203206

204-
= 5.4.1 =
205-
* Fix: Split payment not working properly when the split payment transaction charge setting field is empty
206-
207+
= 5.4.2 =
208+
* Misc: Remove Paystack fee and Paystack payout amount on the order details page
207209

208210
== Screenshots ==
209211

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.4.1
6+
Version: 5.4.2
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.4.1' );
22+
define( 'WC_PAYSTACK_VERSION', '5.4.2' );
2323

2424
function tbz_wc_paystack_init() {
2525

0 commit comments

Comments
 (0)