From 537325d06b83f037b65950ecf45c64d883badc62 Mon Sep 17 00:00:00 2001 From: Abraham Olaobaju Date: Mon, 25 Aug 2025 12:47:18 +0000 Subject: [PATCH 1/4] update --- .../rave-woocommerce-payment-gateway.pot | 138 ++++++++++-------- ...-flutterwave-wc-gateway-blocks-support.php | 9 +- includes/class-flw-wc-payment-gateway.php | 24 +-- .../class-flw-wc-payment-gateway-sdk.php | 1 + includes/util/class-flutterwave-logger.php | 101 +++++++++++++ 5 files changed, 194 insertions(+), 79 deletions(-) create mode 100644 includes/util/class-flutterwave-logger.php diff --git a/i18n/languages/rave-woocommerce-payment-gateway.pot b/i18n/languages/rave-woocommerce-payment-gateway.pot index 0db335d..2c0ce25 100644 --- a/i18n/languages/rave-woocommerce-payment-gateway.pot +++ b/i18n/languages/rave-woocommerce-payment-gateway.pot @@ -1,64 +1,69 @@ -# Copyright (C) 2023 Flutterwave Developers +# Copyright (C) 2025 Flutterwave Developers # This file is distributed under the MIT License. msgid "" msgstr "" -"Project-Id-Version: Flutterwave WooCommerce 2.3.4\n" +"Project-Id-Version: Flutterwave WooCommerce 2.3.6\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/rave-woocommerce-payment-gateway\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2023-12-26T17:58:20+00:00\n" +"POT-Creation-Date: 2025-08-25T12:02:32+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"X-Generator: WP-CLI 2.5.0\n" +"X-Generator: WP-CLI 2.12.0\n" "X-Domain: rave-woocommerce-payment-gateway\n" #. Plugin Name of the plugin #. Translators: %s Plugin name. -#: includes/class-flw-wc-payment-gateway.php:227 +#: rave-woocommerce-payment-gateway.php +#: includes/class-flw-wc-payment-gateway.php:230 #: includes/views/html-admin-missing-woocommerce.php:15 msgid "Flutterwave WooCommerce" msgstr "" #. Plugin URI of the plugin +#: rave-woocommerce-payment-gateway.php msgid "https://developer.flutterwave.com/" msgstr "" #. Description of the plugin +#: rave-woocommerce-payment-gateway.php msgid "Official WooCommerce payment gateway for Flutterwave." msgstr "" #. Author of the plugin +#: rave-woocommerce-payment-gateway.php msgid "Flutterwave Developers" msgstr "" #. Author URI of the plugin +#: rave-woocommerce-payment-gateway.php msgid "http://flutterwave.com/us" msgstr "" -#: includes/blocks/class-flutterwave-wc-gateway-blocks-support.php:156 +#: includes/blocks/class-flutterwave-wc-gateway-blocks-support.php:155 msgid "Visa" msgstr "" -#: includes/blocks/class-flutterwave-wc-gateway-blocks-support.php:160 +#: includes/blocks/class-flutterwave-wc-gateway-blocks-support.php:159 msgid "American Express" msgstr "" -#: includes/blocks/class-flutterwave-wc-gateway-blocks-support.php:164 +#: includes/blocks/class-flutterwave-wc-gateway-blocks-support.php:163 msgid "Mastercard" msgstr "" -#: includes/blocks/class-flutterwave-wc-gateway-blocks-support.php:171 +#: includes/blocks/class-flutterwave-wc-gateway-blocks-support.php:170 msgctxt "Name of credit card" msgid "Discover" msgstr "" -#: includes/blocks/class-flutterwave-wc-gateway-blocks-support.php:175 +#: includes/blocks/class-flutterwave-wc-gateway-blocks-support.php:174 msgid "JCB" msgstr "" -#: includes/blocks/class-flutterwave-wc-gateway-blocks-support.php:179 +#: includes/blocks/class-flutterwave-wc-gateway-blocks-support.php:178 msgid "Diners" msgstr "" @@ -132,233 +137,238 @@ msgstr "" #. translators: 1: payment reference 2: transaction reference #: includes/class-flw-wc-payment-gateway-subscriptions.php:163 +#, php-format msgid "Payment via Flutterwave successful (Payment Reference: %1$s, Transaction Reference: %2$s)" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:152 +#: includes/class-flw-wc-payment-gateway.php:154 msgid "allows you to accept payment from cards and bank accounts in multiple currencies. You can also accept payment offline via USSD and POS." msgstr "" -#: includes/class-flw-wc-payment-gateway.php:231 +#: includes/class-flw-wc-payment-gateway.php:234 msgid "Webhook Instruction" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:235 +#: includes/class-flw-wc-payment-gateway.php:238 msgid "Please copy this webhook URL and paste on the webhook section on your dashboard" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:256 +#: includes/class-flw-wc-payment-gateway.php:259 msgid "Enable/Disable" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:257 +#: includes/class-flw-wc-payment-gateway.php:260 msgid "Enable Flutterwave" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:259 +#: includes/class-flw-wc-payment-gateway.php:262 msgid "Enable Flutterwave as a payment option on the checkout page" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:264 +#: includes/class-flw-wc-payment-gateway.php:267 msgid "Enter Secret Hash" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:266 +#: includes/class-flw-wc-payment-gateway.php:269 msgid "Please change from default hash and ensure that SECRET HASH is the same with the one on your Flutterwave dashboard" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:270 +#: includes/class-flw-wc-payment-gateway.php:273 msgid "Payment method title" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:272 -#: includes/class-flw-wc-payment-gateway.php:278 +#: includes/class-flw-wc-payment-gateway.php:275 +#: includes/class-flw-wc-payment-gateway.php:281 msgid "Optional" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:276 +#: includes/class-flw-wc-payment-gateway.php:279 msgid "Payment method description" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:282 +#: includes/class-flw-wc-payment-gateway.php:285 msgid "Test Public Key" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:284 +#: includes/class-flw-wc-payment-gateway.php:287 msgid "Required! Enter your Flutterwave test public key here" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:288 +#: includes/class-flw-wc-payment-gateway.php:291 msgid "Test Secret Key" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:290 +#: includes/class-flw-wc-payment-gateway.php:293 msgid "Required! Enter your Flutterwave test secret key here" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:294 +#: includes/class-flw-wc-payment-gateway.php:297 msgid "Live Public Key" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:296 +#: includes/class-flw-wc-payment-gateway.php:299 msgid "Required! Enter your Flutterwave live public key here" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:300 +#: includes/class-flw-wc-payment-gateway.php:303 msgid "Live Secret Key" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:302 +#: includes/class-flw-wc-payment-gateway.php:305 msgid "Required! Enter your Flutterwave live secret key here" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:306 +#: includes/class-flw-wc-payment-gateway.php:309 msgid "Payment Style on checkout" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:308 +#: includes/class-flw-wc-payment-gateway.php:311 msgid "Optional - Choice of payment style to use. Either inline or redirect. (Default: inline)" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:310 +#: includes/class-flw-wc-payment-gateway.php:313 msgctxt "payment_style" msgid "Popup(Keep payment experience on the website)" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:311 +#: includes/class-flw-wc-payment-gateway.php:314 msgctxt "payment_style" msgid "Redirect" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:316 +#: includes/class-flw-wc-payment-gateway.php:319 msgid "Autocomplete Order After Payment" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:317 +#: includes/class-flw-wc-payment-gateway.php:320 msgid "Autocomplete Order" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:320 +#: includes/class-flw-wc-payment-gateway.php:323 msgid "If enabled, the order will be marked as complete after successful payment" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:325 +#: includes/class-flw-wc-payment-gateway.php:328 msgid "Payment Options" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:327 +#: includes/class-flw-wc-payment-gateway.php:330 msgid "Optional - Choice of payment method to use. Card, Account etc." msgstr "" -#: includes/class-flw-wc-payment-gateway.php:329 +#: includes/class-flw-wc-payment-gateway.php:332 msgctxt "payment_options" msgid "All" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:330 +#: includes/class-flw-wc-payment-gateway.php:333 msgctxt "payment_options" msgid "Card Only" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:331 +#: includes/class-flw-wc-payment-gateway.php:334 msgctxt "payment_options" msgid "Account Only" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:332 +#: includes/class-flw-wc-payment-gateway.php:335 msgctxt "payment_options" msgid "USSD Only" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:333 +#: includes/class-flw-wc-payment-gateway.php:336 msgctxt "payment_options" msgid "QR Only" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:334 +#: includes/class-flw-wc-payment-gateway.php:337 msgctxt "payment_options" msgid "Mpesa Only" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:335 +#: includes/class-flw-wc-payment-gateway.php:338 msgctxt "payment_options" msgid "Ghana MM Only" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:336 +#: includes/class-flw-wc-payment-gateway.php:339 msgctxt "payment_options" msgid "Rwanda MM Only" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:337 +#: includes/class-flw-wc-payment-gateway.php:340 msgctxt "payment_options" msgid "Zambia MM Only" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:338 +#: includes/class-flw-wc-payment-gateway.php:341 msgctxt "payment_options" msgid "Tanzania MM Only" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:343 +#: includes/class-flw-wc-payment-gateway.php:346 msgid "Mode" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:344 +#: includes/class-flw-wc-payment-gateway.php:347 msgid "Live mode" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:346 +#: includes/class-flw-wc-payment-gateway.php:349 msgid "Check this box if you're using your live keys." msgstr "" -#: includes/class-flw-wc-payment-gateway.php:351 -#: includes/class-flw-wc-payment-gateway.php:352 +#: includes/class-flw-wc-payment-gateway.php:354 +#: includes/class-flw-wc-payment-gateway.php:355 msgid "Disable Logging" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:354 +#: includes/class-flw-wc-payment-gateway.php:357 msgid "Check this box if you're disabling logging." msgstr "" -#: includes/class-flw-wc-payment-gateway.php:359 -#: includes/class-flw-wc-payment-gateway.php:360 +#: includes/class-flw-wc-payment-gateway.php:362 +#: includes/class-flw-wc-payment-gateway.php:363 msgid "Disable Barter" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:362 +#: includes/class-flw-wc-payment-gateway.php:365 msgid "Check the box if you want to disable barter." msgstr "" #. translators: %s: url -#: includes/class-flw-wc-payment-gateway.php:453 +#: includes/class-flw-wc-payment-gateway.php:456 +#, php-format msgid "Flutterwave is enabled, but the API keys are not set. Please set your Flutterwave API keys to be able to accept payments." msgstr "" #. translators: %s: shop cart url -#: includes/class-flw-wc-payment-gateway.php:490 +#: includes/class-flw-wc-payment-gateway.php:493 +#, php-format msgid "Sorry, your session has expired. Return to shop" msgstr "" -#: includes/class-flw-wc-payment-gateway.php:504 +#: includes/class-flw-wc-payment-gateway.php:507 msgid "We were unable to process your order, please try again." msgstr "" -#: includes/class-flw-wc-payment-gateway.php:551 +#: includes/class-flw-wc-payment-gateway.php:582 msgid "Order Payment" msgstr "" -#: includes/client/class-flw-wc-payment-gateway-request.php:126 +#: includes/client/class-flw-wc-payment-gateway-request.php:153 msgid "Payment for order " msgstr "" #. translators: $1. Minimum WooCommerce version. $2. Current WooCommerce version. #: includes/notices/class-flw-wc-payment-gateway-notices.php:32 +#, php-format msgid "Flutterwave WooCommerce requires WooCommerce %1$s or greater to be installed and active. kindly upgrade to a higher version of WooCommerce or downgrade to a lower version of Flutterwave WooCommerce that supports WooCommerce version %2$s." msgstr "" #. Translators: %s Plugin name. #: includes/views/html-admin-missing-woocommerce.php:15 +#, php-format msgid "%s requires WooCommerce to be installed and activated in order to serve updates." msgstr "" diff --git a/includes/blocks/class-flutterwave-wc-gateway-blocks-support.php b/includes/blocks/class-flutterwave-wc-gateway-blocks-support.php index 1856029..8c49ad7 100644 --- a/includes/blocks/class-flutterwave-wc-gateway-blocks-support.php +++ b/includes/blocks/class-flutterwave-wc-gateway-blocks-support.php @@ -50,12 +50,9 @@ public function initialize() { if ( ! class_exists( 'FLW_WC_Payment_Gateway' ) ) { require_once dirname( FLW_WC_PLUGIN_FILE ) . '/includes/class-flw-wc-payment-gateway.php'; } - - $this->gateway = new FLW_WC_Payment_Gateway(); - } else { - $gateways = WC()->payment_gateways->payment_gateways(); - $this->gateway = $gateways[ $this->name ]; } + + $this->gateway = new FLW_WC_Payment_Gateway(); } /** @@ -70,6 +67,8 @@ public function is_active(): bool { if ( ! isset( $gateways[ $this->name ] ) ) { return false; } + + $this->gateway = $gateways[ $this->name ]; } return $this->gateway->is_available(); diff --git a/includes/class-flw-wc-payment-gateway.php b/includes/class-flw-wc-payment-gateway.php index b927b1d..5ea8709 100644 --- a/includes/class-flw-wc-payment-gateway.php +++ b/includes/class-flw-wc-payment-gateway.php @@ -25,10 +25,12 @@ require_once __DIR__ . '/class-flw-wc-payment-gateway-event-handler.php'; require_once __DIR__ . '/client/class-flw-wc-payment-gateway-request.php'; require_once __DIR__ . '/client/class-flw-wc-payment-gateway-sdk.php'; +require_once __DIR__ . '/util/class-flutterwave-logger.php'; use Flutterwave\WooCommerce\Client\Flw_WC_Payment_Gateway_Request; use Flutterwave\WooCommerce\Client\FLW_WC_Payment_Gateway_Sdk as FlwSdk; use FLW_WC_Payment_Gateway_Event_Handler as FlwEventHandler; +use Flutterwave\WooCommerce\Util\Flutterwave_Logger; /** * Main Flutterwave Gateway Class @@ -92,9 +94,9 @@ class FLW_WC_Payment_Gateway extends WC_Payment_Gateway { /** * Logger * - * @var WC_Logger the logger + * @var Flutterwave_Logger the logger */ - private WC_Logger $logger; + private Flutterwave_Logger $logger; /** * Flutterwave Sdk * @@ -204,6 +206,7 @@ public function __construct() { $this->secret_key = $this->live_secret_key; } + $this->logger = Flutterwave_Logger::instance(); $this->sdk = new FlwSdk( $this->secret_key, self::$log_enabled ); add_action( 'wp_enqueue_scripts', array( $this, 'payment_scripts' ) ); @@ -593,13 +596,11 @@ public function payment_scripts() { * @return void */ public function flw_verify_payment() { - $public_key = $this->public_key; - $secret_key = $this->secret_key; - $logging_option = $this->logging_option; - $sdk = $this->sdk; + $sdk = $this->sdk; if ( ! isset( $_GET['_wpnonce'] ) && ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['_wpnonce'] ) ) ) ) { if ( isset( $_GET['status'] ) && 'cancelled' === $_GET['status'] ) { + $this->logger->info('transaction cancelled by the customer.'); $sdk->set_event_handler( new FlwEventHandler( $order ) )->cancel_payment( $txn_ref ); header( 'Location: ' . wc_get_cart_url() ); die(); @@ -613,6 +614,7 @@ public function flw_verify_payment() { $order = wc_get_order( $order_id ); if ( isset( $_GET['status'] ) && 'cancelled' === $_GET['status'] ) { + $this->logger->info('transaction cancelled by the customer.'); $sdk->set_event_handler( new FlwEventHandler( $order ) )->cancel_payment( $txn_ref ); header( 'Location: ' . wc_get_cart_url() ); die(); @@ -630,10 +632,7 @@ public function flw_verify_payment() { * Process Webhook. */ public function flutterwave_webhooks() { - $public_key = $this->public_key; - $secret_key = $this->secret_key; - $logging_option = $this->logging_option; - $sdk = $this->sdk; + $sdk = $this->sdk; $event = file_get_contents( 'php://input' ); @@ -647,6 +646,7 @@ public function flutterwave_webhooks() { $signature = ( sanitize_text_field( wp_unslash( $_SERVER['HTTP_VERIF_HASH'] ) ) ?? '' ); if ( ! $signature ) { + $this->logger->info( 'Faudulent Webhook Notification Attempt [Access Redirected]' ); // redirect to the home page. wp_safe_redirect( home_url() ); exit(); @@ -655,6 +655,7 @@ public function flutterwave_webhooks() { $local_signature = $this->get_option( 'secret_hash' ); if ( $signature !== $local_signature ) { + $this->logger->info( 'Faudulent Webhook Notification Attempt [Access Restricted]' ); wp_send_json( array( 'status' => 'error', @@ -665,6 +666,7 @@ public function flutterwave_webhooks() { } http_response_code( 200 ); + $this->logger->info("Webhook recieved: ". $event); $event = json_decode( $event ); if ( empty( $event->event ) && empty( $event->data ) ) { @@ -678,6 +680,7 @@ public function flutterwave_webhooks() { } if ( 'test_assess' === $event->event ) { + $this->logger->info( 'Flutterwave Webhook Testing Successful.' ); wp_send_json( array( 'status' => 'success', @@ -695,6 +698,7 @@ public function flutterwave_webhooks() { // check if transaction reference starts with WOOC on hpos enabled. if ( substr( $event_data->tx_ref, 0, 4 ) !== 'WOOC' ) { + $this->logger->info( 'Attempt to verifiy a transaction not produced by the merchants store.' ); wp_send_json( array( 'status' => 'failed', diff --git a/includes/client/class-flw-wc-payment-gateway-sdk.php b/includes/client/class-flw-wc-payment-gateway-sdk.php index 5ef90bf..7fa9761 100644 --- a/includes/client/class-flw-wc-payment-gateway-sdk.php +++ b/includes/client/class-flw-wc-payment-gateway-sdk.php @@ -22,6 +22,7 @@ defined( 'FLUTTERWAVEACCESS' ) || exit( 'No direct script access allowed' ); require_once __DIR__ . '/class-flw-wc-payment-gateway-client.php'; +require_once __DIR__ . '/../util/class-flutterwave-logger.php'; /** * Class FLW_WC_Payment_Gateway_Sdk file. diff --git a/includes/util/class-flutterwave-logger.php b/includes/util/class-flutterwave-logger.php new file mode 100644 index 0000000..a2dc79b --- /dev/null +++ b/includes/util/class-flutterwave-logger.php @@ -0,0 +1,101 @@ + 'flutterwave' ); + /** + * Logger instance. + * + * @var Flutterwave_Logger|null + */ + private static ?Flutterwave_Logger $instance = null; + + /** + * Logger instance. + * + * @var WC_Logger|null + */ + private ?WC_Logger $logger = null; + + /** + * Logger Filename. + * + * @var string + */ + public string $file_name; + + /** + * Logger Constructor. + */ + private function ___construct() {} + + /** + * Get Logger Instance. + */ + public static function instance() { + + if ( null === self::$instance ) { + self::$instance = new Flutterwave_Logger(); + } + return self::$instance; + } + + /** + * Log information + * + * @param string $message constant name. + */ + public function info( string $message ) { + wc_get_logger()->info( $message, $this->source_name ); + } + + /** + * Error information + * + * @param string $message constant name. + */ + public function error( string $message ) { + wc_get_logger()->error( $message, $this->source_name ); + } + + /** + * Alert information + * + * @param string $message constant name. + */ + public function alert( string $message ) { + wc_get_logger()->alert( $message, $this->source_name ); + } + + /** + * Debug information + * + * @param string $message constant name. + */ + public function debug( string $message ) { + wc_get_logger()->debug( $message, $this->source_name ); + } +} \ No newline at end of file From 0e7bc00c94932549e616dcde5bfe1e527b2483ba Mon Sep 17 00:00:00 2001 From: Abraham Olaobaju Date: Mon, 25 Aug 2025 14:24:16 +0000 Subject: [PATCH 2/4] phpcs fix --- includes/class-flw-wc-payment-gateway.php | 8 ++++---- includes/util/class-flutterwave-logger.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/class-flw-wc-payment-gateway.php b/includes/class-flw-wc-payment-gateway.php index 5ea8709..ac0407c 100644 --- a/includes/class-flw-wc-payment-gateway.php +++ b/includes/class-flw-wc-payment-gateway.php @@ -207,7 +207,7 @@ public function __construct() { } $this->logger = Flutterwave_Logger::instance(); - $this->sdk = new FlwSdk( $this->secret_key, self::$log_enabled ); + $this->sdk = new FlwSdk( $this->secret_key, self::$log_enabled ); add_action( 'wp_enqueue_scripts', array( $this, 'payment_scripts' ) ); @@ -600,7 +600,7 @@ public function flw_verify_payment() { if ( ! isset( $_GET['_wpnonce'] ) && ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['_wpnonce'] ) ) ) ) { if ( isset( $_GET['status'] ) && 'cancelled' === $_GET['status'] ) { - $this->logger->info('transaction cancelled by the customer.'); + $this->logger->info( 'transaction cancelled by the customer.' ); $sdk->set_event_handler( new FlwEventHandler( $order ) )->cancel_payment( $txn_ref ); header( 'Location: ' . wc_get_cart_url() ); die(); @@ -614,7 +614,7 @@ public function flw_verify_payment() { $order = wc_get_order( $order_id ); if ( isset( $_GET['status'] ) && 'cancelled' === $_GET['status'] ) { - $this->logger->info('transaction cancelled by the customer.'); + $this->logger->info( 'transaction cancelled by the customer.' ); $sdk->set_event_handler( new FlwEventHandler( $order ) )->cancel_payment( $txn_ref ); header( 'Location: ' . wc_get_cart_url() ); die(); @@ -666,7 +666,7 @@ public function flutterwave_webhooks() { } http_response_code( 200 ); - $this->logger->info("Webhook recieved: ". $event); + $this->logger->info( 'Webhook recieved: ' . $event ); $event = json_decode( $event ); if ( empty( $event->event ) && empty( $event->data ) ) { diff --git a/includes/util/class-flutterwave-logger.php b/includes/util/class-flutterwave-logger.php index a2dc79b..ac4c657 100644 --- a/includes/util/class-flutterwave-logger.php +++ b/includes/util/class-flutterwave-logger.php @@ -50,7 +50,7 @@ final class Flutterwave_Logger { /** * Logger Constructor. */ - private function ___construct() {} + private function __construct() {} /** * Get Logger Instance. @@ -98,4 +98,4 @@ public function alert( string $message ) { public function debug( string $message ) { wc_get_logger()->debug( $message, $this->source_name ); } -} \ No newline at end of file +} From 27fe60b12330345d0a532309a680d115a4110e2d Mon Sep 17 00:00:00 2001 From: Abraham Olaobaju Date: Wed, 27 Aug 2025 21:13:06 +0000 Subject: [PATCH 3/4] update: bump up the version to 2.3.7 --- i18n/languages/rave-woocommerce-payment-gateway.pot | 2 +- includes/class-flutterwave.php | 2 +- package.json | 2 +- rave-woocommerce-payment-gateway.php | 2 +- readme.txt | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/i18n/languages/rave-woocommerce-payment-gateway.pot b/i18n/languages/rave-woocommerce-payment-gateway.pot index 2c0ce25..9cf6ebe 100644 --- a/i18n/languages/rave-woocommerce-payment-gateway.pot +++ b/i18n/languages/rave-woocommerce-payment-gateway.pot @@ -9,7 +9,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2025-08-25T12:02:32+00:00\n" +"POT-Creation-Date: 2025-08-27T20:31:46+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.12.0\n" "X-Domain: rave-woocommerce-payment-gateway\n" diff --git a/includes/class-flutterwave.php b/includes/class-flutterwave.php index 2cf2674..b315fd6 100644 --- a/includes/class-flutterwave.php +++ b/includes/class-flutterwave.php @@ -18,7 +18,7 @@ final class Flutterwave { * * @var string */ - public string $version = '2.3.6'; + public string $version = '2.3.7'; /** * Plugin API version. diff --git a/package.json b/package.json index 2bfb855..b8d57f3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "rave-woocommerce-payment-gateway", "title": "flutterwave-woocommerce", - "version": "2.3.6", + "version": "2.3.7", "description": "Official WooCommerce payment gateway for Flutterwave", "scripts": { "postinstall": "composer install", diff --git a/rave-woocommerce-payment-gateway.php b/rave-woocommerce-payment-gateway.php index d9f549d..ff48d8a 100644 --- a/rave-woocommerce-payment-gateway.php +++ b/rave-woocommerce-payment-gateway.php @@ -3,7 +3,7 @@ * Plugin Name: Flutterwave WooCommerce * Plugin URI: https://developer.flutterwave.com/ * Description: Official WooCommerce payment gateway for Flutterwave. - * Version: 2.3.6 + * Version: 2.3.7 * Author: Flutterwave Developers * Author URI: http://flutterwave.com/us * License: MIT License diff --git a/readme.txt b/readme.txt index c3cc0f5..0b822e5 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: theflutterwave Tags: fintech,flutterwave, woocommerce, payments, nigeria, mastercard, visa, target,Naira,payments,verve,donation,church,shop,store, ghana, kenya, international, mastercard, visa Requires at least: 3.1 Tested up to: 6.7.1 -Stable tag: 2.3.6 +Stable tag: 2.3.7 License: MIT License URI: https://github.com/Flutterwave/Woocommerce/blob/master/LICENSE @@ -11,7 +11,7 @@ The WooCommerce Plugin makes it very easy and quick to add Flutterwave Payment o == Description == -Accept Credit card, Debit card and Bank account payment directly on your store with the official Flutterwave Plugin for WooCommerce. +Accept Credit card, Debit card and Bank account payment directly on your store with the official Flutterwave Plugin for WooCommerce. This plugin supports WooCommerce Version 6.9 or greater. For WooCommerce Version 6.8 or lower please install Flutterwave WooCommerce Version (2.3.6 or lower) of the plugin [here](https://wordpress.org/plugins/rave-woocommerce-payment-gateway/advanced/) at the section update advanced options. = Plugin Features = From 2c24be16d146ecc3c1cf8f39412e64bacf31494a Mon Sep 17 00:00:00 2001 From: Abraham Olaobaju Date: Thu, 28 Aug 2025 16:45:35 +0000 Subject: [PATCH 4/4] Bumped up Flutterwave WC to 3.1.0 --- CHANGELOG.md | 6 ++++++ changelog.txt | 3 +++ includes/class-flutterwave.php | 2 +- package.json | 2 +- rave-woocommerce-payment-gateway.php | 2 +- readme.txt | 4 ++-- 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9da440f..47ca3fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ # Changelog + +## 3.1.0 | 28-08-2025 +General Update +### Version Changes +- [ADDED] Set Minimum Support to WooCommerce 6.9 or greater. +- [ADDED] Flutterwave Logger instance using wc_logger. ## 2.3.6 | 01-09-2025 Bug Fixes and Webhook Handler improvements. ### Version Changes diff --git a/changelog.txt b/changelog.txt index 08cdfb0..03f60f3 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,7 @@ == Changelog == += 3.1.0 = +* Added: Set Minimum Support to WooCommerce 6.9 or greater. +* Added: Flutterwave Logger instance using wc_logger. = 2.3.6 = * Fixed: Dynamic Adjustment to Custom Permalink Set by Merchant. * Fixed: Redirect Payment option return a Payment Mismatch Error. diff --git a/includes/class-flutterwave.php b/includes/class-flutterwave.php index b315fd6..049be44 100644 --- a/includes/class-flutterwave.php +++ b/includes/class-flutterwave.php @@ -18,7 +18,7 @@ final class Flutterwave { * * @var string */ - public string $version = '2.3.7'; + public string $version = '3.1.0'; /** * Plugin API version. diff --git a/package.json b/package.json index b8d57f3..56746e5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "rave-woocommerce-payment-gateway", "title": "flutterwave-woocommerce", - "version": "2.3.7", + "version": "3.1.0", "description": "Official WooCommerce payment gateway for Flutterwave", "scripts": { "postinstall": "composer install", diff --git a/rave-woocommerce-payment-gateway.php b/rave-woocommerce-payment-gateway.php index ff48d8a..a524463 100644 --- a/rave-woocommerce-payment-gateway.php +++ b/rave-woocommerce-payment-gateway.php @@ -3,7 +3,7 @@ * Plugin Name: Flutterwave WooCommerce * Plugin URI: https://developer.flutterwave.com/ * Description: Official WooCommerce payment gateway for Flutterwave. - * Version: 2.3.7 + * Version: 3.1.0 * Author: Flutterwave Developers * Author URI: http://flutterwave.com/us * License: MIT License diff --git a/readme.txt b/readme.txt index 0b822e5..1874664 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: theflutterwave Tags: fintech,flutterwave, woocommerce, payments, nigeria, mastercard, visa, target,Naira,payments,verve,donation,church,shop,store, ghana, kenya, international, mastercard, visa Requires at least: 3.1 Tested up to: 6.7.1 -Stable tag: 2.3.7 +Stable tag: 3.1.0 License: MIT License URI: https://github.com/Flutterwave/Woocommerce/blob/master/LICENSE @@ -22,7 +22,7 @@ Accept Credit card, Debit card and Bank account payment directly on your store w = Requirements = 1. Flutterwave for business [API Keys](https://developer.flutterwave.com/docs/integration-guides/authentication) -2. [WooCommerce](https://woocommerce.com/) +2. [WooCommerce](https://woocommerce.com/) version: >= 6.9 6. Supported PHP version: 7.4.0 - 8.1.0 == Installation ==