Plugin Directory

Changeset 2596495


Ignore:
Timestamp:
09/09/2021 07:38:12 PM (4 years ago)
Author:
Helcim
Message:
  • Added Refund Capability
  • Tested upto WordPress 5.8
  • Tested upto woocommerce v5.6
Location:
helcim-commerce-for-woocommerce/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • helcim-commerce-for-woocommerce/trunk/WCHelcimGateway.php

    r2596407 r2596495  
    1919 * @class        WCHelcimGateway
    2020 * @extends    WC_Payment_Gateway
    21  * @version    2.0.0
     21 * @version    2.0.1
    2222 * @author        Helcim Inc.
    2323 */
     
    2525{
    2626    private const PLUGIN_NAME = 'woocommerce';
    27     private const VERSION = '2.0.0';
     27    private const VERSION = '2.0.1';
    2828    private const HELCIM_JS_FILE = 'https://secure.myhelcim.com/js/version2.js';
    2929    private const GOOGLE_RECAPTCHA_URL = 'https://www.google.com/recaptcha/api.js';
     
    291291        $helcimArgs['server_remote_addr'] = $_SERVER['REMOTE_ADDR'] ?? '';
    292292        $helcimArgs['amount'] = number_format($order->get_total(), 2, '.', '');
    293         $helcimArgs['currency'] = get_woocommerce_currency();
     293        $helcimArgs['currency'] = $this->woocommerceCurrencyAbbreviation();
    294294        $helcimArgs['amountShipping'] = number_format($shippingAmount, 2, '.', '');
    295295        $helcimArgs['amountTax'] = number_format($order->get_total_tax(), 2, '.', '');
     
    595595            echo $this->isTest(); ?>">
    596596            <input type="hidden" id="currency" value="<?php
    597             echo get_woocommerce_currency(); ?>">
     597            echo $this->woocommerceCurrencyAbbreviation(); ?>">
    598598            <input type="hidden" id="amount" value="<?php
    599599            echo number_format($amountTotal, 2, '.', ''); ?>">
     
    771771        return $this;
    772772    }
     773
     774    public function woocommerceCurrencyAbbreviation(): string
     775    {
     776        return strtoupper((string)preg_replace("/[^a-zA-Z]/", '', get_woocommerce_currency()));
     777    }
    773778}
  • helcim-commerce-for-woocommerce/trunk/classes/HelcimJSService.php

    r2596407 r2596495  
    241241        }
    242242
    243         if ((string)$xmlObject->currency !== get_woocommerce_currency()) {
     243        if ((string)$xmlObject->currency !== $helcimGateway->woocommerceCurrencyAbbreviation()) {
    244244            wc_add_notice('<b>Payment error:</b> Something went wrong please contact the Merchant', 'error');
    245245            WCHelcimGateway::log(
    246                 'Helcim JS - Order Currency(' . get_woocommerce_currency(
     246                'Helcim JS - Order Currency(' . $helcimGateway->woocommerceCurrencyAbbreviation(
    247247                ) . ') Does not match Transaction Currency(' . (string)$xmlObject->currency . ')'
    248248            );
    249249            $order->add_order_note(
    250                 'ERROR - Order Currency(' . get_woocommerce_currency(
     250                'ERROR - Order Currency(' . $helcimGateway->woocommerceCurrencyAbbreviation(
    251251                ) . ') Does not match Transaction Currency(' . (string)$xmlObject->currency . ')'
    252252            );
  • helcim-commerce-for-woocommerce/trunk/index.php

    r2596407 r2596495  
    44Plugin URI: https://www.helcim.com/
    55Description: Helcim Commerce for WooCommerce
    6 Version: 2.0.0
     6Version: 2.0.1
    77Author: Helcim Inc.
    88Author URI: https://www.helcim.com/
  • helcim-commerce-for-woocommerce/trunk/readme.txt

    r2596407 r2596495  
    7272
    7373== Changelog ==
     74
     75= 2.0.1 =
     76* Added Refund Capability
     77* Tested upto WordPress 5.8
     78* Tested upto woocommerce v5.6
    7479
    7580= 2.0.0 =
  • helcim-commerce-for-woocommerce/trunk/uninstall.php

    r2596407 r2596495  
    55 * Uninstalls Helcim Gateway.
    66 *
    7  * @version    2.0.0
     7 * @version    2.0.1
    88 * @author        Helcim Inc.
    99 */
Note: See TracChangeset for help on using the changeset viewer.