Plugin Directory

Changeset 2966570


Ignore:
Timestamp:
09/13/2023 02:23:43 PM (2 years ago)
Author:
flutterwave
Message:

Update to version 2.3.3 from GitHub

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

Legend:

Unmodified
Added
Removed
  • rave-woocommerce-payment-gateway/tags/2.3.3/i18n/languages/rave-woocommerce-payment-gateway.pot

    r2916059 r2966570  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Flutterwave WooCommerce 2.3.2\n"
     5"Project-Id-Version: Flutterwave WooCommerce 2.3.3\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: 2023-05-22T19:32:29+00:00\n"
     12"POT-Creation-Date: 2023-09-13T14:23:27+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.7.1\n"
     14"X-Generator: WP-CLI 2.8.1\n"
    1515"X-Domain: rave-woocommerce-payment-gateway\n"
    1616
     
    6363msgstr ""
    6464
    65 #: includes/class-flw-wc-payment-gateway-event-handler.php:46
     65#: includes/class-flw-wc-payment-gateway-event-handler.php:64
    6666msgid "Payment initialized via Flutterwave"
    6767msgstr ""
    6868
    69 #: includes/class-flw-wc-payment-gateway-event-handler.php:48
     69#: includes/class-flw-wc-payment-gateway-event-handler.php:66
    7070msgid "Your transaction reference: "
    7171msgstr ""
    7272
    73 #: includes/class-flw-wc-payment-gateway-event-handler.php:68
     73#: includes/class-flw-wc-payment-gateway-event-handler.php:83
    7474msgid "Attention: New order has been placed on hold because of incorrect payment amount or currency. Please, look into it."
    7575msgstr ""
    7676
    77 #: includes/class-flw-wc-payment-gateway-event-handler.php:69
     77#: includes/class-flw-wc-payment-gateway-event-handler.php:84
    7878msgid "Amount paid: "
    7979msgstr ""
    8080
    81 #: includes/class-flw-wc-payment-gateway-event-handler.php:69
     81#: includes/class-flw-wc-payment-gateway-event-handler.php:84
    8282msgid "Order amount: "
    8383msgstr ""
    8484
    85 #: includes/class-flw-wc-payment-gateway-event-handler.php:69
     85#: includes/class-flw-wc-payment-gateway-event-handler.php:84
    8686msgid " Reference: "
    8787msgstr ""
    8888
    89 #: includes/class-flw-wc-payment-gateway-event-handler.php:109
     89#: includes/class-flw-wc-payment-gateway-event-handler.php:124
    9090msgid "The payment failed on Flutterwave"
    9191msgstr ""
    9292
    93 #: includes/class-flw-wc-payment-gateway-event-handler.php:114
     93#: includes/class-flw-wc-payment-gateway-event-handler.php:129
    9494msgid "Reason for Failure : "
    9595msgstr ""
    9696
    97 #: includes/class-flw-wc-payment-gateway-event-handler.php:126
     97#: includes/class-flw-wc-payment-gateway-event-handler.php:141
    9898msgid "Confirming payment on Flutterwave"
    9999msgstr ""
    100100
    101 #: includes/class-flw-wc-payment-gateway-event-handler.php:136
     101#: includes/class-flw-wc-payment-gateway-event-handler.php:151
    102102msgid "An error occured while confirming payment on Flutterwave"
    103103msgstr ""
    104104
    105 #: includes/class-flw-wc-payment-gateway-event-handler.php:141
     105#: includes/class-flw-wc-payment-gateway-event-handler.php:156
    106106msgid "Attention: New order has been placed on hold because we could not confirm the payment. Please, look into it."
    107107msgstr ""
    108108
    109 #: includes/class-flw-wc-payment-gateway-event-handler.php:157
     109#: includes/class-flw-wc-payment-gateway-event-handler.php:172
    110110msgid "The customer clicked on the cancel button on Checkout."
    111111msgstr ""
    112112
    113 #: includes/class-flw-wc-payment-gateway-event-handler.php:159
     113#: includes/class-flw-wc-payment-gateway-event-handler.php:174
    114114msgid "Attention: Customer clicked on the cancel button on the payment gateway. We have updated the order to cancelled status. "
    115115msgstr ""
    116116
    117 #: includes/class-flw-wc-payment-gateway-event-handler.php:160
     117#: includes/class-flw-wc-payment-gateway-event-handler.php:175
    118118msgid "Please, confirm from the order notes that there is no note of a successful transaction. If there is, this means that the user was debited and you either have to give value for the transaction or refund the customer."
    119119msgstr ""
    120120
    121 #: includes/class-flw-wc-payment-gateway-event-handler.php:174
     121#: includes/class-flw-wc-payment-gateway-event-handler.php:189
    122122msgid "The payment didn't return a valid response. It could have timed out or abandoned by the customer on Flutterwave"
    123123msgstr ""
    124124
    125 #: includes/class-flw-wc-payment-gateway-event-handler.php:179
     125#: includes/class-flw-wc-payment-gateway-event-handler.php:194
    126126msgid "Attention: New order has been placed on hold because we could not get a definite response from the payment gateway. Kindly contact the Rave support team at hi@flutterwave.com to confirm the payment."
    127127msgstr ""
    128128
    129 #: includes/class-flw-wc-payment-gateway-event-handler.php:180
     129#: includes/class-flw-wc-payment-gateway-event-handler.php:195
    130130msgid "Payment Reference: "
    131131msgstr ""
  • rave-woocommerce-payment-gateway/tags/2.3.3/includes/class-flutterwave.php

    r2916059 r2966570  
    1919     * @var string
    2020     */
    21     public string $version = '2.3.2';
     21    public string $version = '2.3.3';
    2222
    2323    /**
     
    7777        $this->define( 'FLW_WC_MIN_WC_VER', '7.1' );
    7878        $this->define( 'FLW_WC_URL', trailingslashit( plugins_url( '/', FLW_WC_PLUGIN_FILE ) ) );
     79        $this->define( 'FLW_WC_EPSILON', 0.01 );
    7980    }
    8081
  • rave-woocommerce-payment-gateway/tags/2.3.3/includes/class-flw-wc-payment-gateway-event-handler.php

    r2916059 r2966570  
    3838
    3939    /**
     40     * Check Amount Equals.
     41     *
     42     * Checks to see whether the given amounts are equal using a proper floating
     43     * point comparison with an Epsilon which ensures that insignificant decimal
     44     * places are ignored in the comparison.
     45     *
     46     * eg. 100.00 is equal to 100.0001
     47     *
     48     * @param Float $amount1 1st amount for comparison.
     49     * @param Float $amount2  2nd amount for comparison.
     50     * @since 2.3.3
     51     * @return bool
     52     */
     53    public function amounts_equal( $amount1, $amount2 ): bool {
     54        return ! ( abs( floatval( $amount1 ) - floatval( $amount2 ) ) > FLW_WC_EPSILON );
     55    }
     56
     57    /**
    4058     * This is called when the Flutterwave class is initialized
    4159     *
     
    5674    public function on_successful( object $transaction_data ) {
    5775        if ( 'successful' === $transaction_data->status ) {
    58             $amount             = (float) $transaction_data->amount;
    59             $decimal            = wc_get_price_decimals() ?? 2;
    60             $decimal_separator  = wc_get_price_decimal_separator() ?? '.';
    61             $thousand_separator = wc_get_price_thousand_separator() ?? '';
    62             $amount             = number_format( $amount, $decimal, $decimal_separator, $thousand_separator );
    63             if ( $transaction_data->currency !== $this->order->get_currency() || $amount !== $this->order->get_total() ) {
     76            $amount = (float) $transaction_data->amount;
     77
     78            if ( $transaction_data->currency !== $this->order->get_currency() || ! $this->amounts_equal( $amount, $this->order->get_total() ) ) {
    6479                $this->order->update_status( 'on-hold' );
    6580                $customer_note  = 'Thank you for your order.<br>';
     
    6782                $customer_note .= 'because the we couldn\t verify your order. Please, contact us for information regarding this order.';
    6883                $admin_note     = esc_html__( 'Attention: New order has been placed on hold because of incorrect payment amount or currency. Please, look into it.', 'rave-woocommerce-payment-gateway' ) . '<br>';
    69                 $admin_note    .= esc_html__( 'Amount paid: ', 'rave-woocommerce-payment-gateway' ) . $transaction_data->currency . ' ' . $transaction_data->amount . ' <br>' . esc_html__( 'Order amount: ', 'rave-woocommerce-payment-gateway' ) . $this->order->get_currency() . ' ' . $this->order->get_total() . ' <br>' . esc_html__( ' Reference: ', 'rave-woocommerce-payment-gateway' ) . $transaction_data->tx_ref;
     84                $admin_note    .= esc_html__( 'Amount paid: ', 'rave-woocommerce-payment-gateway' ) . $transaction_data->currency . ' ' . $amount . ' <br>' . esc_html__( 'Order amount: ', 'rave-woocommerce-payment-gateway' ) . $this->order->get_currency() . ' ' . $this->order->get_total() . ' <br>' . esc_html__( ' Reference: ', 'rave-woocommerce-payment-gateway' ) . $transaction_data->tx_ref;
    7085
    7186                $this->order->add_order_note( $customer_note, 1 );
  • rave-woocommerce-payment-gateway/tags/2.3.3/rave-woocommerce-payment-gateway.php

    r2916059 r2966570  
    44 * Plugin URI: https://developer.flutterwave.com/
    55 * Description: Official WooCommerce payment gateway for Flutterwave.
    6  * Version: 2.3.2
     6 * Version: 2.3.3
    77 * Author: Flutterwave Developers
    88 * Author URI: http://flutterwave.com/us
  • rave-woocommerce-payment-gateway/tags/2.3.3/readme.txt

    r2916059 r2966570  
    44Requires at least: 3.1
    55Tested up to: 6.2.1
    6 Stable tag: 2.3.2
     6Stable tag: 2.3.3
    77License: MIT
    88License URI: https://github.com/Flutterwave/Woocommerce/blob/master/LICENSE
  • rave-woocommerce-payment-gateway/trunk/i18n/languages/rave-woocommerce-payment-gateway.pot

    r2916059 r2966570  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Flutterwave WooCommerce 2.3.2\n"
     5"Project-Id-Version: Flutterwave WooCommerce 2.3.3\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: 2023-05-22T19:32:29+00:00\n"
     12"POT-Creation-Date: 2023-09-13T14:23:27+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.7.1\n"
     14"X-Generator: WP-CLI 2.8.1\n"
    1515"X-Domain: rave-woocommerce-payment-gateway\n"
    1616
     
    6363msgstr ""
    6464
    65 #: includes/class-flw-wc-payment-gateway-event-handler.php:46
     65#: includes/class-flw-wc-payment-gateway-event-handler.php:64
    6666msgid "Payment initialized via Flutterwave"
    6767msgstr ""
    6868
    69 #: includes/class-flw-wc-payment-gateway-event-handler.php:48
     69#: includes/class-flw-wc-payment-gateway-event-handler.php:66
    7070msgid "Your transaction reference: "
    7171msgstr ""
    7272
    73 #: includes/class-flw-wc-payment-gateway-event-handler.php:68
     73#: includes/class-flw-wc-payment-gateway-event-handler.php:83
    7474msgid "Attention: New order has been placed on hold because of incorrect payment amount or currency. Please, look into it."
    7575msgstr ""
    7676
    77 #: includes/class-flw-wc-payment-gateway-event-handler.php:69
     77#: includes/class-flw-wc-payment-gateway-event-handler.php:84
    7878msgid "Amount paid: "
    7979msgstr ""
    8080
    81 #: includes/class-flw-wc-payment-gateway-event-handler.php:69
     81#: includes/class-flw-wc-payment-gateway-event-handler.php:84
    8282msgid "Order amount: "
    8383msgstr ""
    8484
    85 #: includes/class-flw-wc-payment-gateway-event-handler.php:69
     85#: includes/class-flw-wc-payment-gateway-event-handler.php:84
    8686msgid " Reference: "
    8787msgstr ""
    8888
    89 #: includes/class-flw-wc-payment-gateway-event-handler.php:109
     89#: includes/class-flw-wc-payment-gateway-event-handler.php:124
    9090msgid "The payment failed on Flutterwave"
    9191msgstr ""
    9292
    93 #: includes/class-flw-wc-payment-gateway-event-handler.php:114
     93#: includes/class-flw-wc-payment-gateway-event-handler.php:129
    9494msgid "Reason for Failure : "
    9595msgstr ""
    9696
    97 #: includes/class-flw-wc-payment-gateway-event-handler.php:126
     97#: includes/class-flw-wc-payment-gateway-event-handler.php:141
    9898msgid "Confirming payment on Flutterwave"
    9999msgstr ""
    100100
    101 #: includes/class-flw-wc-payment-gateway-event-handler.php:136
     101#: includes/class-flw-wc-payment-gateway-event-handler.php:151
    102102msgid "An error occured while confirming payment on Flutterwave"
    103103msgstr ""
    104104
    105 #: includes/class-flw-wc-payment-gateway-event-handler.php:141
     105#: includes/class-flw-wc-payment-gateway-event-handler.php:156
    106106msgid "Attention: New order has been placed on hold because we could not confirm the payment. Please, look into it."
    107107msgstr ""
    108108
    109 #: includes/class-flw-wc-payment-gateway-event-handler.php:157
     109#: includes/class-flw-wc-payment-gateway-event-handler.php:172
    110110msgid "The customer clicked on the cancel button on Checkout."
    111111msgstr ""
    112112
    113 #: includes/class-flw-wc-payment-gateway-event-handler.php:159
     113#: includes/class-flw-wc-payment-gateway-event-handler.php:174
    114114msgid "Attention: Customer clicked on the cancel button on the payment gateway. We have updated the order to cancelled status. "
    115115msgstr ""
    116116
    117 #: includes/class-flw-wc-payment-gateway-event-handler.php:160
     117#: includes/class-flw-wc-payment-gateway-event-handler.php:175
    118118msgid "Please, confirm from the order notes that there is no note of a successful transaction. If there is, this means that the user was debited and you either have to give value for the transaction or refund the customer."
    119119msgstr ""
    120120
    121 #: includes/class-flw-wc-payment-gateway-event-handler.php:174
     121#: includes/class-flw-wc-payment-gateway-event-handler.php:189
    122122msgid "The payment didn't return a valid response. It could have timed out or abandoned by the customer on Flutterwave"
    123123msgstr ""
    124124
    125 #: includes/class-flw-wc-payment-gateway-event-handler.php:179
     125#: includes/class-flw-wc-payment-gateway-event-handler.php:194
    126126msgid "Attention: New order has been placed on hold because we could not get a definite response from the payment gateway. Kindly contact the Rave support team at hi@flutterwave.com to confirm the payment."
    127127msgstr ""
    128128
    129 #: includes/class-flw-wc-payment-gateway-event-handler.php:180
     129#: includes/class-flw-wc-payment-gateway-event-handler.php:195
    130130msgid "Payment Reference: "
    131131msgstr ""
  • rave-woocommerce-payment-gateway/trunk/includes/class-flutterwave.php

    r2916059 r2966570  
    1919     * @var string
    2020     */
    21     public string $version = '2.3.2';
     21    public string $version = '2.3.3';
    2222
    2323    /**
     
    7777        $this->define( 'FLW_WC_MIN_WC_VER', '7.1' );
    7878        $this->define( 'FLW_WC_URL', trailingslashit( plugins_url( '/', FLW_WC_PLUGIN_FILE ) ) );
     79        $this->define( 'FLW_WC_EPSILON', 0.01 );
    7980    }
    8081
  • rave-woocommerce-payment-gateway/trunk/includes/class-flw-wc-payment-gateway-event-handler.php

    r2916059 r2966570  
    3838
    3939    /**
     40     * Check Amount Equals.
     41     *
     42     * Checks to see whether the given amounts are equal using a proper floating
     43     * point comparison with an Epsilon which ensures that insignificant decimal
     44     * places are ignored in the comparison.
     45     *
     46     * eg. 100.00 is equal to 100.0001
     47     *
     48     * @param Float $amount1 1st amount for comparison.
     49     * @param Float $amount2  2nd amount for comparison.
     50     * @since 2.3.3
     51     * @return bool
     52     */
     53    public function amounts_equal( $amount1, $amount2 ): bool {
     54        return ! ( abs( floatval( $amount1 ) - floatval( $amount2 ) ) > FLW_WC_EPSILON );
     55    }
     56
     57    /**
    4058     * This is called when the Flutterwave class is initialized
    4159     *
     
    5674    public function on_successful( object $transaction_data ) {
    5775        if ( 'successful' === $transaction_data->status ) {
    58             $amount             = (float) $transaction_data->amount;
    59             $decimal            = wc_get_price_decimals() ?? 2;
    60             $decimal_separator  = wc_get_price_decimal_separator() ?? '.';
    61             $thousand_separator = wc_get_price_thousand_separator() ?? '';
    62             $amount             = number_format( $amount, $decimal, $decimal_separator, $thousand_separator );
    63             if ( $transaction_data->currency !== $this->order->get_currency() || $amount !== $this->order->get_total() ) {
     76            $amount = (float) $transaction_data->amount;
     77
     78            if ( $transaction_data->currency !== $this->order->get_currency() || ! $this->amounts_equal( $amount, $this->order->get_total() ) ) {
    6479                $this->order->update_status( 'on-hold' );
    6580                $customer_note  = 'Thank you for your order.<br>';
     
    6782                $customer_note .= 'because the we couldn\t verify your order. Please, contact us for information regarding this order.';
    6883                $admin_note     = esc_html__( 'Attention: New order has been placed on hold because of incorrect payment amount or currency. Please, look into it.', 'rave-woocommerce-payment-gateway' ) . '<br>';
    69                 $admin_note    .= esc_html__( 'Amount paid: ', 'rave-woocommerce-payment-gateway' ) . $transaction_data->currency . ' ' . $transaction_data->amount . ' <br>' . esc_html__( 'Order amount: ', 'rave-woocommerce-payment-gateway' ) . $this->order->get_currency() . ' ' . $this->order->get_total() . ' <br>' . esc_html__( ' Reference: ', 'rave-woocommerce-payment-gateway' ) . $transaction_data->tx_ref;
     84                $admin_note    .= esc_html__( 'Amount paid: ', 'rave-woocommerce-payment-gateway' ) . $transaction_data->currency . ' ' . $amount . ' <br>' . esc_html__( 'Order amount: ', 'rave-woocommerce-payment-gateway' ) . $this->order->get_currency() . ' ' . $this->order->get_total() . ' <br>' . esc_html__( ' Reference: ', 'rave-woocommerce-payment-gateway' ) . $transaction_data->tx_ref;
    7085
    7186                $this->order->add_order_note( $customer_note, 1 );
  • rave-woocommerce-payment-gateway/trunk/rave-woocommerce-payment-gateway.php

    r2916059 r2966570  
    44 * Plugin URI: https://developer.flutterwave.com/
    55 * Description: Official WooCommerce payment gateway for Flutterwave.
    6  * Version: 2.3.2
     6 * Version: 2.3.3
    77 * Author: Flutterwave Developers
    88 * Author URI: http://flutterwave.com/us
  • rave-woocommerce-payment-gateway/trunk/readme.txt

    r2916059 r2966570  
    44Requires at least: 3.1
    55Tested up to: 6.2.1
    6 Stable tag: 2.3.2
     6Stable tag: 2.3.3
    77License: MIT
    88License URI: https://github.com/Flutterwave/Woocommerce/blob/master/LICENSE
Note: See TracChangeset for help on using the changeset viewer.