Plugin Directory

Changeset 2717378


Ignore:
Timestamp:
05/03/2022 04:27:35 AM (4 years ago)
Author:
clearpayit
Message:

Release v3.4.1.

Location:
clearpay-gateway-for-woocommerce
Files:
148 added
1 deleted
26 edited
1 copied

Legend:

Unmodified
Added
Removed
  • clearpay-gateway-for-woocommerce/tags/3.4.1/build/index.asset.php

    r2635651 r2717378  
    1 <?php return array('dependencies' => array('wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => '406b322a3a3f18513a1e8bca2f8aa6fe');
     1<?php return array('dependencies' => array('wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => '569dacac1c5a01a8936b81d00b598587');
  • clearpay-gateway-for-woocommerce/tags/3.4.1/build/index.js

    r2635651 r2717378  
    1 !function(e){var t={};function n(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(a,r,function(t){return e[t]}.bind(null,r));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.wp.htmlEntities},function(e,t,n){"use strict";n.r(t);var a,r,o,c=n(0),i=(n(4),n(1)),l=n(2),u=n(3),d=function(){var e=Object(u.getSetting)("clearpay_data",null);if(!e)throw new Error("Clearpay initialization data is not available");return e},p=function(e){var t;return"GB"==(null===(t=d())||void 0===t?void 0:t.country)?Object(c.createElement)(m,e):Object(c.createElement)(f,e)},m=function(e){var t,n,a=null===(t=d())||void 0===t?void 0:t.testmode,r={target:"#afterpay-widget-container",locale:null===(n=d())||void 0===n?void 0:n.locale,amount:{amount:(e.billing.cartTotal.value/Math.pow(10,e.billing.currency.minorUnit)).toString(),currency:e.billing.currency.code}};return Object(c.useEffect)((function(){var e=document.createElement("script");e.innerHTML="window.afterpayWidget = new AfterPay.Widgets.PaymentSchedule(".concat(JSON.stringify(r),")"),document.body.appendChild(e)}),[]),Object(c.useEffect)((function(){window.afterpayWidget&&window.afterpayWidget.update({amount:r.amount})}),[e.billing.cartTotal.value]),Object(c.createElement)("div",null,"production"!=a&&Object(c.createElement)("p",{className:"clearpay-test-mode-warning-text"},"TEST MODE ENABLED"),Object(c.createElement)("div",{id:"afterpay-widget-container"}))},f=function(e){var t=d(),n=t.testmode,a=t.locale,r=e.billing,o=r.cartTotal,l=r.currency,u=o.value/Math.pow(10,l.minorUnit),p=l.prefix+u.toLocaleString(a.replace("_","-"),{minimumFractionDigits:l.minorUnit})+l.suffix;return Object(c.useEffect)((function(){var e=document.createElement("script");e.innerHTML="\n\t\t\twindow.afterpayPlacement = new Afterpay.AfterpayPlacement();\n\t\t\twindow.afterpayPlacement.type = 'price-table';\n\t\t\twindow.afterpayPlacement.amount = '".concat(u,"';\n\t\t\twindow.afterpayPlacement.locale = '").concat(a,"';\n\t\t\twindow.afterpayPlacement.currency = '").concat(l.code,"';\n\t\t\twindow.afterpayPlacement.priceTableTheme = 'white';\n\t\t\tdocument.querySelector('#clearpay-checkout-instalment-info-container .instalment-wrapper').appendChild(window.afterpayPlacement);\n\t\t"),document.body.appendChild(e)}),[]),Object(c.useEffect)((function(){window.afterpayPlacement&&(window.afterpayPlacement.amount=u)}),[u]),Object(c.createElement)("div",null,"production"!=n&&Object(c.createElement)("p",{className:"clearpay-test-mode-warning-text"},"TEST MODE ENABLED"),Object(c.createElement)("div",{className:"instalment-info-container",id:"clearpay-checkout-instalment-info-container"},Object(c.createElement)("p",{className:"header-text"},Object(i.__)("Four interest-free payments totalling ","woo_clearpay"),Object(c.createElement)("strong",null,p)),Object(c.createElement)("div",{className:"instalment-wrapper"})))};Object(l.registerPaymentMethod)({name:"clearpay",label:Object(c.createElement)("img",{src:null===(a=d())||void 0===a?void 0:a.logo_url,alt:Object(i.__)("Clearpay","woo_clearpay")}),ariaLabel:Object(i.__)("Clearpay payment method","woo_clearpay"),canMakePayment:function(e){var t,n,a=e.cartTotals,r=parseFloat(null===(t=d())||void 0===t?void 0:t.min),o=parseFloat(null===(n=d())||void 0===n?void 0:n.max),c=parseFloat(a.total_price)/Math.pow(10,a.currency_minor_unit);return c>=r&&c<=o},content:Object(c.createElement)(p,null),edit:Object(c.createElement)(p,null),supports:{features:null!==(r=null===(o=d())||void 0===o?void 0:o.supports)&&void 0!==r?r:[]}})}]);
     1!function(e){var t={};function n(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(a,r,function(t){return e[t]}.bind(null,r));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.wp.htmlEntities},function(e,t,n){"use strict";n.r(t);var a,r,o,c=n(0),i=(n(4),n(1)),l=n(2),u=n(3),d=function(){var e=Object(u.getSetting)("clearpay_data",null);if(!e)throw new Error("Clearpay initialization data is not available");return e},p=function(e){var t;return"GB"==(null===(t=d())||void 0===t?void 0:t.country)?Object(c.createElement)(m,e):Object(c.createElement)(f,e)},m=function(e){var t,n,a=null===(t=d())||void 0===t?void 0:t.testmode,r={target:"#afterpay-widget-container",locale:null===(n=d())||void 0===n?void 0:n.locale,amount:{amount:(e.billing.cartTotal.value/Math.pow(10,e.billing.currency.minorUnit)).toString(),currency:e.billing.currency.code}};return Object(c.useEffect)((function(){var e=document.createElement("script");e.innerHTML="window.afterpayWidget = new AfterPay.Widgets.PaymentSchedule(".concat(JSON.stringify(r),")"),document.body.appendChild(e)}),[]),Object(c.useEffect)((function(){window.afterpayWidget&&window.afterpayWidget.update({amount:r.amount})}),[e.billing.cartTotal.value]),Object(c.createElement)("div",null,"production"!=a&&Object(c.createElement)("p",{className:"clearpay-test-mode-warning-text"},"TEST MODE ENABLED"),Object(c.createElement)("div",{id:"afterpay-widget-container"}))},f=function(e){var t=d(),n=t.testmode,a=t.locale,r=e.billing,o=r.cartTotal,l=r.currency,u=o.value/Math.pow(10,l.minorUnit),p=l.prefix+u.toLocaleString(a.replace("_","-"),{minimumFractionDigits:l.minorUnit})+l.suffix,m="EUR"===l.code?Object(i.__)("Three","woo_clearpay"):Object(i.__)("Four","woo_clearpay"),f=Object(i.__)("%s interest-free payments totalling","woo_clearpay"),s=Object(i.sprintf)(f,m);return Object(c.useEffect)((function(){var e=document.createElement("script");e.innerHTML="\n\t\t\twindow.afterpayPlacement = new Afterpay.AfterpayPlacement();\n\t\t\twindow.afterpayPlacement.type = 'price-table';\n\t\t\twindow.afterpayPlacement.amount = '".concat(u,"';\n\t\t\twindow.afterpayPlacement.locale = '").concat(a,"';\n\t\t\twindow.afterpayPlacement.currency = '").concat(l.code,"';\n\t\t\twindow.afterpayPlacement.priceTableTheme = 'white';\n\t\t\tdocument.querySelector('#clearpay-checkout-instalment-info-container .instalment-wrapper').appendChild(window.afterpayPlacement);\n\t\t"),document.body.appendChild(e)}),[]),Object(c.useEffect)((function(){window.afterpayPlacement&&(window.afterpayPlacement.amount=u)}),[u]),Object(c.createElement)("div",null,"production"!=n&&Object(c.createElement)("p",{className:"clearpay-test-mode-warning-text"},"TEST MODE ENABLED"),Object(c.createElement)("div",{className:"instalment-info-container",id:"clearpay-checkout-instalment-info-container"},Object(c.createElement)("p",{className:"header-text"},s," ",Object(c.createElement)("strong",null,p)),Object(c.createElement)("div",{className:"instalment-wrapper"})))};Object(l.registerPaymentMethod)({name:"clearpay",label:Object(c.createElement)("img",{src:null===(a=d())||void 0===a?void 0:a.logo_url,alt:Object(i.__)("Clearpay","woo_clearpay")}),ariaLabel:Object(i.__)("Clearpay payment method","woo_clearpay"),canMakePayment:function(e){var t,n,a=e.cartTotals,r=parseFloat(null===(t=d())||void 0===t?void 0:t.min),o=parseFloat(null===(n=d())||void 0===n?void 0:n.max),c=parseFloat(a.total_price)/Math.pow(10,a.currency_minor_unit);return c>=r&&c<=o},content:Object(c.createElement)(p,null),edit:Object(c.createElement)(p,null),supports:{features:null!==(r=null===(o=d())||void 0===o?void 0:o.supports)&&void 0!==r?r:[]}})}]);
  • clearpay-gateway-for-woocommerce/tags/3.4.1/class/Cron/Clearpay_Plugin_Cron.php

    r2645621 r2717378  
    155155                    $settings['settlement-currency'] = $new_currency;
    156156                }
     157
    157158                $old_cbt = isset($settings['cbt-countries']) ? $settings['cbt-countries'] : '';
    158                 if (property_exists($configuration, 'CBT') &&
    159                     $configuration->CBT->enabled &&
    160                     is_array($configuration->CBT->countries)
    161                 ) {
    162                     $new_cbt = implode('|', $configuration->CBT->countries);
    163                 } else {
    164                     $new_cbt = 'N/A';
     159                $new_cbt = 'N/A';
     160                if (property_exists($configuration, 'CBT') && $configuration->CBT->enabled) {
     161                    if (is_array($configuration->CBT->countries)) {
     162                        sort($configuration->CBT->countries);
     163                        $new_cbt = implode('|', $configuration->CBT->countries);
     164                    }
    165165                }
    166166                if ($new_cbt != $old_cbt) {
  • clearpay-gateway-for-woocommerce/tags/3.4.1/class/WC_Gateway_Clearpay.php

    r2645621 r2717378  
    262262        public function is_available_for_blocks() {
    263263            $products_supported = true;
    264             if (WC()->cart && did_action('wp_loaded')) {
     264            if (WC()->cart) {
    265265                $products_supported = $this->cart_products_are_supported();
    266266            }
     
    529529            );
    530530            $country = $this->get_country_code();
     531            if ($country != 'GB' && substr(get_locale(), 0, 2) == 'en') {
     532                $country = 'GB'; // Allow EU merchants to show placements in English
     533            }
    531534            return $locale_by_country[$country];
    532535        }
     
    628631
    629632            /* Check for API Failure */
    630 
    631             if(($this->settings['pay-over-time-limit-min'] == 'N/A' && $this->settings['pay-over-time-limit-max'] == 'N/A')
    632                 || (empty($this->settings['pay-over-time-limit-min']) && empty($this->settings['pay-over-time-limit-max']))) {
     633            if (!$this->api_is_ok()) {
    633634                return false;
    634635            }
     
    730731         */
    731732        private function cart_products_are_supported() {
    732             foreach (WC()->cart->get_cart() as $cart_item) {
    733                 $product = $cart_item['data'];
    734                 if (!$this->is_product_supported($product)) {
    735                     return false;
     733            if (did_action('wp_loaded')) {
     734                foreach (WC()->cart->get_cart() as $cart_item) {
     735                    $product = $cart_item['data'];
     736                    if (!$this->is_product_supported($product)) {
     737                        return false;
     738                    }
    736739                }
    737740            }
     
    19691972                $attributes['data-modal-link-style'] = 'none';
    19701973            }
    1971             if (get_option('woocommerce_currency') == 'EUR'
     1974            if ($this->get_country_code() != 'GB'
    19721975                && substr(get_locale(), 0, 2) == 'en'
    19731976            ) {
  • clearpay-gateway-for-woocommerce/tags/3.4.1/class/WC_Gateway_Clearpay/instalments.html.php

    r2612228 r2717378  
    2727    <div class="instalment-info-container" id="clearpay-checkout-instalment-info-container">
    2828        <p class="header-text">
    29             <?php _e( 'Four interest-free payments totalling', 'woo_clearpay' ); ?>
     29            <?php
     30                $numberInstalmentsText = $currency === 'EUR' ? __('Three', 'woo_clearpay') : __('Four', 'woo_clearpay');
     31                $totallingText = __( '%s interest-free payments totalling', 'woo_clearpay' );
     32                printf($totallingText, $numberInstalmentsText);
     33            ?>
    3034            <strong><?php echo wc_price($order_total); ?></strong>
    3135        </p>
  • clearpay-gateway-for-woocommerce/tags/3.4.1/clearpay-gateway-for-woocommerce.php

    r2654949 r2717378  
    55 * Author: Clearpay
    66 * Author URI: https://www.clearpay.co.uk/
    7  * Version: 3.4.0
     7 * Version: 3.4.1
    88 * Text Domain: woo_clearpay
    99 * Domain Path: /languages/
    1010 * WC requires at least: 3.2.6
    11  * WC tested up to: 6.0.0
     11 * WC tested up to: 6.4.1
    1212 *
    1313 * Copyright: (c) 2021 Clearpay
     
    4747         *                                          the value in the comments above.
    4848         */
    49         public static $version = '3.4.0';
     49        public static $version = '3.4.1';
    5050
    5151        /**
     
    263263            if (!is_numeric($limit_min)) { $limit_min = 1; }
    264264            if (!is_numeric($limit_max)) { $limit_max = 1000; }
    265             if (get_option('woocommerce_currency') == 'EUR'
     265            if ($instance->get_country_code() != 'GB'
    266266                && substr(get_locale(), 0, 2) == 'en'
    267267            ) {
  • clearpay-gateway-for-woocommerce/tags/3.4.1/languages/woo_clearpay-es_ES.po

    r2584545 r2717378  
    237237msgstr "Primera entrega"
    238238
    239 msgid "Four interest-free payments totalling"
    240 msgstr "Cuatro cuotas sin coste por un total de "
     239msgid "Three"
     240msgstr "Tres"
     241
     242msgid "Four"
     243msgstr "Cuatro"
     244
     245msgid "%s interest-free payments totalling"
     246msgstr "%s cuotas sin coste por un total de"
    241247
    242248msgid "from"
  • clearpay-gateway-for-woocommerce/tags/3.4.1/languages/woo_clearpay-fr_FR.po

    r2504269 r2717378  
    227227msgstr "Premier paiement"
    228228
    229 msgid "Four interest-free payments totalling"
    230 msgstr "Quatre paiements sans frais pour un total de"
     229msgid "Three"
     230msgstr "Trois"
     231
     232msgid "Four"
     233msgstr "Quatre"
     234
     235msgid "%s interest-free payments totalling"
     236msgstr "%s paiements sans frais pour un total de"
    231237
    232238msgid "from"
  • clearpay-gateway-for-woocommerce/tags/3.4.1/languages/woo_clearpay-it_IT.po

    r2504269 r2717378  
    212212msgstr "Prima rata"
    213213
    214 msgid "Four interest-free payments totalling"
    215 msgstr "Quattro rate senza interessi"
     214msgid "Three"
     215msgstr "Tre"
     216
     217msgid "Four"
     218msgstr "Quattro"
     219
     220msgid "%s interest-free payments totalling"
     221msgstr "%s rate senza interessi"
    216222
    217223msgid "from"
  • clearpay-gateway-for-woocommerce/tags/3.4.1/readme.txt

    r2654949 r2717378  
    33Tags: woocommerce, clearpay
    44Requires at least: 4.8.3
    5 Tested up to: 5.8.2
    6 Stable tag: 3.4.0
     5Tested up to: 5.9.3
     6Stable tag: 3.4.1
    77License: GNU Public License
    88License URI: https://www.gnu.org/licenses/
     
    4040== Changelog ==
    4141
     42= 3.4.1 =
     43*Release Date: Tuesday, 03 May 2022*
     44
     45* Added support for pay in 3 for EUR.
     46* Updated SDK dependency to utilize global API endpoints.
     47* Other minor fixes.
     48* Tested and verified support for WordPress 5.9.3 and WooCommerce 6.4.1.
     49
    4250= 3.4.0 =
    4351*Release Date: Monday, 10 Jan 2022*
  • clearpay-gateway-for-woocommerce/trunk/build/index.asset.php

    r2635651 r2717378  
    1 <?php return array('dependencies' => array('wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => '406b322a3a3f18513a1e8bca2f8aa6fe');
     1<?php return array('dependencies' => array('wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => '569dacac1c5a01a8936b81d00b598587');
  • clearpay-gateway-for-woocommerce/trunk/build/index.js

    r2635651 r2717378  
    1 !function(e){var t={};function n(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(a,r,function(t){return e[t]}.bind(null,r));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.wp.htmlEntities},function(e,t,n){"use strict";n.r(t);var a,r,o,c=n(0),i=(n(4),n(1)),l=n(2),u=n(3),d=function(){var e=Object(u.getSetting)("clearpay_data",null);if(!e)throw new Error("Clearpay initialization data is not available");return e},p=function(e){var t;return"GB"==(null===(t=d())||void 0===t?void 0:t.country)?Object(c.createElement)(m,e):Object(c.createElement)(f,e)},m=function(e){var t,n,a=null===(t=d())||void 0===t?void 0:t.testmode,r={target:"#afterpay-widget-container",locale:null===(n=d())||void 0===n?void 0:n.locale,amount:{amount:(e.billing.cartTotal.value/Math.pow(10,e.billing.currency.minorUnit)).toString(),currency:e.billing.currency.code}};return Object(c.useEffect)((function(){var e=document.createElement("script");e.innerHTML="window.afterpayWidget = new AfterPay.Widgets.PaymentSchedule(".concat(JSON.stringify(r),")"),document.body.appendChild(e)}),[]),Object(c.useEffect)((function(){window.afterpayWidget&&window.afterpayWidget.update({amount:r.amount})}),[e.billing.cartTotal.value]),Object(c.createElement)("div",null,"production"!=a&&Object(c.createElement)("p",{className:"clearpay-test-mode-warning-text"},"TEST MODE ENABLED"),Object(c.createElement)("div",{id:"afterpay-widget-container"}))},f=function(e){var t=d(),n=t.testmode,a=t.locale,r=e.billing,o=r.cartTotal,l=r.currency,u=o.value/Math.pow(10,l.minorUnit),p=l.prefix+u.toLocaleString(a.replace("_","-"),{minimumFractionDigits:l.minorUnit})+l.suffix;return Object(c.useEffect)((function(){var e=document.createElement("script");e.innerHTML="\n\t\t\twindow.afterpayPlacement = new Afterpay.AfterpayPlacement();\n\t\t\twindow.afterpayPlacement.type = 'price-table';\n\t\t\twindow.afterpayPlacement.amount = '".concat(u,"';\n\t\t\twindow.afterpayPlacement.locale = '").concat(a,"';\n\t\t\twindow.afterpayPlacement.currency = '").concat(l.code,"';\n\t\t\twindow.afterpayPlacement.priceTableTheme = 'white';\n\t\t\tdocument.querySelector('#clearpay-checkout-instalment-info-container .instalment-wrapper').appendChild(window.afterpayPlacement);\n\t\t"),document.body.appendChild(e)}),[]),Object(c.useEffect)((function(){window.afterpayPlacement&&(window.afterpayPlacement.amount=u)}),[u]),Object(c.createElement)("div",null,"production"!=n&&Object(c.createElement)("p",{className:"clearpay-test-mode-warning-text"},"TEST MODE ENABLED"),Object(c.createElement)("div",{className:"instalment-info-container",id:"clearpay-checkout-instalment-info-container"},Object(c.createElement)("p",{className:"header-text"},Object(i.__)("Four interest-free payments totalling ","woo_clearpay"),Object(c.createElement)("strong",null,p)),Object(c.createElement)("div",{className:"instalment-wrapper"})))};Object(l.registerPaymentMethod)({name:"clearpay",label:Object(c.createElement)("img",{src:null===(a=d())||void 0===a?void 0:a.logo_url,alt:Object(i.__)("Clearpay","woo_clearpay")}),ariaLabel:Object(i.__)("Clearpay payment method","woo_clearpay"),canMakePayment:function(e){var t,n,a=e.cartTotals,r=parseFloat(null===(t=d())||void 0===t?void 0:t.min),o=parseFloat(null===(n=d())||void 0===n?void 0:n.max),c=parseFloat(a.total_price)/Math.pow(10,a.currency_minor_unit);return c>=r&&c<=o},content:Object(c.createElement)(p,null),edit:Object(c.createElement)(p,null),supports:{features:null!==(r=null===(o=d())||void 0===o?void 0:o.supports)&&void 0!==r?r:[]}})}]);
     1!function(e){var t={};function n(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(a,r,function(t){return e[t]}.bind(null,r));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.wp.htmlEntities},function(e,t,n){"use strict";n.r(t);var a,r,o,c=n(0),i=(n(4),n(1)),l=n(2),u=n(3),d=function(){var e=Object(u.getSetting)("clearpay_data",null);if(!e)throw new Error("Clearpay initialization data is not available");return e},p=function(e){var t;return"GB"==(null===(t=d())||void 0===t?void 0:t.country)?Object(c.createElement)(m,e):Object(c.createElement)(f,e)},m=function(e){var t,n,a=null===(t=d())||void 0===t?void 0:t.testmode,r={target:"#afterpay-widget-container",locale:null===(n=d())||void 0===n?void 0:n.locale,amount:{amount:(e.billing.cartTotal.value/Math.pow(10,e.billing.currency.minorUnit)).toString(),currency:e.billing.currency.code}};return Object(c.useEffect)((function(){var e=document.createElement("script");e.innerHTML="window.afterpayWidget = new AfterPay.Widgets.PaymentSchedule(".concat(JSON.stringify(r),")"),document.body.appendChild(e)}),[]),Object(c.useEffect)((function(){window.afterpayWidget&&window.afterpayWidget.update({amount:r.amount})}),[e.billing.cartTotal.value]),Object(c.createElement)("div",null,"production"!=a&&Object(c.createElement)("p",{className:"clearpay-test-mode-warning-text"},"TEST MODE ENABLED"),Object(c.createElement)("div",{id:"afterpay-widget-container"}))},f=function(e){var t=d(),n=t.testmode,a=t.locale,r=e.billing,o=r.cartTotal,l=r.currency,u=o.value/Math.pow(10,l.minorUnit),p=l.prefix+u.toLocaleString(a.replace("_","-"),{minimumFractionDigits:l.minorUnit})+l.suffix,m="EUR"===l.code?Object(i.__)("Three","woo_clearpay"):Object(i.__)("Four","woo_clearpay"),f=Object(i.__)("%s interest-free payments totalling","woo_clearpay"),s=Object(i.sprintf)(f,m);return Object(c.useEffect)((function(){var e=document.createElement("script");e.innerHTML="\n\t\t\twindow.afterpayPlacement = new Afterpay.AfterpayPlacement();\n\t\t\twindow.afterpayPlacement.type = 'price-table';\n\t\t\twindow.afterpayPlacement.amount = '".concat(u,"';\n\t\t\twindow.afterpayPlacement.locale = '").concat(a,"';\n\t\t\twindow.afterpayPlacement.currency = '").concat(l.code,"';\n\t\t\twindow.afterpayPlacement.priceTableTheme = 'white';\n\t\t\tdocument.querySelector('#clearpay-checkout-instalment-info-container .instalment-wrapper').appendChild(window.afterpayPlacement);\n\t\t"),document.body.appendChild(e)}),[]),Object(c.useEffect)((function(){window.afterpayPlacement&&(window.afterpayPlacement.amount=u)}),[u]),Object(c.createElement)("div",null,"production"!=n&&Object(c.createElement)("p",{className:"clearpay-test-mode-warning-text"},"TEST MODE ENABLED"),Object(c.createElement)("div",{className:"instalment-info-container",id:"clearpay-checkout-instalment-info-container"},Object(c.createElement)("p",{className:"header-text"},s," ",Object(c.createElement)("strong",null,p)),Object(c.createElement)("div",{className:"instalment-wrapper"})))};Object(l.registerPaymentMethod)({name:"clearpay",label:Object(c.createElement)("img",{src:null===(a=d())||void 0===a?void 0:a.logo_url,alt:Object(i.__)("Clearpay","woo_clearpay")}),ariaLabel:Object(i.__)("Clearpay payment method","woo_clearpay"),canMakePayment:function(e){var t,n,a=e.cartTotals,r=parseFloat(null===(t=d())||void 0===t?void 0:t.min),o=parseFloat(null===(n=d())||void 0===n?void 0:n.max),c=parseFloat(a.total_price)/Math.pow(10,a.currency_minor_unit);return c>=r&&c<=o},content:Object(c.createElement)(p,null),edit:Object(c.createElement)(p,null),supports:{features:null!==(r=null===(o=d())||void 0===o?void 0:o.supports)&&void 0!==r?r:[]}})}]);
  • clearpay-gateway-for-woocommerce/trunk/class/Cron/Clearpay_Plugin_Cron.php

    r2645621 r2717378  
    155155                    $settings['settlement-currency'] = $new_currency;
    156156                }
     157
    157158                $old_cbt = isset($settings['cbt-countries']) ? $settings['cbt-countries'] : '';
    158                 if (property_exists($configuration, 'CBT') &&
    159                     $configuration->CBT->enabled &&
    160                     is_array($configuration->CBT->countries)
    161                 ) {
    162                     $new_cbt = implode('|', $configuration->CBT->countries);
    163                 } else {
    164                     $new_cbt = 'N/A';
     159                $new_cbt = 'N/A';
     160                if (property_exists($configuration, 'CBT') && $configuration->CBT->enabled) {
     161                    if (is_array($configuration->CBT->countries)) {
     162                        sort($configuration->CBT->countries);
     163                        $new_cbt = implode('|', $configuration->CBT->countries);
     164                    }
    165165                }
    166166                if ($new_cbt != $old_cbt) {
  • clearpay-gateway-for-woocommerce/trunk/class/WC_Gateway_Clearpay.php

    r2645621 r2717378  
    262262        public function is_available_for_blocks() {
    263263            $products_supported = true;
    264             if (WC()->cart && did_action('wp_loaded')) {
     264            if (WC()->cart) {
    265265                $products_supported = $this->cart_products_are_supported();
    266266            }
     
    529529            );
    530530            $country = $this->get_country_code();
     531            if ($country != 'GB' && substr(get_locale(), 0, 2) == 'en') {
     532                $country = 'GB'; // Allow EU merchants to show placements in English
     533            }
    531534            return $locale_by_country[$country];
    532535        }
     
    628631
    629632            /* Check for API Failure */
    630 
    631             if(($this->settings['pay-over-time-limit-min'] == 'N/A' && $this->settings['pay-over-time-limit-max'] == 'N/A')
    632                 || (empty($this->settings['pay-over-time-limit-min']) && empty($this->settings['pay-over-time-limit-max']))) {
     633            if (!$this->api_is_ok()) {
    633634                return false;
    634635            }
     
    730731         */
    731732        private function cart_products_are_supported() {
    732             foreach (WC()->cart->get_cart() as $cart_item) {
    733                 $product = $cart_item['data'];
    734                 if (!$this->is_product_supported($product)) {
    735                     return false;
     733            if (did_action('wp_loaded')) {
     734                foreach (WC()->cart->get_cart() as $cart_item) {
     735                    $product = $cart_item['data'];
     736                    if (!$this->is_product_supported($product)) {
     737                        return false;
     738                    }
    736739                }
    737740            }
     
    19691972                $attributes['data-modal-link-style'] = 'none';
    19701973            }
    1971             if (get_option('woocommerce_currency') == 'EUR'
     1974            if ($this->get_country_code() != 'GB'
    19721975                && substr(get_locale(), 0, 2) == 'en'
    19731976            ) {
  • clearpay-gateway-for-woocommerce/trunk/class/WC_Gateway_Clearpay/instalments.html.php

    r2612228 r2717378  
    2727    <div class="instalment-info-container" id="clearpay-checkout-instalment-info-container">
    2828        <p class="header-text">
    29             <?php _e( 'Four interest-free payments totalling', 'woo_clearpay' ); ?>
     29            <?php
     30                $numberInstalmentsText = $currency === 'EUR' ? __('Three', 'woo_clearpay') : __('Four', 'woo_clearpay');
     31                $totallingText = __( '%s interest-free payments totalling', 'woo_clearpay' );
     32                printf($totallingText, $numberInstalmentsText);
     33            ?>
    3034            <strong><?php echo wc_price($order_total); ?></strong>
    3135        </p>
  • clearpay-gateway-for-woocommerce/trunk/clearpay-gateway-for-woocommerce.php

    r2654949 r2717378  
    55 * Author: Clearpay
    66 * Author URI: https://www.clearpay.co.uk/
    7  * Version: 3.4.0
     7 * Version: 3.4.1
    88 * Text Domain: woo_clearpay
    99 * Domain Path: /languages/
    1010 * WC requires at least: 3.2.6
    11  * WC tested up to: 6.0.0
     11 * WC tested up to: 6.4.1
    1212 *
    1313 * Copyright: (c) 2021 Clearpay
     
    4747         *                                          the value in the comments above.
    4848         */
    49         public static $version = '3.4.0';
     49        public static $version = '3.4.1';
    5050
    5151        /**
     
    263263            if (!is_numeric($limit_min)) { $limit_min = 1; }
    264264            if (!is_numeric($limit_max)) { $limit_max = 1000; }
    265             if (get_option('woocommerce_currency') == 'EUR'
     265            if ($instance->get_country_code() != 'GB'
    266266                && substr(get_locale(), 0, 2) == 'en'
    267267            ) {
  • clearpay-gateway-for-woocommerce/trunk/languages/woo_clearpay-es_ES.po

    r2584545 r2717378  
    237237msgstr "Primera entrega"
    238238
    239 msgid "Four interest-free payments totalling"
    240 msgstr "Cuatro cuotas sin coste por un total de "
     239msgid "Three"
     240msgstr "Tres"
     241
     242msgid "Four"
     243msgstr "Cuatro"
     244
     245msgid "%s interest-free payments totalling"
     246msgstr "%s cuotas sin coste por un total de"
    241247
    242248msgid "from"
  • clearpay-gateway-for-woocommerce/trunk/languages/woo_clearpay-fr_FR.po

    r2504269 r2717378  
    227227msgstr "Premier paiement"
    228228
    229 msgid "Four interest-free payments totalling"
    230 msgstr "Quatre paiements sans frais pour un total de"
     229msgid "Three"
     230msgstr "Trois"
     231
     232msgid "Four"
     233msgstr "Quatre"
     234
     235msgid "%s interest-free payments totalling"
     236msgstr "%s paiements sans frais pour un total de"
    231237
    232238msgid "from"
  • clearpay-gateway-for-woocommerce/trunk/languages/woo_clearpay-it_IT.po

    r2504269 r2717378  
    212212msgstr "Prima rata"
    213213
    214 msgid "Four interest-free payments totalling"
    215 msgstr "Quattro rate senza interessi"
     214msgid "Three"
     215msgstr "Tre"
     216
     217msgid "Four"
     218msgstr "Quattro"
     219
     220msgid "%s interest-free payments totalling"
     221msgstr "%s rate senza interessi"
    216222
    217223msgid "from"
  • clearpay-gateway-for-woocommerce/trunk/readme.txt

    r2654949 r2717378  
    33Tags: woocommerce, clearpay
    44Requires at least: 4.8.3
    5 Tested up to: 5.8.2
    6 Stable tag: 3.4.0
     5Tested up to: 5.9.3
     6Stable tag: 3.4.1
    77License: GNU Public License
    88License URI: https://www.gnu.org/licenses/
     
    4040== Changelog ==
    4141
     42= 3.4.1 =
     43*Release Date: Tuesday, 03 May 2022*
     44
     45* Added support for pay in 3 for EUR.
     46* Updated SDK dependency to utilize global API endpoints.
     47* Other minor fixes.
     48* Tested and verified support for WordPress 5.9.3 and WooCommerce 6.4.1.
     49
    4250= 3.4.0 =
    4351*Release Date: Monday, 10 Jan 2022*
Note: See TracChangeset for help on using the changeset viewer.