WordPress.org

Plugin Directory

Changeset 1742984


Ignore:
Timestamp:
10/08/17 21:49:40 (6 weeks ago)
Author:
webaware
Message:

eway payment gateway 4.1.0: WooCommerce 3.2 compatible; minimum supported WooCommerce version is now 2.3; proper handling of Japanese Yen (JPY)

Location:
eway-payment-gateway/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • eway-payment-gateway/trunk/changelog.md

    r1657367 r1742984  
    22 
    33## Changelog 
     4 
     5### 4.1.0, 2017-10-09 
     6 
     7* fixed: amounts in Japanese Yen (JPY) are already in the lowest denomination; no need to shift to / from cents 
     8* fixed: appearance of dropdown settings broken in WooCommerce 3.2 
     9* changed: minimum supported WooCommerce version is now 2.3 
     10* added: plugin headers for WooCommerce supported versions 
    411 
    512### 4.0.2, 2017-05-15 
  • eway-payment-gateway/trunk/eway-payment-gateway.php

    r1657367 r1742984  
    44Plugin URI: https://shop.webaware.com.au/downloads/eway-payment-gateway/ 
    55Description: Integrate some popular WordPress plugins with the eWAY credit card payment gateway 
    6 Version: 4.0.2 
     6Version: 4.1.0 
    77Author: WebAware 
    88Author URI: https://shop.webaware.com.au/ 
    99Text Domain: eway-payment-gateway 
     10WC requires at least: 2.3 
     11WC tested up to: 3.2 
    1012*/ 
    1113 
     
    3537define('EWAY_PAYMENTS_PLUGIN_ROOT', dirname(__FILE__) . '/'); 
    3638define('EWAY_PAYMENTS_PLUGIN_NAME', basename(dirname(__FILE__)) . '/' . basename(__FILE__)); 
    37 define('EWAY_PAYMENTS_VERSION', '4.0.2'); 
     39define('EWAY_PAYMENTS_VERSION', '4.1.0'); 
    3840 
    3941// special test customer ID for sandbox 
  • eway-payment-gateway/trunk/includes/class.EwayPaymentsRapidAPI.php

    r1612656 r1742984  
    589589 
    590590        if ($this->amount > 0) { 
    591             $record->TotalAmount        = number_format($this->amount * 100, 0, '', ''); 
     591            $record->TotalAmount        = self::formatCurrency($this->amount, $this->currencyCode); 
    592592            $record->InvoiceReference   = $this->transactionNumber  ? substr($this->transactionNumber, 0, 50) : ''; 
    593593            $record->InvoiceDescription = $this->invoiceDescription ? substr($this->invoiceDescription, 0, 64) : ''; 
     
    713713    } 
    714714 
     715    /** 
     716    * format amount per currency 
     717    * @param float $amount 
     718    * @param string $currencyCode 
     719    * @return string 
     720    */ 
     721    protected static function formatCurrency($amount, $currencyCode) { 
     722        switch ($currencyCode) { 
     723 
     724            // Japanese Yen already has no decimal fraction 
     725            case 'JPY': 
     726                $value = number_format($amount, 0, '', ''); 
     727                break; 
     728 
     729            default: 
     730                $value = number_format($amount * 100, 0, '', ''); 
     731                break; 
     732 
     733        } 
     734 
     735        return $value; 
     736    } 
     737 
    715738} 
  • eway-payment-gateway/trunk/includes/class.EwayPaymentsResponse.php

    r1613068 r1742984  
    4141 
    4242        // if we got an amount, convert it back into dollars.cents from just cents 
    43         if (isset($this->Payment) && !empty($this->Payment->TotalAmount)) { 
     43        // but not if it's in JPY which is already at the target format 
     44        if (isset($this->Payment) && !empty($this->Payment->TotalAmount) && $this->Payment->CurrencyCode !== 'JPY') { 
    4445            $this->Payment->TotalAmount = floatval($this->Payment->TotalAmount) / 100.0; 
    4546        } 
  • eway-payment-gateway/trunk/includes/integrations/class.EwayPaymentsWoo.php

    r1657367 r1742984  
    121121                            'type'          => 'select', 
    122122                            'default'       => 'all', 
    123                             'class'         => 'availability', 
     123                            'class'         => 'availability wc-enhanced-select', 
    124124                            'options'       => array( 
    125125                                'all'       => translate('All allowed countries', 'woocommerce'), 
     
    131131                            'title'         => translate('Specific Countries', 'woocommerce'), 
    132132                            'type'          => 'multiselect', 
    133                             'class'         => 'chosen_select', 
     133                            'class'         => 'wc-enhanced-select', 
    134134                            'css'           => 'width: 450px;', 
    135135                            'default'       => '', 
     
    220220                            'title'         => _x('Payment Method', 'settings field', 'eway-payment-gateway'), 
    221221                            'type'          => 'select', 
     222                            'class'         => 'wc-enhanced-select', 
    222223                            'description'   => esc_html__("Capture processes the payment immediately. Authorize holds the amount on the customer's card for processing later.", 'eway-payment-gateway'), 
    223224                            'desc_tip'      => true, 
     
    233234                            'title'         => _x('Logging', 'settings field', 'eway-payment-gateway'), 
    234235                            'type'          => 'select', 
     236                            'class'         => 'wc-enhanced-select', 
    235237                            'description'   =>  sprintf('%s<br/>%s<br/>%s', 
    236238                                                    esc_html__('Enable logging to assist trouble shooting', 'eway-payment-gateway'), 
  • eway-payment-gateway/trunk/js/admin-events-manager-settings.min.js

    r1640357 r1742984  
    22// https://shop.webaware.com.au/downloads/eway-payment-gateway/ 
    33 
    4 !function(a){function b(){var b="sandbox"===a("select[name='em_eway_mode']").val();!function(a,b){b?a.show():a.hide()}(a(".em_eway_sandbox_row"),b)}a("form[name='gatewaysettingsform']").on("change","select[name='em_eway_mode']",b),b()}(jQuery); 
     4!function(e){function n(){var n="sandbox"===e("select[name='em_eway_mode']").val();!function(e,n){n?e.show():e.hide()}(e(".em_eway_sandbox_row"),n)}e("form[name='gatewaysettingsform']").on("change","select[name='em_eway_mode']",n),n()}(jQuery); 
  • eway-payment-gateway/trunk/js/admin-woocommerce-settings.min.js

    r1640357 r1742984  
    22// https://shop.webaware.com.au/downloads/eway-payment-gateway/ 
    33 
    4 !function(a){function b(){var b="1"===a("#woocommerce_eway_payments_eway_sandbox:checked").val();!function(a,b){b?a.show():a.hide()}(a("#woocommerce_eway_payments_eway_sandbox_api_key,#woocommerce_eway_payments_eway_sandbox_password,#woocommerce_eway_payments_eway_sandbox_ecrypt_key").closest("tr"),b)}b(),a("#mainform").on("change","#woocommerce_eway_payments_eway_sandbox",b),a("#woocommerce_eway_payments_eway_site_seal").on("change",function(){var b=a("#woocommerce_eway_payments_eway_site_seal_code").closest("tr");this.checked?b.show():b.hide()}).trigger("change")}(jQuery); 
     4!function(e){function o(){var o="1"===e("#woocommerce_eway_payments_eway_sandbox:checked").val();!function(e,o){o?e.show():e.hide()}(e("#woocommerce_eway_payments_eway_sandbox_api_key,#woocommerce_eway_payments_eway_sandbox_password,#woocommerce_eway_payments_eway_sandbox_ecrypt_key").closest("tr"),o)}o(),e("#mainform").on("change","#woocommerce_eway_payments_eway_sandbox",o),e("#woocommerce_eway_payments_eway_site_seal").on("change",function(){var o=e("#woocommerce_eway_payments_eway_site_seal_code").closest("tr");this.checked?o.show():o.hide()}).trigger("change")}(jQuery); 
  • eway-payment-gateway/trunk/js/admin-wpsc-settings.min.js

    r1640357 r1742984  
    22// https://shop.webaware.com.au/downloads/eway-payment-gateway/ 
    33 
    4 !function(a){function b(){var b="1"===a("input[name='eway_test']:checked").val();!function(a,b){b?a.show():a.hide()}(a(".eway_sandbox_field_row"),b)}a("#wpsc_options_page").on("change","input[name='eway_test']",b),a(document).ajaxSuccess(function(a,c,d){-1!==d.data.indexOf("wpsc_merchant_eway")&&b()}),a(WPSC_Settings_Page).on("wpsc_settings_tab_loaded_gateway",b)}(jQuery); 
     4!function(e){function n(){var n="1"===e("input[name='eway_test']:checked").val();!function(e,n){n?e.show():e.hide()}(e(".eway_sandbox_field_row"),n)}e("#wpsc_options_page").on("change","input[name='eway_test']",n),e(document).ajaxSuccess(function(e,a,t){-1!==t.data.indexOf("wpsc_merchant_eway")&&n()}),e(WPSC_Settings_Page).on("wpsc_settings_tab_loaded_gateway",n)}(jQuery); 
  • eway-payment-gateway/trunk/js/awpcp-checkout-form.min.js

    r1640357 r1742984  
    22// https://shop.webaware.com.au/downloads/eway-payment-gateway/ 
    33 
    4 !function(a){a("#awpcp-eway-checkout").submit(function(b){var c=[],d=eway_awpcp_checkout.errors;""===a("input[name='eway_card_number']").val().trim()&&c.push(d.card_number),""===a("input[name='eway_card_name']").val().trim()&&c.push(d.card_name),""!==a("select[name='eway_expiry_month']").val()&&""!==a("select[name='eway_expiry_year']").val()||c.push(d.expiry_month),""===a("input[name='eway_cvn']").val().trim()&&c.push(d.cvn),c.length>0&&(b.preventDefault(),window.alert(c.join("\n")))})}(jQuery); 
     4!function(e){e("#awpcp-eway-checkout").submit(function(a){var n=[],r=eway_awpcp_checkout.errors;""===e("input[name='eway_card_number']").val().trim()&&n.push(r.card_number),""===e("input[name='eway_card_name']").val().trim()&&n.push(r.card_name),""!==e("select[name='eway_expiry_month']").val()&&""!==e("select[name='eway_expiry_year']").val()||n.push(r.expiry_month),""===e("input[name='eway_cvn']").val().trim()&&n.push(r.cvn),n.length>0&&(a.preventDefault(),window.alert(n.join("\n")))})}(jQuery); 
  • eway-payment-gateway/trunk/js/ecrypt.min.js

    r1640357 r1742984  
    22// https://shop.webaware.com.au/downloads/eway-payment-gateway/ 
    33 
    4 !function(a){function b(b,c){var d=e.find(b);if(d.length){var f=d.val().replace(/[\s-]/g,"");if(f.length){var g=eCrypt.encryptValue(f,eway_ecrypt_vars.key);a("<input type='hidden'>").attr("name",c).val(g).appendTo(e),d.val("")}}}function c(){var a=eway_ecrypt_vars.fields;for(var c in a)b(c,a[c]);return!0}function d(a){return e.get(0).elements[a].value}var e=a(eway_ecrypt_vars.form);switch(eway_ecrypt_vars.mode){case"woocommerce":e.on("checkout_place_order_eway_payments",c);break;case"wp-e-commerce":e.on("submit",function(){"wpsc_merchant_eway"===d("custom_gateway")&&c()});break;case"events-manager":e.on("submit",function(){"eway"===d("gateway")&&c()});break;case"awpcp":e.on("submit",c)}}(jQuery); 
     4!function(e){function a(a,r){var t=n.find(a);if(t.length){var c=t.val().replace(/[\s-]/g,"");if(c.length){var o=eCrypt.encryptValue(c,eway_ecrypt_vars.key);e("<input type='hidden'>").attr("name",r).val(o).appendTo(n),t.val("")}}}function r(){var e=eway_ecrypt_vars.fields;for(var r in e)a(r,e[r]);return!0}function t(e){return n.get(0).elements[e].value}var n=e(eway_ecrypt_vars.form);switch(eway_ecrypt_vars.mode){case"woocommerce":n.on("checkout_place_order_eway_payments",r);break;case"wp-e-commerce":n.on("submit",function(){"wpsc_merchant_eway"===t("custom_gateway")&&r()});break;case"events-manager":n.on("submit",function(){"eway"===t("gateway")&&r()});break;case"awpcp":n.on("submit",r)}}(jQuery); 
  • eway-payment-gateway/trunk/readme.txt

    r1657367 r1742984  
    77Tags: eway, payment, credit cards, woocommerce, wp e-commerce, events manager, awpcp 
    88Requires at least: 4.2 
    9 Tested up to: 4.7 
    10 Stable tag: 4.0.2 
     9Tested up to: 4.9 
     10Stable tag: 4.1.0 
    1111License: GPLv2 or later 
    1212License URI: https://www.gnu.org/licenses/gpl-2.0.html 
     
    227227== Upgrade Notice == 
    228228 
    229 = 4.0.2 = 
    230  
    231 fixed WooCommerce custom credit card fields not using Client Side Encryption 
     229= 4.1.0 = 
     230 
     231WooCommerce 3.2 compatible; minimum supported WooCommerce version is now 2.3; proper handling of Japanese Yen (JPY) 
    232232 
    233233== Changelog == 
     
    235235The full changelog can be found [on GitHub](https://github.com/webaware/eway-payment-gateway/blob/master/changelog.md). Recent entries: 
    236236 
    237 ### 4.0.2, 2017-05-15 
    238  
    239 * fixed: WooCommerce custom credit card fields not using Client Side Encryption 
    240  
    241 ### 4.0.1, 2017-04-19 
    242  
    243 * changed: WooCommerce 3.0 support better accommodates other plugins and their abstractions for WooCommerce 2.6 
    244 * changed: dropped support for WooCommerce 2.0 and earlier 
    245  
    246 ### 4.0.0, 2017-03-13 
    247  
    248 * changed: uses eWAY Rapid API if API key and password are set 
    249 * changed: WooCommerce 3.0 compatibility, with fallback support to previous version 
    250 * changed: AWPCP minimum version now 3.0 
    251 * changed: sandbox always uses customer ID 87654321 if no Rapid API key/password are set for the sandbox 
    252 * changed: currency is no longer limited to AUD; currency always passed from shop settings 
    253 * changed: always send data for Beagle Lite and Beagle Enterprise support 
    254 * changed: improved error reporting and logging 
    255 * removed: `*_eway_customer_id` filters; these have been replaced by `*_eway_credentials` filters that accommodate Rapid API credentials 
    256 * added: capture and report HTTP errors communicating with the gateway 
    257 * added: strings are localized and ready for [translation](https://translate.wordpress.org/projects/wp-plugins/eway-payment-gateway) 
     237### 4.1.0, 2017-10-09 
     238 
     239* fixed: amounts in Japanese Yen (JPY) are already in the lowest denomination; no need to shift to / from cents 
     240* fixed: appearance of dropdown settings broken in WooCommerce 3.2 
     241* changed: minimum supported WooCommerce version is now 2.3 
     242* added: plugin headers for WooCommerce supported versions 
Note: See TracChangeset for help on using the changeset viewer.