Plugin Directory

Changeset 3220062


Ignore:
Timestamp:
01/10/2025 09:07:51 AM (14 months ago)
Author:
flutterwave
Message:

Update to version 2.3.7 from GitHub

Location:
rave-woocommerce-payment-gateway
Files:
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • rave-woocommerce-payment-gateway/tags/2.3.7/changelog.txt

    r3027434 r3220062  
    11== Changelog ==
     2= 2.3.6 =
     3* Fixed: Dynamic Adjustment to Custom Permalink Set by Merchant.
     4* Fixed: Redirect Payment option return a Payment Mismatch Error.
    25= 2.3.5 =
    36* Added: Support for WooCommerce HPOS.
  • rave-woocommerce-payment-gateway/tags/2.3.7/i18n/languages/rave-woocommerce-payment-gateway.pot

    r3027434 r3220062  
    1 # Copyright (C) 2024 Flutterwave Developers
     1# Copyright (C) 2025 Flutterwave Developers
    22# This file is distributed under the MIT License.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Flutterwave WooCommerce 2.3.5\n"
     5"Project-Id-Version: Flutterwave WooCommerce 2.3.6\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/rave-woocommerce-payment-gateway\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2024-01-26T17:05:41+00:00\n"
     12"POT-Creation-Date: 2025-01-10T09:07:15+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.9.0\n"
     14"X-Generator: WP-CLI 2.11.0\n"
    1515"X-Domain: rave-woocommerce-payment-gateway\n"
    1616
    1717#. Plugin Name of the plugin
    1818#. Translators: %s Plugin name.
     19#: rave-woocommerce-payment-gateway.php
    1920#: includes/class-flw-wc-payment-gateway.php:227
    2021#: includes/views/html-admin-missing-woocommerce.php:15
     
    2324
    2425#. Plugin URI of the plugin
     26#: rave-woocommerce-payment-gateway.php
    2527msgid "https://developer.flutterwave.com/"
    2628msgstr ""
    2729
    2830#. Description of the plugin
     31#: rave-woocommerce-payment-gateway.php
    2932msgid "Official WooCommerce payment gateway for Flutterwave."
    3033msgstr ""
    3134
    3235#. Author of the plugin
     36#: rave-woocommerce-payment-gateway.php
    3337msgid "Flutterwave Developers"
    3438msgstr ""
    3539
    3640#. Author URI of the plugin
     41#: rave-woocommerce-payment-gateway.php
    3742msgid "http://flutterwave.com/us"
    3843msgstr ""
     
    345350msgstr ""
    346351
    347 #: includes/class-flw-wc-payment-gateway.php:551
     352#: includes/class-flw-wc-payment-gateway.php:579
    348353msgid "Order Payment"
    349354msgstr ""
    350355
    351 #: includes/client/class-flw-wc-payment-gateway-request.php:126
     356#: includes/client/class-flw-wc-payment-gateway-request.php:153
    352357msgid "Payment for order "
    353358msgstr ""
  • rave-woocommerce-payment-gateway/tags/2.3.7/includes/class-flutterwave.php

    r3027434 r3220062  
    1919     * @var string
    2020     */
    21     public string $version = '2.3.5';
     21    public string $version = '2.3.6';
    2222
    2323    /**
     
    2727     */
    2828    public string $api_version = 'v3';
     29
    2930    /**
    3031     * Plugin instance.
     
    120121
    121122        $this->register_payment_gateway();
    122 
    123123    }
    124124
  • rave-woocommerce-payment-gateway/tags/2.3.7/includes/class-flw-wc-payment-gateway.php

    r3027434 r3220062  
    533533            $currency      = $order->get_currency();
    534534            $custom_nonce  = wp_create_nonce();
    535             $redirect_url  = WC()->api_request_url( 'FLW_WC_Payment_Gateway' ) . '?order_id=' . $order_id . '&_wpnonce=' . $custom_nonce;
     535            $redirect_url  = '';
     536
     537            $flutterwave_woo_url = WC()->api_request_url( 'FLW_WC_Payment_Gateway' );
     538
     539            // Parse the base URL to check for existing query parameters.
     540            $url_parts = wp_parse_url( $flutterwave_woo_url );
     541
     542            // If the base URL already has query parameters, merge them with new ones.
     543            if ( isset( $url_parts['query'] ) ) {
     544                // Convert the query string to an array.
     545                parse_str( $url_parts['query'], $query_array );
     546
     547                // Add the new parameters to the existing query array.
     548                $query_array['order_id'] = $order_id;
     549
     550                // Rebuild the query string with the new parameters.
     551                $new_query_string = http_build_query( $query_array );
     552
     553                // Rebuild the final URL with the new query string.
     554                $redirect_url = $url_parts['scheme'] . '://' . $url_parts['host'] . $url_parts['path'] . '?' . $new_query_string;
     555            } else {
     556                // If no existing query parameters, simply append the new ones.
     557                $redirect_url = add_query_arg(
     558                    array(
     559                        'order_id' => $order_id,
     560                        '_wpnonce' => $custom_nonce,
     561                    ),
     562                    $flutterwave_woo_url
     563                );
     564            }
    536565
    537566            if ( $the_order_id === $order_id && $the_order_key === $order_key ) {
    538 
    539567                $payment_args['email']           = $email;
    540568                $payment_args['amount']          = $amount;
     
    561589
    562590    /**
    563      * Verify payment made on the checkout page
     591     * Verify payment made on the checkout page.
    564592     *
    565593     * @return void
     
    600628
    601629    /**
    602      * Process Webhook
     630     * Process Webhook.
    603631     */
    604632    public function flutterwave_webhooks() {
     
    681709            $order_id = intval( $o[1] );
    682710            $order    = wc_get_order( $order_id );
     711
     712            if ( ! $order ) {
     713                wp_send_json(
     714                    array(
     715                        'status'  => 'error',
     716                        'message' => 'Invalid Reference',
     717                        'reason'  => 'Order does not belong to store',
     718                    ),
     719                    WP_Http::BAD_REQUEST
     720                );
     721            }
     722
    683723            // get order status.
    684724            $current_order_status = $order->get_status();
  • rave-woocommerce-payment-gateway/tags/2.3.7/includes/client/class-flw-wc-payment-gateway-request.php

    r2916059 r3220062  
    8383        $order_id = $order->get_id();
    8484        $txnref   = 'WOOC_' . $order_id . '_' . time();
    85         $amount   = $order->get_total();
     85        $amount   = (float) $order->get_total();
    8686        $currency = $order->get_currency();
    8787        $email    = $order->get_billing_email();
     
    9696        }
    9797
    98         $data_to_hash  = array(
     98        $data_to_hash = array(
    9999            'amount'     => $amount,
    100100            'currency'   => $currency,
     
    103103            'secret_key' => $secret_key,
    104104        );
     105
    105106        $checkout_hash = $this->generate_checkout_hash( $data_to_hash );
     107
     108        // Parse the base URL to check for existing query parameters.
     109        $url_parts = wp_parse_url( $this->notify_url );
     110
     111        // If the base URL already has query parameters, merge them with new ones.
     112        if ( isset( $url_parts['query'] ) ) {
     113            // Convert the query string to an array.
     114            parse_str( $url_parts['query'], $query_array );
     115
     116            // Add the new parameters to the existing query array.
     117            $query_array['order_id'] = $order_id;
     118
     119            // Rebuild the query string with the new parameters.
     120            $new_query_string = http_build_query( $query_array );
     121
     122            // Rebuild the final URL with the new query string.
     123            $callback_url = $url_parts['scheme'] . '://' . $url_parts['host'] . $url_parts['path'] . '?' . $new_query_string;
     124        } else {
     125            // If no existing query parameters, simply append the new ones.
     126            $callback_url = add_query_arg(
     127                array(
     128                    'order_id' => $order_id,
     129                ),
     130                $this->notify_url
     131            );
     132        }
    106133
    107134        return array(
     
    110137            'currency'        => $currency,
    111138            'payment_options' => 'card',
    112             'redirect_url'    => $this->notify_url . '?order_id=' . $order_id,
     139            'redirect_url'    => $callback_url,
    113140            'payload_hash'    => $checkout_hash,
    114141            'customer'        => array(
  • rave-woocommerce-payment-gateway/tags/2.3.7/rave-woocommerce-payment-gateway.php

    r3027434 r3220062  
    44 * Plugin URI: https://developer.flutterwave.com/
    55 * Description: Official WooCommerce payment gateway for Flutterwave.
    6  * Version: 2.3.5
     6 * Version: 2.3.6
    77 * Author: Flutterwave Developers
    88 * Author URI: http://flutterwave.com/us
     
    1010 * Text Domain: rave-woocommerce-payment-gateway
    1111 * Domain Path: i18n/languages
    12  * WC requires at least:   6.9.1
     12 * WC requires at least:   9.6.0
    1313 * WC tested up to:        8.4.0
    1414 * Requires at least:      5.6
  • rave-woocommerce-payment-gateway/tags/2.3.7/readme.txt

    r3027434 r3220062  
    33Tags: fintech,flutterwave, woocommerce, payments, nigeria, mastercard, visa, target,Naira,payments,verve,donation,church,shop,store, ghana, kenya, international, mastercard, visa
    44Requires at least: 3.1
    5 Tested up to: 6.4.2
    6 Stable tag: 2.3.5
     5Tested up to: 6.7.1
     6Stable tag: 2.3.6
    77License: MIT
    88License URI: https://github.com/Flutterwave/Woocommerce/blob/master/LICENSE
     
    9797
    9898== Changelog ==
     99= 2.3.6 =
     100* Fixed: Dynamic Adjustment to Custom Permalink Set by Merchant.
     101* Fixed: Redirect Payment option return a Payment Mismatch Error.
    99102= 2.3.5 =
    100103* Added: Support for HPOS.
  • rave-woocommerce-payment-gateway/trunk/changelog.txt

    r3027434 r3220062  
    11== Changelog ==
     2= 2.3.6 =
     3* Fixed: Dynamic Adjustment to Custom Permalink Set by Merchant.
     4* Fixed: Redirect Payment option return a Payment Mismatch Error.
    25= 2.3.5 =
    36* Added: Support for WooCommerce HPOS.
  • rave-woocommerce-payment-gateway/trunk/i18n/languages/rave-woocommerce-payment-gateway.pot

    r3027434 r3220062  
    1 # Copyright (C) 2024 Flutterwave Developers
     1# Copyright (C) 2025 Flutterwave Developers
    22# This file is distributed under the MIT License.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Flutterwave WooCommerce 2.3.5\n"
     5"Project-Id-Version: Flutterwave WooCommerce 2.3.6\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/rave-woocommerce-payment-gateway\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2024-01-26T17:05:41+00:00\n"
     12"POT-Creation-Date: 2025-01-10T09:07:15+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.9.0\n"
     14"X-Generator: WP-CLI 2.11.0\n"
    1515"X-Domain: rave-woocommerce-payment-gateway\n"
    1616
    1717#. Plugin Name of the plugin
    1818#. Translators: %s Plugin name.
     19#: rave-woocommerce-payment-gateway.php
    1920#: includes/class-flw-wc-payment-gateway.php:227
    2021#: includes/views/html-admin-missing-woocommerce.php:15
     
    2324
    2425#. Plugin URI of the plugin
     26#: rave-woocommerce-payment-gateway.php
    2527msgid "https://developer.flutterwave.com/"
    2628msgstr ""
    2729
    2830#. Description of the plugin
     31#: rave-woocommerce-payment-gateway.php
    2932msgid "Official WooCommerce payment gateway for Flutterwave."
    3033msgstr ""
    3134
    3235#. Author of the plugin
     36#: rave-woocommerce-payment-gateway.php
    3337msgid "Flutterwave Developers"
    3438msgstr ""
    3539
    3640#. Author URI of the plugin
     41#: rave-woocommerce-payment-gateway.php
    3742msgid "http://flutterwave.com/us"
    3843msgstr ""
     
    345350msgstr ""
    346351
    347 #: includes/class-flw-wc-payment-gateway.php:551
     352#: includes/class-flw-wc-payment-gateway.php:579
    348353msgid "Order Payment"
    349354msgstr ""
    350355
    351 #: includes/client/class-flw-wc-payment-gateway-request.php:126
     356#: includes/client/class-flw-wc-payment-gateway-request.php:153
    352357msgid "Payment for order "
    353358msgstr ""
  • rave-woocommerce-payment-gateway/trunk/includes/class-flutterwave.php

    r3027434 r3220062  
    1919     * @var string
    2020     */
    21     public string $version = '2.3.5';
     21    public string $version = '2.3.6';
    2222
    2323    /**
     
    2727     */
    2828    public string $api_version = 'v3';
     29
    2930    /**
    3031     * Plugin instance.
     
    120121
    121122        $this->register_payment_gateway();
    122 
    123123    }
    124124
  • rave-woocommerce-payment-gateway/trunk/includes/class-flw-wc-payment-gateway.php

    r3027434 r3220062  
    533533            $currency      = $order->get_currency();
    534534            $custom_nonce  = wp_create_nonce();
    535             $redirect_url  = WC()->api_request_url( 'FLW_WC_Payment_Gateway' ) . '?order_id=' . $order_id . '&_wpnonce=' . $custom_nonce;
     535            $redirect_url  = '';
     536
     537            $flutterwave_woo_url = WC()->api_request_url( 'FLW_WC_Payment_Gateway' );
     538
     539            // Parse the base URL to check for existing query parameters.
     540            $url_parts = wp_parse_url( $flutterwave_woo_url );
     541
     542            // If the base URL already has query parameters, merge them with new ones.
     543            if ( isset( $url_parts['query'] ) ) {
     544                // Convert the query string to an array.
     545                parse_str( $url_parts['query'], $query_array );
     546
     547                // Add the new parameters to the existing query array.
     548                $query_array['order_id'] = $order_id;
     549
     550                // Rebuild the query string with the new parameters.
     551                $new_query_string = http_build_query( $query_array );
     552
     553                // Rebuild the final URL with the new query string.
     554                $redirect_url = $url_parts['scheme'] . '://' . $url_parts['host'] . $url_parts['path'] . '?' . $new_query_string;
     555            } else {
     556                // If no existing query parameters, simply append the new ones.
     557                $redirect_url = add_query_arg(
     558                    array(
     559                        'order_id' => $order_id,
     560                        '_wpnonce' => $custom_nonce,
     561                    ),
     562                    $flutterwave_woo_url
     563                );
     564            }
    536565
    537566            if ( $the_order_id === $order_id && $the_order_key === $order_key ) {
    538 
    539567                $payment_args['email']           = $email;
    540568                $payment_args['amount']          = $amount;
     
    561589
    562590    /**
    563      * Verify payment made on the checkout page
     591     * Verify payment made on the checkout page.
    564592     *
    565593     * @return void
     
    600628
    601629    /**
    602      * Process Webhook
     630     * Process Webhook.
    603631     */
    604632    public function flutterwave_webhooks() {
     
    681709            $order_id = intval( $o[1] );
    682710            $order    = wc_get_order( $order_id );
     711
     712            if ( ! $order ) {
     713                wp_send_json(
     714                    array(
     715                        'status'  => 'error',
     716                        'message' => 'Invalid Reference',
     717                        'reason'  => 'Order does not belong to store',
     718                    ),
     719                    WP_Http::BAD_REQUEST
     720                );
     721            }
     722
    683723            // get order status.
    684724            $current_order_status = $order->get_status();
  • rave-woocommerce-payment-gateway/trunk/includes/client/class-flw-wc-payment-gateway-request.php

    r2916059 r3220062  
    8383        $order_id = $order->get_id();
    8484        $txnref   = 'WOOC_' . $order_id . '_' . time();
    85         $amount   = $order->get_total();
     85        $amount   = (float) $order->get_total();
    8686        $currency = $order->get_currency();
    8787        $email    = $order->get_billing_email();
     
    9696        }
    9797
    98         $data_to_hash  = array(
     98        $data_to_hash = array(
    9999            'amount'     => $amount,
    100100            'currency'   => $currency,
     
    103103            'secret_key' => $secret_key,
    104104        );
     105
    105106        $checkout_hash = $this->generate_checkout_hash( $data_to_hash );
     107
     108        // Parse the base URL to check for existing query parameters.
     109        $url_parts = wp_parse_url( $this->notify_url );
     110
     111        // If the base URL already has query parameters, merge them with new ones.
     112        if ( isset( $url_parts['query'] ) ) {
     113            // Convert the query string to an array.
     114            parse_str( $url_parts['query'], $query_array );
     115
     116            // Add the new parameters to the existing query array.
     117            $query_array['order_id'] = $order_id;
     118
     119            // Rebuild the query string with the new parameters.
     120            $new_query_string = http_build_query( $query_array );
     121
     122            // Rebuild the final URL with the new query string.
     123            $callback_url = $url_parts['scheme'] . '://' . $url_parts['host'] . $url_parts['path'] . '?' . $new_query_string;
     124        } else {
     125            // If no existing query parameters, simply append the new ones.
     126            $callback_url = add_query_arg(
     127                array(
     128                    'order_id' => $order_id,
     129                ),
     130                $this->notify_url
     131            );
     132        }
    106133
    107134        return array(
     
    110137            'currency'        => $currency,
    111138            'payment_options' => 'card',
    112             'redirect_url'    => $this->notify_url . '?order_id=' . $order_id,
     139            'redirect_url'    => $callback_url,
    113140            'payload_hash'    => $checkout_hash,
    114141            'customer'        => array(
  • rave-woocommerce-payment-gateway/trunk/rave-woocommerce-payment-gateway.php

    r3027434 r3220062  
    44 * Plugin URI: https://developer.flutterwave.com/
    55 * Description: Official WooCommerce payment gateway for Flutterwave.
    6  * Version: 2.3.5
     6 * Version: 2.3.6
    77 * Author: Flutterwave Developers
    88 * Author URI: http://flutterwave.com/us
     
    1010 * Text Domain: rave-woocommerce-payment-gateway
    1111 * Domain Path: i18n/languages
    12  * WC requires at least:   6.9.1
     12 * WC requires at least:   9.6.0
    1313 * WC tested up to:        8.4.0
    1414 * Requires at least:      5.6
  • rave-woocommerce-payment-gateway/trunk/readme.txt

    r3027434 r3220062  
    33Tags: fintech,flutterwave, woocommerce, payments, nigeria, mastercard, visa, target,Naira,payments,verve,donation,church,shop,store, ghana, kenya, international, mastercard, visa
    44Requires at least: 3.1
    5 Tested up to: 6.4.2
    6 Stable tag: 2.3.5
     5Tested up to: 6.7.1
     6Stable tag: 2.3.6
    77License: MIT
    88License URI: https://github.com/Flutterwave/Woocommerce/blob/master/LICENSE
     
    9797
    9898== Changelog ==
     99= 2.3.6 =
     100* Fixed: Dynamic Adjustment to Custom Permalink Set by Merchant.
     101* Fixed: Redirect Payment option return a Payment Mismatch Error.
    99102= 2.3.5 =
    100103* Added: Support for HPOS.
Note: See TracChangeset for help on using the changeset viewer.