Plugin Directory

Changeset 3386206


Ignore:
Timestamp:
10/29/2025 06:34:54 AM (5 months ago)
Author:
fantasyworld
Message:

update 3.5.11

Location:
ry-woocommerce-tools/trunk
Files:
32 edited

Legend:

Unmodified
Added
Removed
  • ry-woocommerce-tools/trunk/assets/admin/ry-shipping.asset.php

    r3217447 r3386206  
    1 <?php return array('dependencies' => array('jquery'), 'version' => '926e672f2345ae9d04e7');
     1<?php return array('dependencies' => array('jquery'), 'version' => '6e7e9297020dbb0105e6');
  • ry-woocommerce-tools/trunk/assets/admin/ry-shipping.js

    r3217447 r3386206  
    1 (()=>{"use strict";var i={n:n=>{var e=n&&n.__esModule?()=>n.default:()=>n;return i.d(e,{a:e}),e},d:(n,e)=>{for(var o in e)i.o(e,o)&&!i.o(n,o)&&Object.defineProperty(n,o,{enumerable:!0,get:e[o]})},o:(i,n)=>Object.prototype.hasOwnProperty.call(i,n)};const n=window.jQuery;var e=i.n(n);e()((function(){e()("#_shipping_cvs_store_ID").length&&e()(".edit_address").on("click",(function(){e()("a.load_customer_shipping").remove(),e()("a.billing-same-as-shipping").remove(),e()("._shipping_company_field").hide(),e()("._shipping_address_1_field").hide(),e()("._shipping_address_2_field").hide(),e()("._shipping_city_field").hide(),e()("._shipping_postcode_field").hide(),e()("._shipping_country_field").hide(),e()("._shipping_state_field").hide()}));let i=e()("#ry-ecpay-shipping-info");if(0==i.length&&(i=e()("#ry-newebpay-shipping-info")),0==i.length&&(i=e()("#ry-smilepay-shipping-info")),i.length){const n=i.find(".inside"),o=function(){n.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})};i.on("click",".ry-delete-shipping-info",(function(){if(window.confirm(RyAdminShippingParams.i18n.delete_shipping_info)){const i=e()(this);o(),e().ajax({url:ajaxurl,method:"POST",data:{action:"RY_delete_shipping_info",id:i.data("id"),orderid:i.data("orderid"),_ajax_nonce:RyAdminShippingParams._nonce.delete}}).done((function(){0==i.closest("table").find("tbody tr").length&&n.find(".button:gt(0)").remove(),i.closest("tr").remove()})).always((function(){n.unblock()}))}})),i.on("click",".ry-ecpay-shipping-info",(function(){const i=e()(this);o(),e().ajax({url:ajaxurl,method:"POST",data:{action:"RY_ecpay_shipping_info",orderid:i.data("orderid"),temp:i.data("temp"),collection:i.data("collection"),_ajax_nonce:RyAdminShippingParams._nonce.get}}).always((function(){location.reload()}))})),i.on("click",".ry-smilepay-shipping-info",(function(){const i=e()(this);o(),e().ajax({url:ajaxurl,method:"POST",data:{action:"RY_smilepay_shipping_info",orderid:i.data("orderid"),temp:i.data("temp"),collection:i.data("collection"),_ajax_nonce:RyAdminShippingParams._nonce.get},dataType:"text"}).done((function(i){"https://"==i.substr(0,8)||"http://"==i.substr(0,7)?window.location=i:location.reload()})).always((function(){n.unblock()}))})),i.on("click",".ry-smilepay-shipping-no",(function(){const i=e()(this);o(),e().ajax({url:ajaxurl,method:"POST",data:{action:"RY_smilepay_shipping_no",id:i.data("id"),orderid:i.data("orderid"),_ajax_nonce:RyAdminShippingParams._nonce.smilepay}}).always((function(){location.reload()}))}))}e()(document).on("change",".ry-shipping-cost_requires",(function(){const i=e()(this).closest("form");if(i.length){const n=i.find(".ry-shipping-min_amount");switch(e()(this).val()){case"min_amount":case"min_amount_or_coupon":case"min_amount_and_coupon":case"min_amount_except_discount":case"min_amount_except_discount_or_coupon":case"min_amount_except_discount_and_coupon":0==n.closest("tr").length?(n.closest("fieldset").show(),i.find('label[for="'+n.attr("id")+'"]').show()):n.closest("tr").show();break;default:0==n.closest("tr").length?(n.closest("fieldset").hide(),i.find('label[for="'+n.attr("id")+'"]').hide()):n.closest("tr").hide()}}})),e()(".ry-shipping-cost_requires").trigger("change"),e()(document).on("wc_backbone_modal_loaded",(function(i,n){if("wc-modal-shipping-method-settings"===n){const i=e()("#wc-backbone-modal-dialog .ry-shipping-cost_requires");i.length&&i.trigger("change")}}))}))})();
     1(()=>{"use strict";var i={n:n=>{var e=n&&n.__esModule?()=>n.default:()=>n;return i.d(e,{a:e}),e},d:(n,e)=>{for(var o in e)i.o(e,o)&&!i.o(n,o)&&Object.defineProperty(n,o,{enumerable:!0,get:e[o]})},o:(i,n)=>Object.prototype.hasOwnProperty.call(i,n)};const n=window.jQuery;var e=i.n(n);e()(function(){e()("#_shipping_cvs_store_ID").length&&e()(".edit_address").on("click",function(){e()("a.load_customer_shipping").remove(),e()("a.billing-same-as-shipping").remove(),e()("._shipping_company_field").hide(),e()("._shipping_address_1_field").hide(),e()("._shipping_address_2_field").hide(),e()("._shipping_city_field").hide(),e()("._shipping_postcode_field").hide(),e()("._shipping_country_field").hide(),e()("._shipping_state_field").hide()});let i=e()("#ry-ecpay-shipping-info");if(0==i.length&&(i=e()("#ry-newebpay-shipping-info")),0==i.length&&(i=e()("#ry-smilepay-shipping-info")),i.length){const n=i.find(".inside"),o=function(){n.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})};i.on("click",".ry-delete-shipping-info",function(){if(window.confirm(RyAdminShippingParams.i18n.delete_shipping_info)){const i=e()(this);o(),e().ajax({url:ajaxurl,method:"POST",data:{action:"RY_delete_shipping_info",id:i.data("id"),orderid:i.data("orderid"),_ajax_nonce:RyAdminShippingParams._nonce.delete}}).done(function(){0==i.closest("table").find("tbody tr").length&&n.find(".button:gt(0)").remove(),i.closest("tr").remove()}).always(function(){n.unblock()})}}),i.on("click",".ry-ecpay-shipping-info",function(){const i=e()(this);o(),e().ajax({url:ajaxurl,method:"POST",data:{action:"RY_ecpay_shipping_info",orderid:i.data("orderid"),temp:i.data("temp"),collection:i.data("collection"),_ajax_nonce:RyAdminShippingParams._nonce.get}}).always(function(){location.reload()})}),i.on("click",".ry-smilepay-shipping-info",function(){const i=e()(this);o(),e().ajax({url:ajaxurl,method:"POST",data:{action:"RY_smilepay_shipping_info",orderid:i.data("orderid"),temp:i.data("temp"),collection:i.data("collection"),_ajax_nonce:RyAdminShippingParams._nonce.get},dataType:"text"}).done(function(i){"https://"==i.substr(0,8)||"http://"==i.substr(0,7)?window.location=i:location.reload()}).always(function(){n.unblock()})}),i.on("click",".ry-smilepay-shipping-no",function(){const i=e()(this);o(),e().ajax({url:ajaxurl,method:"POST",data:{action:"RY_smilepay_shipping_no",id:i.data("id"),orderid:i.data("orderid"),_ajax_nonce:RyAdminShippingParams._nonce.smilepay}}).always(function(){location.reload()})})}e()(document).on("change",".ry-shipping-cost_requires",function(){const i=e()(this).closest("form");if(i.length){const n=i.find(".ry-shipping-min_amount");switch(e()(this).val()){case"min_amount":case"min_amount_or_coupon":case"min_amount_and_coupon":case"min_amount_except_discount":case"min_amount_except_discount_or_coupon":case"min_amount_except_discount_and_coupon":0==n.closest("tr").length?(n.closest("fieldset").show(),i.find('label[for="'+n.attr("id")+'"]').show()):n.closest("tr").show();break;default:0==n.closest("tr").length?(n.closest("fieldset").hide(),i.find('label[for="'+n.attr("id")+'"]').hide()):n.closest("tr").hide()}}}),e()(".ry-shipping-cost_requires").trigger("change"),e()(document).on("wc_backbone_modal_loaded",function(i,n){if("wc-modal-shipping-method-settings"===n){const i=e()("#wc-backbone-modal-dialog .ry-shipping-cost_requires");i.length&&i.trigger("change")}})})})();
  • ry-woocommerce-tools/trunk/assets/ry-checkout.asset.php

    r3217447 r3386206  
    1 <?php return array('dependencies' => array('jquery'), 'version' => '384147b42203c1768d43');
     1<?php return array('dependencies' => array('jquery'), 'version' => 'd12f145791277cb10bb0');
  • ry-woocommerce-tools/trunk/assets/ry-checkout.js

    r3217447 r3386206  
    1 (()=>{"use strict";var e={n:o=>{var c=o&&o.__esModule?()=>o.default:()=>o;return e.d(c,{a:c}),c},d:(o,c)=>{for(var i in c)e.o(c,i)&&!e.o(o,i)&&Object.defineProperty(o,i,{enumerable:!0,get:c[i]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o)};const o=window.jQuery;var c=e.n(o);let i;c()((function(){const e=function(e){"undefined"!=typeof RyCheckoutParams&&(c()(".woocommerce-checkout #shipping_phone_field label .required").remove(),c()(".woocommerce-checkout #shipping_phone_field label .optional").remove(),e?(c()(".woocommerce-checkout #shipping_phone_field").addClass(["validate-required"]),c()(".woocommerce-checkout #shipping_phone_field label").append(RyCheckoutParams.i18n.required)):(c()(".woocommerce-checkout #shipping_phone_field").removeClass(["validate-required"]),c()(".woocommerce-checkout #shipping_phone_field label").append(RyCheckoutParams.i18n.optional)),c()(".woocommerce-checkout #shipping_phone").trigger("change"))};c()(document.body).on("updated_checkout",(function(o,t){if(void 0!==t&&(i=void 0,c()(".woocommerce-checkout .ry-cvs-hide").show(),c()(".woocommerce-checkout .ry-ecpay-cvs-hide").show(),c()(".woocommerce-checkout .ry-newebpay-cvs-hide").show(),c()(".woocommerce-checkout .ry-smilepay-cvs-hide").show(),void 0!==t.fragments.ry_shipping_info?(!0===t.fragments.ry_shipping_info.ecpay_cvs&&(e(!0),i=t.fragments.ry_shipping_info.postData,c()(".woocommerce-checkout .ry-cvs-hide").hide(),c()(".woocommerce-checkout .ry-ecpay-cvs-hide").hide(),c()(".ry-cvs-store-info").hide(),""!=c()("input#RY_CVSStoreID").val()&&(c()(".ry-cvs-store-info").show(),c()(".ry-cvs-store-info > span").hide(),""!=c()("input#RY_CVSStoreName").val()&&c()(".ry-cvs-store-info .store-name").text(c()("input#RY_CVSStoreName").val()).parent().show(),""!=c()("input#RY_CVSAddress").val()&&c()(".ry-cvs-store-info .store-address").text(c()("input#RY_CVSAddress").val()).parent().show(),""!=c()("input#RY_CVSTelephone").val()&&c()(".ry-cvs-store-info .store-telephone").text(c()("input#RY_CVSTelephone").val()).parent().show())),!0===t.fragments.ry_shipping_info.ecpay_home&&e(!0),!0===t.fragments.ry_shipping_info.newebpay_cvs&&(e(!1),c()(".woocommerce-checkout .ry-cvs-hide").hide(),c()(".woocommerce-checkout .ry-newebpay-cvs-hide").hide()),!0===t.fragments.ry_shipping_info.smilepay_cvs&&(e(!0),c()(".woocommerce-checkout .ry-cvs-hide").hide(),c()(".woocommerce-checkout .ry-smilepay-cvs-hide").hide()),!0===t.fragments.ry_shipping_info.smilepay_home&&e(!0)):e(!1)),null!==window.sessionStorage.getItem("RyTempCheckout")){let e=JSON.parse(window.sessionStorage.getItem("RyTempCheckout"));for(const o in e){let c=jQuery('[name="'+e[o].name+'"]');switch(c.prop("tagName")){case"INPUT":if("checkbox"==c.attr("type")){!1===c.prop("checked")&&c.trigger("click");break}if("radio"==c.attr("type")){c=jQuery('[name="'+e[o].name+'"][value="'+e[o].value+'"]'),!1===c.prop("checked")&&c.trigger("click");break}case"TEXTAREA":case"SELECT":const i=c.val();c.val(e[o].value),i!=e[o].value&&c.trigger("change")}}window.sessionStorage.removeItem("RyTempCheckout")}})),c()(".woocommerce-checkout").on("click",".ry-choose-cvs",(function(){let e=c()("form.checkout").serializeArray();e=e.filter((function(e){return"_"!=e.name.substring(0,1)&&"RY_"!=e.name.substring(0,3)&&-1===["terms"].indexOf(e.name)})),window.sessionStorage.setItem("RyTempCheckout",JSON.stringify(e));let o='<form id="RyECPayChooseCvs" action="'+c()(this).data("ry-url")+'" method="post">';for(const e in i)o+='<input type="hidden" name="'+e+'" value="'+i[e]+'">';window.innerWidth<1024&&(o+='<input type="hidden" name="Device" value="1">'),o+="</form>",document.body.innerHTML+=o,document.getElementById("RyECPayChooseCvs").submit()}))}))})();
     1(()=>{"use strict";var e={n:o=>{var c=o&&o.__esModule?()=>o.default:()=>o;return e.d(c,{a:c}),c},d:(o,c)=>{for(var i in c)e.o(c,i)&&!e.o(o,i)&&Object.defineProperty(o,i,{enumerable:!0,get:c[i]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o)};const o=window.jQuery;var c=e.n(o);let i;c()(function(){const e=function(e){"undefined"!=typeof RyCheckoutParams&&(c()(".woocommerce-checkout #shipping_phone_field label .required").remove(),c()(".woocommerce-checkout #shipping_phone_field label .optional").remove(),e?(c()(".woocommerce-checkout #shipping_phone_field").addClass(["validate-required"]),c()(".woocommerce-checkout #shipping_phone_field label").append(RyCheckoutParams.i18n.required)):(c()(".woocommerce-checkout #shipping_phone_field").removeClass(["validate-required"]),c()(".woocommerce-checkout #shipping_phone_field label").append(RyCheckoutParams.i18n.optional)),c()(".woocommerce-checkout #shipping_phone").trigger("change"))};c()(document.body).on("updated_checkout",function(o,t){if(void 0!==t&&(i=void 0,c()(".woocommerce-checkout .ry-cvs-hide").show(),c()(".woocommerce-checkout .ry-ecpay-cvs-hide").show(),c()(".woocommerce-checkout .ry-newebpay-cvs-hide").show(),c()(".woocommerce-checkout .ry-smilepay-cvs-hide").show(),void 0!==t.fragments.ry_shipping_info?(!0===t.fragments.ry_shipping_info.ecpay_cvs&&(e(!0),i=t.fragments.ry_shipping_info.postData,c()(".woocommerce-checkout .ry-cvs-hide").hide(),c()(".woocommerce-checkout .ry-ecpay-cvs-hide").hide(),c()(".ry-cvs-store-info").hide(),""!=c()("input#RY_CVSStoreID").val()&&(c()(".ry-cvs-store-info").show(),c()(".ry-cvs-store-info > span").hide(),""!=c()("input#RY_CVSStoreName").val()&&c()(".ry-cvs-store-info .store-name").text(c()("input#RY_CVSStoreName").val()).parent().show(),""!=c()("input#RY_CVSAddress").val()&&c()(".ry-cvs-store-info .store-address").text(c()("input#RY_CVSAddress").val()).parent().show(),""!=c()("input#RY_CVSTelephone").val()&&c()(".ry-cvs-store-info .store-telephone").text(c()("input#RY_CVSTelephone").val()).parent().show())),!0===t.fragments.ry_shipping_info.ecpay_home&&e(!0),!0===t.fragments.ry_shipping_info.newebpay_cvs&&(e(!1),c()(".woocommerce-checkout .ry-cvs-hide").hide(),c()(".woocommerce-checkout .ry-newebpay-cvs-hide").hide()),!0===t.fragments.ry_shipping_info.smilepay_cvs&&(e(!0),c()(".woocommerce-checkout .ry-cvs-hide").hide(),c()(".woocommerce-checkout .ry-smilepay-cvs-hide").hide()),!0===t.fragments.ry_shipping_info.smilepay_home&&e(!0)):e(!1)),null!==window.sessionStorage.getItem("RyTempCheckout")){let e=JSON.parse(window.sessionStorage.getItem("RyTempCheckout"));for(const o in e){let c=jQuery('[name="'+e[o].name+'"]');switch(c.prop("tagName")){case"INPUT":if("checkbox"==c.attr("type")){!1===c.prop("checked")&&c.trigger("click");break}if("radio"==c.attr("type")){c=jQuery('[name="'+e[o].name+'"][value="'+e[o].value+'"]'),!1===c.prop("checked")&&c.trigger("click");break}case"TEXTAREA":case"SELECT":const i=c.val();c.val(e[o].value),i!=e[o].value&&c.trigger("change")}}window.sessionStorage.removeItem("RyTempCheckout")}}),c()(".woocommerce-checkout").on("click",".ry-choose-cvs",function(){let e=c()("form.checkout").serializeArray();e=e.filter(function(e){return"_"!=e.name.substring(0,1)&&"RY_"!=e.name.substring(0,3)&&-1===["terms"].indexOf(e.name)}),window.sessionStorage.setItem("RyTempCheckout",JSON.stringify(e));let o='<form id="RyECPayChooseCvs" action="'+c()(this).data("ry-url")+'" method="post">';for(const e in i)o+='<input type="hidden" name="'+e+'" value="'+i[e]+'">';window.innerWidth<1024&&(o+='<input type="hidden" name="Device" value="1">'),o+="</form>",document.body.innerHTML+=o,document.getElementById("RyECPayChooseCvs").submit()})})})();
  • ry-woocommerce-tools/trunk/includes/cron.php

    r3294501 r3386206  
    33final class RY_WT_Cron
    44{
    5     public static function add_action()
     5    public static function add_action(): void
    66    {
    77        add_action('ry_check_ntp_time', [__CLASS__, 'check_ntp_time']);
     
    3939    }
    4040
    41     public static function update_3_2_0()
     41    public static function update_3_2_0(): void
    4242    {
    4343        $start_time = microtime(true);
  • ry-woocommerce-tools/trunk/includes/main.php

    r3294501 r3386206  
    77    public const MIN_WC_VERSION = '8.0.0';
    88
    9     public const MIN_PRO_TOOLS_VERSION = '3.5.9';
     9    public const MIN_PRO_TOOLS_VERSION = '3.6.6';
    1010
    1111    protected static $_instance = null;
  • ry-woocommerce-tools/trunk/includes/update.php

    r3315774 r3386206  
    116116            RY_WT::update_option('version', '3.5.10', true);
    117117        }
     118
     119        if (version_compare($now_version, '3.5.11', '<')) {
     120            RY_WT::update_option('version', '3.5.11', true);
     121        }
    118122    }
    119123}
  • ry-woocommerce-tools/trunk/languages/ry-woocommerce-tools.pot

    r3301505 r3386206  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: RY Tools for WooCommerce 3.5.8\n"
     5"Project-Id-Version: RY Tools for WooCommerce 3.5.11\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/ry-woocommerce-tools\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-05-27T20:37:21+08:00\n"
     12"POT-Creation-Date: 2025-10-29T14:29:44+08:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.11.0\n"
     14"X-Generator: WP-CLI 2.12.0\n"
    1515"X-Domain: ry-woocommerce-tools\n"
    1616
     
    4444#. translators: %1$s: Name of this plugin %2$s: min require version
    4545#: includes/admin.php:30
     46#, php-format
    4647msgid "<strong>%1$s</strong> is inactive. It require WooCommerce version %2$s or newer."
    4748msgstr ""
     
    9697#: templates/order/order-smilepay-payment-info-cvs-711.php:25
    9798#: templates/order/order-smilepay-payment-info-cvs-fami.php:25
    98 #: woocommerce/abstracts/abstract-wc-payment-gateway.php:28
     99#: woocommerce/abstracts/abstract-wc-payment-gateway.php:35
    99100msgid "Payment details"
    100101msgstr ""
     
    103104#: templates/order/order-newebpay-payment-info-atm.php:31
    104105#: templates/order/order-smilepay-payment-info-atm.php:31
    105 #: woocommerce/gateways/ecpay/gateway-atm.php:52
    106 #: woocommerce/gateways/newebpay/gateway-atm.php:48
    107 #: woocommerce/gateways/smilepay/gateway-atm.php:53
     106#: woocommerce/gateways/ecpay/gateway-atm.php:47
     107#: woocommerce/gateways/newebpay/gateway-atm.php:43
     108#: woocommerce/gateways/smilepay/gateway-atm.php:48
    108109msgid "Bank"
    109110msgstr ""
     
    118119#: templates/order/order-newebpay-payment-info-atm.php:47
    119120#: templates/order/order-smilepay-payment-info-atm.php:47
    120 #: woocommerce/gateways/ecpay/gateway-atm.php:56
    121 #: woocommerce/gateways/newebpay/gateway-atm.php:52
    122 #: woocommerce/gateways/smilepay/gateway-atm.php:57
     121#: woocommerce/gateways/ecpay/gateway-atm.php:51
     122#: woocommerce/gateways/newebpay/gateway-atm.php:47
     123#: woocommerce/gateways/smilepay/gateway-atm.php:52
    123124msgid "ATM Bank account"
    124125msgstr ""
     
    134135#: templates/order/order-smilepay-payment-info-cvs-711.php:39
    135136#: templates/order/order-smilepay-payment-info-cvs-fami.php:39
    136 #: woocommerce/gateways/ecpay/gateway-atm.php:60
    137 #: woocommerce/gateways/ecpay/gateway-barcode.php:64
    138 #: woocommerce/gateways/ecpay/gateway-cvs.php:56
     137#: woocommerce/gateways/ecpay/gateway-atm.php:55
     138#: woocommerce/gateways/ecpay/gateway-barcode.php:59
     139#: woocommerce/gateways/ecpay/gateway-cvs.php:51
    139140#: woocommerce/gateways/ecpay/includes/settings/atm.php:6
    140141#: woocommerce/gateways/ecpay/includes/settings/barcode.php:6
    141 #: woocommerce/gateways/newebpay/gateway-atm.php:56
    142 #: woocommerce/gateways/newebpay/gateway-barcode.php:64
    143 #: woocommerce/gateways/newebpay/gateway-cvs.php:56
     142#: woocommerce/gateways/newebpay/gateway-atm.php:51
     143#: woocommerce/gateways/newebpay/gateway-barcode.php:59
     144#: woocommerce/gateways/newebpay/gateway-cvs.php:51
    144145#: woocommerce/gateways/newebpay/includes/settings/atm.php:6
    145146#: woocommerce/gateways/newebpay/includes/settings/barcode.php:6
    146147#: woocommerce/gateways/newebpay/includes/settings/cvs.php:6
    147 #: woocommerce/gateways/smilepay/gateway-atm.php:61
    148 #: woocommerce/gateways/smilepay/gateway-barcode.php:65
    149 #: woocommerce/gateways/smilepay/gateway-cvs-711.php:57
    150 #: woocommerce/gateways/smilepay/gateway-cvs-fami.php:57
     148#: woocommerce/gateways/smilepay/gateway-atm.php:56
     149#: woocommerce/gateways/smilepay/gateway-barcode.php:60
     150#: woocommerce/gateways/smilepay/gateway-cvs-711.php:52
     151#: woocommerce/gateways/smilepay/gateway-cvs-fami.php:52
    151152#: woocommerce/gateways/smilepay/includes/settings/atm.php:6
    152153#: woocommerce/gateways/smilepay/includes/settings/barcode.php:6
     
    157158#: templates/order/order-newebpay-payment-info-barcode.php:31
    158159#: templates/order/order-smilepay-payment-info-barcode.php:31
    159 #: woocommerce/gateways/ecpay/gateway-barcode.php:52
    160 #: woocommerce/gateways/newebpay/gateway-barcode.php:52
    161 #: woocommerce/gateways/smilepay/gateway-barcode.php:53
     160#: woocommerce/gateways/ecpay/gateway-barcode.php:47
     161#: woocommerce/gateways/newebpay/gateway-barcode.php:47
     162#: woocommerce/gateways/smilepay/gateway-barcode.php:48
    162163msgid "Barcode 1"
    163164msgstr ""
     
    166167#: templates/order/order-newebpay-payment-info-barcode.php:39
    167168#: templates/order/order-smilepay-payment-info-barcode.php:39
    168 #: woocommerce/gateways/ecpay/gateway-barcode.php:56
    169 #: woocommerce/gateways/newebpay/gateway-barcode.php:56
    170 #: woocommerce/gateways/smilepay/gateway-barcode.php:57
     169#: woocommerce/gateways/ecpay/gateway-barcode.php:51
     170#: woocommerce/gateways/newebpay/gateway-barcode.php:51
     171#: woocommerce/gateways/smilepay/gateway-barcode.php:52
    171172msgid "Barcode 2"
    172173msgstr ""
     
    175176#: templates/order/order-newebpay-payment-info-barcode.php:47
    176177#: templates/order/order-smilepay-payment-info-barcode.php:47
    177 #: woocommerce/gateways/ecpay/gateway-barcode.php:60
    178 #: woocommerce/gateways/newebpay/gateway-barcode.php:60
    179 #: woocommerce/gateways/smilepay/gateway-barcode.php:61
     178#: woocommerce/gateways/ecpay/gateway-barcode.php:55
     179#: woocommerce/gateways/newebpay/gateway-barcode.php:55
     180#: woocommerce/gateways/smilepay/gateway-barcode.php:56
    180181msgid "Barcode 3"
    181182msgstr ""
     
    188189#: woocommerce/shipping/info-list-table.php:120
    189190#: woocommerce/shipping/info-list-table.php:130
     191#, php-format
    190192msgctxt "Datetime"
    191193msgid "%1$s %2$s"
     
    200202#: templates/order/order-smilepay-payment-info-cvs-711.php:31
    201203#: templates/order/order-smilepay-payment-info-cvs-fami.php:31
    202 #: woocommerce/gateways/ecpay/gateway-cvs.php:52
    203 #: woocommerce/gateways/newebpay/gateway-cvs.php:52
    204 #: woocommerce/gateways/smilepay/gateway-cvs-711.php:53
    205 #: woocommerce/gateways/smilepay/gateway-cvs-fami.php:53
     204#: woocommerce/gateways/ecpay/gateway-cvs.php:47
     205#: woocommerce/gateways/newebpay/gateway-cvs.php:47
     206#: woocommerce/gateways/smilepay/gateway-cvs-711.php:48
     207#: woocommerce/gateways/smilepay/gateway-cvs-fami.php:48
    206208msgid "CVS code"
    207209msgstr ""
     
    217219
    218220#. translators: %1$s: Gateway method title, %2$d normal minimum
    219 #: woocommerce/abstracts/abstract-wc-payment-gateway.php:72
     221#: woocommerce/abstracts/abstract-wc-payment-gateway.php:79
     222#, php-format
    220223msgid "%1$s minimum amount less then normal minimum (%2$d)."
    221224msgstr ""
    222225
    223226#. translators: %1$s: Gateway method title, %2$d normal maximum
    224 #: woocommerce/abstracts/abstract-wc-payment-gateway.php:87
     227#: woocommerce/abstracts/abstract-wc-payment-gateway.php:94
     228#, php-format
    225229msgid "%1$s maximum amount more then normal maximum (%2$d)."
    226230msgstr ""
     
    245249#. translators: %1$s server time, %2$d: differ time (second)
    246250#: woocommerce/admin/settings/html/tools.php:9
     251#, php-format
    247252msgid "Server time (%1$s) and Google Public NTP differ is %2$d second"
    248253msgid_plural "Server time (%1$s) and Google Public NTP differ is %2$d seconds"
     
    314319#: woocommerce/gateways/newebpay/includes/admin.php:41
    315320#: woocommerce/gateways/smilepay/includes/admin.php:40
     321#, php-format
    316322msgid "Need %s to support block checkout."
    317323msgstr ""
     
    932938msgstr ""
    933939
    934 #: woocommerce/gateways/ecpay/gateway-atm.php:40
    935 #: woocommerce/gateways/ecpay/gateway-barcode.php:40
    936 #: woocommerce/gateways/ecpay/gateway-cvs.php:40
    937 #: woocommerce/gateways/newebpay/gateway-atm.php:36
    938 #: woocommerce/gateways/newebpay/gateway-barcode.php:40
    939 #: woocommerce/gateways/newebpay/gateway-cvs.php:40
    940 #: woocommerce/gateways/smilepay/gateway-atm.php:41
    941 #: woocommerce/gateways/smilepay/gateway-barcode.php:41
    942 #: woocommerce/gateways/smilepay/gateway-cvs-711.php:41
    943 #: woocommerce/gateways/smilepay/gateway-cvs-fami.php:41
     940#: woocommerce/gateways/ecpay/gateway-atm.php:35
     941#: woocommerce/gateways/ecpay/gateway-barcode.php:35
     942#: woocommerce/gateways/ecpay/gateway-cvs.php:35
     943#: woocommerce/gateways/newebpay/gateway-atm.php:31
     944#: woocommerce/gateways/newebpay/gateway-barcode.php:35
     945#: woocommerce/gateways/newebpay/gateway-cvs.php:35
     946#: woocommerce/gateways/smilepay/gateway-atm.php:36
     947#: woocommerce/gateways/smilepay/gateway-barcode.php:36
     948#: woocommerce/gateways/smilepay/gateway-cvs-711.php:36
     949#: woocommerce/gateways/smilepay/gateway-cvs-fami.php:36
    944950msgid "Payment expire date out of range. Set as default value."
    945951msgstr ""
     
    972978msgstr ""
    973979
    974 #: woocommerce/gateways/ecpay/gateway-credit-installment.php:60
    975 #: woocommerce/gateways/newebpay/gateway-credit-installment.php:55
     980#: woocommerce/gateways/ecpay/gateway-credit-installment.php:55
     981#: woocommerce/gateways/newebpay/gateway-credit-installment.php:50
    976982msgctxt "Checkout info"
    977983msgid "Number of periods"
    978984msgstr ""
    979985
    980 #: woocommerce/gateways/ecpay/gateway-credit.php:15
     986#: woocommerce/gateways/ecpay/gateway-credit.php:17
    981987#: woocommerce/gateways/newebpay/gateway-credit.php:11
    982988#: woocommerce/gateways/smilepay/gateway-credit.php:11
     
    984990msgstr ""
    985991
    986 #: woocommerce/gateways/ecpay/gateway-credit.php:16
    987 msgid "ECPay Credit"
    988 msgstr ""
    989 
    990992#: woocommerce/gateways/ecpay/gateway-credit.php:18
     993msgid "ECPay Credit ( include \"Apple Pay\" )"
     994msgstr ""
     995
     996#: woocommerce/gateways/ecpay/gateway-credit.php:20
    991997msgid "Pay via ECPay Credit"
    992998msgstr ""
     
    10381044#: woocommerce/gateways/ecpay/includes/admin.php:42
    10391045#: woocommerce/shipping/ecpay/includes/admin.php:52
     1046#, php-format
    10401047msgid "Used MerchantID \"%s\""
    10411048msgstr ""
     
    10431050#. translators: %s: link to RY ECPay Invoice for WooCommerce
    10441051#: woocommerce/gateways/ecpay/includes/admin.php:58
     1052#, php-format
    10451053msgid "If you need ECPay Invoice support, you can try %s"
    10461054msgstr ""
     
    10541062
    10551063#. translators: %d number of periods
    1056 #: woocommerce/gateways/ecpay/includes/gateway-api.php:165
     1064#: woocommerce/gateways/ecpay/includes/gateway-api.php:274
    10571065#: woocommerce/gateways/newebpay/includes/gateway-api.php:187
     1066#, php-format
    10581067msgid "Credit installment to %d"
    10591068msgstr ""
     
    10731082#. translators: %1$s: status message, %2$d status code
    10741083#: woocommerce/gateways/ecpay/includes/gateway-response.php:184
     1084#, php-format
    10751085msgid "Payment failed: %1$s (%2$d)"
    10761086msgstr ""
     
    10781088#. translators: %1$s: status message, %2$d status code
    10791089#: woocommerce/gateways/ecpay/includes/gateway-response.php:195
     1090#, php-format
    10801091msgid "Payment unkonw status: %1$s (%2$d)"
    10811092msgstr ""
     
    11071118#: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:19
    11081119#: woocommerce/shipping/smilepay/includes/settings/admin-settings.php:17
     1120#, php-format
    11091121msgid "Log API / IPN information, inside %s"
    11101122msgstr ""
     
    11491161#: woocommerce/gateways/newebpay/includes/settings/admin-settings.php:43
    11501162#: woocommerce/gateways/smilepay/includes/settings/admin-settings.php:43
    1151 #: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:172
     1163#: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:169
    11521164msgid "API credentials"
    11531165msgstr ""
     
    11641176#: woocommerce/gateways/newebpay/includes/settings/admin-settings.php:53
    11651177#: woocommerce/gateways/smilepay/includes/settings/admin-settings.php:53
     1178#: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:179
     1179msgid "Note: Recommend using this for development purposes only."
     1180msgstr ""
     1181
     1182#: woocommerce/gateways/ecpay/includes/settings/admin-settings.php:56
    11661183#: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:182
    1167 msgid "Note: Recommend using this for development purposes only."
    1168 msgstr ""
    1169 
    1170 #: woocommerce/gateways/ecpay/includes/settings/admin-settings.php:56
    1171 #: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:185
    11721184msgctxt "ECPay"
    11731185msgid "MerchantID"
     
    11751187
    11761188#: woocommerce/gateways/ecpay/includes/settings/admin-settings.php:62
    1177 #: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:191
     1189#: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:188
    11781190msgctxt "ECPay"
    11791191msgid "HashKey"
     
    11811193
    11821194#: woocommerce/gateways/ecpay/includes/settings/admin-settings.php:68
    1183 #: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:197
     1195#: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:194
    11841196msgctxt "ECPay"
    11851197msgid "HashIV"
     
    12131225#: woocommerce/gateways/newebpay/includes/settings/credit-installment.php:22
    12141226#: woocommerce/gateways/newebpay/includes/settings/credit-installment.php:24
     1227#, php-format
    12151228msgid "%d periods"
    12161229msgstr ""
     
    12221235msgstr ""
    12231236
     1237#: woocommerce/gateways/ecpay/includes/settings/credit.php:6
     1238msgid "Apple Pay"
     1239msgstr ""
     1240
     1241#: woocommerce/gateways/ecpay/includes/settings/credit.php:7
     1242msgid "Support Apple Pay"
     1243msgstr ""
     1244
    12241245#: woocommerce/gateways/ecpay/includes/settings/cvs.php:6
    12251246#: woocommerce/gateways/smilepay/includes/settings/cvs.php:6
     
    12371258#. translators: %s: Gateway method title
    12381259#: woocommerce/gateways/global-setting.php:8
     1260#, php-format
    12391261msgid "Enable %s"
    12401262msgstr ""
     
    13291351#. translators: 1: Store name 2: Store ID
    13301352#: woocommerce/gateways/newebpay/includes/gateway-response.php:116
     1353#, php-format
    13311354msgid "CVS store %1$s (%2$s)"
    13321355msgstr ""
     
    13341357#. translators: 1: Error status code 2: Error status message
    13351358#: woocommerce/gateways/newebpay/includes/gateway-response.php:203
     1359#, php-format
    13361360msgid "Payment failed: %1$s (%2$s)"
    13371361msgstr ""
     
    14381462#. translators: %s: link to RY SmilePay Invoice for WooCommerce
    14391463#: woocommerce/gateways/smilepay/includes/admin.php:48
     1464#, php-format
    14401465msgid "If you need SmilePay Invoice support, you can try %s"
    14411466msgstr ""
     
    14431468#. translators: %1$s Error messade, %2$d Error messade ID
    14441469#: woocommerce/gateways/smilepay/includes/gateway-api.php:131
     1470#, php-format
    14451471msgid "Get Smilepay code error: %1$s (%2$d)"
    14461472msgstr ""
     
    14481474#. translators: Error status message
    14491475#: woocommerce/gateways/smilepay/includes/gateway-response.php:119
     1476#, php-format
    14501477msgid "Payment failed (%s)"
    14511478msgstr ""
     
    15071534#. translators: %s: number of orders
    15081535#: woocommerce/shipping.php:77
     1536#, php-format
    15091537msgid "Wait pickup (cvs) <span class=\"count\">(%s)</span>"
    15101538msgid_plural "Wait pickup (cvs) <span class=\"count\">(%s)</span>"
     
    15141542#. translators: %s: number of orders
    15151543#: woocommerce/shipping.php:87
     1544#, php-format
    15161545msgid "Overdue return (cvs) <span class=\"count\">(%s)</span>"
    15171546msgid_plural "Overdue return (cvs) <span class=\"count\">(%s)</span>"
     
    15211550#. translators: %s: number of orders
    15221551#: woocommerce/shipping.php:97
     1552#, php-format
    15231553msgid "Transporting <span class=\"count\">(%s)</span>"
    15241554msgid_plural "Transporting <span class=\"count\">(%s)</span>"
     
    16341664
    16351665#: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:118
     1666msgid "Shipping declare amount mode"
     1667msgstr ""
     1668
     1669#: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:123
     1670msgid "product regular"
     1671msgstr ""
     1672
     1673#: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:124
     1674msgid "payment amount"
     1675msgstr ""
     1676
     1677#: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:126
     1678msgid "Only work with cash on delivery and can set different amount."
     1679msgstr ""
     1680
     1681#: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:130
    16361682msgid "Shipping declare amount over 20000"
    16371683msgstr ""
    16381684
    1639 #: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:123
     1685#: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:135
    16401686msgid "keep amount"
    16411687msgstr ""
    16421688
    1643 #: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:124
     1689#: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:136
    16441690msgid "limit 2000"
    16451691msgstr ""
    16461692
    1647 #: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:126
    1648 msgid "Use product regular price as declare amount."
    1649 msgstr ""
    1650 
    1651 #: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:130
     1693#: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:140
    16521694#: woocommerce/shipping/smilepay/includes/settings/admin-settings.php:70
    16531695msgid "Shipping box size ( Home delivery )"
    16541696msgstr ""
    16551697
    1656 #: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:135
     1698#: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:145
    16571699#: woocommerce/shipping/smilepay/includes/settings/admin-settings.php:75
    16581700msgctxt "box size"
     
    16601702msgstr ""
    16611703
    1662 #: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:136
     1704#: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:146
    16631705#: woocommerce/shipping/smilepay/includes/settings/admin-settings.php:76
    16641706msgctxt "box size"
     
    16661708msgstr ""
    16671709
    1668 #: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:137
     1710#: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:147
    16691711#: woocommerce/shipping/smilepay/includes/settings/admin-settings.php:77
    16701712msgctxt "box size"
     
    16721714msgstr ""
    16731715
    1674 #: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:138
     1716#: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:148
    16751717#: woocommerce/shipping/smilepay/includes/settings/admin-settings.php:78
    16761718msgctxt "box size"
     
    16781720msgstr ""
    16791721
    1680 #: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:139
     1722#: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:149
    16811723#: woocommerce/shipping/smilepay/includes/settings/admin-settings.php:79
    16821724msgctxt "box size"
     
    16841726msgstr ""
    16851727
    1686 #: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:141
     1728#: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:151
    16871729#: woocommerce/shipping/smilepay/includes/settings/admin-settings.php:81
    16881730msgid "By product is set box size to the biggest product size."
     
    16901732
    16911733#. translators: %s: Weight unit
    1692 #: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:147
     1734#: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:157
     1735#, php-format
    16931736msgid "Product default weight (%s) ( Home delivery )"
    16941737msgstr ""
    16951738
    1696 #: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:177
     1739#: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:174
    16971740msgid "ECPay shipping sandbox"
    16981741msgstr ""
    16991742
    1700 #: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:181
     1743#: woocommerce/shipping/ecpay/includes/settings/admin-settings.php:178
    17011744msgid "Enable ECPay shipping sandbox"
    17021745msgstr ""
    17031746
    17041747#. translators: %s Error messade
    1705 #: woocommerce/shipping/ecpay/includes/shipping-api.php:220
     1748#: woocommerce/shipping/ecpay/includes/shipping-api.php:222
     1749#, php-format
    17061750msgid "Get shipping code error: %s"
    17071751msgstr ""
     
    17701814#. translators: 1: ECPay ID 2: Old status mag 3: Old status no 4: New status mag 5: New status no
    17711815#: woocommerce/shipping/ecpay/includes/shipping-response.php:150
     1816#, php-format
    17721817msgid "%1$s shipping status from %2$s(%3$d) to %4$s(%5$d)"
    17731818msgstr ""
     
    17971842msgstr ""
    17981843
    1799 #: woocommerce/shipping/ecpay/shipping.php:268
    1800 #: woocommerce/shipping/ecpay/shipping.php:270
     1844#: woocommerce/shipping/ecpay/shipping.php:269
     1845#: woocommerce/shipping/ecpay/shipping.php:271
    18011846msgid "No convenience store has been chosen."
    18021847msgstr ""
     
    18491894#. translators: %s WooCommerce weight unit
    18501895#: woocommerce/shipping/global-setting.php:55
     1896#, php-format
    18511897msgid "Every weight (%s) to plus times of cost"
    18521898msgstr ""
     
    18621908#. translators: %s: shipping class setting url
    18631909#: woocommerce/shipping/global-setting.php:75
     1910#, php-format
    18641911msgid "These shipping available based on the <a href=\"%s\">product shipping class</a>."
    18651912msgstr ""
     
    18671914#. translators: %s: shipping class name
    18681915#: woocommerce/shipping/global-setting.php:86
     1916#, php-format
    18691917msgid "\"%s\" available"
    18701918msgstr ""
     
    20212069#. translators: %1$s Error messade, %2$d Error messade ID
    20222070#: woocommerce/shipping/smilepay/includes/shipping-api.php:254
     2071#, php-format
    20232072msgid "Get Smilepay no error: %1$s (%2$d)"
    20242073msgstr ""
     
    20262075#. translators: %1$s Error messade, %2$d Error messade ID
    20272076#: woocommerce/shipping/smilepay/includes/shipping-api.php:400
     2077#, php-format
    20282078msgid "Get Smilepay info no error: %1$s (%2$d)"
    20292079msgstr ""
     
    20402090#. translators: 1: ECPay ID 2: Old status no 3: New status no
    20412091#: woocommerce/shipping/smilepay/includes/shipping-response.php:169
     2092#, php-format
    20422093msgid "%1$s shipping status from %2$s to %3$s"
    20432094msgstr ""
  • ry-woocommerce-tools/trunk/ry-woocommerce-tools.php

    r3315774 r3386206  
    55 * Plugin URI: https://ry-plugin.com/ry-woocommerce-tools
    66 * Description: WooCommerce paymet and shipping tools
    7  * Version: 3.5.10
     7 * Version: 3.5.11
    88 * Requires at least: 6.6
    99 * Requires PHP: 8.0
     
    2222function_exists('plugin_dir_url') or exit('No direct script access allowed');
    2323
    24 define('RY_WT_VERSION', '3.5.10');
     24define('RY_WT_VERSION', '3.5.11');
    2525define('RY_WT_PLUGIN_URL', plugin_dir_url(__FILE__));
    2626define('RY_WT_PLUGIN_DIR', plugin_dir_path(__FILE__));
  • ry-woocommerce-tools/trunk/woocommerce/abstracts/abstract-wc-payment-gateway.php

    r3294501 r3386206  
    1313    public function __construct()
    1414    {
     15        $this->init_settings();
     16
     17        $this->title = $this->settings['title'] ?: $this->method_title;
     18        $this->description = $this->settings['description'];
     19        $this->min_amount = (int) $this->settings['min_amount'];
     20        $this->max_amount = (int) $this->settings['max_amount'];
     21
    1522        add_action('woocommerce_admin_order_data_after_billing_address', [$this, 'admin_payment_info']);
    1623    }
     
    4956            $total = $this->get_order_total();
    5057            if (0 < $total) {
    51                 if ($this->min_amount > 0 && $total < $this->min_amount) {
     58                if ($this->min_amount > 0 && $total <= $this->min_amount) {
    5259                    $is_available = false;
    5360                }
    54                 if ($this->max_amount > 0 && $total > $this->max_amount) {
     61                if ($this->max_amount > 0 && $total >= $this->max_amount) {
    5562                    $is_available = false;
    5663                }
  • ry-woocommerce-tools/trunk/woocommerce/abstracts/abstract-wc-shipping-method.php

    r3301505 r3386206  
    1919        $this->init_settings();
    2020
    21         $this->title = $this->get_option('title');
    22         $this->tax_status = $this->get_option('tax_status');
    23         $this->cost = $this->get_option('cost');
    24         $this->cost_requires = $this->get_option('cost_requires');
    25         $this->min_amount = $this->get_option('min_amount', 0);
    26         $this->weight_plus_cost = $this->get_option('weight_plus_cost', 0);
     21        $this->title = $this->settings['title'] ?: $this->method_title;
     22        $this->tax_status = $this->settings['tax_status'];
     23        $this->cost = $this->settings['cost'];
     24        $this->cost_requires = $this->settings['cost_requires'];
     25        $this->min_amount = $this->settings['min_amount'];
     26        $this->weight_plus_cost = $this->settings['weight_plus_cost'] ?: 0;
    2727
    2828        if (!wc_tax_enabled()) {
  • ry-woocommerce-tools/trunk/woocommerce/gateways/ecpay/gateway-atm.php

    r3294501 r3386206  
    1919
    2020        $this->form_fields = include RY_WT_PLUGIN_DIR . 'woocommerce/gateways/ecpay/includes/settings/atm.php';
    21         $this->init_settings();
    2221
    23         $this->title = $this->get_option('title') ?: $this->method_title;
    24         $this->description = $this->get_option('description');
    25         $this->expire_date = (int) $this->get_option('expire_date', 3);
    26         $this->min_amount = (int) $this->get_option('min_amount', 0);
    27         $this->max_amount = (int) $this->get_option('max_amount', 0);
     22        parent::__construct();
     23
     24        $this->expire_date = (int) ($this->settings['expire_date'] ?: 3);
    2825
    2926        add_filter('ry_admin_payment_info-ry_ecpay_atm', [$this, 'show_payment_info'], 10, 2);
    30 
    31         parent::__construct();
    3227    }
    3328
  • ry-woocommerce-tools/trunk/woocommerce/gateways/ecpay/gateway-barcode.php

    r3294501 r3386206  
    55    public const Payment_Type = 'BARCODE';
    66
    7     protected $check_min_amount = 17;
     7    protected $check_min_amount = 16;
    88
    99    protected $check_max_amount = 20000;
     
    1919
    2020        $this->form_fields = include RY_WT_PLUGIN_DIR . 'woocommerce/gateways/ecpay/includes/settings/barcode.php';
    21         $this->init_settings();
    2221
    23         $this->title = $this->get_option('title') ?: $this->method_title;
    24         $this->description = $this->get_option('description');
    25         $this->expire_date = (int) $this->get_option('expire_date', 7);
    26         $this->min_amount = (int) $this->get_option('min_amount', 0);
    27         $this->max_amount = (int) $this->get_option('max_amount', 0);
     22        parent::__construct();
     23
     24        $this->expire_date = (int) ($this->settings['expire_date'] ?: 7);
    2825
    2926        add_filter('ry_admin_payment_info-ry_ecpay_barcode', [$this, 'show_payment_info'], 10, 2);
    30 
    31         parent::__construct();
    3227    }
    3328
  • ry-woocommerce-tools/trunk/woocommerce/gateways/ecpay/gateway-credit-installment.php

    r3294501 r3386206  
    77    public $number_of_periods = [];
    88
    9     protected $check_min_amount = 5;
     9    protected $check_min_amount = 6;
    1010
    11     protected $check_max_amount = 200000;
     11    protected $check_max_amount = 199999;
    1212
    1313    public function __construct()
     
    2121
    2222        $this->form_fields = include RY_WT_PLUGIN_DIR . 'woocommerce/gateways/ecpay/includes/settings/credit-installment.php';
    23         $this->init_settings();
    24 
    25         $this->title = $this->get_option('title') ?: $this->method_title;
    26         $this->description = $this->get_option('description');
    27         $this->min_amount = (int) $this->get_option('min_amount', 0);
    28         $this->max_amount = (int) $this->get_option('max_amount', 0);
    29         $this->number_of_periods = $this->get_option('number_of_periods', []);
    3023
    3124        parent::__construct();
     25
     26        $this->number_of_periods = $this->settings['number_of_periods'] ?: [];
    3227    }
    3328
  • ry-woocommerce-tools/trunk/woocommerce/gateways/ecpay/gateway-credit.php

    r3145248 r3386206  
    55    public const Payment_Type = 'Credit';
    66
    7     protected $check_min_amount = 5;
     7    public $support_applepay = 'yes';
    88
    9     protected $check_max_amount = 200000;
     9    protected $check_min_amount = 6;
     10
     11    protected $check_max_amount = 199999;
    1012
    1113    public function __construct()
     
    1416        $this->has_fields = false;
    1517        $this->order_button_text = __('Pay via Credit', 'ry-woocommerce-tools');
    16         $this->method_title = __('ECPay Credit', 'ry-woocommerce-tools');
     18        $this->method_title = __('ECPay Credit ( include "Apple Pay" )', 'ry-woocommerce-tools');
    1719        $this->method_description = '';
    1820        $this->process_payment_note = __('Pay via ECPay Credit', 'ry-woocommerce-tools');
    1921
    2022        $this->form_fields = include RY_WT_PLUGIN_DIR . 'woocommerce/gateways/ecpay/includes/settings/credit.php';
    21         $this->init_settings();
    22 
    23         $this->title = $this->get_option('title') ?: $this->method_title;
    24         $this->description = $this->get_option('description');
    25         $this->min_amount = (int) $this->get_option('min_amount', 0);
    26         $this->max_amount = (int) $this->get_option('max_amount', 0);
    2723
    2824        parent::__construct();
     25
     26        $this->support_applepay = ! empty($this->settings['applepay']) && 'no' === $this->settings['applepay'] ? 'no' : 'yes';
    2927    }
    3028}
  • ry-woocommerce-tools/trunk/woocommerce/gateways/ecpay/gateway-cvs.php

    r3294501 r3386206  
    55    public const Payment_Type = 'CVS';
    66
    7     protected $check_min_amount = 33;
     7    protected $check_min_amount = 31;
    88
    99    protected $check_max_amount = 6000;
     
    1919
    2020        $this->form_fields = include RY_WT_PLUGIN_DIR . 'woocommerce/gateways/ecpay/includes/settings/cvs.php';
    21         $this->init_settings();
    2221
    23         $this->title = $this->get_option('title') ?: $this->method_title;
    24         $this->description = $this->get_option('description');
    25         $this->expire_date = (int) $this->get_option('expire_date', 10080);
    26         $this->min_amount = (int) $this->get_option('min_amount', 0);
    27         $this->max_amount = (int) $this->get_option('max_amount', 0);
     22        parent::__construct();
     23
     24        $this->expire_date = (int) ($this->settings['expire_date'] ?: 10080);
    2825
    2926        add_filter('ry_admin_payment_info-ry_ecpay_cvs', [$this, 'show_payment_info'], 10, 2);
    30 
    31         parent::__construct();
    3227    }
    3328
  • ry-woocommerce-tools/trunk/woocommerce/gateways/ecpay/gateway-twqr.php

    r3145248 r3386206  
    77    protected $check_min_amount = 6;
    88
    9     protected $check_max_amount = 300000;
     9    protected $check_max_amount = 49999;
    1010
    1111    public function __construct()
     
    1919
    2020        $this->form_fields = include RY_WT_PLUGIN_DIR . 'woocommerce/gateways/ecpay/includes/settings/twqr.php';
    21         $this->init_settings();
    22 
    23         $this->title = $this->get_option('title') ?: $this->method_title;
    24         $this->description = $this->get_option('description');
    25         $this->min_amount = (int) $this->get_option('min_amount', 0);
    26         $this->max_amount = (int) $this->get_option('max_amount', 0);
    2721
    2822        parent::__construct();
  • ry-woocommerce-tools/trunk/woocommerce/gateways/ecpay/gateway-webatm.php

    r3145248 r3386206  
    1919
    2020        $this->form_fields = include RY_WT_PLUGIN_DIR . 'woocommerce/gateways/ecpay/includes/settings/webatm.php';
    21         $this->init_settings();
    22 
    23         $this->title = $this->get_option('title') ?: $this->method_title;
    24         $this->description = $this->get_option('description');
    25         $this->min_amount = (int) $this->get_option('min_amount', 0);
    26         $this->max_amount = (int) $this->get_option('max_amount', 0);
    2721
    2822        parent::__construct();
  • ry-woocommerce-tools/trunk/woocommerce/gateways/ecpay/includes/gateway-api.php

    r3264259 r3386206  
    88        'checkout' => 'https://payment-stage.ecpay.com.tw/Cashier/AioCheckOut/V5',
    99        'query' => 'https://payment-stage.ecpay.com.tw/Cashier/QueryTradeInfo/V5',
     10        'credit-query' => 'https://ecpayment-stage.ecpay.com.tw/1.0.0/CreditDetail/QueryTrade',
     11        'credit-action' => 'https://payment-stage.ecpay.com.tw/CreditDetail/DoAction',
    1012    ];
    1113
     
    1315        'checkout' => 'https://payment.ecpay.com.tw/Cashier/AioCheckOut/V5',
    1416        'query' => 'https://payment.ecpay.com.tw/Cashier/QueryTradeInfo/V5',
     17        'credit-query' => 'https://ecpayment.ecpay.com.tw/1.0.0/CreditDetail/QueryTrade',
     18        'credit-action' => 'https://payment.ecpay.com.tw/CreditDetail/DoAction',
    1519    ];
    1620
     
    146150    }
    147151
     152    public function get_credit_info($order)
     153    {
     154        list($MerchantID, $HashKey, $HashIV) = RY_WT_WC_ECPay_Gateway::instance()->get_api_info();
     155
     156        $args = [
     157            'MerchantID' => $MerchantID,
     158            'RqHeader' => [
     159                'Timestamp' => new DateTime('', new DateTimeZone('Asia/Taipei')),
     160            ],
     161            'Data' => wp_json_encode([
     162                'MerchantID' => $MerchantID,
     163                'MerchantTradeNo' => $order->get_meta('_ecpay_MerchantTradeNo', true),
     164            ]),
     165        ];
     166        $args['RqHeader']['Timestamp'] = $args['RqHeader']['Timestamp']->getTimestamp();
     167
     168        if (RY_WT_WC_ECPay_Gateway::instance()->is_testmode()) {
     169            $url = $this->api_test_url['credit-query'];
     170        } else {
     171            $url = $this->api_url['credit-query'];
     172        }
     173
     174        $response = $this->link_v2_server($url, $args, $HashKey, $HashIV);
     175        if (is_wp_error($response)) {
     176            RY_WT_WC_ECPay_Gateway::instance()->log('Credit query failed', WC_Log_Levels::ERROR, ['data' => $args, 'info' => $response->get_error_messages()]);
     177            return;
     178        }
     179
     180        if (wp_remote_retrieve_response_code($response) != '200') {
     181            RY_WT_WC_ECPay_Gateway::instance()->log('Credit query HTTP status error', WC_Log_Levels::ERROR, ['data' => $args, 'code' => wp_remote_retrieve_response_code($response)]);
     182            return;
     183        }
     184
     185        $body = wp_remote_retrieve_body($response);
     186        $result = json_decode($body);
     187        if (!is_object($result)) {
     188            RY_WT_WC_ECPay_Gateway::instance()->log('Credit query result parse failed', WC_Log_Levels::WARNING, ['data' => $args, 'result' => wp_remote_retrieve_body($response)]);
     189            return;
     190        }
     191
     192        if (!(isset($result->TransCode) && 1 == $result->TransCode)) {
     193            RY_WT_WC_ECPay_Gateway::instance()->log('Credit query result error', WC_Log_Levels::ERROR, ['code' => $result->TransCode, 'msg' => $result->TransMsg]);
     194            return;
     195        }
     196
     197        $result->Data = openssl_decrypt($result->Data, self::Encrypt_Method, $HashKey, 0, $HashIV);
     198        $result->Data = json_decode(urldecode($result->Data), true);
     199
     200        if (!is_array($result->Data)) {
     201            RY_WT_WC_ECPay_Gateway::instance()->log('Credit query data decrypt failed', WC_Log_Levels::ERROR, ['data' => $result->Data]);
     202            return;
     203        }
     204
     205        RY_WT_WC_ECPay_Gateway::instance()->log('Credit query data', WC_Log_Levels::INFO, ['data' => $result->Data]);
     206
     207        return $result->Data;
     208    }
     209
     210    public function credit_action($order, $action, $amount)
     211    {
     212        $amount = (int) $amount;
     213
     214        list($MerchantID, $HashKey, $HashIV) = RY_WT_WC_ECPay_Gateway::instance()->get_api_info();
     215
     216        $args = [
     217            'MerchantID' => $MerchantID,
     218            'MerchantTradeNo' => $order->get_meta('_ecpay_MerchantTradeNo', true),
     219            'TradeNo' => $order->get_transaction_id(),
     220            'Action' => $action,
     221            'TotalAmount' => $amount,
     222        ];
     223
     224        if (RY_WT_WC_ECPay_Gateway::instance()->is_testmode()) {
     225            $url = $this->api_test_url['credit-action'];
     226        } else {
     227            $url = $this->api_url['credit-action'];
     228        }
     229        $args = $this->add_check_value($args, $HashKey, $HashIV, 'sha256');
     230
     231        $response = $this->link_server($url, $args);
     232        if (is_wp_error($response)) {
     233            RY_WT_WC_ECPay_Gateway::instance()->log('Credit action failed', WC_Log_Levels::ERROR, ['data' => $args, 'info' => $response->get_error_messages()]);
     234            return;
     235        }
     236
     237        if (wp_remote_retrieve_response_code($response) != '200') {
     238            RY_WT_WC_ECPay_Gateway::instance()->log('Credit action HTTP status error', WC_Log_Levels::ERROR, ['data' => $args, 'code' => wp_remote_retrieve_response_code($response)]);
     239            return;
     240        }
     241
     242        $body = wp_remote_retrieve_body($response);
     243        parse_str($body, $result);
     244        if (!is_array($result)) {
     245            RY_WT_WC_ECPay_Gateway::instance()->log('Credit action result parse failed', WC_Log_Levels::WARNING, ['data' => $args, 'result' => wp_remote_retrieve_body($response)]);
     246            return;
     247        }
     248
     249        RY_WT_WC_ECPay_Gateway::instance()->log('Credit action data', WC_Log_Levels::INFO, ['data' => $result]);
     250
     251        return $result;
     252    }
     253
    148254    protected function add_type_info($args, $order, $gateway)
    149255    {
    150256        switch ($gateway::Payment_Type) {
    151257            case 'Credit':
     258                if (isset($gateway->support_applepay) && $gateway->support_applepay === 'no') {
     259                    $args['IgnorePayment'] = 'ApplePay';
     260                }
    152261                if (isset($gateway->number_of_periods) && !empty($gateway->number_of_periods)) {
    153262                    if (is_array($gateway->number_of_periods)) {
  • ry-woocommerce-tools/trunk/woocommerce/gateways/ecpay/includes/settings/credit.php

    r2989087 r3386206  
    33$setting = include RY_WT_PLUGIN_DIR . 'woocommerce/gateways/global-setting.php';
    44
     5$setting['applepay'] = [
     6    'title' => __('Apple Pay', 'ry-woocommerce-tools'),
     7    'label' => __('Support Apple Pay', 'ry-woocommerce-tools'),
     8    'type' => 'checkbox',
     9    'default' => 'yes',
     10];
     11
    512return $setting;
  • ry-woocommerce-tools/trunk/woocommerce/gateways/newebpay/gateway-atm.php

    r3294501 r3386206  
    1515
    1616        $this->form_fields = include RY_WT_PLUGIN_DIR . 'woocommerce/gateways/newebpay/includes/settings/atm.php';
    17         $this->init_settings();
    1817
    19         $this->title = $this->get_option('title');
    20         $this->description = $this->get_option('description');
    21         $this->expire_date = (int) $this->get_option('expire_date', 7);
    22         $this->min_amount = (int) $this->get_option('min_amount', 0);
    23         $this->max_amount = (int) $this->get_option('max_amount', 0);
     18        parent::__construct();
     19
     20        $this->expire_date = (int) ($this->settings['expire_date'] ?: 7);
    2421
    2522        add_filter('ry_admin_payment_info-ry_newebpay_atm', [$this, 'show_payment_info'], 10, 2);
    26 
    27         parent::__construct();
    2823    }
    2924
  • ry-woocommerce-tools/trunk/woocommerce/gateways/newebpay/gateway-barcode.php

    r3294501 r3386206  
    1919
    2020        $this->form_fields = include RY_WT_PLUGIN_DIR . 'woocommerce/gateways/newebpay/includes/settings/barcode.php';
    21         $this->init_settings();
    2221
    23         $this->title = $this->get_option('title');
    24         $this->description = $this->get_option('description');
    25         $this->expire_date = (int) $this->get_option('expire_date', 7);
    26         $this->min_amount = (int) $this->get_option('min_amount', 0);
    27         $this->max_amount = (int) $this->get_option('max_amount', 0);
     22        parent::__construct();
     23
     24        $this->expire_date = (int) ($this->settings['expire_date'] ?: 7);
    2825
    2926        add_filter('ry_admin_payment_info-ry_newebpay_barcode', [$this, 'show_payment_info'], 10, 2);
    30 
    31         parent::__construct();
    3227    }
    3328
  • ry-woocommerce-tools/trunk/woocommerce/gateways/newebpay/gateway-credit-installment.php

    r3294501 r3386206  
    1717
    1818        $this->form_fields = include RY_WT_PLUGIN_DIR . 'woocommerce/gateways/newebpay/includes/settings/credit-installment.php';
    19         $this->init_settings();
    20 
    21         $this->title = $this->get_option('title');
    22         $this->description = $this->get_option('description');
    23         $this->min_amount = (int) $this->get_option('min_amount', 0);
    24         $this->max_amount = (int) $this->get_option('max_amount', 0);
    25         $this->number_of_periods = $this->get_option('number_of_periods', []);
    2619
    2720        parent::__construct();
     21
     22        $this->number_of_periods = $this->settings['number_of_periods'] ?: [];
    2823    }
    2924
  • ry-woocommerce-tools/trunk/woocommerce/gateways/newebpay/gateway-credit.php

    r2989087 r3386206  
    1515
    1616        $this->form_fields = include RY_WT_PLUGIN_DIR . 'woocommerce/gateways/newebpay/includes/settings/credit.php';
    17         $this->init_settings();
    18 
    19         $this->title = $this->get_option('title');
    20         $this->description = $this->get_option('description');
    21         $this->min_amount = (int) $this->get_option('min_amount', 0);
    22         $this->max_amount = (int) $this->get_option('max_amount', 0);
    2317
    2418        parent::__construct();
  • ry-woocommerce-tools/trunk/woocommerce/gateways/newebpay/gateway-cvs.php

    r3294501 r3386206  
    1919
    2020        $this->form_fields = include RY_WT_PLUGIN_DIR . 'woocommerce/gateways/newebpay/includes/settings/cvs.php';
    21         $this->init_settings();
    2221
    23         $this->title = $this->get_option('title');
    24         $this->description = $this->get_option('description');
    25         $this->expire_date = (int) $this->get_option('expire_date', 7);
    26         $this->min_amount = (int) $this->get_option('min_amount', 0);
    27         $this->max_amount = (int) $this->get_option('max_amount', 0);
     22        parent::__construct();
     23
     24        $this->expire_date = (int) ($this->settings['expire_date'] ?: 7);
    2825
    2926        add_filter('ry_admin_payment_info-ry_newebpay_cvs', [$this, 'show_payment_info'], 10, 2);
    30 
    31         parent::__construct();
    3227    }
    3328
  • ry-woocommerce-tools/trunk/woocommerce/gateways/newebpay/gateway-webatm.php

    r2989087 r3386206  
    1515
    1616        $this->form_fields = include RY_WT_PLUGIN_DIR . 'woocommerce/gateways/newebpay/includes/settings/webatm.php';
    17         $this->init_settings();
    18 
    19         $this->title = $this->get_option('title');
    20         $this->description = $this->get_option('description');
    21         $this->min_amount = (int) $this->get_option('min_amount', 0);
    22         $this->max_amount = (int) $this->get_option('max_amount', 0);
    2317
    2418        parent::__construct();
  • ry-woocommerce-tools/trunk/woocommerce/gateways/smilepay/gateway-atm.php

    r3294501 r3386206  
    2020
    2121        $this->form_fields = include RY_WT_PLUGIN_DIR . 'woocommerce/gateways/smilepay/includes/settings/atm.php';
    22         $this->init_settings();
    2322
    24         $this->title = $this->get_option('title');
    25         $this->description = $this->get_option('description');
    26         $this->expire_date = (int) $this->get_option('expire_date', 3);
    27         $this->min_amount = (int) $this->get_option('min_amount', 0);
    28         $this->max_amount = (int) $this->get_option('max_amount', 0);
     23        parent::__construct();
     24
     25        $this->expire_date = (int) ($this->settings['expire_date'] ?: 3);
    2926
    3027        add_filter('ry_admin_payment_info-ry_smilepay_atm', [$this, 'show_payment_info'], 10, 2);
    31 
    32         parent::__construct();
    3328    }
    3429
  • ry-woocommerce-tools/trunk/woocommerce/gateways/smilepay/gateway-barcode.php

    r3294501 r3386206  
    2020
    2121        $this->form_fields = include RY_WT_PLUGIN_DIR . 'woocommerce/gateways/smilepay/includes/settings/barcode.php';
    22         $this->init_settings();
    2322
    24         $this->title = $this->get_option('title');
    25         $this->description = $this->get_option('description');
    26         $this->expire_date = (int) $this->get_option('expire_date', 7);
    27         $this->min_amount = (int) $this->get_option('min_amount', 0);
    28         $this->max_amount = (int) $this->get_option('max_amount', 0);
     23        parent::__construct();
     24
     25        $this->expire_date = (int) ($this->settings['expire_date'] ?: 7);
    2926
    3027        add_filter('ry_admin_payment_info-ry_smilepay_barcode', [$this, 'show_payment_info'], 10, 2);
    31 
    32         parent::__construct();
    3328    }
    3429
  • ry-woocommerce-tools/trunk/woocommerce/gateways/smilepay/gateway-credit.php

    r2989087 r3386206  
    1515
    1616        $this->form_fields = include RY_WT_PLUGIN_DIR . 'woocommerce/gateways/smilepay/includes/settings/credit.php';
    17         $this->init_settings();
    18 
    19         $this->title = $this->get_option('title');
    20         $this->description = $this->get_option('description');
    21         $this->min_amount = (int) $this->get_option('min_amount', 0);
    22         $this->max_amount = (int) $this->get_option('max_amount', 0);
    2317
    2418        parent::__construct();
  • ry-woocommerce-tools/trunk/woocommerce/gateways/smilepay/gateway-cvs-711.php

    r3294501 r3386206  
    2020
    2121        $this->form_fields = include RY_WT_PLUGIN_DIR . 'woocommerce/gateways/smilepay/includes/settings/cvs.php';
    22         $this->init_settings();
    2322
    24         $this->title = $this->get_option('title');
    25         $this->description = $this->get_option('description');
    26         $this->expire_date = (int) $this->get_option('expire_date', 4320);
    27         $this->min_amount = (int) $this->get_option('min_amount', 0);
    28         $this->max_amount = (int) $this->get_option('max_amount', 0);
     23        parent::__construct();
     24
     25        $this->expire_date = (int) ($this->settings['expire_date'] ?: 4320);
    2926
    3027        add_filter('ry_admin_payment_info-ry_smilepay_cvs_711', [$this, 'show_payment_info'], 10, 2);
    31 
    32         parent::__construct();
    3328    }
    3429
  • ry-woocommerce-tools/trunk/woocommerce/gateways/smilepay/gateway-cvs-fami.php

    r3294501 r3386206  
    2020
    2121        $this->form_fields = include RY_WT_PLUGIN_DIR . 'woocommerce/gateways/smilepay/includes/settings/cvs.php';
    22         $this->init_settings();
    2322
    24         $this->title = $this->get_option('title');
    25         $this->description = $this->get_option('description');
    26         $this->expire_date = (int) $this->get_option('expire_date', 4320);
    27         $this->min_amount = (int) $this->get_option('min_amount', 0);
    28         $this->max_amount = (int) $this->get_option('max_amount', 0);
     23        parent::__construct();
     24
     25        $this->expire_date = (int) ($this->settings['expire_date'] ?: 4320);
    2926
    3027        add_filter('ry_admin_payment_info-ry_smilepay_cvs_fami', [$this, 'show_payment_info'], 10, 2);
    31 
    32         parent::__construct();
    3328    }
    3429
  • ry-woocommerce-tools/trunk/woocommerce/gateways/smilepay/gateway-webatm.php

    r3145248 r3386206  
    1919
    2020        $this->form_fields = include RY_WT_PLUGIN_DIR . 'woocommerce/gateways/smilepay/includes/settings/webatm.php';
    21         $this->init_settings();
    22 
    23         $this->title = $this->get_option('title');
    24         $this->description = $this->get_option('description');
    25         $this->expire_date = (int) $this->get_option('expire_date', 7);
    26         $this->min_amount = (int) $this->get_option('min_amount', 0);
    27         $this->max_amount = (int) $this->get_option('max_amount', 0);
    2821
    2922        parent::__construct();
     23
     24        $this->expire_date = (int) ($this->settings['expire_date'] ?: 7);
    3025    }
    3126}
Note: See TracChangeset for help on using the changeset viewer.