Skip to content

Commit 7234ad4

Browse files
authored
Version 5.7.2 Release (#60)
1 parent e38f698 commit 7234ad4

10 files changed

Lines changed: 69 additions & 123 deletions

README.md

Lines changed: 9 additions & 4 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.6
11+
**Tested up to:** 5.7
1212

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

1515
**License:** GPLv2 or later
1616

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

149149
## Changelog
150150

151+
### 5.7.2 - March 12, 2021
152+
* New: Auto display paystack payment popup on the payment page
153+
* Removed: Remove Paystack metrics tracker
154+
* Tweak: WooCommerce 5.1 compatibility
155+
151156
### 5.7.1 - March 1, 2021
152157
* Removed: Remove inline embed payment option
153158
* Updated: Update payment method icon for South Africa
@@ -276,8 +281,8 @@ To configure the plugin, go to __WooCommerce > Settings__ from the left hand men
276281

277282
## Upgrade Notice
278283

279-
### 5.7.1 ###
280-
* Remove inline embed payment method and update payment method icon for South Africa.
284+
### 5.7.2 ###
285+
* Auto display Paystack payment popup on the payment page
281286

282287
## Screenshots ##
283288

assets/images/paystack-za.png

-30 KB
Loading

assets/js/paystack.js

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

33
let paystack_submit = false;
44

5+
$( '#wc-paystack-form' ).hide();
6+
7+
wcPaystackFormHandler();
8+
59
jQuery( '#paystack-payment-button' ).click( function() {
610
return wcPaystackFormHandler();
711
} );
@@ -138,6 +142,8 @@ jQuery( function( $ ) {
138142

139143
function wcPaystackFormHandler() {
140144

145+
$( '#wc-paystack-form' ).hide();
146+
141147
if ( paystack_submit ) {
142148
paystack_submit = false;
143149
return true;
@@ -197,6 +203,7 @@ jQuery( function( $ ) {
197203
custom_fields: wcPaystackCustomFields(),
198204
},
199205
onClose: function() {
206+
$( '#wc-paystack-form' ).show();
200207
$( this.el ).unblock();
201208
}
202209
};

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-paystack-subscriptions.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,6 @@ public function process_subscription_payment( $order, $amount ) {
143143

144144
$order->add_order_note( $message );
145145

146-
// Log successful transaction to Paystack plugin metrics tracker.
147-
$paystack_logger = new WC_Paystack_Plugin_Tracker( 'woo-paystack', $this->public_key );
148-
$paystack_logger->log_transaction( $paystack_ref );
149-
150146
if ( parent::is_autocomplete_order_enabled( $order ) ) {
151147
$order->update_status( 'completed' );
152148
}

includes/class-wc-gateway-paystack.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -997,10 +997,6 @@ public function process_token_payment( $token, $order_id ) {
997997

998998
}
999999

1000-
// Log successful transaction to Paystack plugin metrics tracker.
1001-
$paystack_logger = new WC_Paystack_Plugin_Tracker( 'woo-paystack', $this->public_key );
1002-
$paystack_logger->log_transaction( $paystack_response->data->reference );
1003-
10041000
$order_total = $order->get_total();
10051001
$order_currency = method_exists( $order, 'get_currency' ) ? $order->get_currency() : $order->get_order_currency();
10061002
$currency_symbol = get_woocommerce_currency_symbol( $order_currency );
@@ -1113,6 +1109,8 @@ public function receipt_page( $order_id ) {
11131109

11141110
$order = wc_get_order( $order_id );
11151111

1112+
echo '<div id="wc-paystack-form">';
1113+
11161114
echo '<p>' . __( 'Thank you for your order, please click the button below to pay with Paystack.', 'woo-paystack' ) . '</p>';
11171115

11181116
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>';
@@ -1121,6 +1119,8 @@ public function receipt_page( $order_id ) {
11211119
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>';
11221120
}
11231121

1122+
echo '</div>';
1123+
11241124
}
11251125

11261126
/**
@@ -1171,10 +1171,6 @@ public function verify_paystack_transaction() {
11711171

11721172
}
11731173

1174-
// Log successful transaction to Paystack plugin metrics tracker.
1175-
$paystack_logger = new WC_Paystack_Plugin_Tracker( 'woo-paystack', $this->public_key );
1176-
$paystack_logger->log_transaction( $paystack_response->data->reference );
1177-
11781174
$order_total = $order->get_total();
11791175
$order_currency = method_exists( $order, 'get_currency' ) ? $order->get_currency() : $order->get_order_currency();
11801176
$currency_symbol = get_woocommerce_currency_symbol( $order_currency );
@@ -1305,10 +1301,6 @@ public function process_webhooks() {
13051301
exit;
13061302
}
13071303

1308-
// Log successful transaction to Paystack plugin metrics tracker.
1309-
$paystack_logger = new WC_Paystack_Plugin_Tracker( 'woo-paystack', $this->public_key );
1310-
$paystack_logger->log_transaction( $event->data->reference );
1311-
13121304
$order_currency = method_exists( $order, 'get_currency' ) ? $order->get_currency() : $order->get_order_currency();
13131305

13141306
$currency_symbol = get_woocommerce_currency_symbol( $order_currency );

includes/class-wc-paystack-plugin-tracker.php

Lines changed: 0 additions & 57 deletions
This file was deleted.

languages/woo-paystack.pot

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ msgid ""
33
msgstr ""
44
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
55
"Project-Id-Version: Paystack WooCommerce Payment Gateway\n"
6-
"POT-Creation-Date: 2021-03-01 16:52+0100\n"
7-
"PO-Revision-Date: 2021-03-01 16:52+0100\n"
6+
"POT-Creation-Date: 2021-03-10 11:04+0100\n"
7+
"PO-Revision-Date: 2021-03-10 11:04+0100\n"
88
"Last-Translator: \n"
99
"Language-Team: \n"
1010
"MIME-Version: 1.0\n"
@@ -594,22 +594,22 @@ msgid "Paystack Transaction Failed (%s)"
594594
msgstr ""
595595

596596
#: includes/class-wc-gateway-paystack-subscriptions.php:142
597-
#: includes/class-wc-gateway-paystack.php:1232
598-
#: includes/class-wc-gateway-paystack.php:1375
597+
#: includes/class-wc-gateway-paystack.php:1228
598+
#: includes/class-wc-gateway-paystack.php:1367
599599
#, php-format
600600
msgid "Payment via Paystack successful (Transaction Reference: %s)"
601601
msgstr ""
602602

603-
#: includes/class-wc-gateway-paystack-subscriptions.php:158
603+
#: includes/class-wc-gateway-paystack-subscriptions.php:154
604604
msgid "Paystack payment failed."
605605
msgstr ""
606606

607-
#: includes/class-wc-gateway-paystack-subscriptions.php:161
607+
#: includes/class-wc-gateway-paystack-subscriptions.php:157
608608
#, php-format
609609
msgid "Paystack payment failed. Reason: %s"
610610
msgstr ""
611611

612-
#: includes/class-wc-gateway-paystack-subscriptions.php:170
612+
#: includes/class-wc-gateway-paystack-subscriptions.php:166
613613
msgid ""
614614
"This subscription can&#39;t be renewed automatically. The customer will have "
615615
"to login to their account to renew their subscription"
@@ -774,9 +774,9 @@ msgstr ""
774774
msgid "Unable to process payment try again"
775775
msgstr ""
776776

777-
#: includes/class-wc-gateway-paystack.php:1019
778-
#: includes/class-wc-gateway-paystack.php:1193
779-
#: includes/class-wc-gateway-paystack.php:1333
777+
#: includes/class-wc-gateway-paystack.php:1015
778+
#: includes/class-wc-gateway-paystack.php:1189
779+
#: includes/class-wc-gateway-paystack.php:1325
780780
#, php-format
781781
msgid ""
782782
"Thank you for shopping with us.%1$sYour payment transaction was successful, "
@@ -785,9 +785,9 @@ msgid ""
785785
"your order and payment status."
786786
msgstr ""
787787

788-
#: includes/class-wc-gateway-paystack.php:1026
789-
#: includes/class-wc-gateway-paystack.php:1200
790-
#: includes/class-wc-gateway-paystack.php:1340
788+
#: includes/class-wc-gateway-paystack.php:1022
789+
#: includes/class-wc-gateway-paystack.php:1196
790+
#: includes/class-wc-gateway-paystack.php:1332
791791
#, php-format
792792
msgid ""
793793
"<strong>Look into this order</strong>%1$sThis order is currently on hold."
@@ -796,9 +796,9 @@ msgid ""
796796
"%6$s (%7$s)</strong>%8$s<strong>Paystack Transaction Reference:</strong> %9$s"
797797
msgstr ""
798798

799-
#: includes/class-wc-gateway-paystack.php:1039
800-
#: includes/class-wc-gateway-paystack.php:1215
801-
#: includes/class-wc-gateway-paystack.php:1357
799+
#: includes/class-wc-gateway-paystack.php:1035
800+
#: includes/class-wc-gateway-paystack.php:1211
801+
#: includes/class-wc-gateway-paystack.php:1349
802802
#, php-format
803803
msgid ""
804804
"Thank you for shopping with us.%1$sYour payment was successful, but the "
@@ -807,9 +807,9 @@ msgid ""
807807
"order and payment status."
808808
msgstr ""
809809

810-
#: includes/class-wc-gateway-paystack.php:1046
811-
#: includes/class-wc-gateway-paystack.php:1222
812-
#: includes/class-wc-gateway-paystack.php:1364
810+
#: includes/class-wc-gateway-paystack.php:1042
811+
#: includes/class-wc-gateway-paystack.php:1218
812+
#: includes/class-wc-gateway-paystack.php:1356
813813
#, php-format
814814
msgid ""
815815
"<strong>Look into this order</strong>%1$sThis order is currently on hold."
@@ -819,59 +819,59 @@ msgid ""
819819
"strong> %9$s"
820820
msgstr ""
821821

822-
#: includes/class-wc-gateway-paystack.php:1070
823-
#: includes/class-wc-gateway-paystack.php:1252
822+
#: includes/class-wc-gateway-paystack.php:1066
823+
#: includes/class-wc-gateway-paystack.php:1248
824824
msgid "Payment was declined by Paystack."
825825
msgstr ""
826826

827-
#: includes/class-wc-gateway-paystack.php:1071
827+
#: includes/class-wc-gateway-paystack.php:1067
828828
msgid "Payment failed using the saved card. Kindly use another payment option."
829829
msgstr ""
830830

831-
#: includes/class-wc-gateway-paystack.php:1075
831+
#: includes/class-wc-gateway-paystack.php:1071
832832
#, php-format
833833
msgid "Payment was declined by Paystack. Reason: %s."
834834
msgstr ""
835835

836-
#: includes/class-wc-gateway-paystack.php:1076
836+
#: includes/class-wc-gateway-paystack.php:1072
837837
#, php-format
838838
msgid ""
839839
"Payment failed using the saved card. Reason: %s. Kindly use another payment "
840840
"option."
841841
msgstr ""
842842

843-
#: includes/class-wc-gateway-paystack.php:1090
843+
#: includes/class-wc-gateway-paystack.php:1086
844844
msgid "Payment Failed."
845845
msgstr ""
846846

847-
#: includes/class-wc-gateway-paystack.php:1101
847+
#: includes/class-wc-gateway-paystack.php:1097
848848
msgid "You can only add a new card when placing an order."
849849
msgstr ""
850850

851-
#: includes/class-wc-gateway-paystack.php:1116
851+
#: includes/class-wc-gateway-paystack.php:1114
852852
msgid ""
853853
"Thank you for your order, please click the button below to pay with Paystack."
854854
msgstr ""
855855

856-
#: includes/class-wc-gateway-paystack.php:1118
856+
#: includes/class-wc-gateway-paystack.php:1116
857857
msgid "Pay Now"
858858
msgstr ""
859859

860-
#: includes/class-wc-gateway-paystack.php:1121
860+
#: includes/class-wc-gateway-paystack.php:1119
861861
msgid "Cancel order &amp; restore cart"
862862
msgstr ""
863863

864-
#: includes/class-wc-gateway-paystack.php:1657
864+
#: includes/class-wc-gateway-paystack.php:1649
865865
#, php-format
866866
msgid "Refund for Order ID: #%1$s on %2$s"
867867
msgstr ""
868868

869-
#: includes/class-wc-gateway-paystack.php:1679
869+
#: includes/class-wc-gateway-paystack.php:1671
870870
#, php-format
871871
msgid "Refunded %1$s. Refund ID: %2$s. Reason: %3$s"
872872
msgstr ""
873873

874-
#: includes/class-wc-gateway-paystack.php:1692
874+
#: includes/class-wc-gateway-paystack.php:1684
875875
msgid "Can&#39;t process refund at the moment. Try again later."
876876
msgstr ""
877877

@@ -895,23 +895,23 @@ msgstr ""
895895
msgid "Two"
896896
msgstr ""
897897

898-
#: woo-paystack.php:71
898+
#: woo-paystack.php:69
899899
msgid "View Paystack WooCommerce Settings"
900900
msgstr ""
901901

902-
#: woo-paystack.php:71
902+
#: woo-paystack.php:69
903903
msgid "Settings"
904904
msgstr ""
905905

906-
#: woo-paystack.php:142
906+
#: woo-paystack.php:140
907907
#, php-format
908908
msgid ""
909909
"Paystack requires WooCommerce to be installed and active. Click %s to "
910910
"install WooCommerce."
911911
msgstr ""
912912

913913
#. translators: 1. Paystack settings page URL link.
914-
#: woo-paystack.php:159
914+
#: woo-paystack.php:157
915915
#, php-format
916916
msgid ""
917917
"Paystack test mode is still enabled, Click <strong><a href=\"%s\">here</a></"

0 commit comments

Comments
 (0)