@@ -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- - <?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.
0 commit comments