Plugin Directory

Changeset 2560395


Ignore:
Timestamp:
07/08/2021 07:21:23 AM (5 years ago)
Author:
zipmoney
Message:

added Mexico translation

Location:
zipmoney-payments-woocommerce
Files:
198 added
13 edited

Legend:

Unmodified
Added
Removed
  • zipmoney-payments-woocommerce/trunk/README.txt

    r2481936 r2560395  
    44Requires at least: WP 4.0
    55Tested up to: 5.6
    6 Stable tag: 2.3.3
     6Stable tag: 2.3.4
    77License: GPLv2 or later License http://www.gnu.org/licenses/gpl-2.0.html
    88
     
    169169= 2.3.3 =
    170170* Removed git related folders and files
     171
     172= 2.3.4 =
     173* removed currency validation
     174* added translation for mexico
     175* fixed some widget related issue
  • zipmoney-payments-woocommerce/trunk/includes/api/class-wc-zipmoney-payment-gateway-api-charge.php

    r2476029 r2560395  
    346346
    347347            WC_Zipmoney_Payment_Gateway_Util::log("Create charge exception ". $exception->getCode() . $exception->getMessage(), WC_Zipmoney_Payment_Gateway_Config::LOG_LEVEL_INFO);
    348             wc_add_notice(__('Payment error:', 'woothemes') . $exception->getMessage(), 'error');
     348            wc_add_notice(__('Payment error:', 'zippayment') . $exception->getMessage(), 'error');
    349349            delete_option($checkout_id);
    350350        }
  • zipmoney-payments-woocommerce/trunk/includes/api/class-wc-zipmoney-payment-gateway-api-checkout.php

    r2464696 r2560395  
    3333            $order = new WC_Order($order_id);
    3434            $WC_Zipmoney_Payment_Gateway_Config = $this->WC_Zipmoney_Payment_Gateway->WC_Zipmoney_Payment_Gateway_Config;
    35             $is_iframe_flow = $WC_Zipmoney_Payment_Gateway_Config->is_bool_config_by_key(WC_Zipmoney_Payment_Gateway_Config::CONFIG_IS_IFRAME_FLOW);
     35            $is_iframe_flow = $WC_Zipmoney_Payment_Gateway_Config->is_it_iframe_flow();
    3636            if ($is_iframe_flow){
    3737                $redirect_url .= "&iframe=1";
  • zipmoney-payments-woocommerce/trunk/includes/class-wc-zipmoney-payment-gateway-config.php

    r2464696 r2560395  
    11<?php
     2
     3use zipMoney\Model\CurrencyUtil;
    24
    35class WC_Zipmoney_Payment_Gateway_Config
     
    6769    const REGION_ZA = 'za';
    6870    const REGION_US = 'us';
     71    const REGION_MX = 'mx';
    6972
    7073    //Log levels
     
    156159        return array(
    157160            self::CONFIG_ENABLED => array(
    158                 'title' => __('Active', 'woocommerce'),
    159                 'label' => __('Enable Zip payment', 'woocommerce'),
     161                'title' => __('Active', 'zippayment'),
     162                'label' => __('Enable Zip payment', 'zippayment'),
    160163                'type' => 'checkbox',
    161164                'description' => '',
     
    169172            ),*/
    170173            self::CONFIG_SANDBOX => array(
    171                 'title' => __('Environment', 'woocommerce'),
    172                 'label' => __('Enable sandbox mode', 'woocommerce'),
     174                'title' => __('Environment', 'zippayment'),
     175                'label' => __('Enable sandbox mode', 'zippayment'),
    173176                'class' => 'woocommerce_sandbox_enable_option',
    174177                'type' => 'checkbox',
    175                 'desc_tip' => __('ONLY use sandbox mode in conjunction with sandbox Zip credentials.', 'woocommerce'),
     178                'desc_tip' => __('ONLY use sandbox mode in conjunction with sandbox Zip credentials.', 'zippayment'),
    176179                'default' => 'no'
    177180            ),
    178181            self::CONFIG_SANDBOX_MERCHANT_PUBLIC_KEY => array(
    179                 'title' => __('Sandbox public key', 'woocommerce'),
     182                'title' => __('Sandbox public key', 'zippayment'),
    180183                'type' => 'text',
    181184                'class' => 'woocommerce_toggle_sandbox_field',
    182                 'desc_tip' => __('Please contact [email protected] to request your Sandbox Public key.', 'woocommerce'),
    183                 'description' => __('Required for Australia only.','woocommerce'),
     185                'desc_tip' => __('Please contact [email protected] to request your Sandbox Public key.', 'zippayment'),
     186                'description' => __('Required for Australia only.','zippayment'),
    184187                'default' => 'no',
    185188            ),
    186189            self::CONFIG_SANDBOX_MERCHANT_PRIVATE_KEY => array(
    187                 'title' => __('Sandbox private key', 'woocommerce'),
     190                'title' => __('Sandbox private key', 'zippayment'),
    188191                'type' => 'text',
    189192                'class' => 'woocommerce_toggle_sandbox_field',
    190                 'desc_tip' => __('Please contact [email protected] to request your Sandbox API key.', 'woocommerce'),
    191                 'description' => __( 'Please contact [email protected] to request Sandbox API key.', 'woocommerce' ),
     193                'desc_tip' => __('Please contact [email protected] to request your Sandbox API key.', 'zippayment'),
     194                'description' => __( 'Please contact [email protected] to request Sandbox API key.', 'zippayment' ),
    192195                'default' => 'no',
    193196            ),
    194197            self::CONFIG_MERCHANT_PUBLIC_KEY => array(
    195                 'title' => __('Public key', 'woocommerce'),
     198                'title' => __('Public key', 'zippayment'),
    196199                'type' => 'text',
    197200                'class' => 'woocommerce_toggle_prod_field',
    198                 'desc_tip' => __('Please contact [email protected] to request your production public key..', 'woocommerce'),
    199                 'description' => __('Required for Australia only.','woocommerce'),
     201                'desc_tip' => __('Please contact [email protected] to request your production public key..', 'zippayment'),
     202                'description' => __('Required for Australia only.','zippayment'),
    200203                'default' => '',
    201204            ),
    202205            self::CONFIG_MERCHANT_PRIVATE_KEY => array(
    203                 'title' => __('Private key', 'woocommerce'),
     206                'title' => __('Private key', 'zippayment'),
    204207                'type' => 'text',
    205208                'class' => 'woocommerce_toggle_prod_field',
    206                 'desc_tip' => __('Please contact [email protected] to request your product API key.', 'woocommerce'),
    207                 'description' => __( 'Please contact [email protected] to request your API key.', 'woocommerce' ),
     209                'desc_tip' => __('Please contact [email protected] to request your product API key.', 'zippayment'),
     210                'description' => __( 'Please contact [email protected] to request your API key.', 'zippayment' ),
    208211                'default' => '',
    209212            ),
     
    212215                'type' => 'button',
    213216                'value' => "Check Private key is valid",
    214                 'description' => __( '', 'woocommerce' ),
    215217                'class' => 'check_private_key',
    216218                'desc_tip'          => true,
    217219            ),
    218220            self::CONFIG_CHARGE_CAPTURE => array(
    219                 'title' => __('Capture method', 'woocommerce'),
     221                'title' => __('Capture method', 'zippayment'),
    220222                'type' => 'select',
    221                 'desc_tip' => __('Set to "Immediate capture" unless directed by Zip. Immedate capture = automatically capture funds when order approved by Zip. Authorise & capture = initially authorise the funds on the customers account and manually capture at a later time.', 'woocommerce'),
     223                'desc_tip' => __('Set to "Immediate capture" unless directed by Zip. Immedate capture = automatically capture funds when order approved by Zip. Authorise & capture = initially authorise the funds on the customers account and manually capture at a later time.', 'zippayment'),
    222224                'default' => self::CAPTURE_CHARGE_IMMEDIATELY,
    223225                'options' => array(
    224                     self::CAPTURE_CHARGE_IMMEDIATELY => 'Immediate capture',
    225                     self::CAPTURE_CHARGE_AUTHORIZED => 'Authorise & capture'
     226                    self::CAPTURE_CHARGE_IMMEDIATELY => __('Immediate capture','zippayment'),
     227                    self::CAPTURE_CHARGE_AUTHORIZED => __('Authorise & capture','zippayment')
    226228                )
    227229            ),
    228230            self::CONFIG_LOGGING_LEVEL => array(
    229                 'title' => __('Log setting', 'woocommerce'),
    230                 'desc_tip' => __('So Zip can assist with troubleshooting any potential issues, we recommend configuring Log Setting to "ALL"', 'woocommerce'),
     231                'title' => __('Log setting', 'zippayment'),
     232                'desc_tip' => __('So Zip can assist with troubleshooting any potential issues, we recommend configuring Log Setting to "ALL"', 'zippayment'),
    231233                'type' => 'select',
    232234                'default' => self::LOG_LEVEL_ALL,
    233235                'options' => array(
    234                     self::LOG_LEVEL_ALL => 'All messages',
    235                     self::LOG_LEVEL_DEBUG => 'Debug (and above)',
    236                     self::LOG_LEVEL_INFO => 'Info (and above)',
    237                     self::LOG_LEVEL_WARN => 'Warn (and above)',
    238                     self::LOG_LEVEL_ERROR => 'Error (and above)',
    239                     self::LOG_LEVEL_FATAL => 'Fatal (and above)',
    240                     self::LOG_LEVEL_OFF => 'Off (No message will be logged)'
     236                    self::LOG_LEVEL_ALL => __('All messages','zippayment'),
     237                    self::LOG_LEVEL_DEBUG => __('Debug (and above)','zippayment'),
     238                    self::LOG_LEVEL_INFO => __('Info (and above)','zippayment'),
     239                    self::LOG_LEVEL_WARN => __('Warn (and above)','zippayment'),
     240                    self::LOG_LEVEL_ERROR => __('Error (and above)','zippayment'),
     241                    self::LOG_LEVEL_FATAL => __('Fatal (and above)','zippayment'),
     242                    self::LOG_LEVEL_OFF => __('Off (No message will be logged)','zippayment')
    241243                )
    242244            ),
    243245            self::CONFIG_IS_IFRAME_FLOW => array(
    244                 'title' => __('In-context checkout', 'woocommerce'),
    245                 'label' => __('Enable in-context checkout flow', 'woocommerce'),
    246                 'type' => 'checkbox',
    247                 'desc_tip' => __('Enable to offer your customers an iframe checkout experience without being redirected away from your website.', 'woocommerce'),
    248                 'description' => __('', 'woocommerce'),
     246                'title' => __('In-context checkout', 'zippayment'),
     247                'label' => __('Enable in-context checkout flow', 'zippayment'),
     248                'type' => 'checkbox',
     249                'desc_tip' => __('Enable to offer your customers an iframe checkout experience without being redirected away from your website. But this feature only work for AU region. Other region customer will redirect to zip for payment.', 'zippayment'),
     250                'description' => __('Iframe zip checkout only work for AU region. Other region customer will redirect to zip for payment. ', 'zippayment'),
    249251                'default' => 'no'
    250252            ),
    251253            self::CONFIG_ORDER_THRESHOLD_MIN_TOTAL => array(
    252                 'title' => __('Minimum order value', 'woocommerce'),
    253                 'type' => 'text',
    254                 'desc_tip' => 'Set the minimum shopping cart value that Zip will be available for use.',
     254                'title' => __('Minimum order value', 'zippayment'),
     255                'type' => 'text',
     256                'desc_tip' => __('Set the minimum shopping cart value that Zip will be available for use.',"zippayment"),
    255257                'default' => 1
    256258            ),
    257259            self::CONFIG_ORDER_THRESHOLD_MAX_TOTAL => array(
    258                 'title' => __('Maximum order value', 'woocommerce'),
    259                 'type' => 'text',
    260                 'desc_tip' => 'Set the maximum shopping cart value that Zip will be available for use.',
     260                'title' => __('Maximum order value', 'zippayment'),
     261                'type' => 'text',
     262                'desc_tip' => __('Set the maximum shopping cart value that Zip will be available for use.','zippayment'),
    261263                'default' => 1500
    262264            ),
    263265            self::CONFIG_SELECT_REGION => array(
    264                 'title'     => __( 'Widget Region', 'woocommerce' ),
     266                'title'     => __( 'Widget Region', 'zippayment' ),
    265267                'type' => 'select',
    266                 'desc_tip' => __('Select Region to show proper zip widget in product, cart and checkout page', 'woocommerce'),
     268                'desc_tip' => __('Select Region to show proper zip widget in product, cart and checkout page', 'zippayment'),
    267269                'default' => self::REGION_AU,
    268270                'options' => array(
     
    272274                    self::REGION_US => 'United States',
    273275                    self::REGION_ZA => 'South Africa',
     276                    self::REGION_MX => 'Mexico',
    274277                )
    275278            ),
    276279            self::CONFIG_DISPLAY_WIDGET_MODE => array(
    277                 'title'     => __( 'Display Widget Mode', 'woocommerce' ),
     280                'title'     => __( 'Display Widget Mode', 'zippayment' ),
    278281                'type' => 'select',
    279                 'desc_tip' => __('Select Display widget mode for Zip widget', 'woocommerce'),
     282                'desc_tip' => __('Select Display widget mode for Zip widget', 'zippayment'),
    280283                'default' => self::REGION_AU,
    281284                'options' => array(
    282                     self::DISPLAY_IFRAME => 'iframe',
    283                     self::DISPLAY_INLINE => 'inline',
     285                    self::DISPLAY_IFRAME => __('iframe','zippayment'),
     286                    self::DISPLAY_INLINE => __('inline','zippayment'),
    284287                )
    285288            ),
    286289            self::CONFIG_DISPLAY_WIDGET_PRODUCT_PAGE => array(
    287                 'title' => __('Marketing widgets', 'woocommerce'),
    288                 'label' => __('Display on product page', 'woocommerce'),
    289                 'type' => 'checkbox',
    290                 'desc_tip' => __('Enable to display the Zip widget below the add to cart button on the product page.', 'woocommerce'),
     290                'title' => __('Marketing widgets', 'zippayment'),
     291                'label' => __('Display on product page', 'zippayment'),
     292                'type' => 'checkbox',
     293                'desc_tip' => __('Enable to display the Zip widget below the add to cart button on the product page.', 'zippayment'),
    291294                'default' => 'yes'
    292295            ),
    293296            self::CONFIG_DISPLAY_WIDGET_CART => array(
    294                 'label' => __('Display on cart page', 'woocommerce'),
    295                 'type' => 'checkbox',
    296                 'desc_tip' => __('Enable to display the Zip widget below the checkout button on the cart page.', 'woocommerce'),
     297                'label' => __('Display on cart page', 'zippayment'),
     298                'type' => 'checkbox',
     299                'desc_tip' => __('Enable to display the Zip widget below the checkout button on the cart page.', 'zippayment'),
    297300                'default' => 'yes'
    298301            ),
    299302            self::CONFIG_DISPLAY_TAGLINE_PRODUCT_PAGE => array(
    300                 'title' => __('Marketing taglines', 'woocommerce'),
    301                 'label' => __('Display on product page', 'woocommerce'),
    302                 'desc_tip' => __('Enable to display the Zip tagline widget below the price on the product page.', 'woocommerce'),
     303                'title' => __('Marketing taglines', 'zippayment'),
     304                'label' => __('Display on product page', 'zippayment'),
     305                'desc_tip' => __('Enable to display the Zip tagline widget below the price on the product page.', 'zippayment'),
    303306                'type' => 'checkbox',
    304307                'default' => 'no'
    305308            ),
    306309            self::CONFIG_DISPLAY_TAGLINE_CART => array(
    307                 'label' => __('Display on cart page', 'woocommerce'),
    308                 'desc_tip' => __('Enable to display the Zip tagline widget below the total price on the cart page.', 'woocommerce'),
     310                'label' => __('Display on cart page', 'zippayment'),
     311                'desc_tip' => __('Enable to display the Zip tagline widget below the total price on the cart page.', 'zippayment'),
    309312                'type' => 'checkbox',
    310313                'default' => 'no'
    311314            ),
    312315            self::CONFIG_DISPLAY_BANNERS => array(
    313                 'title' => __('Marketing banners', 'woocommerce'),
    314                 'label' => __('Display marketing banners', 'woocommerce'),
     316                'title' => __('Marketing banners', 'zippayment'),
     317                'label' => __('Display marketing banners', 'zippayment'),
    315318                'class' => 'woocommerce_banner_enable',
    316319                'type' => 'checkbox',
    317                 'desc_tip' => __('Enable to display the Zip strip banners on the pages outlined below.', 'woocommerce'),
     320                'desc_tip' => __('Enable to display the Zip strip banners on the pages outlined below.', 'zippayment'),
    318321                'default' => 'no'
    319322            ),
    320323            self::CONFIG_DISPLAY_BANNER_SHOP => array(
    321                 'label' => __('Display on shop', 'woocommerce'),
     324                'label' => __('Display on shop', 'zippayment'),
    322325                'class' => 'woocommerce_banner_option',
    323326                'type' => 'checkbox',
     
    325328            ),
    326329            self::CONFIG_DISPLAY_BANNER_PRODUCT_PAGE => array(
    327                 'label' => __('Display on product page', 'woocommerce'),
     330                'label' => __('Display on product page', 'zippayment'),
    328331                'class' => 'woocommerce_banner_option',
    329332                'type' => 'checkbox',
     
    331334            ),
    332335            self::CONFIG_DISPLAY_BANNER_CATEGORY => array(
    333                 'label' => __('Display on category cage', 'woocommerce'),
     336                'label' => __('Display on category cage', 'zippayment'),
    334337                'class' => 'woocommerce_banner_option',
    335338                'type' => 'checkbox',
     
    337340            ),
    338341            self::CONFIG_DISPLAY_BANNER_CART => array(
    339                 'label' => __('Display on cart', 'woocommerce'),
     342                'label' => __('Display on cart', 'zippayment'),
    340343                'class' => 'woocommerce_banner_option',
    341344                'type' => 'checkbox',
     
    461464    }
    462465
     466    /**
     467     * check zip checkout iframe is enabled
     468     */
     469    public function is_it_iframe_flow()
     470    {
     471        $currency = get_option('woocommerce_currency');
     472        if ($currency != CurrencyUtil::CURRENCY_AUD) {
     473            return false; //iframe checking is disable until we fix zip checkout js issue to support iframe for all browse
     474        } else {
     475            return $this->is_bool_config_by_key(self::CONFIG_IS_IFRAME_FLOW);
     476        }
     477    }
     478
    463479}
  • zipmoney-payments-woocommerce/trunk/includes/class-wc-zipmoney-payment-gateway-widget.php

    r2464696 r2560395  
    2121
    2222        //inject the order button
    23         if($WC_Zipmoney_Payment_Gateway_Config->is_bool_config_by_key(WC_Zipmoney_Payment_Gateway_Config::CONFIG_IS_IFRAME_FLOW)){
     23        if($WC_Zipmoney_Payment_Gateway_Config->is_it_iframe_flow()){
    2424            add_filter('woocommerce_order_button_html', array($this, 'order_button'), 10, 2);
    2525        }
     
    385385        $max_limit = $this->WC_Zipmoney_Payment_Gateway->get_option(WC_Zipmoney_Payment_Gateway_Config::CONFIG_ORDER_THRESHOLD_MAX_TOTAL);
    386386        echo '<div data-zm-merchant="'.esc_attr($this->WC_Zipmoney_Payment_Gateway->WC_Zipmoney_Payment_Gateway_Config->get_merchant_public_key()).'" data-env="' .
    387             esc_attr($this->WC_Zipmoney_Payment_Gateway->WC_Zipmoney_Payment_Gateway_Config->get_environment()) . '" data-require-checkout="false" data-zm-region="'.$region.'" data-zm-price-max="'.$max_limit.'" data-zm-price-min="'.$min_limit.'" data-zm-display-inline="'.$this->isDisplayInlineWidget().'"></div> ';
     387            esc_attr($this->WC_Zipmoney_Payment_Gateway->WC_Zipmoney_Payment_Gateway_Config->get_environment()) . '" data-require-checkout="false" data-zm-region="'.$region.'" data-zm-price-max="'.$max_limit.'" data-zm-price-min="'.$min_limit.'" data-zm-display-inline="'.$this->isDisplayInlineWidget().'" data-zm-language="'.substr(get_locale(), 0, strpos(get_locale(), '_')).'"></div> ';
    388388    }
    389389
     
    426426    {
    427427
    428         $is_iframe_checkout = $this->WC_Zipmoney_Payment_Gateway->WC_Zipmoney_Payment_Gateway_Config->is_bool_config_by_key(WC_Zipmoney_Payment_Gateway_Config::CONFIG_IS_IFRAME_FLOW);
     428        $is_iframe_checkout = $this->WC_Zipmoney_Payment_Gateway->WC_Zipmoney_Payment_Gateway_Config->is_it_iframe_flow();
    429429
    430430        include plugin_dir_path(dirname(__FILE__)) . 'includes/view/frontend/order_button.php';
  • zipmoney-payments-woocommerce/trunk/includes/class-wc-zipmoney-payment-gateway.php

    r2481936 r2560395  
    2424    public $description = 'Own the way you pay';
    2525
    26     public $version = '2.3.3';
     26    public $version = '2.3.4';
    2727
    2828    public $supports = array('products', 'refunds');
     
    8585        if ($display) {
    8686
    87             echo '<div class="error" style="color: red;"><p><strong>Error:</strong> Zip private key is invalid.</p></div>';
     87            echo '<div class="error" style="color: red;"><p><strong>'.__("Error:","zippayment").'</strong>'.__(" Zip private key is invalid.","zippayment").'</p></div>';
    8888        }
    8989    }
     
    9393
    9494        if (is_admin()) {
    95             return "Zip - Own it now, pay later";
     95            return __("Zip - Own it now, pay later","zippayment");
    9696        } else {
    97             return "<span data-zm-widget='inline' data-zm-asset='checkouttitle'> Zip - Own it now, pay later </span>";
     97            return "<span data-zm-widget='inline' data-zm-asset='checkouttitle'>".__(" Zip - Own it now, pay later ","zippayment")." </span>";
    9898        }
    9999    }
     
    101101    public function zip_payment_title($title)
    102102    {
    103         if (strcmp("<span data-zm-widget='inline' data-zm-asset='checkouttitle'> Zip - Own it now, pay later </span>", $title) == 0)
     103        if (strcmp("<span data-zm-widget='inline' data-zm-asset='checkouttitle'>".__(" Zip - Own it now, pay later ","zippayment")."</span>", $title) == 0)
    104104            return strip_tags($title);
    105105
     
    229229        if ($responseCode == '200' && $isAuEndpoint == false) {
    230230            $body    = json_decode($response['body']);
    231             $message = ucfirst($environment) . ' private key is valid for ' . $body->name;
     231            $message = ucfirst($environment) . __(' private key is valid for ','zippayment') . $body->name;
    232232            $htmlMessage = '<div class="notice notice-success notice-alt is-dismissible zip-notice"><p>' . $message . '</p>';
    233233            $regions = $body->regions;
    234234            if ($regions) {
    235                 $regionList = '<p>key is valid for below regions ' . ucfirst($environment) . ' environment:<br>';
     235                $regionList = '<p>'.__('key is valid for below regions ','zippayment') . ucfirst($environment) . ' environment:<br>';
    236236                $availableRegions = \zipMoney\Model\CurrencyUtil::getAvailableRegions();
    237237                foreach ($regions as $key => $value) {
     
    243243        }
    244244        if (($responseCode == '404' || $responseCode == '200') && $isAuEndpoint == true) {
    245             $message = ucfirst($environment) . " private key valid for Australia region.";
     245            $message = ucfirst($environment) . __(" private key valid for Australia region.","zippayment");
    246246            $htmlMessage = '<div class="notice notice-success notice-alt is-dismissible zip-notice"><p>' . $message . '</p></div>';
    247247        }
     
    253253        if (!is_wp_error($response)) {
    254254            if ($responseCode == '401' || $responseCode == '403' || ($responseCode == '404' && $isAuEndpoint == false)) {
    255                 $htmlMessage = '<div class="notice notice-error notice-alt is-dismissible zip-notice"><p>Invalid Zip private key. Please check with Zip.</p></div>';
     255                $htmlMessage = '<div class="notice notice-error notice-alt is-dismissible zip-notice"><p>'.__("Invalid Zip private key. Please check with Zip.","zippayment").'</p></div>';
    256256                $result = array(
    257257                    'error' => true,
     
    261261            }
    262262        } else {
    263             $htmlMessage = '<div class="notice notice-error notice-alt is-dismissible zip-notice"><p>Connection error. Please try later.</p></div>';
     263            $htmlMessage = '<div class="notice notice-error notice-alt is-dismissible zip-notice"><p>'.__("Connection error. Please try later.","zippayment").'</p></div>';
    264264            $result = array(
    265265                'error' => true,
     
    319319        if (version_compare(phpversion(), '5.3.0', '<')) {
    320320            // PHP Version
    321             echo '<div class="error"><p>' . sprintf(__('ZipMoney Error: ZipMoney requires PHP 5.3.0 and above. You are using version %s.', 'woocommerce'), phpversion()) . '</p></div>';
     321            echo '<div class="error"><p>' . sprintf(__('ZipMoney Error: ZipMoney requires PHP 5.3.0 and above. You are using version %s.', 'zippayment'), phpversion()) . '</p></div>';
    322322        } elseif (is_checkout() && !is_ssl()) {
    323323            // Show message if enabled and FORCE SSL is disabled and WordPressHTTPS plugin is not detected
    324             echo '<div class="error"><p>' . sprintf(__('WARN: ZipMoney is enabled, but the <a href="%s">force SSL option</a> is disabled; your checkout may not be secure! Please enable SSL and ensure your server has a valid SSL certificate - ZipMoney will only work in sandbox mode.', 'woocommerce'), admin_url('admin.php?page=wc-settings&tab=checkout')) . '</p></div>';
     324            echo '<div class="error"><p>' . sprintf(__('WARN: ZipMoney is enabled, but the <a href="%s">force SSL option</a> is disabled; your checkout may not be secure! Please enable SSL and ensure your server has a valid SSL certificate - ZipMoney will only work in sandbox mode.', 'zippayment'), admin_url('admin.php?page=wc-settings&tab=checkout')) . '</p></div>';
    325325        }
    326326    }
     
    395395            WC_Zipmoney_Payment_Gateway_Util::log($exception->getResponseBody());
    396396
    397             wc_add_notice(__('Payment error:', 'woothemes') . $exception->getMessage(), 'error');
     397            wc_add_notice(__('Payment error:', 'zippayment') . $exception->getMessage(), 'error');
    398398
    399399            return array(
     
    410410            );
    411411        }
    412         wc_add_notice(__('Payment error: ', 'woothemes') . $response['message'], 'error');
     412        wc_add_notice(__('Payment error: ', 'zippayment') . $response['message'], 'error');
    413413    }
    414414
     
    467467            case 'create':
    468468                $currency = get_option('woocommerce_currency');
    469                 if (isset($_GET['iframe']) && $currency != CurrencyUtil::CURRENCY_AUD) {
     469                $is_iframe_flow = $this->WC_Zipmoney_Payment_Gateway_Config->is_it_iframe_flow();
     470                if (isset($_GET['iframe']) && $currency != CurrencyUtil::CURRENCY_AUD && $is_iframe_flow) {
    470471                    $checkoutId = $_GET['checkoutId'];
    471472                    $state = $_GET['result'];
  • zipmoney-payments-woocommerce/trunk/includes/controller/class-wc-zipmoney-payment-charge-controller.php

    r2464696 r2560395  
    2121            $result['title'] = 'Invalid request';
    2222            $result['content'] = 'There are some parameters missing in the request url.';
    23             wc_add_notice('The payment has been cancelled.', 'error');
     23            wc_add_notice(__('The payment has been cancelled.','zippayment'), 'error');
    2424            $result['redirect_url'] = $this->wc_get_checkout_url();
    2525            return $result;
     
    7474                            $result['content'] = $response['message'];
    7575                            $result['title'] = 'Error';
    76                             wc_add_notice($response['message'], 'error');
     76                            wc_add_notice(__("An error occurred while processing payment","zippayment"), 'error');
    7777                        }
    7878                    } else {
     
    8080                        $result['content'] = 'Could not find the order, please try again later.';
    8181                        $result['title'] = 'Error';
    82                         wc_add_notice("Could not find the order, please try again later.", 'error');
     82                        wc_add_notice(__("Could not find the order, please try again later.","zippament"), 'error');
    8383                    }
    8484                    break;
     
    8686                    $result['title'] = 'The payment is in referred state';
    8787                    $result['content'] = 'Your application is currently under review by zipMoney and will be processed very shortly. You can contact the customer care at [email protected] for any enquiries.';
    88                     wc_add_notice('Payment pending, your application is currently under review and will be processed shortly.', 'success');
     88                    wc_add_notice(__('Payment pending, your application is currently under review and will be processed shortly.',"zippayment"), 'success');
    8989                    WC()->cart->empty_cart();
    9090                    break;
     
    9393                    $result['content'] = 'Your application has been declined by zipMoney. Please contact zipMoney for further information.';
    9494                    $result['redirect_url'] = $this->wc_get_checkout_url();
    95                     wc_add_notice('Your application has been declined. Please contact Zip Co for further information.', 'error');
     95                    wc_add_notice(__('Your application has been declined. Please contact Zip Co for further information.',"zippayment"), 'error');
    9696                    //remove the wp_option
    9797                    delete_option($checkoutId);
     
    100100                    $result['title'] = 'The checkout has been cancelled';
    101101                    $result['content'] = 'The checkout has been cancelled.';
    102                     wc_add_notice('The payment has been cancelled.', 'error');
     102                    wc_add_notice(__('The payment has been cancelled.',"zippayment"), 'error');
    103103                    $result['redirect_url'] = $this->wc_get_checkout_url();
    104104                    //remove the wp_option
     
    110110            $result['content'] = $ex->getMessage();
    111111            $result['title'] = 'Error';
    112             wc_add_notice($ex->getMessage(), 'error');
     112            wc_add_notice(__("An error occurred while processing payment","zippayment"), 'error');
    113113        }
    114114        return $result;
     
    127127        if (empty($order)) {
    128128            //if it can't find the order
    129             wc_add_notice(__('Unable to find order by id: ' . $order_id, 'woothemes'), 'error');
     129            wc_add_notice(__('Unable to find order by id: ' . $order_id, 'zippayment'), 'error');
    130130            return false;
    131131        }
     
    142142
    143143        if ($is_success == true) {
    144             WC_Zipmoney_Payment_Gateway_Util::add_admin_notice('The zipMoney payment has been cancelled.', 'success');
     144            WC_Zipmoney_Payment_Gateway_Util::add_admin_notice(__('The zipMoney payment has been cancelled.','zippayment'), 'success');
    145145        } else {
    146             WC_Zipmoney_Payment_Gateway_Util::add_admin_notice('Unable to cancel payment.', 'error');
     146            WC_Zipmoney_Payment_Gateway_Util::add_admin_notice(__('Unable to cancel payment.','zippayment'), 'error');
    147147        }
    148148    }
     
    161161        if (empty($order)) {
    162162            //if it can't find the order
    163             wc_add_notice(__('Unable to find order by id: ' . $order_id, 'woothemes'), 'error');
     163            wc_add_notice(__('Unable to find order by id: ' . $order_id, 'zippayment'), 'error');
    164164            return false;
    165165        }
  • zipmoney-payments-woocommerce/trunk/includes/controller/class-wc-zipmoney-payment-checkout-controller.php

    r2467646 r2560395  
    3333        if (isset($checkout_response)) {
    3434            $WC_Zipmoney_Payment_Gateway_Config = $this->WC_Zipmoney_Payment_Gateway->WC_Zipmoney_Payment_Gateway_Config;
    35             $is_iframe_flow = $WC_Zipmoney_Payment_Gateway_Config->is_bool_config_by_key(WC_Zipmoney_Payment_Gateway_Config::CONFIG_IS_IFRAME_FLOW);
     35            $is_iframe_flow = $WC_Zipmoney_Payment_Gateway_Config->is_it_iframe_flow();
    3636            $redirectUri = $checkout_response->getUri();
    3737            $currency = get_option('woocommerce_currency');
     
    5151        }
    5252        return array(
    53             'message' => "An error occurred while getting the redirect url from Zip.",
     53            'message' => __("An error occurred while getting the redirect url from Zip.","zippayment"),
    5454            'result' => 'failure'
    5555        );
  • zipmoney-payments-woocommerce/trunk/includes/view/frontend/express_payment_button.php

    r2283719 r2560395  
    1010
    1111// Is is iframe flow
    12 $is_iframe_flow = $WC_Zipmoney_Payment_Gateway_Config->is_bool_config_by_key(WC_Zipmoney_Payment_Gateway_Config::CONFIG_IS_IFRAME_FLOW);
     12$is_iframe_flow = $WC_Zipmoney_Payment_Gateway_Config->is_it_iframe_flow();
    1313if ($is_iframe_flow){
    1414    ?>
  • zipmoney-payments-woocommerce/trunk/vendor/zipmoney/merchantapi-php/lib/Model/CreateChargeRequest.php

    r2467646 r2560395  
    143143            $invalid_properties[] = "'currency' can't be null";
    144144        }
    145         $allowed_values = CurrencyUtil::isValidCurrency($this->container['currency']);
    146         if (!$allowed_values['valid']) {
    147             $invalid_properties[] = $allowed_values['message'];
    148         }
    149145
    150146        return $invalid_properties;
     
    169165            return false;
    170166        }
    171         $allowed_values = CurrencyUtil::isValidCurrency($this->container['currency']);
    172         if (!$allowed_values['valid']) {
    173             return false;
    174         }
    175167        return true;
    176168    }
     
    256248    public function setCurrency($currency)
    257249    {
    258         $allowed_values = CurrencyUtil::isValidCurrency($currency);
    259         if (!$allowed_values['valid']) {
    260             throw new \InvalidArgumentException($allowed_values['message']);
    261         }
    262250        $this->container['currency'] = $currency;
    263251
  • zipmoney-payments-woocommerce/trunk/vendor/zipmoney/merchantapi-php/lib/Model/CurrencyUtil.php

    r2464697 r2560395  
    1919    const CURRENCY_ZAR = 'ZAR';
    2020    const CURRENCY_CAD = 'CAD';
     21    const CURRENCY_MXN = 'MXN';
    2122
    2223    /**
     
    3334            self::CURRENCY_ZAR,
    3435            self::CURRENCY_CAD,
     36            self::CURRENCY_MXN,
    3537        );
    3638    }
     
    5961            'za' => 'South Africa',
    6062            'ca' => 'Canada',
     63            'mx' => 'Mexico',
    6164        );
    6265    }
  • zipmoney-payments-woocommerce/trunk/vendor/zipmoney/merchantapi-php/lib/Model/ShopperStatistics.php

    r2467646 r2560395  
    172172        $invalid_properties = array();
    173173
    174         $allowed_values = CurrencyUtil::isValidCurrency($this->container['currency']);
    175         if (!$allowed_values['valid']) {
    176             $invalid_properties[] = $allowed_values['message'];
    177         }
    178 
    179174        $allowed_values = array("pass", "fail", "unknown");
    180175        if (!in_array($this->container['fraud_check_result'], $allowed_values)) {
     
    193188    public function valid()
    194189    {
    195         $allowed_values = CurrencyUtil::isValidCurrency($this->container['currency']);
    196         if (!$allowed_values['valid']) {
    197             return false;
    198         }
    199190        $allowed_values = array("pass", "fail", "unknown");
    200191        if (!in_array($this->container['fraud_check_result'], $allowed_values)) {
     
    368359    public function setCurrency($currency)
    369360    {
    370         $allowed_values = CurrencyUtil::isValidCurrency($currency);
    371         if (!is_null($currency) && (!$allowed_values['valid'])) {
    372             throw new \InvalidArgumentException($allowed_values['message']);
    373         }
    374361        $this->container['currency'] = $currency;
    375362
  • zipmoney-payments-woocommerce/trunk/zipmoney-payment-gateway.php

    r2481936 r2560395  
    77Give your customers the power to pay later, interest free and watch your sales grow.
    88Take advantage of our fast-growing customer base, proven revenue uplift, fast and simple integration.
    9  * Version:           2.3.3
     9 * Version:           2.3.4
    1010 * Author:            Zip
    1111 * Author URI:        https://www.zip.co/
     
    1515 * WC requires at least: 2.6.13
    1616 * WC tested up to: 4.8.0
    17  * @version  2.3.3
     17 * @version  2.3.4
    1818 * @package  Zip
    1919 * @author   Zip
     
    8484}
    8585
     86// load language file
     87function load_language() {
     88    load_plugin_textdomain( 'zippayment', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
     89}
     90
    8691// Call the above function to begin execution of the plugin.
    8792add_action('plugins_loaded', 'run_zipmoney_payment_gateway');
     93add_action('plugins_loaded', 'load_language');
Note: See TracChangeset for help on using the changeset viewer.