Changeset 3328029
- Timestamp:
- 07/15/2025 08:37:46 AM (9 months ago)
- Location:
- svea-webpay-for-woocommerce
- Files:
-
- 12 edited
- 25 copied
-
tags/4.0.3 (copied) (copied from svea-webpay-for-woocommerce/trunk)
-
tags/4.0.3/assets/js/frontend.min.js (modified) (1 diff)
-
tags/4.0.3/inc/Gateways/WC_Gateway_Svea_Invoice.php (modified) (10 diffs)
-
tags/4.0.3/inc/Gateways/WC_Gateway_Svea_Part_Pay.php (modified) (2 diffs)
-
tags/4.0.3/inc/Order_Functions.php (modified) (2 diffs)
-
tags/4.0.3/inc/Scripts.php (copied) (copied from svea-webpay-for-woocommerce/trunk/inc/Scripts.php)
-
tags/4.0.3/partials/invoice/admin-subscription.php (modified) (1 diff)
-
tags/4.0.3/readme.txt (copied) (copied from svea-webpay-for-woocommerce/trunk/readme.txt) (3 diffs)
-
tags/4.0.3/svea-webpay-for-woocommerce.php (copied) (copied from svea-webpay-for-woocommerce/trunk/svea-webpay-for-woocommerce.php) (2 diffs)
-
tags/4.0.3/vendor/autoload.php (copied) (copied from svea-webpay-for-woocommerce/trunk/vendor/autoload.php)
-
tags/4.0.3/vendor/composer/autoload_classmap.php (copied) (copied from svea-webpay-for-woocommerce/trunk/vendor/composer/autoload_classmap.php)
-
tags/4.0.3/vendor/composer/autoload_real.php (copied) (copied from svea-webpay-for-woocommerce/trunk/vendor/composer/autoload_real.php)
-
tags/4.0.3/vendor/composer/autoload_static.php (copied) (copied from svea-webpay-for-woocommerce/trunk/vendor/composer/autoload_static.php)
-
tags/4.0.3/vendor/composer/installed.json (copied) (copied from svea-webpay-for-woocommerce/trunk/vendor/composer/installed.json)
-
tags/4.0.3/vendor/composer/installed.php (copied) (copied from svea-webpay-for-woocommerce/trunk/vendor/composer/installed.php)
-
tags/4.0.3/vendor/composer/platform_check.php (copied) (copied from svea-webpay-for-woocommerce/trunk/vendor/composer/platform_check.php)
-
tags/4.0.3/vendor/sveaekonomi/checkout/README.md (copied) (copied from svea-webpay-for-woocommerce/trunk/vendor/sveaekonomi/checkout/README.md)
-
tags/4.0.3/vendor/sveaekonomi/checkout/VERSION (copied) (copied from svea-webpay-for-woocommerce/trunk/vendor/sveaekonomi/checkout/VERSION)
-
tags/4.0.3/vendor/sveaekonomi/checkout/composer.json (copied) (copied from svea-webpay-for-woocommerce/trunk/vendor/sveaekonomi/checkout/composer.json)
-
tags/4.0.3/vendor/sveaekonomi/checkout/src/CheckoutClient.php (copied) (copied from svea-webpay-for-woocommerce/trunk/vendor/sveaekonomi/checkout/src/CheckoutClient.php)
-
tags/4.0.3/vendor/sveaekonomi/checkout/src/Implementation/ChangePaymentMethod.php (copied) (copied from svea-webpay-for-woocommerce/trunk/vendor/sveaekonomi/checkout/src/Implementation/ChangePaymentMethod.php)
-
tags/4.0.3/vendor/sveaekonomi/checkout/src/Implementation/ImplementationFactory.php (copied) (copied from svea-webpay-for-woocommerce/trunk/vendor/sveaekonomi/checkout/src/Implementation/ImplementationFactory.php)
-
tags/4.0.3/vendor/sveaekonomi/checkout/src/Validation/ValidateChangePaymentMethodData.php (copied) (copied from svea-webpay-for-woocommerce/trunk/vendor/sveaekonomi/checkout/src/Validation/ValidateChangePaymentMethodData.php)
-
tags/4.0.3/vendor/sveaekonomi/webpay/composer.json (copied) (copied from svea-webpay-for-woocommerce/trunk/vendor/sveaekonomi/webpay/composer.json)
-
tags/4.0.3/vendor/sveaekonomi/webpay/src/BuildOrder/RowBuilders/FixedDiscount.php (copied) (copied from svea-webpay-for-woocommerce/trunk/vendor/sveaekonomi/webpay/src/BuildOrder/RowBuilders/FixedDiscount.php)
-
tags/4.0.3/vendor/sveaekonomi/webpay/src/BuildOrder/RowBuilders/InvoiceFee.php (copied) (copied from svea-webpay-for-woocommerce/trunk/vendor/sveaekonomi/webpay/src/BuildOrder/RowBuilders/InvoiceFee.php)
-
tags/4.0.3/vendor/sveaekonomi/webpay/src/BuildOrder/RowBuilders/OrderRow.php (copied) (copied from svea-webpay-for-woocommerce/trunk/vendor/sveaekonomi/webpay/src/BuildOrder/RowBuilders/OrderRow.php)
-
tags/4.0.3/vendor/sveaekonomi/webpay/src/BuildOrder/RowBuilders/RelativeDiscount.php (copied) (copied from svea-webpay-for-woocommerce/trunk/vendor/sveaekonomi/webpay/src/BuildOrder/RowBuilders/RelativeDiscount.php)
-
tags/4.0.3/vendor/sveaekonomi/webpay/src/BuildOrder/RowBuilders/ShippingFee.php (copied) (copied from svea-webpay-for-woocommerce/trunk/vendor/sveaekonomi/webpay/src/BuildOrder/RowBuilders/ShippingFee.php)
-
tags/4.0.3/vendor/sveaekonomi/webpay/version.json (copied) (copied from svea-webpay-for-woocommerce/trunk/vendor/sveaekonomi/webpay/version.json)
-
trunk/assets/js/frontend.min.js (modified) (1 diff)
-
trunk/inc/Gateways/WC_Gateway_Svea_Invoice.php (modified) (10 diffs)
-
trunk/inc/Gateways/WC_Gateway_Svea_Part_Pay.php (modified) (2 diffs)
-
trunk/inc/Order_Functions.php (modified) (2 diffs)
-
trunk/partials/invoice/admin-subscription.php (modified) (1 diff)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/svea-webpay-for-woocommerce.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
svea-webpay-for-woocommerce/tags/4.0.3/assets/js/frontend.min.js
r3319942 r3328029 1 "use strict";jQuery(document).ready(function(i){var n=[],r=!1,a=!1,o=!1,d="sveawebpay_invoice",l="sveawebpay_invoice_b2b",c="sveawebpay_part_pay",g=i('[name="payment_method"]:checked').val()||!1,m=i('[name="billing_country"]').val()||!1,_=(void 0!==Svea.sameShippingAsBilling[g]&&Svea.sameShippingAsBilling[g]&&i(".woocommerce form.woocommerce-checkout").addClass("hide-shipping-fields"),0!=Svea.onlyOneAllowedCountry&&(m=Svea.onlyOneAllowedCountry),Svea.isPayPage&&(m=Svea.customerCountry,i(".payment_methods, .svea-get-address-button-container").addClass("is-pay-page")),i(".payment_methods, .svea-get-address-button-container").addClass("payment-method-"+g).addClass("country-"+(m?m.toLowerCase():"false")),!1);function v(e){if(e.length<=0)return"";for(var s="",t=0;t<e.length;++t){var a=e[t];s+='<option value="'+a.addressSelector+'">',"business"==a.customerType.toLowerCase()?s+=a.fullName+", ":"person"==a.customerType.toLowerCase()&&(s+=a.lastName+", "+a.firstName+" "),s+=a.street+" "+a.zipCode+" "+a.locality+"</option>"}return s}function u(e){0<String(e.firstName).length&&i("#billing_first_name").val(String(e.firstName)).change().trigger("keydown"),0<String(e.lastName).length&&i("#billing_last_name").val(String(e.lastName)).change().trigger("keydown"),"business"==String(e.customerType).toLowerCase()&&i("#billing_company").val(String(e.fullName)).change().trigger("keydown"),0<String(e.street).length&&i("#billing_address_1").val(String(e.street)).change().trigger("keydown"),0<String(e.coAddress).length&&i("#billing_address_2").val(String(e.coAddress)).change().trigger("keydown"),0<String(e.zipCode).length&&i("#billing_postcode").val(String(e.zipCode)).change().trigger("keydown"),0<String(e.locality).length&&i("#billing_city").val(String(e.locality)).change().trigger("keydown"),0<String(e.phoneNumber).length&&i("#billing_phone").val(String(e.phoneNumber)).change().trigger("keydown"),a=!0}function b(e){e?(i("#billing_address_1, #billing_address_2, #billing_postcode, \t\t\t\t#billing_city").prop("readonly",!1),i("#billing_address_1, #billing_address_2, #billing_postcode, \t\t\t\t#billing_city").removeClass("disabled-input")):(i("#billing_address_1, #billing_address_2, \t\t\t\t#billing_postcode, #billing_city").prop("readonly",!0),i("#billing_address_1, #billing_address_2, \t\t\t\t#billing_postcode, #billing_city").addClass("disabled-input"))}function p(e,s,t){switch(e){case"SE":case"DK":switch(s){case d:if("individual"===t)return;break;case c:return}}return 1}function b(e){e?(i("#billing_first_name, #billing_last_name, #billing_address_1, \t\t\t\t#billing_address_2, #billing_postcode, #billing_city").prop("readonly",!1),i("#billing_first_name, #billing_last_name, #billing_address_1, \t\t\t\t#billing_address_2, #billing_postcode, #billing_city").removeClass("disabled-input")):(i("#billing_first_name, #billing_last_name, #billing_address_1, \t\t\t\t#billing_address_2, #billing_postcode, #billing_city").prop("readonly",!0),i("#billing_first_name, #billing_last_name, #billing_address_1, \t\t\t\t#billing_address_2, #billing_postcode, #billing_city").addClass("disabled-input"))}function h(){i("#billing_first_name, #billing_last_name, #billing_address_1, \t\t\t\t#billing_address_2, #billing_postcode, #billing_city").val([])}0<i(".svea-get-address-button-container.get-address-shortcode").length&&(i(".payment_method_"+d).is(":visible")||i(".payment_method_"+l).is(":visible")?i(".svea-get-address-button-container.get-address-shortcode").removeClass("invoice-not-available"):i(".svea-get-address-button-container.get-address-shortcode").addClass("invoice-not-available")),i(".svea-get-address-button-container.get-address-shortcode").is(":visible")&&(_=i("[name='svea_get_address_customer_type']:checked").val(),i('[name="iv_billing_customer_type"]').val(_),i(".payment_methods, .svea-get-address-button-container").addClass("customer-type-"+_)),p(m,g,_)?p(m,g,_)&&b(!0):(b(!1),a||h()),i(document).on("change",".woocommerce form.woocommerce-checkout .woocommerce-billing-fields :input",function(e){a=!1}),i(document).on("keydown",'[name="svea_billing_ssn"], [name="svea_billing_org_number"], [name="iv_billing_org_number"], [name="iv_billing_ssn"], [name="pp_billing_ssn"]',function(e){var s=i(e.target);13==(e.which||e.keyCode||0)&&(e.preventDefault(),(e=($container=s.closest(".svea-fields, .svea-get-address-button-container")).find(".svea-get-address-button")).is(":visible"))&&e.click()}),i(document).on("change",'[name="svea_billing_ssn"]',function(e){i("[name='iv_billing_ssn'], [name='pp_billing_ssn']").val(i(this).val())}),i(document).on("change",'[name="svea_billing_org_number"]',function(e){i("[name='iv_billing_org_number'], [name='pp_billing_org_number']").val(i(this).val())}),i(document).on("click",".svea-get-address-button",function(e){e.preventDefault();var s,e=g,t=(i(this),i(this).closest(".svea-get-address-button-container")),a=i(".svea-get-address-button-container.get-address-shortcode").is(":visible");i(".svea-invoice-fields, .svea-part-pay-fields");o||(a&&(e=d),"individual"==_||e==c?(s=i(a?"[name='svea_billing_ssn']":"[name='"+(e==d?"iv":"pp")+"_billing_ssn']").val(),t.addClass("getting-address"),o=!0,i.post(Svea.ajaxUrl,{action:"svea_get_address",pers_nr:s,country_code:m,payment_type:e,security:Svea.gaSecurity},function(e){t.removeClass("getting-address"),o=!1,void 0===e.resultcode||void 0===e.customerIdentity?(t.append('<div class="svea-message error">'+Phrases.could_not_get_address+"</div>"),t.addClass("getting-address-error"),setTimeout(function(){t.find(".svea-message.error").remove(),t.removeClass("getting-address-error")},5e3)):"Error"==e.resultcode||"NoSuchEntity"==e.resultcode?(t.append('<div class="svea-message error">'+e.errormessage+"</div>"),t.addClass("getting-address-error"),setTimeout(function(){t.find(".svea-message.error").remove(),t.removeClass("getting-address-error")},5e3)):(u(e.customerIdentity[0]),t.append('<div class="svea-message success">'+Phrases.your_address_was_found+"</div>"),t.addClass("getting-address-success"),setTimeout(function(){t.find(".svea-message.success").remove(),t.removeClass("getting-address-success")},5e3))})):"company"==_&&(s=i(a?"[name='svea_billing_org_number']":"[name='"+(e==d||e==l?"iv":"pp")+"_billing_org_number _"+e+"']").val(),t.addClass("getting-address"),o=!0,i.post(Svea.ajaxUrl,{action:"svea_get_address",org_nr:s,country_code:m,payment_type:e,security:Svea.gaSecurity},function(e){t.removeClass("getting-address"),o=!1,void 0===e.resultcode||void 0===e.customerIdentity?(t.append('<div class="svea-message error">'+Phrases.could_not_get_address+"</div>"),t.addClass("getting-address-error"),setTimeout(function(){t.find(".svea-message.error").remove(),t.removeClass("getting-address-error")},5e3)):"Error"==e.resultcode||"NoSuchEntity"==e.resultcode?(t.append('<div class="svea-message error">'+e.errormessage+"</div>"),t.addClass("getting-address-error"),setTimeout(function(){t.find(".svea-message.error").remove(),t.removeClass("getting-address-error")},5e3)):(e=e.customerIdentity,i(".org-address-selector").html(v(e)),n=e,i(".address-selector").val(e[0].addressSelector),u(e[0]),r=e[0],t.addClass("getting-address-success"),t.append('<div class="svea-message success">'+Phrases.your_address_was_found+"</div>"),setTimeout(function(){t.find(".svea-message.success").remove(),t.removeClass("getting-address-success")},5e3))})))}),Svea.isPayPage&&i('.payment_methods [name="payment_method"]').on("change",function(){var e=g||!1;g=i('[name="payment_method"]:checked').val(),_=i('[name="iv_billing_customer_type"]').val()||!1,i(".payment_methods, .svea-get-address-button-container").removeClass("payment-method-"+e).addClass("payment-method-"+g).removeClass("customer-type-"+_).addClass("customer-type-"+_),r=!1,n=[],i(".org-address-selector").html("")}),i(document).on("updated_checkout",function(){0<i(".svea-get-address-button-container.get-address-shortcode").length&&(i(".payment_method_"+d).is(":visible")?i(".svea-get-address-button-container.get-address-shortcode").removeClass("invoice-not-available"):i(".svea-get-address-button-container.get-address-shortcode").addClass("invoice-not-available")),i(".svea-get-address-button-container.get-address-shortcode").is(":visible")&&(i("[name='iv_billing_ssn'], [name='pp_billing_ssn']").val(i("[name='svea_billing_ssn']").val()),i("[name='iv_billing_org_number']").val(i("[name='svea_billing_org_number']").val()),i('[name="iv_billing_customer_type"]').val(i('[name="svea_get_address_customer_type"]:checked').val()));var e=m||!1,s=g||!1,t=_||!1;0==Svea.onlyOneAllowedCountry&&(m=i('[name="billing_country"]').val()),g=i('[name="payment_method"]:checked').val(),_=i('[name="iv_billing_customer_type"]').val()||"individual",i(".payment_methods, .svea-get-address-button-container").removeClass("country-"+(e?e.toLowerCase():"false")).addClass("country-"+(m?m.toLowerCase():"false")).removeClass("payment-method-"+s).addClass("payment-method-"+g),i(".svea-get-address-button-container.get-address-shortcode").is(":visible")&&(_=i('[name="iv_billing_customer_type"]').val()||"individual"),i(".payment_methods, .svea-get-address-button-container").removeClass("customer-type-"+t).addClass("customer-type-"+_),!1!==r&&0<n.length&&(i(".org-address-selector").html(v(n)),i(".org-address-selector").val(r.addressSelector),i(".address-selector").val(r.addressSelector)),void 0!==Svea.sameShippingAsBilling[g]&&Svea.sameShippingAsBilling[g]?i(".woocommerce .woocommerce-checkout").hasClass("hide-shipping-fields")||i(".woocommerce .woocommerce-checkout").addClass("hide-shipping-fields"):i(".woocommerce .woocommerce-checkout").hasClass("hide-shipping-fields")&&i(".woocommerce .woocommerce-checkout").removeClass("hide-shipping-fields"),e===m&&g===s||(r=!1,n=[],i(".org-address-selector").html(""),p(m,g,_)?p(m,g,_)&&b(!0):(b(!1),a||h()))}),i(document).on("change",'[name="payment_method"]',function(){i("body").trigger("update_checkout")}),i(document).on("change",'[name="billing_country"]',function(){var e=m||!1;m=i('[name="billing_country"]').val(),i(".payment_methods, .svea-get-address-button-container").removeClass("country-"+(e?e.toLowerCase():"false")).addClass("country-"+(m?m.toLowerCase():"false")),p(m,g,_)?p(m,g,_)&&b(!0):(b(!1),a||h())});var s=null;i(document).on("change",'.invoice-customer-type select, [name="svea_get_address_customer_type"]',function(){var e;o?null!=s&&i(this).val(s.val()):(e=_||!1,_=i(this).val()||!1,i(".payment_methods, .svea-get-address-button-container").removeClass("customer-type-"+e).addClass("customer-type-"+_),s=i(this),p(m,g,_)?p(m,g,_)&&b(!0):(b(!1),a||h()))}),i(document).on("change",'[name="svea_get_address_customer_type"]',function(){i("[name='iv_billing_customer_type']").val(i(this).val()),s=i(this),i("body").trigger("update_checkout")}),i(document).on("change",".org-address-selector",function(){for(var e=0;e<n.length;++e){var s=n[e];if(s.addressSelector==i(".org-address-selector").val())return i(".address-selector").val(i(".org-address-selector").val()),u(s),void(r=s)}}),i(document).on("change",".birth-date-month, .birth-date-day, .birth-date-year",function(){var e=i(this).parents(".svea-part-pay-fields, .svea-invoice-fields"),s=parseInt(e.find(".birth-date-year").val()),t=parseInt(e.find(".birth-date-month").val()),a=parseInt(e.find(".birth-date-day").val()),n=new Date(s,t,0).getDate();e.find(".birth-date-day option").each(function(){parseInt(i(this).val())>n?i(this).prop("disabled",!0):i(this).prop("disabled",!1)}),n<a&&e.find(".birth-date-day").val(n)})});1 "use strict";jQuery(document).ready(function(i){var n=[],r=!1,a=!1,o=!1,d="sveawebpay_invoice",l="sveawebpay_invoice_b2b",c="sveawebpay_part_pay",g=i('[name="payment_method"]:checked').val()||!1,m=i('[name="billing_country"]').val()||!1,_=(void 0!==Svea.sameShippingAsBilling[g]&&Svea.sameShippingAsBilling[g]&&i(".woocommerce form.woocommerce-checkout").addClass("hide-shipping-fields"),0!=Svea.onlyOneAllowedCountry&&(m=Svea.onlyOneAllowedCountry),Svea.isPayPage&&(m=Svea.customerCountry,i(".payment_methods, .svea-get-address-button-container").addClass("is-pay-page")),i(".payment_methods, .svea-get-address-button-container").addClass("payment-method-"+g).addClass("country-"+(m?m.toLowerCase():"false")),!1);function v(e){if(e.length<=0)return"";for(var s="",t=0;t<e.length;++t){var a=e[t];s+='<option value="'+a.addressSelector+'">',"business"==a.customerType.toLowerCase()?s+=a.fullName+", ":"person"==a.customerType.toLowerCase()&&(s+=a.lastName+", "+a.firstName+" "),s+=a.street+" "+a.zipCode+" "+a.locality+"</option>"}return s}function u(e){0<String(e.firstName).length&&i("#billing_first_name").val(String(e.firstName)).change().trigger("keydown"),0<String(e.lastName).length&&i("#billing_last_name").val(String(e.lastName)).change().trigger("keydown"),"business"==String(e.customerType).toLowerCase()&&i("#billing_company").val(String(e.fullName)).change().trigger("keydown"),0<String(e.street).length&&i("#billing_address_1").val(String(e.street)).change().trigger("keydown"),0<String(e.coAddress).length&&i("#billing_address_2").val(String(e.coAddress)).change().trigger("keydown"),0<String(e.zipCode).length&&i("#billing_postcode").val(String(e.zipCode)).change().trigger("keydown"),0<String(e.locality).length&&i("#billing_city").val(String(e.locality)).change().trigger("keydown"),0<String(e.phoneNumber).length&&i("#billing_phone").val(String(e.phoneNumber)).change().trigger("keydown"),a=!0}function b(e){e?(i("#billing_address_1, #billing_address_2, #billing_postcode, \t\t\t\t#billing_city").prop("readonly",!1),i("#billing_address_1, #billing_address_2, #billing_postcode, \t\t\t\t#billing_city").removeClass("disabled-input")):(i("#billing_address_1, #billing_address_2, \t\t\t\t#billing_postcode, #billing_city").prop("readonly",!0),i("#billing_address_1, #billing_address_2, \t\t\t\t#billing_postcode, #billing_city").addClass("disabled-input"))}function p(e,s,t){switch(e){case"SE":case"DK":switch(s){case d:if("individual"===t)return;break;case c:return}}return 1}function b(e){e?(i("#billing_first_name, #billing_last_name, #billing_address_1, \t\t\t\t#billing_address_2, #billing_postcode, #billing_city").prop("readonly",!1),i("#billing_first_name, #billing_last_name, #billing_address_1, \t\t\t\t#billing_address_2, #billing_postcode, #billing_city").removeClass("disabled-input")):(i("#billing_first_name, #billing_last_name, #billing_address_1, \t\t\t\t#billing_address_2, #billing_postcode, #billing_city").prop("readonly",!0),i("#billing_first_name, #billing_last_name, #billing_address_1, \t\t\t\t#billing_address_2, #billing_postcode, #billing_city").addClass("disabled-input"))}function h(){i("#billing_first_name, #billing_last_name, #billing_address_1, \t\t\t\t#billing_address_2, #billing_postcode, #billing_city").val([])}0<i(".svea-get-address-button-container.get-address-shortcode").length&&(i(".payment_method_"+d).is(":visible")||i(".payment_method_"+l).is(":visible")?i(".svea-get-address-button-container.get-address-shortcode").removeClass("invoice-not-available"):i(".svea-get-address-button-container.get-address-shortcode").addClass("invoice-not-available")),i(".svea-get-address-button-container.get-address-shortcode").is(":visible")&&(_=i("[name='svea_get_address_customer_type']:checked").val(),i('[name="iv_billing_customer_type"]').val(_),i(".payment_methods, .svea-get-address-button-container").addClass("customer-type-"+_)),p(m,g,_)?p(m,g,_)&&b(!0):(b(!1),a||h()),i(document).on("change",".woocommerce form.woocommerce-checkout .woocommerce-billing-fields :input",function(e){a=!1}),i(document).on("keydown",'[name="svea_billing_ssn"], [name="svea_billing_org_number"], [name="iv_billing_org_number"], [name="iv_billing_ssn"], [name="pp_billing_ssn"]',function(e){var s=i(e.target);13==(e.which||e.keyCode||0)&&(e.preventDefault(),(e=($container=s.closest(".svea-fields, .svea-get-address-button-container")).find(".svea-get-address-button")).is(":visible"))&&e.click()}),i(document).on("change",'[name="svea_billing_ssn"]',function(e){i("[name='iv_billing_ssn'], [name='pp_billing_ssn']").val(i(this).val())}),i(document).on("change",'[name="svea_billing_org_number"]',function(e){i("[name='iv_billing_org_number'], [name='pp_billing_org_number']").val(i(this).val())}),i(document).on("click",".svea-get-address-button",function(e){e.preventDefault();var s,e=g,t=(i(this),i(this).closest(".svea-get-address-button-container")),a=i(".svea-get-address-button-container.get-address-shortcode").is(":visible");i(".svea-invoice-fields, .svea-part-pay-fields");o||(a&&(e=d),"individual"==_||e==c?(s=i(a?"[name='svea_billing_ssn']":"[name='"+(e==d?"iv":"pp")+"_billing_ssn']").val(),t.addClass("getting-address"),o=!0,i.post(Svea.ajaxUrl,{action:"svea_get_address",pers_nr:s,country_code:m,payment_type:e,security:Svea.gaSecurity},function(e){t.removeClass("getting-address"),o=!1,void 0===e.resultcode||void 0===e.customerIdentity?(t.append('<div class="svea-message error">'+Phrases.could_not_get_address+"</div>"),t.addClass("getting-address-error"),setTimeout(function(){t.find(".svea-message.error").remove(),t.removeClass("getting-address-error")},5e3)):"Error"==e.resultcode||"NoSuchEntity"==e.resultcode?(t.append('<div class="svea-message error">'+e.errormessage+"</div>"),t.addClass("getting-address-error"),setTimeout(function(){t.find(".svea-message.error").remove(),t.removeClass("getting-address-error")},5e3)):(u(e.customerIdentity[0]),t.append('<div class="svea-message success">'+Phrases.your_address_was_found+"</div>"),t.addClass("getting-address-success"),setTimeout(function(){t.find(".svea-message.success").remove(),t.removeClass("getting-address-success")},5e3))})):"company"==_&&(s=i(a?"[name='svea_billing_org_number']":"[name='"+(e==d||e==l?"iv":"pp")+"_billing_org_number']").val(),t.addClass("getting-address"),o=!0,i.post(Svea.ajaxUrl,{action:"svea_get_address",org_nr:s,country_code:m,payment_type:e,security:Svea.gaSecurity},function(e){t.removeClass("getting-address"),o=!1,void 0===e.resultcode||void 0===e.customerIdentity?(t.append('<div class="svea-message error">'+Phrases.could_not_get_address+"</div>"),t.addClass("getting-address-error"),setTimeout(function(){t.find(".svea-message.error").remove(),t.removeClass("getting-address-error")},5e3)):"Error"==e.resultcode||"NoSuchEntity"==e.resultcode?(t.append('<div class="svea-message error">'+e.errormessage+"</div>"),t.addClass("getting-address-error"),setTimeout(function(){t.find(".svea-message.error").remove(),t.removeClass("getting-address-error")},5e3)):(e=e.customerIdentity,i(".org-address-selector").html(v(e)),n=e,i(".address-selector").val(e[0].addressSelector),u(e[0]),r=e[0],t.addClass("getting-address-success"),t.append('<div class="svea-message success">'+Phrases.your_address_was_found+"</div>"),setTimeout(function(){t.find(".svea-message.success").remove(),t.removeClass("getting-address-success")},5e3))})))}),Svea.isPayPage&&i('.payment_methods [name="payment_method"]').on("change",function(){var e=g||!1;g=i('[name="payment_method"]:checked').val(),_=i('[name="iv_billing_customer_type"]').val()||!1,i(".payment_methods, .svea-get-address-button-container").removeClass("payment-method-"+e).addClass("payment-method-"+g).removeClass("customer-type-"+_).addClass("customer-type-"+_),r=!1,n=[],i(".org-address-selector").html("")}),i(document).on("updated_checkout",function(){0<i(".svea-get-address-button-container.get-address-shortcode").length&&(i(".payment_method_"+d).is(":visible")?i(".svea-get-address-button-container.get-address-shortcode").removeClass("invoice-not-available"):i(".svea-get-address-button-container.get-address-shortcode").addClass("invoice-not-available")),i(".svea-get-address-button-container.get-address-shortcode").is(":visible")&&(i("[name='iv_billing_ssn'], [name='pp_billing_ssn']").val(i("[name='svea_billing_ssn']").val()),i("[name='iv_billing_org_number']").val(i("[name='svea_billing_org_number']").val()),i('[name="iv_billing_customer_type"]').val(i('[name="svea_get_address_customer_type"]:checked').val()));var e=m||!1,s=g||!1,t=_||!1;0==Svea.onlyOneAllowedCountry&&(m=i('[name="billing_country"]').val()),g=i('[name="payment_method"]:checked').val(),_=i('[name="iv_billing_customer_type"]').val()||"individual",i(".payment_methods, .svea-get-address-button-container").removeClass("country-"+(e?e.toLowerCase():"false")).addClass("country-"+(m?m.toLowerCase():"false")).removeClass("payment-method-"+s).addClass("payment-method-"+g),i(".svea-get-address-button-container.get-address-shortcode").is(":visible")&&(_=i('[name="iv_billing_customer_type"]').val()||"individual"),i(".payment_methods, .svea-get-address-button-container").removeClass("customer-type-"+t).addClass("customer-type-"+_),!1!==r&&0<n.length&&(i(".org-address-selector").html(v(n)),i(".org-address-selector").val(r.addressSelector),i(".address-selector").val(r.addressSelector)),void 0!==Svea.sameShippingAsBilling[g]&&Svea.sameShippingAsBilling[g]?i(".woocommerce .woocommerce-checkout").hasClass("hide-shipping-fields")||i(".woocommerce .woocommerce-checkout").addClass("hide-shipping-fields"):i(".woocommerce .woocommerce-checkout").hasClass("hide-shipping-fields")&&i(".woocommerce .woocommerce-checkout").removeClass("hide-shipping-fields"),e===m&&g===s||(r=!1,n=[],i(".org-address-selector").html(""),p(m,g,_)?p(m,g,_)&&b(!0):(b(!1),a||h()))}),i(document).on("change",'[name="payment_method"]',function(){i("body").trigger("update_checkout")}),i(document).on("change",'[name="billing_country"]',function(){var e=m||!1;m=i('[name="billing_country"]').val(),i(".payment_methods, .svea-get-address-button-container").removeClass("country-"+(e?e.toLowerCase():"false")).addClass("country-"+(m?m.toLowerCase():"false")),p(m,g,_)?p(m,g,_)&&b(!0):(b(!1),a||h())});var s=null;i(document).on("change",'.invoice-customer-type select, [name="svea_get_address_customer_type"]',function(){var e;o?null!=s&&i(this).val(s.val()):(e=_||!1,_=i(this).val()||!1,i(".payment_methods, .svea-get-address-button-container").removeClass("customer-type-"+e).addClass("customer-type-"+_),s=i(this),p(m,g,_)?p(m,g,_)&&b(!0):(b(!1),a||h()))}),i(document).on("change",'[name="svea_get_address_customer_type"]',function(){i("[name='iv_billing_customer_type']").val(i(this).val()),s=i(this),i("body").trigger("update_checkout")}),i(document).on("change",".org-address-selector",function(){for(var e=0;e<n.length;++e){var s=n[e];if(s.addressSelector==i(".org-address-selector").val())return i(".address-selector").val(i(".org-address-selector").val()),u(s),void(r=s)}}),i(document).on("change",".birth-date-month, .birth-date-day, .birth-date-year",function(){var e=i(this).parents(".svea-part-pay-fields, .svea-invoice-fields"),s=parseInt(e.find(".birth-date-year").val()),t=parseInt(e.find(".birth-date-month").val()),a=parseInt(e.find(".birth-date-day").val()),n=new Date(s,t,0).getDate();e.find(".birth-date-day option").each(function(){parseInt(i(this).val())>n?i(this).prop("disabled",!0):i(this).prop("disabled",!1)}),n<a&&e.find(".birth-date-day").val(n)})}); -
svea-webpay-for-woocommerce/tags/4.0.3/inc/Gateways/WC_Gateway_Svea_Invoice.php
r3319942 r3328029 143 143 add_action( 'woocommerce_api_wc_gateway_svea_invoice_strong_auth_rejected', [ $this, 'handle_callback_request_rejected' ] ); 144 144 145 self::$log_enabled = $this->get_option( 'debug' ) === 'yes'; 146 145 147 $this->same_shipping_as_billing = $this->get_option( 'same_shipping_as_billing' ) === 'yes'; 146 148 … … 167 169 $this->invoice_fee_taxable = $this->get_option( 'invoice_fee_taxable_' . $customer_country ) === 'yes'; 168 170 169 self::$log_enabled = $this->get_option( 'debug' ) === 'yes';170 171 $this->description = __( $this->get_option( 'description' ), 'svea-webpay-for-woocommerce' ); // phpcs:ignore 171 172 } … … 1201 1202 $strong_auth = $this->uses_strong_auth( $customer_country, $customer_type ); 1202 1203 1204 $this->testmode = $this->get_option( 'testmode_' . strtolower( $customer_country ) ) === 'yes'; 1205 1203 1206 $config = $this->get_config( $customer_country, $customer_type ); 1204 1207 … … 1499 1502 1500 1503 $post_data = [ 1501 'iv_billing_customer_type' => $subscription->get_meta( '_svea_customer_type' ), 1502 'iv_billing_org_number' => $subscription->get_meta( '_svea_iv_billing_org_number' ), 1503 'iv_billing_ssn' => $subscription->get_meta( '_svea_iv_billing_ssn' ), 1504 'iv_billing_vat_number' => $subscription->get_meta( '_svea_iv_billing_vat_number' ), 1505 'iv_birth_date_year' => $subscription->get_meta( '_svea_iv_birth_date_year' ), 1506 'iv_birth_date_month' => $subscription->get_meta( '_svea_iv_birth_date_month' ), 1507 'iv_birth_date_day' => $subscription->get_meta( '_svea_iv_birth_date_day' ), 1508 'iv_billing_initials' => $subscription->get_meta( '_svea_iv_billing_initials' ), 1504 'iv_billing_customer_type' => $subscription->get_meta( '_svea_customer_type' ) ?: $subscription->get_meta( '_svea_iv_billing_customer_type' ), 1505 'iv_billing_address_selector' => $subscription->get_meta( '_svea_address_selector' ), 1506 'iv_billing_org_number' => $subscription->get_meta( '_svea_iv_billing_org_number' ), 1507 'iv_billing_ssn' => $subscription->get_meta( '_svea_iv_billing_ssn' ), 1508 'iv_billing_vat_number' => $subscription->get_meta( '_svea_iv_billing_vat_number' ), 1509 'iv_birth_date_year' => $subscription->get_meta( '_svea_iv_birth_date_year' ), 1510 'iv_birth_date_month' => $subscription->get_meta( '_svea_iv_birth_date_month' ), 1511 'iv_birth_date_day' => $subscription->get_meta( '_svea_iv_birth_date_day' ), 1512 'iv_billing_initials' => $subscription->get_meta( '_svea_iv_billing_initials' ), 1509 1513 ]; 1510 1514 … … 1677 1681 $customer_company = $wc_order->get_billing_company(); 1678 1682 1679 $customer_type = $subscription->get_meta( '_svea_customer_type' ) ;1683 $customer_type = $subscription->get_meta( '_svea_customer_type' ) ?: $subscription->get_meta( '_svea_iv_billing_customer_type' ); 1680 1684 1681 1685 $invoice_fee_label = $this->get_option( 'invoice_fee_label_' . strtolower( $customer_country ) ); … … 1737 1741 } 1738 1742 1743 $this->testmode = $this->get_option( 'testmode_' . strtolower( $customer_country ) ) === 'yes'; 1744 1739 1745 $config = $this->get_config( $customer_country, $customer_type ); 1740 1746 … … 1756 1762 */ 1757 1763 $svea_data = [ 1758 'customer_type' => $subscription->get_meta( '_svea_customer_type' ) ,1764 'customer_type' => $subscription->get_meta( '_svea_customer_type' ) ?: $subscription->get_meta( '_svea_iv_billing_customer_type' ), 1759 1765 'address_selector' => $subscription->get_meta( '_svea_address_selector' ), 1760 1766 'org_number' => $subscription->get_meta( '_svea_iv_billing_org_number' ), … … 1887 1893 */ 1888 1894 public function cancel_order( $order, $svea_order_id ) { 1889 $customer_type = $order->get_meta( '_svea_customer_type' ) ;1895 $customer_type = $order->get_meta( '_svea_customer_type' ) ?: $order->get_meta( '_svea_iv_billing_customer_type' ); 1890 1896 $config = $this->get_config( $order->get_billing_country(), $customer_type ); 1891 1897 … … 1926 1932 */ 1927 1933 public function credit_order( $order, $svea_order_id ) { 1928 $customer_type = $order->get_meta( '_svea_customer_type' ) ;1934 $customer_type = $order->get_meta( '_svea_customer_type' ) ?: $order->get_meta( '_svea_iv_billing_customer_type' ); 1929 1935 $config = $this->get_config( $order->get_billing_country(), $customer_type ); 1930 1936 … … 2140 2146 */ 2141 2147 public function deliver_order( $order, $svea_order_id ) { 2142 $customer_type = $order->get_meta( '_svea_customer_type' ) ;2148 $customer_type = $order->get_meta( '_svea_customer_type' ) ?: $order->get_meta( '_svea_iv_billing_customer_type' ); 2143 2149 $config = $this->get_config( $order->get_billing_country(), $customer_type ); 2144 2150 $is_b2b = $customer_type === 'company'; -
svea-webpay-for-woocommerce/tags/4.0.3/inc/Gateways/WC_Gateway_Svea_Part_Pay.php
r3319942 r3328029 116 116 add_action( 'woocommerce_api_wc_gateway_svea_part_pay_strong_auth_rejected', [ $this, 'handle_callback_request_rejected' ] ); 117 117 118 self::$log_enabled = $this->get_option( 'debug' ) === 'yes'; 119 118 120 if ( ! isset( WC()->customer ) ) { 119 121 return; … … 141 143 $this->display_product_widget = $this->get_option( 'display_product_widget' ) === 'yes'; 142 144 143 self::$log_enabled = $this->get_option( 'debug' ) === 'yes';144 145 $this->description = __( $this->get_option( 'description' ), 'svea-webpay-for-woocommerce' ); // phpcs:ignore 145 146 } -
svea-webpay-for-woocommerce/tags/4.0.3/inc/Order_Functions.php
r3319942 r3328029 32 32 33 33 add_action( 'woocommerce_after_checkout_validation', [ $this, 'checkout_validation_handler' ], 10, 2 ); 34 35 if ( ! is_admin() ) { 36 add_filter( 'pre_option_woocommerce_ship_to_destination', [ $this, 'maybe_force_ship_to_billing_address' ], 10, 2 ); 37 } 34 38 35 39 add_filter( 'woocommerce_get_order_item_totals', [ $this, 'receipt_display_svea_order_id' ], 10, 2 ); … … 91 95 92 96 /** 97 * Maybe force the ship to billing address 98 * 99 * @param mixed $value 100 * @return mixed 101 */ 102 public function maybe_force_ship_to_billing_address( $value ) { 103 // Get current gateway 104 $current_gateway = Helper::get_current_gateway(); 105 106 if ( $current_gateway && method_exists( $current_gateway, 'can_ship_to_different_address' ) 107 && ! $current_gateway->can_ship_to_different_address() ) { 108 // If the gateway does not allow shipping to a different address, force the value to 'billing_only' 109 $value = 'billing_only'; 110 } 111 112 return $value; 113 } 114 115 /** 93 116 * Display the svea order id whilst viewing the receipt 94 117 * -
svea-webpay-for-woocommerce/tags/4.0.3/partials/invoice/admin-subscription.php
r2365521 r3328029 55 55 <select class="org-address-selector"></select> 56 56 </p> 57 <input type="hidden" name="_address_selector" class="address-selector" /> 57 <input type="hidden" name="_address_selector" 58 value="<?php echo isset( $post_data['iv_billing_address_selector'] ) ? esc_attr( $post_data['iv_billing_address_selector'] ) : ''; ?>" class="address-selector" /> 58 59 </div> 59 60 <div class="vat-number-container"> -
svea-webpay-for-woocommerce/tags/4.0.3/readme.txt
r3327589 r3328029 10 10 License: Apache 2.0 11 11 License URI: https://www.apache.org/licenses/LICENSE-2.0 12 Stable tag: 4.0. 212 Stable tag: 4.0.3 13 13 14 14 The Svea Stand Alone payment module is a complete solution for shops using WordPress / WooCommerce as an e-commerce platform. … … 39 39 == Upgrade Notice == 40 40 41 = 4.0.3 = 42 4.0.3 is a patch release. 43 41 44 = 4.0.2 = 42 45 4.0.2 is a patch release. … … 57 60 58 61 == Changelog == 62 63 = 4.0.3 2025-07-15 = 64 * Add backwards compatibility for subscription payments. 65 * Fix problems with organisational number not being fetched. 66 * Force billing address with new method. 59 67 60 68 = 4.0.2 2025-07-09 = -
svea-webpay-for-woocommerce/tags/4.0.3/svea-webpay-for-woocommerce.php
r3327589 r3328029 4 4 * Plugin Name: Svea Stand Alone for WooCommerce 5 5 * Description: Supercharge your WooCommerce Store with powerful features to pay via Svea Credit card, Invoice, Part Payment, Trustly, Swish, MobilePay and Vipps. 6 * Version: 4.0. 26 * Version: 4.0.3 7 7 * Author: The Generation 8 8 * Author URI: https://thegeneration.se/ … … 37 37 * @var string 38 38 */ 39 const VERSION = '4.0. 2';39 const VERSION = '4.0.3'; 40 40 41 41 /** -
svea-webpay-for-woocommerce/trunk/assets/js/frontend.min.js
r3319942 r3328029 1 "use strict";jQuery(document).ready(function(i){var n=[],r=!1,a=!1,o=!1,d="sveawebpay_invoice",l="sveawebpay_invoice_b2b",c="sveawebpay_part_pay",g=i('[name="payment_method"]:checked').val()||!1,m=i('[name="billing_country"]').val()||!1,_=(void 0!==Svea.sameShippingAsBilling[g]&&Svea.sameShippingAsBilling[g]&&i(".woocommerce form.woocommerce-checkout").addClass("hide-shipping-fields"),0!=Svea.onlyOneAllowedCountry&&(m=Svea.onlyOneAllowedCountry),Svea.isPayPage&&(m=Svea.customerCountry,i(".payment_methods, .svea-get-address-button-container").addClass("is-pay-page")),i(".payment_methods, .svea-get-address-button-container").addClass("payment-method-"+g).addClass("country-"+(m?m.toLowerCase():"false")),!1);function v(e){if(e.length<=0)return"";for(var s="",t=0;t<e.length;++t){var a=e[t];s+='<option value="'+a.addressSelector+'">',"business"==a.customerType.toLowerCase()?s+=a.fullName+", ":"person"==a.customerType.toLowerCase()&&(s+=a.lastName+", "+a.firstName+" "),s+=a.street+" "+a.zipCode+" "+a.locality+"</option>"}return s}function u(e){0<String(e.firstName).length&&i("#billing_first_name").val(String(e.firstName)).change().trigger("keydown"),0<String(e.lastName).length&&i("#billing_last_name").val(String(e.lastName)).change().trigger("keydown"),"business"==String(e.customerType).toLowerCase()&&i("#billing_company").val(String(e.fullName)).change().trigger("keydown"),0<String(e.street).length&&i("#billing_address_1").val(String(e.street)).change().trigger("keydown"),0<String(e.coAddress).length&&i("#billing_address_2").val(String(e.coAddress)).change().trigger("keydown"),0<String(e.zipCode).length&&i("#billing_postcode").val(String(e.zipCode)).change().trigger("keydown"),0<String(e.locality).length&&i("#billing_city").val(String(e.locality)).change().trigger("keydown"),0<String(e.phoneNumber).length&&i("#billing_phone").val(String(e.phoneNumber)).change().trigger("keydown"),a=!0}function b(e){e?(i("#billing_address_1, #billing_address_2, #billing_postcode, \t\t\t\t#billing_city").prop("readonly",!1),i("#billing_address_1, #billing_address_2, #billing_postcode, \t\t\t\t#billing_city").removeClass("disabled-input")):(i("#billing_address_1, #billing_address_2, \t\t\t\t#billing_postcode, #billing_city").prop("readonly",!0),i("#billing_address_1, #billing_address_2, \t\t\t\t#billing_postcode, #billing_city").addClass("disabled-input"))}function p(e,s,t){switch(e){case"SE":case"DK":switch(s){case d:if("individual"===t)return;break;case c:return}}return 1}function b(e){e?(i("#billing_first_name, #billing_last_name, #billing_address_1, \t\t\t\t#billing_address_2, #billing_postcode, #billing_city").prop("readonly",!1),i("#billing_first_name, #billing_last_name, #billing_address_1, \t\t\t\t#billing_address_2, #billing_postcode, #billing_city").removeClass("disabled-input")):(i("#billing_first_name, #billing_last_name, #billing_address_1, \t\t\t\t#billing_address_2, #billing_postcode, #billing_city").prop("readonly",!0),i("#billing_first_name, #billing_last_name, #billing_address_1, \t\t\t\t#billing_address_2, #billing_postcode, #billing_city").addClass("disabled-input"))}function h(){i("#billing_first_name, #billing_last_name, #billing_address_1, \t\t\t\t#billing_address_2, #billing_postcode, #billing_city").val([])}0<i(".svea-get-address-button-container.get-address-shortcode").length&&(i(".payment_method_"+d).is(":visible")||i(".payment_method_"+l).is(":visible")?i(".svea-get-address-button-container.get-address-shortcode").removeClass("invoice-not-available"):i(".svea-get-address-button-container.get-address-shortcode").addClass("invoice-not-available")),i(".svea-get-address-button-container.get-address-shortcode").is(":visible")&&(_=i("[name='svea_get_address_customer_type']:checked").val(),i('[name="iv_billing_customer_type"]').val(_),i(".payment_methods, .svea-get-address-button-container").addClass("customer-type-"+_)),p(m,g,_)?p(m,g,_)&&b(!0):(b(!1),a||h()),i(document).on("change",".woocommerce form.woocommerce-checkout .woocommerce-billing-fields :input",function(e){a=!1}),i(document).on("keydown",'[name="svea_billing_ssn"], [name="svea_billing_org_number"], [name="iv_billing_org_number"], [name="iv_billing_ssn"], [name="pp_billing_ssn"]',function(e){var s=i(e.target);13==(e.which||e.keyCode||0)&&(e.preventDefault(),(e=($container=s.closest(".svea-fields, .svea-get-address-button-container")).find(".svea-get-address-button")).is(":visible"))&&e.click()}),i(document).on("change",'[name="svea_billing_ssn"]',function(e){i("[name='iv_billing_ssn'], [name='pp_billing_ssn']").val(i(this).val())}),i(document).on("change",'[name="svea_billing_org_number"]',function(e){i("[name='iv_billing_org_number'], [name='pp_billing_org_number']").val(i(this).val())}),i(document).on("click",".svea-get-address-button",function(e){e.preventDefault();var s,e=g,t=(i(this),i(this).closest(".svea-get-address-button-container")),a=i(".svea-get-address-button-container.get-address-shortcode").is(":visible");i(".svea-invoice-fields, .svea-part-pay-fields");o||(a&&(e=d),"individual"==_||e==c?(s=i(a?"[name='svea_billing_ssn']":"[name='"+(e==d?"iv":"pp")+"_billing_ssn']").val(),t.addClass("getting-address"),o=!0,i.post(Svea.ajaxUrl,{action:"svea_get_address",pers_nr:s,country_code:m,payment_type:e,security:Svea.gaSecurity},function(e){t.removeClass("getting-address"),o=!1,void 0===e.resultcode||void 0===e.customerIdentity?(t.append('<div class="svea-message error">'+Phrases.could_not_get_address+"</div>"),t.addClass("getting-address-error"),setTimeout(function(){t.find(".svea-message.error").remove(),t.removeClass("getting-address-error")},5e3)):"Error"==e.resultcode||"NoSuchEntity"==e.resultcode?(t.append('<div class="svea-message error">'+e.errormessage+"</div>"),t.addClass("getting-address-error"),setTimeout(function(){t.find(".svea-message.error").remove(),t.removeClass("getting-address-error")},5e3)):(u(e.customerIdentity[0]),t.append('<div class="svea-message success">'+Phrases.your_address_was_found+"</div>"),t.addClass("getting-address-success"),setTimeout(function(){t.find(".svea-message.success").remove(),t.removeClass("getting-address-success")},5e3))})):"company"==_&&(s=i(a?"[name='svea_billing_org_number']":"[name='"+(e==d||e==l?"iv":"pp")+"_billing_org_number _"+e+"']").val(),t.addClass("getting-address"),o=!0,i.post(Svea.ajaxUrl,{action:"svea_get_address",org_nr:s,country_code:m,payment_type:e,security:Svea.gaSecurity},function(e){t.removeClass("getting-address"),o=!1,void 0===e.resultcode||void 0===e.customerIdentity?(t.append('<div class="svea-message error">'+Phrases.could_not_get_address+"</div>"),t.addClass("getting-address-error"),setTimeout(function(){t.find(".svea-message.error").remove(),t.removeClass("getting-address-error")},5e3)):"Error"==e.resultcode||"NoSuchEntity"==e.resultcode?(t.append('<div class="svea-message error">'+e.errormessage+"</div>"),t.addClass("getting-address-error"),setTimeout(function(){t.find(".svea-message.error").remove(),t.removeClass("getting-address-error")},5e3)):(e=e.customerIdentity,i(".org-address-selector").html(v(e)),n=e,i(".address-selector").val(e[0].addressSelector),u(e[0]),r=e[0],t.addClass("getting-address-success"),t.append('<div class="svea-message success">'+Phrases.your_address_was_found+"</div>"),setTimeout(function(){t.find(".svea-message.success").remove(),t.removeClass("getting-address-success")},5e3))})))}),Svea.isPayPage&&i('.payment_methods [name="payment_method"]').on("change",function(){var e=g||!1;g=i('[name="payment_method"]:checked').val(),_=i('[name="iv_billing_customer_type"]').val()||!1,i(".payment_methods, .svea-get-address-button-container").removeClass("payment-method-"+e).addClass("payment-method-"+g).removeClass("customer-type-"+_).addClass("customer-type-"+_),r=!1,n=[],i(".org-address-selector").html("")}),i(document).on("updated_checkout",function(){0<i(".svea-get-address-button-container.get-address-shortcode").length&&(i(".payment_method_"+d).is(":visible")?i(".svea-get-address-button-container.get-address-shortcode").removeClass("invoice-not-available"):i(".svea-get-address-button-container.get-address-shortcode").addClass("invoice-not-available")),i(".svea-get-address-button-container.get-address-shortcode").is(":visible")&&(i("[name='iv_billing_ssn'], [name='pp_billing_ssn']").val(i("[name='svea_billing_ssn']").val()),i("[name='iv_billing_org_number']").val(i("[name='svea_billing_org_number']").val()),i('[name="iv_billing_customer_type"]').val(i('[name="svea_get_address_customer_type"]:checked').val()));var e=m||!1,s=g||!1,t=_||!1;0==Svea.onlyOneAllowedCountry&&(m=i('[name="billing_country"]').val()),g=i('[name="payment_method"]:checked').val(),_=i('[name="iv_billing_customer_type"]').val()||"individual",i(".payment_methods, .svea-get-address-button-container").removeClass("country-"+(e?e.toLowerCase():"false")).addClass("country-"+(m?m.toLowerCase():"false")).removeClass("payment-method-"+s).addClass("payment-method-"+g),i(".svea-get-address-button-container.get-address-shortcode").is(":visible")&&(_=i('[name="iv_billing_customer_type"]').val()||"individual"),i(".payment_methods, .svea-get-address-button-container").removeClass("customer-type-"+t).addClass("customer-type-"+_),!1!==r&&0<n.length&&(i(".org-address-selector").html(v(n)),i(".org-address-selector").val(r.addressSelector),i(".address-selector").val(r.addressSelector)),void 0!==Svea.sameShippingAsBilling[g]&&Svea.sameShippingAsBilling[g]?i(".woocommerce .woocommerce-checkout").hasClass("hide-shipping-fields")||i(".woocommerce .woocommerce-checkout").addClass("hide-shipping-fields"):i(".woocommerce .woocommerce-checkout").hasClass("hide-shipping-fields")&&i(".woocommerce .woocommerce-checkout").removeClass("hide-shipping-fields"),e===m&&g===s||(r=!1,n=[],i(".org-address-selector").html(""),p(m,g,_)?p(m,g,_)&&b(!0):(b(!1),a||h()))}),i(document).on("change",'[name="payment_method"]',function(){i("body").trigger("update_checkout")}),i(document).on("change",'[name="billing_country"]',function(){var e=m||!1;m=i('[name="billing_country"]').val(),i(".payment_methods, .svea-get-address-button-container").removeClass("country-"+(e?e.toLowerCase():"false")).addClass("country-"+(m?m.toLowerCase():"false")),p(m,g,_)?p(m,g,_)&&b(!0):(b(!1),a||h())});var s=null;i(document).on("change",'.invoice-customer-type select, [name="svea_get_address_customer_type"]',function(){var e;o?null!=s&&i(this).val(s.val()):(e=_||!1,_=i(this).val()||!1,i(".payment_methods, .svea-get-address-button-container").removeClass("customer-type-"+e).addClass("customer-type-"+_),s=i(this),p(m,g,_)?p(m,g,_)&&b(!0):(b(!1),a||h()))}),i(document).on("change",'[name="svea_get_address_customer_type"]',function(){i("[name='iv_billing_customer_type']").val(i(this).val()),s=i(this),i("body").trigger("update_checkout")}),i(document).on("change",".org-address-selector",function(){for(var e=0;e<n.length;++e){var s=n[e];if(s.addressSelector==i(".org-address-selector").val())return i(".address-selector").val(i(".org-address-selector").val()),u(s),void(r=s)}}),i(document).on("change",".birth-date-month, .birth-date-day, .birth-date-year",function(){var e=i(this).parents(".svea-part-pay-fields, .svea-invoice-fields"),s=parseInt(e.find(".birth-date-year").val()),t=parseInt(e.find(".birth-date-month").val()),a=parseInt(e.find(".birth-date-day").val()),n=new Date(s,t,0).getDate();e.find(".birth-date-day option").each(function(){parseInt(i(this).val())>n?i(this).prop("disabled",!0):i(this).prop("disabled",!1)}),n<a&&e.find(".birth-date-day").val(n)})});1 "use strict";jQuery(document).ready(function(i){var n=[],r=!1,a=!1,o=!1,d="sveawebpay_invoice",l="sveawebpay_invoice_b2b",c="sveawebpay_part_pay",g=i('[name="payment_method"]:checked').val()||!1,m=i('[name="billing_country"]').val()||!1,_=(void 0!==Svea.sameShippingAsBilling[g]&&Svea.sameShippingAsBilling[g]&&i(".woocommerce form.woocommerce-checkout").addClass("hide-shipping-fields"),0!=Svea.onlyOneAllowedCountry&&(m=Svea.onlyOneAllowedCountry),Svea.isPayPage&&(m=Svea.customerCountry,i(".payment_methods, .svea-get-address-button-container").addClass("is-pay-page")),i(".payment_methods, .svea-get-address-button-container").addClass("payment-method-"+g).addClass("country-"+(m?m.toLowerCase():"false")),!1);function v(e){if(e.length<=0)return"";for(var s="",t=0;t<e.length;++t){var a=e[t];s+='<option value="'+a.addressSelector+'">',"business"==a.customerType.toLowerCase()?s+=a.fullName+", ":"person"==a.customerType.toLowerCase()&&(s+=a.lastName+", "+a.firstName+" "),s+=a.street+" "+a.zipCode+" "+a.locality+"</option>"}return s}function u(e){0<String(e.firstName).length&&i("#billing_first_name").val(String(e.firstName)).change().trigger("keydown"),0<String(e.lastName).length&&i("#billing_last_name").val(String(e.lastName)).change().trigger("keydown"),"business"==String(e.customerType).toLowerCase()&&i("#billing_company").val(String(e.fullName)).change().trigger("keydown"),0<String(e.street).length&&i("#billing_address_1").val(String(e.street)).change().trigger("keydown"),0<String(e.coAddress).length&&i("#billing_address_2").val(String(e.coAddress)).change().trigger("keydown"),0<String(e.zipCode).length&&i("#billing_postcode").val(String(e.zipCode)).change().trigger("keydown"),0<String(e.locality).length&&i("#billing_city").val(String(e.locality)).change().trigger("keydown"),0<String(e.phoneNumber).length&&i("#billing_phone").val(String(e.phoneNumber)).change().trigger("keydown"),a=!0}function b(e){e?(i("#billing_address_1, #billing_address_2, #billing_postcode, \t\t\t\t#billing_city").prop("readonly",!1),i("#billing_address_1, #billing_address_2, #billing_postcode, \t\t\t\t#billing_city").removeClass("disabled-input")):(i("#billing_address_1, #billing_address_2, \t\t\t\t#billing_postcode, #billing_city").prop("readonly",!0),i("#billing_address_1, #billing_address_2, \t\t\t\t#billing_postcode, #billing_city").addClass("disabled-input"))}function p(e,s,t){switch(e){case"SE":case"DK":switch(s){case d:if("individual"===t)return;break;case c:return}}return 1}function b(e){e?(i("#billing_first_name, #billing_last_name, #billing_address_1, \t\t\t\t#billing_address_2, #billing_postcode, #billing_city").prop("readonly",!1),i("#billing_first_name, #billing_last_name, #billing_address_1, \t\t\t\t#billing_address_2, #billing_postcode, #billing_city").removeClass("disabled-input")):(i("#billing_first_name, #billing_last_name, #billing_address_1, \t\t\t\t#billing_address_2, #billing_postcode, #billing_city").prop("readonly",!0),i("#billing_first_name, #billing_last_name, #billing_address_1, \t\t\t\t#billing_address_2, #billing_postcode, #billing_city").addClass("disabled-input"))}function h(){i("#billing_first_name, #billing_last_name, #billing_address_1, \t\t\t\t#billing_address_2, #billing_postcode, #billing_city").val([])}0<i(".svea-get-address-button-container.get-address-shortcode").length&&(i(".payment_method_"+d).is(":visible")||i(".payment_method_"+l).is(":visible")?i(".svea-get-address-button-container.get-address-shortcode").removeClass("invoice-not-available"):i(".svea-get-address-button-container.get-address-shortcode").addClass("invoice-not-available")),i(".svea-get-address-button-container.get-address-shortcode").is(":visible")&&(_=i("[name='svea_get_address_customer_type']:checked").val(),i('[name="iv_billing_customer_type"]').val(_),i(".payment_methods, .svea-get-address-button-container").addClass("customer-type-"+_)),p(m,g,_)?p(m,g,_)&&b(!0):(b(!1),a||h()),i(document).on("change",".woocommerce form.woocommerce-checkout .woocommerce-billing-fields :input",function(e){a=!1}),i(document).on("keydown",'[name="svea_billing_ssn"], [name="svea_billing_org_number"], [name="iv_billing_org_number"], [name="iv_billing_ssn"], [name="pp_billing_ssn"]',function(e){var s=i(e.target);13==(e.which||e.keyCode||0)&&(e.preventDefault(),(e=($container=s.closest(".svea-fields, .svea-get-address-button-container")).find(".svea-get-address-button")).is(":visible"))&&e.click()}),i(document).on("change",'[name="svea_billing_ssn"]',function(e){i("[name='iv_billing_ssn'], [name='pp_billing_ssn']").val(i(this).val())}),i(document).on("change",'[name="svea_billing_org_number"]',function(e){i("[name='iv_billing_org_number'], [name='pp_billing_org_number']").val(i(this).val())}),i(document).on("click",".svea-get-address-button",function(e){e.preventDefault();var s,e=g,t=(i(this),i(this).closest(".svea-get-address-button-container")),a=i(".svea-get-address-button-container.get-address-shortcode").is(":visible");i(".svea-invoice-fields, .svea-part-pay-fields");o||(a&&(e=d),"individual"==_||e==c?(s=i(a?"[name='svea_billing_ssn']":"[name='"+(e==d?"iv":"pp")+"_billing_ssn']").val(),t.addClass("getting-address"),o=!0,i.post(Svea.ajaxUrl,{action:"svea_get_address",pers_nr:s,country_code:m,payment_type:e,security:Svea.gaSecurity},function(e){t.removeClass("getting-address"),o=!1,void 0===e.resultcode||void 0===e.customerIdentity?(t.append('<div class="svea-message error">'+Phrases.could_not_get_address+"</div>"),t.addClass("getting-address-error"),setTimeout(function(){t.find(".svea-message.error").remove(),t.removeClass("getting-address-error")},5e3)):"Error"==e.resultcode||"NoSuchEntity"==e.resultcode?(t.append('<div class="svea-message error">'+e.errormessage+"</div>"),t.addClass("getting-address-error"),setTimeout(function(){t.find(".svea-message.error").remove(),t.removeClass("getting-address-error")},5e3)):(u(e.customerIdentity[0]),t.append('<div class="svea-message success">'+Phrases.your_address_was_found+"</div>"),t.addClass("getting-address-success"),setTimeout(function(){t.find(".svea-message.success").remove(),t.removeClass("getting-address-success")},5e3))})):"company"==_&&(s=i(a?"[name='svea_billing_org_number']":"[name='"+(e==d||e==l?"iv":"pp")+"_billing_org_number']").val(),t.addClass("getting-address"),o=!0,i.post(Svea.ajaxUrl,{action:"svea_get_address",org_nr:s,country_code:m,payment_type:e,security:Svea.gaSecurity},function(e){t.removeClass("getting-address"),o=!1,void 0===e.resultcode||void 0===e.customerIdentity?(t.append('<div class="svea-message error">'+Phrases.could_not_get_address+"</div>"),t.addClass("getting-address-error"),setTimeout(function(){t.find(".svea-message.error").remove(),t.removeClass("getting-address-error")},5e3)):"Error"==e.resultcode||"NoSuchEntity"==e.resultcode?(t.append('<div class="svea-message error">'+e.errormessage+"</div>"),t.addClass("getting-address-error"),setTimeout(function(){t.find(".svea-message.error").remove(),t.removeClass("getting-address-error")},5e3)):(e=e.customerIdentity,i(".org-address-selector").html(v(e)),n=e,i(".address-selector").val(e[0].addressSelector),u(e[0]),r=e[0],t.addClass("getting-address-success"),t.append('<div class="svea-message success">'+Phrases.your_address_was_found+"</div>"),setTimeout(function(){t.find(".svea-message.success").remove(),t.removeClass("getting-address-success")},5e3))})))}),Svea.isPayPage&&i('.payment_methods [name="payment_method"]').on("change",function(){var e=g||!1;g=i('[name="payment_method"]:checked').val(),_=i('[name="iv_billing_customer_type"]').val()||!1,i(".payment_methods, .svea-get-address-button-container").removeClass("payment-method-"+e).addClass("payment-method-"+g).removeClass("customer-type-"+_).addClass("customer-type-"+_),r=!1,n=[],i(".org-address-selector").html("")}),i(document).on("updated_checkout",function(){0<i(".svea-get-address-button-container.get-address-shortcode").length&&(i(".payment_method_"+d).is(":visible")?i(".svea-get-address-button-container.get-address-shortcode").removeClass("invoice-not-available"):i(".svea-get-address-button-container.get-address-shortcode").addClass("invoice-not-available")),i(".svea-get-address-button-container.get-address-shortcode").is(":visible")&&(i("[name='iv_billing_ssn'], [name='pp_billing_ssn']").val(i("[name='svea_billing_ssn']").val()),i("[name='iv_billing_org_number']").val(i("[name='svea_billing_org_number']").val()),i('[name="iv_billing_customer_type"]').val(i('[name="svea_get_address_customer_type"]:checked').val()));var e=m||!1,s=g||!1,t=_||!1;0==Svea.onlyOneAllowedCountry&&(m=i('[name="billing_country"]').val()),g=i('[name="payment_method"]:checked').val(),_=i('[name="iv_billing_customer_type"]').val()||"individual",i(".payment_methods, .svea-get-address-button-container").removeClass("country-"+(e?e.toLowerCase():"false")).addClass("country-"+(m?m.toLowerCase():"false")).removeClass("payment-method-"+s).addClass("payment-method-"+g),i(".svea-get-address-button-container.get-address-shortcode").is(":visible")&&(_=i('[name="iv_billing_customer_type"]').val()||"individual"),i(".payment_methods, .svea-get-address-button-container").removeClass("customer-type-"+t).addClass("customer-type-"+_),!1!==r&&0<n.length&&(i(".org-address-selector").html(v(n)),i(".org-address-selector").val(r.addressSelector),i(".address-selector").val(r.addressSelector)),void 0!==Svea.sameShippingAsBilling[g]&&Svea.sameShippingAsBilling[g]?i(".woocommerce .woocommerce-checkout").hasClass("hide-shipping-fields")||i(".woocommerce .woocommerce-checkout").addClass("hide-shipping-fields"):i(".woocommerce .woocommerce-checkout").hasClass("hide-shipping-fields")&&i(".woocommerce .woocommerce-checkout").removeClass("hide-shipping-fields"),e===m&&g===s||(r=!1,n=[],i(".org-address-selector").html(""),p(m,g,_)?p(m,g,_)&&b(!0):(b(!1),a||h()))}),i(document).on("change",'[name="payment_method"]',function(){i("body").trigger("update_checkout")}),i(document).on("change",'[name="billing_country"]',function(){var e=m||!1;m=i('[name="billing_country"]').val(),i(".payment_methods, .svea-get-address-button-container").removeClass("country-"+(e?e.toLowerCase():"false")).addClass("country-"+(m?m.toLowerCase():"false")),p(m,g,_)?p(m,g,_)&&b(!0):(b(!1),a||h())});var s=null;i(document).on("change",'.invoice-customer-type select, [name="svea_get_address_customer_type"]',function(){var e;o?null!=s&&i(this).val(s.val()):(e=_||!1,_=i(this).val()||!1,i(".payment_methods, .svea-get-address-button-container").removeClass("customer-type-"+e).addClass("customer-type-"+_),s=i(this),p(m,g,_)?p(m,g,_)&&b(!0):(b(!1),a||h()))}),i(document).on("change",'[name="svea_get_address_customer_type"]',function(){i("[name='iv_billing_customer_type']").val(i(this).val()),s=i(this),i("body").trigger("update_checkout")}),i(document).on("change",".org-address-selector",function(){for(var e=0;e<n.length;++e){var s=n[e];if(s.addressSelector==i(".org-address-selector").val())return i(".address-selector").val(i(".org-address-selector").val()),u(s),void(r=s)}}),i(document).on("change",".birth-date-month, .birth-date-day, .birth-date-year",function(){var e=i(this).parents(".svea-part-pay-fields, .svea-invoice-fields"),s=parseInt(e.find(".birth-date-year").val()),t=parseInt(e.find(".birth-date-month").val()),a=parseInt(e.find(".birth-date-day").val()),n=new Date(s,t,0).getDate();e.find(".birth-date-day option").each(function(){parseInt(i(this).val())>n?i(this).prop("disabled",!0):i(this).prop("disabled",!1)}),n<a&&e.find(".birth-date-day").val(n)})}); -
svea-webpay-for-woocommerce/trunk/inc/Gateways/WC_Gateway_Svea_Invoice.php
r3319942 r3328029 143 143 add_action( 'woocommerce_api_wc_gateway_svea_invoice_strong_auth_rejected', [ $this, 'handle_callback_request_rejected' ] ); 144 144 145 self::$log_enabled = $this->get_option( 'debug' ) === 'yes'; 146 145 147 $this->same_shipping_as_billing = $this->get_option( 'same_shipping_as_billing' ) === 'yes'; 146 148 … … 167 169 $this->invoice_fee_taxable = $this->get_option( 'invoice_fee_taxable_' . $customer_country ) === 'yes'; 168 170 169 self::$log_enabled = $this->get_option( 'debug' ) === 'yes';170 171 $this->description = __( $this->get_option( 'description' ), 'svea-webpay-for-woocommerce' ); // phpcs:ignore 171 172 } … … 1201 1202 $strong_auth = $this->uses_strong_auth( $customer_country, $customer_type ); 1202 1203 1204 $this->testmode = $this->get_option( 'testmode_' . strtolower( $customer_country ) ) === 'yes'; 1205 1203 1206 $config = $this->get_config( $customer_country, $customer_type ); 1204 1207 … … 1499 1502 1500 1503 $post_data = [ 1501 'iv_billing_customer_type' => $subscription->get_meta( '_svea_customer_type' ), 1502 'iv_billing_org_number' => $subscription->get_meta( '_svea_iv_billing_org_number' ), 1503 'iv_billing_ssn' => $subscription->get_meta( '_svea_iv_billing_ssn' ), 1504 'iv_billing_vat_number' => $subscription->get_meta( '_svea_iv_billing_vat_number' ), 1505 'iv_birth_date_year' => $subscription->get_meta( '_svea_iv_birth_date_year' ), 1506 'iv_birth_date_month' => $subscription->get_meta( '_svea_iv_birth_date_month' ), 1507 'iv_birth_date_day' => $subscription->get_meta( '_svea_iv_birth_date_day' ), 1508 'iv_billing_initials' => $subscription->get_meta( '_svea_iv_billing_initials' ), 1504 'iv_billing_customer_type' => $subscription->get_meta( '_svea_customer_type' ) ?: $subscription->get_meta( '_svea_iv_billing_customer_type' ), 1505 'iv_billing_address_selector' => $subscription->get_meta( '_svea_address_selector' ), 1506 'iv_billing_org_number' => $subscription->get_meta( '_svea_iv_billing_org_number' ), 1507 'iv_billing_ssn' => $subscription->get_meta( '_svea_iv_billing_ssn' ), 1508 'iv_billing_vat_number' => $subscription->get_meta( '_svea_iv_billing_vat_number' ), 1509 'iv_birth_date_year' => $subscription->get_meta( '_svea_iv_birth_date_year' ), 1510 'iv_birth_date_month' => $subscription->get_meta( '_svea_iv_birth_date_month' ), 1511 'iv_birth_date_day' => $subscription->get_meta( '_svea_iv_birth_date_day' ), 1512 'iv_billing_initials' => $subscription->get_meta( '_svea_iv_billing_initials' ), 1509 1513 ]; 1510 1514 … … 1677 1681 $customer_company = $wc_order->get_billing_company(); 1678 1682 1679 $customer_type = $subscription->get_meta( '_svea_customer_type' ) ;1683 $customer_type = $subscription->get_meta( '_svea_customer_type' ) ?: $subscription->get_meta( '_svea_iv_billing_customer_type' ); 1680 1684 1681 1685 $invoice_fee_label = $this->get_option( 'invoice_fee_label_' . strtolower( $customer_country ) ); … … 1737 1741 } 1738 1742 1743 $this->testmode = $this->get_option( 'testmode_' . strtolower( $customer_country ) ) === 'yes'; 1744 1739 1745 $config = $this->get_config( $customer_country, $customer_type ); 1740 1746 … … 1756 1762 */ 1757 1763 $svea_data = [ 1758 'customer_type' => $subscription->get_meta( '_svea_customer_type' ) ,1764 'customer_type' => $subscription->get_meta( '_svea_customer_type' ) ?: $subscription->get_meta( '_svea_iv_billing_customer_type' ), 1759 1765 'address_selector' => $subscription->get_meta( '_svea_address_selector' ), 1760 1766 'org_number' => $subscription->get_meta( '_svea_iv_billing_org_number' ), … … 1887 1893 */ 1888 1894 public function cancel_order( $order, $svea_order_id ) { 1889 $customer_type = $order->get_meta( '_svea_customer_type' ) ;1895 $customer_type = $order->get_meta( '_svea_customer_type' ) ?: $order->get_meta( '_svea_iv_billing_customer_type' ); 1890 1896 $config = $this->get_config( $order->get_billing_country(), $customer_type ); 1891 1897 … … 1926 1932 */ 1927 1933 public function credit_order( $order, $svea_order_id ) { 1928 $customer_type = $order->get_meta( '_svea_customer_type' ) ;1934 $customer_type = $order->get_meta( '_svea_customer_type' ) ?: $order->get_meta( '_svea_iv_billing_customer_type' ); 1929 1935 $config = $this->get_config( $order->get_billing_country(), $customer_type ); 1930 1936 … … 2140 2146 */ 2141 2147 public function deliver_order( $order, $svea_order_id ) { 2142 $customer_type = $order->get_meta( '_svea_customer_type' ) ;2148 $customer_type = $order->get_meta( '_svea_customer_type' ) ?: $order->get_meta( '_svea_iv_billing_customer_type' ); 2143 2149 $config = $this->get_config( $order->get_billing_country(), $customer_type ); 2144 2150 $is_b2b = $customer_type === 'company'; -
svea-webpay-for-woocommerce/trunk/inc/Gateways/WC_Gateway_Svea_Part_Pay.php
r3319942 r3328029 116 116 add_action( 'woocommerce_api_wc_gateway_svea_part_pay_strong_auth_rejected', [ $this, 'handle_callback_request_rejected' ] ); 117 117 118 self::$log_enabled = $this->get_option( 'debug' ) === 'yes'; 119 118 120 if ( ! isset( WC()->customer ) ) { 119 121 return; … … 141 143 $this->display_product_widget = $this->get_option( 'display_product_widget' ) === 'yes'; 142 144 143 self::$log_enabled = $this->get_option( 'debug' ) === 'yes';144 145 $this->description = __( $this->get_option( 'description' ), 'svea-webpay-for-woocommerce' ); // phpcs:ignore 145 146 } -
svea-webpay-for-woocommerce/trunk/inc/Order_Functions.php
r3319942 r3328029 32 32 33 33 add_action( 'woocommerce_after_checkout_validation', [ $this, 'checkout_validation_handler' ], 10, 2 ); 34 35 if ( ! is_admin() ) { 36 add_filter( 'pre_option_woocommerce_ship_to_destination', [ $this, 'maybe_force_ship_to_billing_address' ], 10, 2 ); 37 } 34 38 35 39 add_filter( 'woocommerce_get_order_item_totals', [ $this, 'receipt_display_svea_order_id' ], 10, 2 ); … … 91 95 92 96 /** 97 * Maybe force the ship to billing address 98 * 99 * @param mixed $value 100 * @return mixed 101 */ 102 public function maybe_force_ship_to_billing_address( $value ) { 103 // Get current gateway 104 $current_gateway = Helper::get_current_gateway(); 105 106 if ( $current_gateway && method_exists( $current_gateway, 'can_ship_to_different_address' ) 107 && ! $current_gateway->can_ship_to_different_address() ) { 108 // If the gateway does not allow shipping to a different address, force the value to 'billing_only' 109 $value = 'billing_only'; 110 } 111 112 return $value; 113 } 114 115 /** 93 116 * Display the svea order id whilst viewing the receipt 94 117 * -
svea-webpay-for-woocommerce/trunk/partials/invoice/admin-subscription.php
r2365521 r3328029 55 55 <select class="org-address-selector"></select> 56 56 </p> 57 <input type="hidden" name="_address_selector" class="address-selector" /> 57 <input type="hidden" name="_address_selector" 58 value="<?php echo isset( $post_data['iv_billing_address_selector'] ) ? esc_attr( $post_data['iv_billing_address_selector'] ) : ''; ?>" class="address-selector" /> 58 59 </div> 59 60 <div class="vat-number-container"> -
svea-webpay-for-woocommerce/trunk/readme.txt
r3327589 r3328029 10 10 License: Apache 2.0 11 11 License URI: https://www.apache.org/licenses/LICENSE-2.0 12 Stable tag: 4.0. 212 Stable tag: 4.0.3 13 13 14 14 The Svea Stand Alone payment module is a complete solution for shops using WordPress / WooCommerce as an e-commerce platform. … … 39 39 == Upgrade Notice == 40 40 41 = 4.0.3 = 42 4.0.3 is a patch release. 43 41 44 = 4.0.2 = 42 45 4.0.2 is a patch release. … … 57 60 58 61 == Changelog == 62 63 = 4.0.3 2025-07-15 = 64 * Add backwards compatibility for subscription payments. 65 * Fix problems with organisational number not being fetched. 66 * Force billing address with new method. 59 67 60 68 = 4.0.2 2025-07-09 = -
svea-webpay-for-woocommerce/trunk/svea-webpay-for-woocommerce.php
r3327589 r3328029 4 4 * Plugin Name: Svea Stand Alone for WooCommerce 5 5 * Description: Supercharge your WooCommerce Store with powerful features to pay via Svea Credit card, Invoice, Part Payment, Trustly, Swish, MobilePay and Vipps. 6 * Version: 4.0. 26 * Version: 4.0.3 7 7 * Author: The Generation 8 8 * Author URI: https://thegeneration.se/ … … 37 37 * @var string 38 38 */ 39 const VERSION = '4.0. 2';39 const VERSION = '4.0.3'; 40 40 41 41 /**
Note: See TracChangeset
for help on using the changeset viewer.