Plugin Directory

Changeset 3017894


Ignore:
Timestamp:
01/05/2024 05:01:39 PM (2 years ago)
Author:
weeconnectpay
Message:

Deploying version v3.6.4 from pipeline

Location:
weeconnectpay
Files:
600 added
7 edited

Legend:

Unmodified
Added
Removed
  • weeconnectpay/trunk/README.txt

    r3001431 r3017894  
    44Plugin URI: https://www.weeconnectpay.com/
    55Author: WeeConnectPay
    6 Stable Tag: 3.6.0
     6Stable Tag: 3.6.4
    77Tested Up To: 6.3.1
    88Text Domain: weeconnectpay
     
    116116
    117117== Changelog ==
     118= 3.6.4 =
     119* Added a temporary workaround (Exact refund validation) to prevent a bug introduced by an undocumented Clover API breaking change that could affect refunds.
     120
    118121= 3.6.0 =
    119122* Feature: Google reCAPTCHA is now supported as an additional security measure for merchants
  • weeconnectpay/trunk/includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php

    r3001431 r3017894  
    988988        try {
    989989            // Get all the line items to refund
    990             foreach ( $latest_refund->get_items() as $item_id => $item ) {
    991 
     990
     991            $undocumentedChangePrefixText = __("Due to an undocumented breaking change in the Clover API, we have temporarily disabled partial refunds.\n", 'weeconnectpay');
     992            $orderWillNotBeRefundedText = __('This request to refund will not be processed. Should you want to do a partial refund, you can do so through your Clover web dashboard.');
     993            foreach ( $latest_refund->get_items() as $item_id => $item ) {
    992994                // Original order line item
    993995                $refunded_item_id    = $item->get_meta( '_refunded_item_id' );
    994996                $refunded_item       = $order->get_item( $refunded_item_id );
    995                 $refunded_item_array = array(
    996                     'line_item_id'     => $refunded_item_id,
    997                     'line_total'       => WeeConnectPayHelper::safe_amount_to_cents_int( $refunded_item->get_total() ),
    998                     'line_total_tax'   => WeeConnectPayHelper::safe_amount_to_cents_int( $refunded_item->get_total_tax() ),
    999                     'line_quantity'    => $refunded_item->get_quantity(),
    1000                     'line_description' => WeeConnectPayHelper::name_and_qty_as_clover_line_desc(
     997
     998                // Log details for debugging
     999                error_log( "Refund check - Order item ID: $refunded_item_id,
     1000                 Refunded Quantity: " . abs( $item->get_quantity() ) . ", Original Quantity: " . $refunded_item->get_quantity() .
     1001                           ", Refunded Total: " . abs( $item->get_total() ) . ", Original Total: " . $refunded_item->get_total() .
     1002                           ", Refunded Taxes: " . abs( $item->get_total_tax() ) . ", Original Taxes: " . $refunded_item->get_total_tax()
     1003                );
     1004
     1005                // Check if the absolute value of refunded quantity, total, and tax match
     1006                if (abs($item->get_quantity()) != $refunded_item->get_quantity()) {
     1007
     1008                    $refundErrorReasonSprintfFormat = __('To refund this line item (%s), the quantity to refund (currently %s) must be the total line item quantity (%s)');
     1009                    $refundFailureReason = sprintf(
     1010                        $refundErrorReasonSprintfFormat,
    10011011                        $refunded_item->get_name(),
     1012                        abs($item->get_quantity()),
    10021013                        $refunded_item->get_quantity()
     1014                    );
     1015
     1016                    error_log("Refund error - Partial refunds not allowed due to mismatched line item quantity. Item ID: $refunded_item_id");
     1017                    return new WP_Error('wc-order', $undocumentedChangePrefixText . $refundFailureReason . "\n\n" . $orderWillNotBeRefundedText);
     1018                } elseif ( WeeConnectPayHelper::safe_amount_to_cents_int( abs( $item->get_total() ) ) != WeeConnectPayHelper::safe_amount_to_cents_int( $refunded_item->get_total() ) ) {
     1019
     1020                    $refundErrorReasonSprintfFormat = __('To refund this line item (%s), the amount before tax to refund (currently $%s) must be the line item total amount before tax ($%s)');
     1021                    $refundFailureReason = sprintf(
     1022                        $refundErrorReasonSprintfFormat,
     1023                        $refunded_item->get_name(),
     1024                        abs( $item->get_total() ),
     1025                        $refunded_item->get_total()
     1026                    );
     1027
     1028                    error_log("Refund error - Partial refunds not allowed due to mismatched line item total. Item ID: $refunded_item_id");
     1029                    return new WP_Error('wc-order', $undocumentedChangePrefixText . $refundFailureReason . "\n\n" . $orderWillNotBeRefundedText);
     1030                } elseif (WeeConnectPayHelper::safe_amount_to_cents_int(abs($item->get_total_tax())) != WeeConnectPayHelper::safe_amount_to_cents_int($refunded_item->get_total_tax())) {
     1031
     1032                    $refundErrorReasonSprintfFormat = __('To refund this line item (%s), the tax to refund (currently $%s) must be the line item total tax ($%s)');
     1033                    $refundFailureReason = sprintf(
     1034                        $refundErrorReasonSprintfFormat,
     1035                        $refunded_item->get_name(),
     1036                        abs($item->get_total_tax()),
     1037                        $refunded_item->get_total_tax()
     1038                    );
     1039
     1040                    error_log("Refund error - Partial refunds not allowed due to mismatched line item tax. Item ID: $refunded_item_id");
     1041                    return new WP_Error('wc-order', $undocumentedChangePrefixText . $refundFailureReason . "\n\n" . $orderWillNotBeRefundedText);
     1042                }
     1043
     1044
     1045
     1046
     1047
     1048                // Order Refund line item
     1049                $line_items[] = array(
     1050                    'refunded_quantity'    => $item->get_quantity(),
     1051                    'refunded_line_total'  => WeeConnectPayHelper::safe_amount_to_cents_int($item->get_total()),
     1052                    'refunded_total_tax'   => WeeConnectPayHelper::safe_amount_to_cents_int($item->get_total_tax()),
     1053                    'order_refund_item_id' => $item_id,
     1054                    'refunded_item'        => array(
     1055                        'line_item_id'     => $refunded_item_id,
     1056                        'line_total'       => WeeConnectPayHelper::safe_amount_to_cents_int($refunded_item->get_total()),
     1057                        'line_total_tax'   => WeeConnectPayHelper::safe_amount_to_cents_int($refunded_item->get_total_tax()),
     1058                        'line_quantity'    => $refunded_item->get_quantity(),
     1059                        'line_description' => WeeConnectPayHelper::name_and_qty_as_clover_line_desc(
     1060                            $refunded_item->get_name(),
     1061                            $refunded_item->get_quantity()
     1062                        ),
    10031063                    ),
    10041064                );
    10051065
    1006                 // Order Refund line item
    1007                 array_push(
    1008                     $line_items,
    1009                     array(
    1010                         // Quantity: zero or negative integer
    1011                         'refunded_quantity'    => $item->get_quantity(),
    1012                         // line total: zero or negative number
    1013                         'refunded_line_total'  => WeeConnectPayHelper::safe_amount_to_cents_int( $item->get_total() ),
    1014                         // line total tax: zero or negative number
    1015                         'refunded_total_tax'   => WeeConnectPayHelper::safe_amount_to_cents_int( $item->get_total_tax() ),
    1016                         'order_refund_item_id' => $item_id,
    1017                         'refunded_item'        => $refunded_item_array,
    1018                     )
    1019                 );
    1020 
     1066                // Log line item details for successful inclusion
     1067                error_log("Refund processed - Item ID: $refunded_item_id, Quantity: " . abs($item->get_quantity()) . ", Line Total: " . abs($item->get_total()) . ", Tax: " . $item->get_total_tax());
    10211068            }
     1069
     1070
    10221071
    10231072            // Add shipping if it's part of the refund request
  • weeconnectpay/trunk/languages/weeconnectpay-fr_CA.po

    r3003390 r3017894  
    22msgstr ""
    33"Project-Id-Version: WeeConnectPay\n"
    4 "POT-Creation-Date: 2023-11-21 22:36-0500\n"
    5 "PO-Revision-Date: 2023-11-29 12:26-0500\n"
     4"POT-Creation-Date: 2024-01-04 16:34-0500\n"
     5"PO-Revision-Date: 2024-01-04 16:36-0500\n"
    66"Last-Translator: \n"
    77"Language-Team: \n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "X-Generator: Poedit 3.4.1\n"
     12"X-Generator: Poedit 3.4.2\n"
    1313"X-Poedit-Basepath: ..\n"
    1414"X-Poedit-Flags-xgettext: --add-comments=translators:\n"
     
    457457
    458458#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:983
    459 #: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1143
     459#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1192
    460460msgid "Order has been already refunded"
    461461msgstr "La commande a déjà été remboursée"
    462462
    463 #: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1078
    464 #: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1105
     463#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:991
     464msgid ""
     465"Due to an undocumented breaking change in the Clover API, we have temporarily "
     466"disabled partial refunds.\n"
     467msgstr ""
     468
     469#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:992
     470msgid ""
     471"This request to refund will not be processed. Should you want to do a partial "
     472"refund, you can do so through your Clover web dashboard."
     473msgstr ""
     474
     475#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1008
     476#, php-format
     477msgid ""
     478"To refund this line item (%s), the quantity to refund (currently %s) must be "
     479"the total line item quantity (%s)"
     480msgstr ""
     481
     482#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1020
     483#, php-format
     484msgid ""
     485"To refund this line item (%s), the amount before tax to refund (currently $"
     486"%s) must be the line item total amount before tax ($%s)"
     487msgstr ""
     488
     489#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1032
     490#, php-format
     491msgid ""
     492"To refund this line item (%s), the tax to refund (currently $%s) must be the "
     493"line item total tax ($%s)"
     494msgstr ""
     495
     496#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1127
     497#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1154
    465498msgid "Refunded: "
    466499msgstr "Remboursé : "
    467500
    468 #: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1080
    469 #: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1107
     501#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1129
     502#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1156
    470503#, php-format
    471504msgid "%1$s %2$s"
     
    477510# Used in the order notes in bold before a 13 character alphanumerical ID from Clover.
    478511# All the order notes that contain "ID" should be described the same way across the different "ID" notes in every language.
    479 #: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1084
    480 #: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1111
     512#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1133
     513#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1160
    481514msgid "Refund ID: "
    482515msgstr "ID du remboursement : "
    483516
    484 #: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1085
     517#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1134
    485518msgid "Charge refunded: "
    486519msgstr "Frais remboursés : "
    487520
    488 #: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1088
    489 #: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1114
     521#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1137
     522#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1163
    490523msgid "Reason: "
    491524msgstr "Raison: "
     
    496529# Used in the order notes in bold before a 13 character alphanumerical ID from Clover.
    497530# All the order notes that contain "ID" should be described the same way across the different "ID" notes in every language.
    498 #: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1127
     531#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1176
    499532msgid "Returned clover item ID: "
    500533msgstr "ID d’article Clover retourné : "
    501534
    502 #: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1129
     535#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1178
    503536#, php-format
    504537msgid "%1$s(%2$s %3$s) - %4$s"
  • weeconnectpay/trunk/languages/weeconnectpay.pot

    r3003390 r3017894  
    33msgstr ""
    44"Project-Id-Version: WeeConnectPay\n"
    5 "POT-Creation-Date: 2023-11-29 12:13-0500\n"
     5"POT-Creation-Date: 2024-01-04 16:37-0500\n"
    66"PO-Revision-Date: 2023-09-20 11:23-0400\n"
    77"Last-Translator: \n"
     
    1111"Content-Transfer-Encoding: 8bit\n"
    1212"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
    13 "X-Generator: Poedit 3.4.1\n"
     13"X-Generator: Poedit 3.4.2\n"
    1414"X-Poedit-Basepath: ..\n"
    1515"X-Poedit-Flags-xgettext: --add-comments=translators:\n"
     
    380380
    381381#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:983
    382 #: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1143
     382#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1192
    383383msgid "Order has been already refunded"
    384384msgstr ""
    385385
    386 #: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1078
    387 #: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1105
     386#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:991
     387msgid ""
     388"Due to an undocumented breaking change in the Clover API, we have temporarily "
     389"disabled partial refunds.\n"
     390msgstr ""
     391
     392#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:992
     393msgid ""
     394"This request to refund will not be processed. Should you want to do a partial "
     395"refund, you can do so through your Clover web dashboard."
     396msgstr ""
     397
     398#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1008
     399#, php-format
     400msgid ""
     401"To refund this line item (%s), the quantity to refund (currently %s) must be "
     402"the total line item quantity (%s)"
     403msgstr ""
     404
     405#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1020
     406#, php-format
     407msgid ""
     408"To refund this line item (%s), the amount before tax to refund (currently $"
     409"%s) must be the line item total amount before tax ($%s)"
     410msgstr ""
     411
     412#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1032
     413#, php-format
     414msgid ""
     415"To refund this line item (%s), the tax to refund (currently $%s) must be the "
     416"line item total tax ($%s)"
     417msgstr ""
     418
     419#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1127
     420#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1154
    388421msgid "Refunded: "
    389422msgstr ""
    390423
    391 #: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1080
    392 #: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1107
     424#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1129
     425#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1156
    393426#, php-format
    394427msgid "%1$s %2$s"
    395428msgstr ""
    396429
    397 #: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1084
    398 #: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1111
     430#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1133
     431#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1160
    399432msgid "Refund ID: "
    400433msgstr ""
    401434
    402 #: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1085
     435#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1134
    403436msgid "Charge refunded: "
    404437msgstr ""
    405438
    406 #: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1088
    407 #: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1114
     439#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1137
     440#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1163
    408441msgid "Reason: "
    409442msgstr ""
    410443
    411 #: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1127
     444#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1176
    412445msgid "Returned clover item ID: "
    413446msgstr ""
    414447
    415 #: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1129
     448#: includes/integrations/woocommerce/WC_Gateway_Weeconnectpay.php:1178
    416449#, php-format
    417450msgid "%1$s(%2$s %3$s) - %4$s"
  • weeconnectpay/trunk/vendor/composer/installed.php

    r3001431 r3017894  
    22    'root' => array(
    33        'name' => '__root__',
    4         'pretty_version' => 'v3.6.0',
    5         'version' => '3.6.0.0',
    6         'reference' => '6787f4bea711f275518a94f775aed3c494b7ec73',
     4        'pretty_version' => 'v3.6.3',
     5        'version' => '3.6.3.0',
     6        'reference' => '82b2d8ac1f6acf07ccdb5dc9b59e2aec63baab89',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        '__root__' => array(
    14             'pretty_version' => 'v3.6.0',
    15             'version' => '3.6.0.0',
    16             'reference' => '6787f4bea711f275518a94f775aed3c494b7ec73',
     14            'pretty_version' => 'v3.6.3',
     15            'version' => '3.6.3.0',
     16            'reference' => '82b2d8ac1f6acf07ccdb5dc9b59e2aec63baab89',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../../',
  • weeconnectpay/trunk/weeconnectpay.php

    r3001431 r3017894  
    1717 * Plugin URI:        https://weeconnectpay.com/plugin?platform=wordpress
    1818 * Description:       Integrate Clover Payments with your WooCommerce online store.
    19  * Version:           3.6.0
     19 * Version:           3.6.4
    2020 * Requires at least: 5.6
    2121 * Requires PHP:      7.2
     
    3232    die;
    3333}
    34 const WEECONNECT_VERSION = '3.6.0';
     34const WEECONNECT_VERSION = '3.6.4';
    3535
    3636define( 'WEECONNECTPAY_PLUGIN_URL', plugin_dir_url(__FILE__));
Note: See TracChangeset for help on using the changeset viewer.