Changeset 3170993
- Timestamp:
- 10/17/2024 07:46:22 PM (18 months ago)
- Location:
- paypal-brasil-para-woocommerce
- Files:
-
- 14 edited
- 1 copied
-
tags/1.5.5 (copied) (copied from paypal-brasil-para-woocommerce/trunk)
-
tags/1.5.5/assets/dist/js/frontend-bcdc.js (modified) (1 diff)
-
tags/1.5.5/assets/dist/js/frontend-bcdc.js.map (modified) (1 diff)
-
tags/1.5.5/includes/payment-methods/class-paypal-brasil-bcdc-gateway.php (modified) (14 diffs)
-
tags/1.5.5/includes/views/admin-options/admin-options-plus/admin-options-plus-template.php (modified) (1 diff)
-
tags/1.5.5/paypal-brasil-para-woocommerce.php (modified) (2 diffs)
-
tags/1.5.5/readme.txt (modified) (3 diffs)
-
tags/1.5.5/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/assets/dist/js/frontend-bcdc.js (modified) (1 diff)
-
trunk/assets/dist/js/frontend-bcdc.js.map (modified) (1 diff)
-
trunk/includes/payment-methods/class-paypal-brasil-bcdc-gateway.php (modified) (14 diffs)
-
trunk/includes/views/admin-options/admin-options-plus/admin-options-plus-template.php (modified) (1 diff)
-
trunk/paypal-brasil-para-woocommerce.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
paypal-brasil-para-woocommerce/tags/1.5.5/assets/dist/js/frontend-bcdc.js
r3154165 r3170993 1 1 /*! For license information please see frontend-bcdc.js.LICENSE.txt */ 2 (()=>{"use strict";var e={"./src/frontend/frontend-bcdc/frontend-bcdc-api.ts":(e,t,a)=>{a.r(t),a.d(t,{paymentBCDC:()=>r});var n=a("./src/frontend/frontend-shared.ts");const r={create:e=>{if(e.errors)throw console.log("Erro"),new Error(e.errors);if(e.payment_id)return e.payment_id;throw new Error("An unexpected error occurred, please try again. If the error persists, please contact us. (#56)")},approve:e=>{jQuery("#paypal-bcdc-fields [name=paypal-brasil-bcdc-order-id]").val(e.orderID),jQuery("#paypal-bcdc-fields [name=paypal-brasil-bcdc-payer-id]").val(e.payerID),jQuery("#paypal-bcdc-fields [name=paypal-brasil-bcdc-pay-id]").val(e.paymentID),n.PaypalPayments.submitForm()},error:e=>{const t=jQuery("#wc-bcdc-brasil-api-error-data").val();if(t)n.PaypalPayments.triggerUpdateCheckout(),n.PaypalPayments.setNotices(JSON.parse(t)),n.PaypalPayments.scrollTop();else{var a='<ul class="woocommerce-error" role="alert"><li>'+e.message+"</li></ul>";n.PaypalPayments.triggerUpdateCheckout(),n.PaypalPayments.setNotices(a),n.PaypalPayments.scrollTop()}},cancel:()=>{n.PaypalPayments.triggerUpdateCheckout(),n.PaypalPayments.setNotices(paypal_brasil_bcdc_messages.cancel_message),n.PaypalPayments.scrollTop()}}},"./src/frontend/frontend-sdk/frontend-sdk-bcdc.ts":(e,t,a)=>{a.r(t),a.d(t,{importBcdcSdk:()=>r});var n=function(e,t,a,n){return new(a||(a=Promise))((function(r,o){function c(e){try{i(n.next(e))}catch(e){o(e)}}function l(e){try{i(n.throw(e))}catch(e){o(e)}}function i(e){var t;e.done?r(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(c,l)}i((n=n.apply(e,t||[])).next())}))};const r={handle(){return n(this,void 0,void 0,(function*(){const e=paypal_brasil_bcdc_settings.client_id,t=paypal_brasil_bcdc_settings.currency,a=paypal_brasil_bcdc_settings.locale,n=document.getElementById("paypal-sdk-script"),r=`https://www.paypal.com/sdk/js?client-id=${e}&components=buttons,funding-eligibility,marks,marks¤cy=${t}&locale=${a}`;if(n&&n.getAttribute("src")!==r||!n){const e=document.createElement("script");return e.id="paypal-sdk-script",e.async=!0,e.src=r,e.setAttribute("data-page-type","checkout"),document.head.appendChild(e),new Promise(((t,a)=>{e.onload=()=>{t()},e.onerror=e=>{console.error("Erro ao carregar o script do PayPal:",e),t()}}))}return Promise.resolve()}))}}},"./src/frontend/frontend-shared.ts":(e,t,a)=>{a.r(t),a.d(t,{PaypalPayments:()=>n});class n{static scrollTop(){jQuery("html, body").animate({scrollTop:0},300)}static setNotices(e){jQuery(".woocommerce-notices-wrapper:first").html(e)}static makeRequest(e,t){console.log(e);const a={async:!0,crossDomain:!0,url:n.replaceVars(paypal_brasil_settings.paypal_brasil_handler_url,{ACTION:e}),method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:JSON.stringify(t)};return jQuery.ajax(a)}static showDefaultButton(){jQuery("#paypal-brasil-button-container .paypal-submit-button-bcdc").hide(),jQuery("#paypal-brasil-button-container .paypal-submit-button").hide(),jQuery("#paypal-brasil-button-container .default-submit-button").show()}static showPaypalButton(){jQuery("#paypal-brasil-button-container .default-submit-button").hide(),jQuery("#paypal-brasil-button-container .paypal-submit-button-bcdc").hide(),jQuery("#paypal-brasil-button-container .paypal-submit-button").show()}static showPaypalBCDCButton(){jQuery("#paypal-brasil-button-container .default-submit-button").hide(),jQuery("#paypal-brasil-button-container .paypal-submit-button").hide(),jQuery("#paypal-brasil-button-container .paypal-submit-button-bcdc").show()}static isPaypalPaymentsSelected(){return!!jQuery("#payment_method_paypal-brasil-spb-gateway:checked").length}static isPaypalBCDCPaymentsSelected(){return!!jQuery("#payment_method_paypal-brasil-bcdc-gateway:checked").length}static triggerUpdateCheckout(){jQuery(document.body).trigger("update_checkout")}static triggerUpdateCart(){jQuery(document.body).trigger("wc_update_cart")}static submitForm(){jQuery("form.woocommerce-checkout, form#order_review").submit()}static submitFormCheckout(){jQuery("form.checkout.woocommerce-checkout").submit()}static replaceVars(e,t){let a=e;for(let e in t)t.hasOwnProperty(e)&&(a=a.replace(new RegExp("{"+e+"}","g"),t[e]));return a}}}},t={};function a(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,a),o.exports}a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{a.r({});var e=a("./src/frontend/frontend-shared.ts"),t=a("./src/frontend/frontend-bcdc/frontend-bcdc-api.ts"),n=a("./src/frontend/frontend-sdk/frontend-sdk-bcdc.ts"),r=function(e,t,a,n){return new(a||(a=Promise))((function(r,o){function c(e){try{i(n.next(e))}catch(e){o(e)}}function l(e){try{i(n.throw(e))}catch(e){o(e)}}function i(e){var t;e.done?r(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(c,l)}i((n=n.apply(e,t||[])).next())}))};class o extends e.PaypalPayments{constructor(){super(),this.sdkLoaded=!1,this.updateCheckout=(e=null)=>{e&&e.preventDefault(),this.triggerUpdateCheckout()},this.forceUpdateCheckout=(e=null)=>{e&&e.preventDefault(),jQuery(document.body).trigger("update_checkout")},this.triggerUpdateCheckout=this.debounce((()=>{this.forceUpdateCheckout()}),1e3),paypal_brasil_bcdc_settings.is_order_pay_page?this.initializeOrderPage():this.initializeCheckoutBcdc(),this.cartLabelTotal()}initializeOrderPage(){return r(this,void 0,void 0,(function*(){this.addPaypalBCDCButtonOnContainer(),this.renderPayPalButtonBcdc(),jQuery(document).on("updated_checkout","body",this.addPaypalBCDCButtonOnContainer),jQuery(document).on("updated_checkout","body",this.updateCheckoutButtonBcdc),jQuery("form#order_review").on("change","[name=payment_method],#payment_method_paypal-brasil-bcdc-gateway",this.updateCheckoutButtonBcdc),jQuery("form#order_review").on("change","[name=payment_method],#payment_method_paypal-brasil-bcdc-gateway",this.renderPayPalButtonBcdc),jQuery("form#order_review").on("change","[name=payment_method],#payment_method_paypal-brasil-bcdc-gateway",this.forceUpdateCheckout),this.listenInputChanges(),jQuery(document).on("updated_checkout","body",this.renderPayPalButtonBcdc)}))}initializeCheckoutBcdc(){return r(this,void 0,void 0,(function*(){jQuery(document).on("updated_checkout","body",this.addPaypalBCDCButtonOnContainer),jQuery(document).on("updated_checkout","body",this.updateCheckoutButtonBcdc),jQuery("form.woocommerce-checkout, form#order_review").on("change","[name=payment_method],#payment_method_paypal-brasil-bcdc-gateway",this.updateCheckoutButtonBcdc),jQuery("form.woocommerce-checkout, form#order_review").on("change","[name=payment_method],#payment_method_paypal-brasil-bcdc-gateway",this.renderPayPalButtonBcdc),jQuery("form.woocommerce-checkout, form#order_review").on("change","[name=payment_method],#payment_method_paypal-brasil-bcdc-gateway",this.forceUpdateCheckout),this.listenInputChanges(),jQuery(document).on("updated_checkout","body",this.renderPayPalButtonBcdc)}))}listenInputChanges(){jQuery(["[name=billing_first_name]","[name=billing_last_name]","[name=billing_cpf]","[name=billing_cnpj]","[name=billing_phone]","[name=billing_address_1]","[name=billing_number]","[name=billing_address_2]","[name=billing_neighborhood]","[name=billing_city]","[name=billing_state]","[name=billing_country]","[name=billing_email]"].join(",")).on("keyup",(()=>this.updateCheckout())),jQuery(["[name=billing_persontype]"].join(",")).on("change",(()=>this.updateCheckout()))}addPaypalBCDCButtonOnContainer(){if(!document.querySelector("#paypal-submit-button-bcdc")){var e=document.createElement("div"),t=document.createElement("div");e.className="paypal-submit-button-bcdc",t.id="paypal-button-bcdc";var a=document.querySelector("#paypal-brasil-button-container");a&&(a.appendChild(e),e.appendChild(t))}}updateCheckoutButtonBcdc(){e.PaypalPayments.isPaypalBCDCPaymentsSelected()?(e.PaypalPayments.showPaypalBCDCButton(),console.debug("bcdc change")):e.PaypalPayments.isPaypalPaymentsSelected()||(console.debug("default change"),e.PaypalPayments.showDefaultButton())}renderPayPalButtonBcdc(){return r(this,void 0,void 0,(function*(){var e=document.getElementById("payment_method_paypal-brasil-bcdc-gateway");if(e.checked){yield n.importBcdcSdk.handle();var a=document.getElementById("paypal-button-bcdc");if(a&&paypal_brasil_bcdc_settings.allowed_currency)a.innerHTML="",[paypal.FUNDING.CARD].forEach((e=>{const a=paypal.Buttons({style:{layout:"vertical",color:"black",shape:"pill",label:"paypal",size:"full",tagline:"false"},fundingSource:e,createOrder:()=>{var e,a=null!==(e=jQuery("#wc-bcdc-brasil-data").val())&&void 0!==e?e:null;try{if(a)return console.warn(a),a=JSON.parse(a),t.paymentBCDC.create(a)}catch(e){throw e}},onApprove:t.paymentBCDC.approve,onError:t.paymentBCDC.error,onCancel:t.paymentBCDC.cancel});a.isEligible()&&a.render("#paypal-button-bcdc")}))}else e.addEventListener("change",(function(){return r(this,void 0,void 0,(function*(){if(e.checked){yield n.importBcdcSdk.handle();var a=document.getElementById("paypal-button-bcdc");if(a&&paypal_brasil_bcdc_settings.allowed_currency)a.innerHTML="",[paypal.FUNDING.CARD].forEach((e=>r(this,void 0,void 0,(function*(){const a=paypal.Buttons({style:{layout:"vertical",color:"black",shape:"pill",label:"paypal",tagline:"false",size:"full"},fundingSource:e,createOrder:()=>{var e,a=null!==(e=jQuery("#wc-bcdc-brasil-data").val())&&void 0!==e?e:null;try{if(a)return console.warn(a),a=JSON.parse(a),t.paymentBCDC.create(a)}catch(e){throw e}},onApprove:t.paymentBCDC.approve,onError:t.paymentBCDC.error,onCancel:t.paymentBCDC.cancel});a.isEligible()&&a.render("#paypal-button-bcdc")}))))}}))}))}))}debounce(e,t,a=!1){let n;return function(){const r=this,o=arguments,c=a&&!n;clearTimeout(n),n=setTimeout((function(){n=null,a||e.apply(r,o)}),t),c&&e.apply(r,o)}}errorHandler(e){}cartLabelTotal(){if(paypal_brasil_bcdc_settings.is_order_pay_page){var e=document.querySelector("span.woocommerce-Price-currencySymbol") .textContent+" "+paypal_brasil_bcdc_order.order_pay_total;document.getElementById("bcdc-total-cart-label").textContent=e}else jQuery(document.body).on("updated_checkout",(function(){var e=document.querySelector("tr.order-total");if(e){var t=e.querySelector("span.woocommerce-Price-amount");if(t){var a=t.textContent;document.getElementById("bcdc-total-cart-label").textContent=a}}}))}}new o})(),a.r(n)})();2 (()=>{"use strict";var e={"./src/frontend/frontend-bcdc/frontend-bcdc-api.ts":(e,t,a)=>{a.r(t),a.d(t,{paymentBCDC:()=>r});var n=a("./src/frontend/frontend-shared.ts");const r={create:e=>{if(e.errors)throw console.log("Erro"),new Error(e.errors);if(e.payment_id)return e.payment_id;throw new Error("An unexpected error occurred, please try again. If the error persists, please contact us. (#56)")},approve:e=>{jQuery("#paypal-bcdc-fields [name=paypal-brasil-bcdc-order-id]").val(e.orderID),jQuery("#paypal-bcdc-fields [name=paypal-brasil-bcdc-payer-id]").val(e.payerID),jQuery("#paypal-bcdc-fields [name=paypal-brasil-bcdc-pay-id]").val(e.paymentID),n.PaypalPayments.submitForm()},error:e=>{const t=jQuery("#wc-bcdc-brasil-api-error-data").val();if(t)n.PaypalPayments.triggerUpdateCheckout(),n.PaypalPayments.setNotices(JSON.parse(t)),n.PaypalPayments.scrollTop();else{var a='<ul class="woocommerce-error" role="alert"><li>'+e.message+"</li></ul>";n.PaypalPayments.triggerUpdateCheckout(),n.PaypalPayments.setNotices(a),n.PaypalPayments.scrollTop()}},cancel:()=>{n.PaypalPayments.triggerUpdateCheckout(),n.PaypalPayments.setNotices(paypal_brasil_bcdc_messages.cancel_message),n.PaypalPayments.scrollTop()}}},"./src/frontend/frontend-sdk/frontend-sdk-bcdc.ts":(e,t,a)=>{a.r(t),a.d(t,{importBcdcSdk:()=>r});var n=function(e,t,a,n){return new(a||(a=Promise))((function(r,o){function c(e){try{i(n.next(e))}catch(e){o(e)}}function l(e){try{i(n.throw(e))}catch(e){o(e)}}function i(e){var t;e.done?r(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(c,l)}i((n=n.apply(e,t||[])).next())}))};const r={handle(){return n(this,void 0,void 0,(function*(){const e=paypal_brasil_bcdc_settings.client_id,t=paypal_brasil_bcdc_settings.currency,a=paypal_brasil_bcdc_settings.locale,n=document.getElementById("paypal-sdk-script"),r=`https://www.paypal.com/sdk/js?client-id=${e}&components=buttons,funding-eligibility,marks,marks¤cy=${t}&locale=${a}`;if(n&&n.getAttribute("src")!==r||!n){const e=document.createElement("script");return e.id="paypal-sdk-script",e.async=!0,e.src=r,e.setAttribute("data-page-type","checkout"),document.head.appendChild(e),new Promise(((t,a)=>{e.onload=()=>{t()},e.onerror=e=>{console.error("Erro ao carregar o script do PayPal:",e),t()}}))}return Promise.resolve()}))}}},"./src/frontend/frontend-shared.ts":(e,t,a)=>{a.r(t),a.d(t,{PaypalPayments:()=>n});class n{static scrollTop(){jQuery("html, body").animate({scrollTop:0},300)}static setNotices(e){jQuery(".woocommerce-notices-wrapper:first").html(e)}static makeRequest(e,t){console.log(e);const a={async:!0,crossDomain:!0,url:n.replaceVars(paypal_brasil_settings.paypal_brasil_handler_url,{ACTION:e}),method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:JSON.stringify(t)};return jQuery.ajax(a)}static showDefaultButton(){jQuery("#paypal-brasil-button-container .paypal-submit-button-bcdc").hide(),jQuery("#paypal-brasil-button-container .paypal-submit-button").hide(),jQuery("#paypal-brasil-button-container .default-submit-button").show()}static showPaypalButton(){jQuery("#paypal-brasil-button-container .default-submit-button").hide(),jQuery("#paypal-brasil-button-container .paypal-submit-button-bcdc").hide(),jQuery("#paypal-brasil-button-container .paypal-submit-button").show()}static showPaypalBCDCButton(){jQuery("#paypal-brasil-button-container .default-submit-button").hide(),jQuery("#paypal-brasil-button-container .paypal-submit-button").hide(),jQuery("#paypal-brasil-button-container .paypal-submit-button-bcdc").show()}static isPaypalPaymentsSelected(){return!!jQuery("#payment_method_paypal-brasil-spb-gateway:checked").length}static isPaypalBCDCPaymentsSelected(){return!!jQuery("#payment_method_paypal-brasil-bcdc-gateway:checked").length}static triggerUpdateCheckout(){jQuery(document.body).trigger("update_checkout")}static triggerUpdateCart(){jQuery(document.body).trigger("wc_update_cart")}static submitForm(){jQuery("form.woocommerce-checkout, form#order_review").submit()}static submitFormCheckout(){jQuery("form.checkout.woocommerce-checkout").submit()}static replaceVars(e,t){let a=e;for(let e in t)t.hasOwnProperty(e)&&(a=a.replace(new RegExp("{"+e+"}","g"),t[e]));return a}}}},t={};function a(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,a),o.exports}a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{a.r({});var e=a("./src/frontend/frontend-shared.ts"),t=a("./src/frontend/frontend-bcdc/frontend-bcdc-api.ts"),n=a("./src/frontend/frontend-sdk/frontend-sdk-bcdc.ts"),r=function(e,t,a,n){return new(a||(a=Promise))((function(r,o){function c(e){try{i(n.next(e))}catch(e){o(e)}}function l(e){try{i(n.throw(e))}catch(e){o(e)}}function i(e){var t;e.done?r(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(c,l)}i((n=n.apply(e,t||[])).next())}))};class o extends e.PaypalPayments{constructor(){super(),this.sdkLoaded=!1,this.updateCheckout=(e=null)=>{e&&e.preventDefault(),this.triggerUpdateCheckout()},this.forceUpdateCheckout=(e=null)=>{e&&e.preventDefault(),jQuery(document.body).trigger("update_checkout")},this.triggerUpdateCheckout=this.debounce((()=>{this.forceUpdateCheckout()}),1e3),paypal_brasil_bcdc_settings.is_order_pay_page?this.initializeOrderPage():this.initializeCheckoutBcdc(),this.cartLabelTotal()}initializeOrderPage(){return r(this,void 0,void 0,(function*(){this.addPaypalBCDCButtonOnContainer(),this.renderPayPalButtonBcdc(),jQuery(document).on("updated_checkout","body",this.addPaypalBCDCButtonOnContainer),jQuery(document).on("updated_checkout","body",this.updateCheckoutButtonBcdc),jQuery("form#order_review").on("change","[name=payment_method],#payment_method_paypal-brasil-bcdc-gateway",this.updateCheckoutButtonBcdc),jQuery("form#order_review").on("change","[name=payment_method],#payment_method_paypal-brasil-bcdc-gateway",this.renderPayPalButtonBcdc),jQuery("form#order_review").on("change","[name=payment_method],#payment_method_paypal-brasil-bcdc-gateway",this.forceUpdateCheckout),this.listenInputChanges(),jQuery(document).on("updated_checkout","body",this.renderPayPalButtonBcdc)}))}initializeCheckoutBcdc(){return r(this,void 0,void 0,(function*(){jQuery(document).on("updated_checkout","body",this.addPaypalBCDCButtonOnContainer),jQuery(document).on("updated_checkout","body",this.updateCheckoutButtonBcdc),jQuery("form.woocommerce-checkout, form#order_review").on("change","[name=payment_method],#payment_method_paypal-brasil-bcdc-gateway",this.updateCheckoutButtonBcdc),jQuery("form.woocommerce-checkout, form#order_review").on("change","[name=payment_method],#payment_method_paypal-brasil-bcdc-gateway",this.renderPayPalButtonBcdc),jQuery("form.woocommerce-checkout, form#order_review").on("change","[name=payment_method],#payment_method_paypal-brasil-bcdc-gateway",this.forceUpdateCheckout),this.listenInputChanges(),jQuery(document).on("updated_checkout","body",this.renderPayPalButtonBcdc)}))}listenInputChanges(){jQuery(["[name=billing_first_name]","[name=billing_last_name]","[name=billing_cpf]","[name=billing_cnpj]","[name=billing_phone]","[name=billing_address_1]","[name=billing_number]","[name=billing_address_2]","[name=billing_neighborhood]","[name=billing_city]","[name=billing_state]","[name=billing_country]","[name=billing_email]"].join(",")).on("keyup",(()=>this.updateCheckout())),jQuery(["[name=billing_persontype]"].join(",")).on("change",(()=>this.updateCheckout()))}addPaypalBCDCButtonOnContainer(){if(!document.querySelector("#paypal-submit-button-bcdc")){var e=document.createElement("div"),t=document.createElement("div");e.className="paypal-submit-button-bcdc",t.id="paypal-button-bcdc";var a=document.querySelector("#paypal-brasil-button-container");a&&(a.appendChild(e),e.appendChild(t))}}updateCheckoutButtonBcdc(){e.PaypalPayments.isPaypalBCDCPaymentsSelected()?(e.PaypalPayments.showPaypalBCDCButton(),console.debug("bcdc change")):e.PaypalPayments.isPaypalPaymentsSelected()||(console.debug("default change"),e.PaypalPayments.showDefaultButton())}renderPayPalButtonBcdc(){return r(this,void 0,void 0,(function*(){var e=document.getElementById("payment_method_paypal-brasil-bcdc-gateway");if(e.checked){yield n.importBcdcSdk.handle();var a=document.getElementById("paypal-button-bcdc");if(a&&paypal_brasil_bcdc_settings.allowed_currency)a.innerHTML="",[paypal.FUNDING.CARD].forEach((e=>{const a=paypal.Buttons({style:{layout:"vertical",color:"black",shape:"pill",label:"paypal",size:"full",tagline:"false"},fundingSource:e,createOrder:()=>{var e,a=null!==(e=jQuery("#wc-bcdc-brasil-data").val())&&void 0!==e?e:null;try{if(a)return console.warn(a),a=JSON.parse(a),t.paymentBCDC.create(a)}catch(e){throw e}},onApprove:t.paymentBCDC.approve,onError:t.paymentBCDC.error,onCancel:t.paymentBCDC.cancel});a.isEligible()&&a.render("#paypal-button-bcdc")}))}else e.addEventListener("change",(function(){return r(this,void 0,void 0,(function*(){if(e.checked){yield n.importBcdcSdk.handle();var a=document.getElementById("paypal-button-bcdc");if(a&&paypal_brasil_bcdc_settings.allowed_currency)a.innerHTML="",[paypal.FUNDING.CARD].forEach((e=>r(this,void 0,void 0,(function*(){const a=paypal.Buttons({style:{layout:"vertical",color:"black",shape:"pill",label:"paypal",tagline:"false",size:"full"},fundingSource:e,createOrder:()=>{var e,a=null!==(e=jQuery("#wc-bcdc-brasil-data").val())&&void 0!==e?e:null;try{if(a)return console.warn(a),a=JSON.parse(a),t.paymentBCDC.create(a)}catch(e){throw e}},onApprove:t.paymentBCDC.approve,onError:t.paymentBCDC.error,onCancel:t.paymentBCDC.cancel});a.isEligible()&&a.render("#paypal-button-bcdc")}))))}}))}))}))}debounce(e,t,a=!1){let n;return function(){const r=this,o=arguments,c=a&&!n;clearTimeout(n),n=setTimeout((function(){n=null,a||e.apply(r,o)}),t),c&&e.apply(r,o)}}errorHandler(e){}cartLabelTotal(){if(paypal_brasil_bcdc_settings.is_order_pay_page){var e=document.querySelector("span.woocommerce-Price-currencySymbol");if(e.textContent)var t=e.textContent+" "+paypal_brasil_bcdc_order.order_pay_total;t&&(document.getElementById("bcdc-total-cart-label").textContent=t)}else jQuery(document.body).on("updated_checkout",(function(){var e=document.querySelector("tr.order-total");if(e){var t=e.querySelector("span.woocommerce-Price-amount");if(t){var a=t.textContent;document.getElementById("bcdc-total-cart-label").textContent=a}}}))}}new o})(),a.r(n)})(); 3 3 //# sourceMappingURL=frontend-bcdc.js.map -
paypal-brasil-para-woocommerce/tags/1.5.5/assets/dist/js/frontend-bcdc.js.map
r3154165 r3170993 1 {"version":3,"file":"js/frontend-bcdc.js","mappings":";uKACO,MAAMA,EAAc,CACvBC,OAASC,IACL,GAAIA,EAAmBC,OAEnB,MADAC,QAAQC,IAAI,QACN,IAAIC,MAAMJ,EAAmBC,QAEvC,GAAID,EAAmBK,WACnB,OAAOL,EAAmBK,WAG1B,MAAM,IAAID,MAAM,kGACpB,EAEJE,QAAUC,IACNC,OAAO,0DAA0DC,IAAIF,EAAKG,SAC1EF,OAAO,0DAA0DC,IAAIF,EAAKI,SAC1EH,OAAO,wDAAwDC,IAAIF,EAAKK,WACxE,EAAAC,eAAeC,YAAY,EAE/BC,MAAQC,IACJ,MAAMC,EAAeT,OAAO,kCAAkCC,MAC9D,GAAIQ,EACA,EAAAJ,eAAeK,wBACf,EAAAL,eAAeM,WAAWC,KAAKC,MAAMJ,IACrC,EAAAJ,eAAeS,gBAEd,CACD,IAAIC,EAAS,kDACTP,EAASQ,QACT,aACJ,EAAAX,eAAeK,wBACf,EAAAL,eAAeM,WAAWI,GAC1B,EAAAV,eAAeS,WACnB,GAEJG,OAAQ,KAEJ,EAAAZ,eAAeK,wBAEf,EAAAL,eAAeM,WAAWO,4BAA4BC,gBAEtD,EAAAd,eAAeS,WAAW,qGC1ClC,IAAIM,EAAwC,SAAUC,EAASC,EAAYC,EAAGC,GAE1E,OAAO,IAAKD,IAAMA,EAAIE,WAAU,SAAUC,EAASC,GAC/C,SAASC,EAAUC,GAAS,IAAMC,EAAKN,EAAUO,KAAKF,GAAS,CAAE,MAAOG,GAAKL,EAAOK,EAAI,CAAE,CAC1F,SAASC,EAASJ,GAAS,IA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sF,kBAAmB,CAC/C,IA CIuD,EADiBxI,SAAS2F,cAAc,yCACZ8C,YAC5B,IACAC,yBAAyBC,gBAC7B3I,SAASC,eAAe,yBAAyBwI,YAAcD,CACnE,MAEIvL,OAAO+C,SAASqC,MAAMkD,GAAG,oBAAoB,WACzC,IAAIqD,EAAgB5I,SAAS2F,cAAc,kBAE3C,GAAIiD,EAAe,CAEf,IAAIC,EAAkBD,EAAcjD,cAAc,iCAElD,GAAIkD,EAAiB,CAEjB,IAAIC,EAAkBD,EAAgBJ,YACtCzI,SAASC,eAAe,yBAAyBwI,YAC7CK,CACR,CACJ,CACJ,GAER,EAEJ,IAAItE","sources":["webpack://paypal-brasil-para-woocommerce/./src/frontend/frontend-bcdc/frontend-bcdc-api.ts","webpack://paypal-brasil-para-woocommerce/./src/frontend/frontend-sdk/frontend-sdk-bcdc.ts","webpack://paypal-brasil-para-woocommerce/./src/frontend/frontend-shared.ts","webpack://paypal-brasil-para-woocommerce/webpack/bootstrap","webpack://paypal-brasil-para-woocommerce/webpack/runtime/define property getters","webpack://paypal-brasil-para-woocommerce/webpack/runtime/hasOwnProperty shorthand","webpack://paypal-brasil-para-woocommerce/webpack/runtime/make namespace object","webpack://paypal-brasil-para-woocommerce/./src/frontend/frontend-bcdc/frontend-bcdc.ts"],"names":["paymentBCDC","create","paymentCreatedData","errors","console","log","Error","payment_id","approve","data","jQuery","val","orderID","payerID","paymentID","PaypalPayments","submitForm","error","response","phpErrorData","triggerUpdateCheckout","setNotices","JSON","parse","scrollTop","notice","message","cancel","paypal_brasil_bcdc_messages","cancel_message","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","apply","importBcdcSdk","handle","this","clientId","paypal_brasil_bcdc_settings","client_id","currency","locale","existingScript","document","getElementById","src","getAttribute","script","createElement","id","async","setAttribute","head","appendChild","onload","onerror","animate","html","makeRequest","action","settings","crossDomain","url","replaceVars","paypal_brasil_settings","paypal_brasil_handler_url","ACTION","method","dataType","contentType","stringify","ajax","showDefaultButton","hide","show","showPaypalButton","showPaypalBCDCButton","isPaypalPaymentsSelected","length","isPaypalBCDCPaymentsSelected","body","trigger","triggerUpdateCart","submit","submitFormCheckout","str","replaces","replacedStr","property","hasOwnProperty","replace","RegExp","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","call","r","Symbol","toStringTag","PaypalPaymentsBCDC","constructor","super","sdkLoaded","updateCheckout","event","preventDefault","forceUpdateCheckout","debounce","is_order_pay_page","initializeOrderPage","initializeCheckoutBcdc","cartLabelTotal","addPaypalBCDCButtonOnContainer","renderPayPalButtonBcdc","on","updateCheckoutButtonBcdc","listenInputChanges","join","querySelector","submitDiv","butttonDiv","className","parentElement","debug","paymentRadio","checked","paypalButton","allowed_currency","innerHTML","paypal","FUNDING","CARD","forEach","fundingSource","button","Buttons","style","layout","color","shape","label","size","tagline","createOrder","_a","warn","onApprove","onError","onCancel","isEligible","render","addEventListener","func","wait","immediate","timeout","context","args","arguments","callNow","clearTimeout","setTimeout","errorHandler","orderTotal","textContent","paypal_brasil_bcdc_order","order_pay_total","orderTotalRow","priceAmountSpan","priceAmountText"],"sourceRoot":""}1 {"version":3,"file":"js/frontend-bcdc.js","mappings":";uKACO,MAAMA,EAAc,CACvBC,OAASC,IACL,GAAIA,EAAmBC,OAEnB,MADAC,QAAQC,IAAI,QACN,IAAIC,MAAMJ,EAAmBC,QAEvC,GAAID,EAAmBK,WACnB,OAAOL,EAAmBK,WAG1B,MAAM,IAAID,MAAM,kGACpB,EAEJE,QAAUC,IACNC,OAAO,0DAA0DC,IAAIF,EAAKG,SAC1EF,OAAO,0DAA0DC,IAAIF,EAAKI,SAC1EH,OAAO,wDAAwDC,IAAIF,EAAKK,WACxE,EAAAC,eAAeC,YAAY,EAE/BC,MAAQC,IACJ,MAAMC,EAAeT,OAAO,kCAAkCC,MAC9D,GAAIQ,EAC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AAOQ,EAElC,CACA,MAAOQ,GACH,MAAMA,CACV,GAEJ+J,UAAW,EAAAhL,YAAYQ,QACvByK,QAAS,EAAAjL,YAAYiB,MACrBiK,SAAU,EAAAlL,YAAY2B,SAGtByI,EAAOe,cAEPf,EAAOgB,OAAO,sBAEtB,KAER,CACJ,GACJ,GAER,GACJ,CACA,QAAA3C,CAAS6C,EAAMC,EAAMC,GAAY,GAC7B,IAAIC,EACJ,OAAO,WACH,MAAMC,EAAUxI,KACVyI,EAAOC,UAMPC,EAAUL,IAAcC,EAC9BK,aAAaL,GACbA,EAAUM,YAPI,WACVN,EAAU,KACLD,GACDF,EAAKvI,MAAM2I,EAASC,EAC5B,GAG4BJ,GACxBM,GACAP,EAAKvI,MAAM2I,EAASC,EAC5B,CACJ,CACA,YAAAK,CAAatK,GAAW,CACxB,cAAAmH,GACI,GAAIzF,4BAA4BsF,kBAAmB,CAC/C,IAAIuD,EAAiBxI,SAAS2F,cAAc,yCAC5C,GAAI6C,EAAeC,YACf,IAAIC,EAAaF,EAAeC,YAC5B,IACAE,yBAAyBC,gBAE7BF,IACA1I,SAASC,eAAe,yBAAyBwI,YAC7CC,EAEZ,MAEIzL,OAAO+C,SAASqC,MAAMkD,GAAG,oBAAoB,WACzC,IAAIsD,EAAgB7I,SAAS2F,cAAc,kBAE3C,GAAIkD,EAAe,CAEf,IAAIC,EAAkBD,EAAclD,cAAc,iCAElD,GAAImD,EAAiB,CAEjB,IAAIC,EAAkBD,EAAgBL,YACtCzI,SAASC,eAAe,yBAAyBwI,YAC7CM,CACR,CACJ,CACJ,GAER,EAEJ,IAAIvE","sources":["webpack://paypal-brasil-para-woocommerce/./src/frontend/frontend-bcdc/frontend-bcdc-api.ts","webpack://paypal-brasil-para-woocommerce/./src/frontend/frontend-sdk/frontend-sdk-bcdc.ts","webpack://paypal-brasil-para-woocommerce/./src/frontend/frontend-shared.ts","webpack://paypal-brasil-para-woocommerce/webpack/bootstrap","webpack://paypal-brasil-para-woocommerce/webpack/runtime/define property getters","webpack://paypal-brasil-para-woocommerce/webpack/runtime/hasOwnProperty shorthand","webpack://paypal-brasil-para-woocommerce/webpack/runtime/make namespace object","webpack://paypal-brasil-para-woocommerce/./src/frontend/frontend-bcdc/frontend-bcdc.ts"],"names":["paymentBCDC","create","paymentCreatedData","errors","console","log","Error","payment_id","approve","data","jQuery","val","orderID","payerID","paymentID","PaypalPayments","submitForm","error","response","phpErrorData","triggerUpdateCheckout","setNotices","JSON","parse","scrollTop","notice","message","cancel","paypal_brasil_bcdc_messages","cancel_message","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","apply","importBcdcSdk","handle","this","clientId","paypal_brasil_bcdc_settings","client_id","currency","locale","existingScript","document","getElementById","src","getAttribute","script","createElement","id","async","setAttribute","head","appendChild","onload","onerror","animate","html","makeRequest","action","settings","crossDomain","url","replaceVars","paypal_brasil_settings","paypal_brasil_handler_url","ACTION","method","dataType","contentType","stringify","ajax","showDefaultButton","hide","show","showPaypalButton","showPaypalBCDCButton","isPaypalPaymentsSelected","length","isPaypalBCDCPaymentsSelected","body","trigger","triggerUpdateCart","submit","submitFormCheckout","str","replaces","replacedStr","property","hasOwnProperty","replace","RegExp","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","call","r","Symbol","toStringTag","PaypalPaymentsBCDC","constructor","super","sdkLoaded","updateCheckout","event","preventDefault","forceUpdateCheckout","debounce","is_order_pay_page","initializeOrderPage","initializeCheckoutBcdc","cartLabelTotal","addPaypalBCDCButtonOnContainer","renderPayPalButtonBcdc","on","updateCheckoutButtonBcdc","listenInputChanges","join","querySelector","submitDiv","butttonDiv","className","parentElement","debug","paymentRadio","checked","paypalButton","allowed_currency","innerHTML","paypal","FUNDING","CARD","forEach","fundingSource","button","Buttons","style","layout","color","shape","label","size","tagline","createOrder","_a","warn","onApprove","onError","onCancel","isEligible","render","addEventListener","func","wait","immediate","timeout","context","args","arguments","callNow","clearTimeout","setTimeout","errorHandler","currencySymbol","textContent","orderTotal","paypal_brasil_bcdc_order","order_pay_total","orderTotalRow","priceAmountSpan","priceAmountText"],"sourceRoot":""} -
paypal-brasil-para-woocommerce/tags/1.5.5/includes/payment-methods/class-paypal-brasil-bcdc-gateway.php
r3154165 r3170993 87 87 self::$instance = $this; 88 88 89 add_action('woocommerce_checkout_show_terms', array($this,'disable_checkout_terms_and_conditions'), 10 );89 //add_action('woocommerce_checkout_show_terms', array($this,'disable_checkout_terms_and_conditions'), 10 ); 90 90 } 91 91 … … 1003 1003 if (!$only_digital_items) { 1004 1004 1005 if ( $shipping_method == 'local_pickup') {1005 if (isset($shipping_method) && $shipping_method == 'local_pickup') { 1006 1006 1007 1007 $shipping = array( … … 1015 1015 1016 1016 $payment_data['payment_source']['paypal']['experience_context']['shipping_preference'] = 'NO_SHIPPING'; 1017 $payment_data['purchase_units'][0] = array_merge($payment_data['purchase_units'][0], $shipping); 1017 1018 1018 1019 } else { … … 1021 1022 $shipping_address = $this->get_payer_address($data); 1022 1023 1023 $shipping = array( 1024 'shipping' => array( 1025 'type' => 'SHIPPING', 1026 'name' => array( 1027 'full_name' => $data['first_name'] . " " . $data['last_name'], 1028 ), 1029 'address' => $shipping_address 1030 ) 1031 ); 1024 if ($this->validate_address($shipping_address)) { 1025 $shipping = array( 1026 'shipping' => array( 1027 'type' => 'SHIPPING', 1028 'name' => array( 1029 'full_name' => $data['first_name'] . " " . $data['last_name'], 1030 ), 1031 'address' => $shipping_address 1032 ) 1033 ); 1034 1035 $payment_data['payment_source']['paypal']['address'] = $shipping_address; 1036 1037 $payment_data['purchase_units'][0] = array_merge($payment_data['purchase_units'][0], $shipping); 1038 } 1039 1040 1032 1041 1033 1042 $payment_data['payment_source']['paypal']['experience_context']['shipping_preference'] = 'SET_PROVIDED_ADDRESS'; … … 1035 1044 } 1036 1045 1037 $payment_data['purchase_units'][0] = array_merge($payment_data['purchase_units'][0], $shipping);1038 1046 } 1039 1047 … … 1041 1049 1042 1050 $payment_data['payment_source']['paypal'] = $this->get_payer_info($data); 1043 //Info Payer address data. 1044 $payment_data['payment_source']['paypal']['address'] = $shipping_address;1051 1052 1045 1053 1046 1054 //Capture item on the cart; … … 1084 1092 } 1085 1093 1086 $exception = new Exception(__('An unexpected error occurred, please try again. If the error persists, contact. (#56)', "paypal-brasil-para-woocommerce")); 1094 $error_message = str_replace('"', '', $error_data['message']); 1095 $exception = new Exception(__("{$error_message} An unexpected error occurred, please try again. If the error persists, contact. (#56)", "paypal-brasil-para-woocommerce")); 1087 1096 $exception->data = $exception_data; 1088 1097 … … 1172 1181 if (!$only_digital_items) { 1173 1182 1174 if ( $shipping_method == 'local_pickup') {1183 if (isset($shipping_method) && $shipping_method == 'local_pickup') { 1175 1184 1176 1185 $shipping = array( … … 1185 1194 $payment_data['payment_source']['paypal']['experience_context']['shipping_preference'] = 'NO_SHIPPING'; 1186 1195 1196 $payment_data['purchase_units'][0] = array_merge($payment_data['purchase_units'][0], $shipping); 1197 1187 1198 } else { 1188 1199 … … 1190 1201 $shipping_address = $this->get_payer_address($data); 1191 1202 1192 $shipping = array( 1193 'shipping' => array( 1194 'type' => 'SHIPPING', 1195 'name' => array( 1196 'full_name' => $data['first_name'] . " " . $data['last_name'], 1197 ), 1198 'address' => $shipping_address 1199 ) 1200 ); 1203 if ($this->validate_address($shipping_address)) { 1204 1205 $shipping = array( 1206 'shipping' => array( 1207 'type' => 'SHIPPING', 1208 'name' => array( 1209 'full_name' => $data['first_name'] . " " . $data['last_name'], 1210 ), 1211 'address' => $shipping_address 1212 ) 1213 ); 1214 1215 $payment_data['purchase_units'][0] = array_merge($payment_data['purchase_units'][0], $shipping); 1216 } 1201 1217 1202 1218 $payment_data['payment_source']['paypal']['experience_context']['shipping_preference'] = 'SET_PROVIDED_ADDRESS'; … … 1204 1220 } 1205 1221 1206 $payment_data['purchase_units'][0] = array_merge($payment_data['purchase_units'][0], $shipping);1222 1207 1223 } 1208 1224 … … 1251 1267 } 1252 1268 1253 $exception = new Exception(__('An unexpected error occurred, please try again. If the error persists, please contact us. (#56)', "paypal-brasil-para-woocommerce")); 1269 $error_message = str_replace('"', '', $error_data['message']); 1270 $exception = new Exception(__("{$error_message} An unexpected error occurred, please try again. If the error persists, contact. (#56)", "paypal-brasil-para-woocommerce")); 1254 1271 $exception->data = $exception_data; 1255 1272 … … 1275 1292 // Add the address 1276 1293 if ($data['address']) { 1277 $address_line_1[] = $data['address'];1294 //$address_line_1[] = $data['address']; 1278 1295 } 1279 1296 // Add the number … … 1305 1322 1306 1323 return $shipping_address; 1324 } 1325 1326 public function validate_address(array $data): bool{ 1327 $adressFields = ['address', 'number','neighborhood', 'address_2','state', 'city', 'postcode', 'country','address_line_1','address_line_2']; 1328 $isValid = true; 1329 foreach ($adressFields as $value) { 1330 if (!isset($data[$value])) { 1331 $isValid = false; 1332 } 1333 } 1334 1335 return $isValid; 1307 1336 } 1308 1337 -
paypal-brasil-para-woocommerce/tags/1.5.5/includes/views/admin-options/admin-options-plus/admin-options-plus-template.php
r2931116 r3170993 26 26 </p> 27 27 </div> 28 <?php elseif ( ( ! empty( $_POST ) && $this->get_updated_values()['reference_enabled'] === 'yes' && get_option( $this->get_option_key() . '_reference_transaction_validator' ) === 'no' )29 || ( empty( $_POST ) && $this->reference_enabled === 'yes' && get_option( $this->get_option_key() . '_reference_transaction_validator' ) === 'no' ) ): ?>30 <div id="message" class="error inline">31 <p>32 <strong><?php _e( "It was not possible to activate the \"Save Digital Wallet\" functionality because we verified that your PayPal account does not have permission to use this product. Contact PayPal at 0800 721 6959 and request its release.","paypal-brasil-para-woocommerce" ); ?></strong>33 </p>34 </div>35 28 <?php endif; ?> 36 29 -
paypal-brasil-para-woocommerce/tags/1.5.5/paypal-brasil-para-woocommerce.php
r3154165 r3170993 4 4 * Plugin Name: PayPal Brasil para WooCommerce 5 5 * Description: Adicione facilmente opções de pagamento do PayPal à sua loja do WooCommerce. 6 * Version: 1.5. 46 * Version: 1.5.5 7 7 * Author: PayPal 8 8 * Author URI: https://paypal.com.br … … 30 30 // Define files. 31 31 define( 'PAYPAL_PAYMENTS_MAIN_FILE', __FILE__ ); 32 define( 'PAYPAL_PAYMENTS_VERSION', '1.5. 4' );32 define( 'PAYPAL_PAYMENTS_VERSION', '1.5.5' ); 33 33 define('WC_PAYPAL_PLUGIN_SLUG','paypal-brasil-para-woocommerce'); 34 34 -
paypal-brasil-para-woocommerce/tags/1.5.5/readme.txt
r3154165 r3170993 5 5 Requires at least: 4.4 6 6 Tested up to: 6.6.1 7 Stable tag: 1.5. 47 Stable tag: 1.5.5 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 90 90 91 91 == Changelog == 92 93 = 1.5.5 = 94 * Enhanced error messages for better clarity. 95 * Fixed undefined property error in PPP. 96 * Fixed frontend issue in transparent checkout. 92 97 93 98 = 1.5.4 = … … 222 227 == Upgrade Notice == 223 228 224 = 1.5.4 = 225 * Added new payment method to transparent checkout. 229 = 1.5.5 = 230 * Enhanced error messages for better clarity. 231 * Fixed undefined property error in PPP. 232 * Fixed frontend issue in transparent checkout. 226 233 227 234 == Screenshots == -
paypal-brasil-para-woocommerce/tags/1.5.5/vendor/composer/installed.php
r3154165 r3170993 4 4 'pretty_version' => 'dev-master', 5 5 'version' => 'dev-master', 6 'reference' => ' b87f3f2a3a2052775433547144500dd5e4743e08',6 'reference' => '6307aa68d452a619473e624a07e51aa3d6b81e5a', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-master', 15 15 'version' => 'dev-master', 16 'reference' => ' b87f3f2a3a2052775433547144500dd5e4743e08',16 'reference' => '6307aa68d452a619473e624a07e51aa3d6b81e5a', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../', -
paypal-brasil-para-woocommerce/trunk/assets/dist/js/frontend-bcdc.js
r3154165 r3170993 1 1 /*! For license information please see frontend-bcdc.js.LICENSE.txt */ 2 (()=>{"use strict";var e={"./src/frontend/frontend-bcdc/frontend-bcdc-api.ts":(e,t,a)=>{a.r(t),a.d(t,{paymentBCDC:()=>r});var n=a("./src/frontend/frontend-shared.ts");const r={create:e=>{if(e.errors)throw console.log("Erro"),new Error(e.errors);if(e.payment_id)return e.payment_id;throw new Error("An unexpected error occurred, please try again. If the error persists, please contact us. (#56)")},approve:e=>{jQuery("#paypal-bcdc-fields [name=paypal-brasil-bcdc-order-id]").val(e.orderID),jQuery("#paypal-bcdc-fields [name=paypal-brasil-bcdc-payer-id]").val(e.payerID),jQuery("#paypal-bcdc-fields [name=paypal-brasil-bcdc-pay-id]").val(e.paymentID),n.PaypalPayments.submitForm()},error:e=>{const t=jQuery("#wc-bcdc-brasil-api-error-data").val();if(t)n.PaypalPayments.triggerUpdateCheckout(),n.PaypalPayments.setNotices(JSON.parse(t)),n.PaypalPayments.scrollTop();else{var a='<ul class="woocommerce-error" role="alert"><li>'+e.message+"</li></ul>";n.PaypalPayments.triggerUpdateCheckout(),n.PaypalPayments.setNotices(a),n.PaypalPayments.scrollTop()}},cancel:()=>{n.PaypalPayments.triggerUpdateCheckout(),n.PaypalPayments.setNotices(paypal_brasil_bcdc_messages.cancel_message),n.PaypalPayments.scrollTop()}}},"./src/frontend/frontend-sdk/frontend-sdk-bcdc.ts":(e,t,a)=>{a.r(t),a.d(t,{importBcdcSdk:()=>r});var n=function(e,t,a,n){return new(a||(a=Promise))((function(r,o){function c(e){try{i(n.next(e))}catch(e){o(e)}}function l(e){try{i(n.throw(e))}catch(e){o(e)}}function i(e){var t;e.done?r(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(c,l)}i((n=n.apply(e,t||[])).next())}))};const r={handle(){return n(this,void 0,void 0,(function*(){const e=paypal_brasil_bcdc_settings.client_id,t=paypal_brasil_bcdc_settings.currency,a=paypal_brasil_bcdc_settings.locale,n=document.getElementById("paypal-sdk-script"),r=`https://www.paypal.com/sdk/js?client-id=${e}&components=buttons,funding-eligibility,marks,marks¤cy=${t}&locale=${a}`;if(n&&n.getAttribute("src")!==r||!n){const e=document.createElement("script");return e.id="paypal-sdk-script",e.async=!0,e.src=r,e.setAttribute("data-page-type","checkout"),document.head.appendChild(e),new Promise(((t,a)=>{e.onload=()=>{t()},e.onerror=e=>{console.error("Erro ao carregar o script do PayPal:",e),t()}}))}return Promise.resolve()}))}}},"./src/frontend/frontend-shared.ts":(e,t,a)=>{a.r(t),a.d(t,{PaypalPayments:()=>n});class n{static scrollTop(){jQuery("html, body").animate({scrollTop:0},300)}static setNotices(e){jQuery(".woocommerce-notices-wrapper:first").html(e)}static makeRequest(e,t){console.log(e);const a={async:!0,crossDomain:!0,url:n.replaceVars(paypal_brasil_settings.paypal_brasil_handler_url,{ACTION:e}),method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:JSON.stringify(t)};return jQuery.ajax(a)}static showDefaultButton(){jQuery("#paypal-brasil-button-container .paypal-submit-button-bcdc").hide(),jQuery("#paypal-brasil-button-container .paypal-submit-button").hide(),jQuery("#paypal-brasil-button-container .default-submit-button").show()}static showPaypalButton(){jQuery("#paypal-brasil-button-container .default-submit-button").hide(),jQuery("#paypal-brasil-button-container .paypal-submit-button-bcdc").hide(),jQuery("#paypal-brasil-button-container .paypal-submit-button").show()}static showPaypalBCDCButton(){jQuery("#paypal-brasil-button-container .default-submit-button").hide(),jQuery("#paypal-brasil-button-container .paypal-submit-button").hide(),jQuery("#paypal-brasil-button-container .paypal-submit-button-bcdc").show()}static isPaypalPaymentsSelected(){return!!jQuery("#payment_method_paypal-brasil-spb-gateway:checked").length}static isPaypalBCDCPaymentsSelected(){return!!jQuery("#payment_method_paypal-brasil-bcdc-gateway:checked").length}static triggerUpdateCheckout(){jQuery(document.body).trigger("update_checkout")}static triggerUpdateCart(){jQuery(document.body).trigger("wc_update_cart")}static submitForm(){jQuery("form.woocommerce-checkout, form#order_review").submit()}static submitFormCheckout(){jQuery("form.checkout.woocommerce-checkout").submit()}static replaceVars(e,t){let a=e;for(let e in t)t.hasOwnProperty(e)&&(a=a.replace(new RegExp("{"+e+"}","g"),t[e]));return a}}}},t={};function a(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,a),o.exports}a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{a.r({});var e=a("./src/frontend/frontend-shared.ts"),t=a("./src/frontend/frontend-bcdc/frontend-bcdc-api.ts"),n=a("./src/frontend/frontend-sdk/frontend-sdk-bcdc.ts"),r=function(e,t,a,n){return new(a||(a=Promise))((function(r,o){function c(e){try{i(n.next(e))}catch(e){o(e)}}function l(e){try{i(n.throw(e))}catch(e){o(e)}}function i(e){var t;e.done?r(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(c,l)}i((n=n.apply(e,t||[])).next())}))};class o extends e.PaypalPayments{constructor(){super(),this.sdkLoaded=!1,this.updateCheckout=(e=null)=>{e&&e.preventDefault(),this.triggerUpdateCheckout()},this.forceUpdateCheckout=(e=null)=>{e&&e.preventDefault(),jQuery(document.body).trigger("update_checkout")},this.triggerUpdateCheckout=this.debounce((()=>{this.forceUpdateCheckout()}),1e3),paypal_brasil_bcdc_settings.is_order_pay_page?this.initializeOrderPage():this.initializeCheckoutBcdc(),this.cartLabelTotal()}initializeOrderPage(){return r(this,void 0,void 0,(function*(){this.addPaypalBCDCButtonOnContainer(),this.renderPayPalButtonBcdc(),jQuery(document).on("updated_checkout","body",this.addPaypalBCDCButtonOnContainer),jQuery(document).on("updated_checkout","body",this.updateCheckoutButtonBcdc),jQuery("form#order_review").on("change","[name=payment_method],#payment_method_paypal-brasil-bcdc-gateway",this.updateCheckoutButtonBcdc),jQuery("form#order_review").on("change","[name=payment_method],#payment_method_paypal-brasil-bcdc-gateway",this.renderPayPalButtonBcdc),jQuery("form#order_review").on("change","[name=payment_method],#payment_method_paypal-brasil-bcdc-gateway",this.forceUpdateCheckout),this.listenInputChanges(),jQuery(document).on("updated_checkout","body",this.renderPayPalButtonBcdc)}))}initializeCheckoutBcdc(){return r(this,void 0,void 0,(function*(){jQuery(document).on("updated_checkout","body",this.addPaypalBCDCButtonOnContainer),jQuery(document).on("updated_checkout","body",this.updateCheckoutButtonBcdc),jQuery("form.woocommerce-checkout, form#order_review").on("change","[name=payment_method],#payment_method_paypal-brasil-bcdc-gateway",this.updateCheckoutButtonBcdc),jQuery("form.woocommerce-checkout, form#order_review").on("change","[name=payment_method],#payment_method_paypal-brasil-bcdc-gateway",this.renderPayPalButtonBcdc),jQuery("form.woocommerce-checkout, form#order_review").on("change","[name=payment_method],#payment_method_paypal-brasil-bcdc-gateway",this.forceUpdateCheckout),this.listenInputChanges(),jQuery(document).on("updated_checkout","body",this.renderPayPalButtonBcdc)}))}listenInputChanges(){jQuery(["[name=billing_first_name]","[name=billing_last_name]","[name=billing_cpf]","[name=billing_cnpj]","[name=billing_phone]","[name=billing_address_1]","[name=billing_number]","[name=billing_address_2]","[name=billing_neighborhood]","[name=billing_city]","[name=billing_state]","[name=billing_country]","[name=billing_email]"].join(",")).on("keyup",(()=>this.updateCheckout())),jQuery(["[name=billing_persontype]"].join(",")).on("change",(()=>this.updateCheckout()))}addPaypalBCDCButtonOnContainer(){if(!document.querySelector("#paypal-submit-button-bcdc")){var e=document.createElement("div"),t=document.createElement("div");e.className="paypal-submit-button-bcdc",t.id="paypal-button-bcdc";var a=document.querySelector("#paypal-brasil-button-container");a&&(a.appendChild(e),e.appendChild(t))}}updateCheckoutButtonBcdc(){e.PaypalPayments.isPaypalBCDCPaymentsSelected()?(e.PaypalPayments.showPaypalBCDCButton(),console.debug("bcdc change")):e.PaypalPayments.isPaypalPaymentsSelected()||(console.debug("default change"),e.PaypalPayments.showDefaultButton())}renderPayPalButtonBcdc(){return r(this,void 0,void 0,(function*(){var e=document.getElementById("payment_method_paypal-brasil-bcdc-gateway");if(e.checked){yield n.importBcdcSdk.handle();var a=document.getElementById("paypal-button-bcdc");if(a&&paypal_brasil_bcdc_settings.allowed_currency)a.innerHTML="",[paypal.FUNDING.CARD].forEach((e=>{const a=paypal.Buttons({style:{layout:"vertical",color:"black",shape:"pill",label:"paypal",size:"full",tagline:"false"},fundingSource:e,createOrder:()=>{var e,a=null!==(e=jQuery("#wc-bcdc-brasil-data").val())&&void 0!==e?e:null;try{if(a)return console.warn(a),a=JSON.parse(a),t.paymentBCDC.create(a)}catch(e){throw e}},onApprove:t.paymentBCDC.approve,onError:t.paymentBCDC.error,onCancel:t.paymentBCDC.cancel});a.isEligible()&&a.render("#paypal-button-bcdc")}))}else e.addEventListener("change",(function(){return r(this,void 0,void 0,(function*(){if(e.checked){yield n.importBcdcSdk.handle();var a=document.getElementById("paypal-button-bcdc");if(a&&paypal_brasil_bcdc_settings.allowed_currency)a.innerHTML="",[paypal.FUNDING.CARD].forEach((e=>r(this,void 0,void 0,(function*(){const a=paypal.Buttons({style:{layout:"vertical",color:"black",shape:"pill",label:"paypal",tagline:"false",size:"full"},fundingSource:e,createOrder:()=>{var e,a=null!==(e=jQuery("#wc-bcdc-brasil-data").val())&&void 0!==e?e:null;try{if(a)return console.warn(a),a=JSON.parse(a),t.paymentBCDC.create(a)}catch(e){throw e}},onApprove:t.paymentBCDC.approve,onError:t.paymentBCDC.error,onCancel:t.paymentBCDC.cancel});a.isEligible()&&a.render("#paypal-button-bcdc")}))))}}))}))}))}debounce(e,t,a=!1){let n;return function(){const r=this,o=arguments,c=a&&!n;clearTimeout(n),n=setTimeout((function(){n=null,a||e.apply(r,o)}),t),c&&e.apply(r,o)}}errorHandler(e){}cartLabelTotal(){if(paypal_brasil_bcdc_settings.is_order_pay_page){var e=document.querySelector("span.woocommerce-Price-currencySymbol") .textContent+" "+paypal_brasil_bcdc_order.order_pay_total;document.getElementById("bcdc-total-cart-label").textContent=e}else jQuery(document.body).on("updated_checkout",(function(){var e=document.querySelector("tr.order-total");if(e){var t=e.querySelector("span.woocommerce-Price-amount");if(t){var a=t.textContent;document.getElementById("bcdc-total-cart-label").textContent=a}}}))}}new o})(),a.r(n)})();2 (()=>{"use strict";var e={"./src/frontend/frontend-bcdc/frontend-bcdc-api.ts":(e,t,a)=>{a.r(t),a.d(t,{paymentBCDC:()=>r});var n=a("./src/frontend/frontend-shared.ts");const r={create:e=>{if(e.errors)throw console.log("Erro"),new Error(e.errors);if(e.payment_id)return e.payment_id;throw new Error("An unexpected error occurred, please try again. If the error persists, please contact us. (#56)")},approve:e=>{jQuery("#paypal-bcdc-fields [name=paypal-brasil-bcdc-order-id]").val(e.orderID),jQuery("#paypal-bcdc-fields [name=paypal-brasil-bcdc-payer-id]").val(e.payerID),jQuery("#paypal-bcdc-fields [name=paypal-brasil-bcdc-pay-id]").val(e.paymentID),n.PaypalPayments.submitForm()},error:e=>{const t=jQuery("#wc-bcdc-brasil-api-error-data").val();if(t)n.PaypalPayments.triggerUpdateCheckout(),n.PaypalPayments.setNotices(JSON.parse(t)),n.PaypalPayments.scrollTop();else{var a='<ul class="woocommerce-error" role="alert"><li>'+e.message+"</li></ul>";n.PaypalPayments.triggerUpdateCheckout(),n.PaypalPayments.setNotices(a),n.PaypalPayments.scrollTop()}},cancel:()=>{n.PaypalPayments.triggerUpdateCheckout(),n.PaypalPayments.setNotices(paypal_brasil_bcdc_messages.cancel_message),n.PaypalPayments.scrollTop()}}},"./src/frontend/frontend-sdk/frontend-sdk-bcdc.ts":(e,t,a)=>{a.r(t),a.d(t,{importBcdcSdk:()=>r});var n=function(e,t,a,n){return new(a||(a=Promise))((function(r,o){function c(e){try{i(n.next(e))}catch(e){o(e)}}function l(e){try{i(n.throw(e))}catch(e){o(e)}}function i(e){var t;e.done?r(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(c,l)}i((n=n.apply(e,t||[])).next())}))};const r={handle(){return n(this,void 0,void 0,(function*(){const e=paypal_brasil_bcdc_settings.client_id,t=paypal_brasil_bcdc_settings.currency,a=paypal_brasil_bcdc_settings.locale,n=document.getElementById("paypal-sdk-script"),r=`https://www.paypal.com/sdk/js?client-id=${e}&components=buttons,funding-eligibility,marks,marks¤cy=${t}&locale=${a}`;if(n&&n.getAttribute("src")!==r||!n){const e=document.createElement("script");return e.id="paypal-sdk-script",e.async=!0,e.src=r,e.setAttribute("data-page-type","checkout"),document.head.appendChild(e),new Promise(((t,a)=>{e.onload=()=>{t()},e.onerror=e=>{console.error("Erro ao carregar o script do PayPal:",e),t()}}))}return Promise.resolve()}))}}},"./src/frontend/frontend-shared.ts":(e,t,a)=>{a.r(t),a.d(t,{PaypalPayments:()=>n});class n{static scrollTop(){jQuery("html, body").animate({scrollTop:0},300)}static setNotices(e){jQuery(".woocommerce-notices-wrapper:first").html(e)}static makeRequest(e,t){console.log(e);const a={async:!0,crossDomain:!0,url:n.replaceVars(paypal_brasil_settings.paypal_brasil_handler_url,{ACTION:e}),method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:JSON.stringify(t)};return jQuery.ajax(a)}static showDefaultButton(){jQuery("#paypal-brasil-button-container .paypal-submit-button-bcdc").hide(),jQuery("#paypal-brasil-button-container .paypal-submit-button").hide(),jQuery("#paypal-brasil-button-container .default-submit-button").show()}static showPaypalButton(){jQuery("#paypal-brasil-button-container .default-submit-button").hide(),jQuery("#paypal-brasil-button-container .paypal-submit-button-bcdc").hide(),jQuery("#paypal-brasil-button-container .paypal-submit-button").show()}static showPaypalBCDCButton(){jQuery("#paypal-brasil-button-container .default-submit-button").hide(),jQuery("#paypal-brasil-button-container .paypal-submit-button").hide(),jQuery("#paypal-brasil-button-container .paypal-submit-button-bcdc").show()}static isPaypalPaymentsSelected(){return!!jQuery("#payment_method_paypal-brasil-spb-gateway:checked").length}static isPaypalBCDCPaymentsSelected(){return!!jQuery("#payment_method_paypal-brasil-bcdc-gateway:checked").length}static triggerUpdateCheckout(){jQuery(document.body).trigger("update_checkout")}static triggerUpdateCart(){jQuery(document.body).trigger("wc_update_cart")}static submitForm(){jQuery("form.woocommerce-checkout, form#order_review").submit()}static submitFormCheckout(){jQuery("form.checkout.woocommerce-checkout").submit()}static replaceVars(e,t){let a=e;for(let e in t)t.hasOwnProperty(e)&&(a=a.replace(new RegExp("{"+e+"}","g"),t[e]));return a}}}},t={};function a(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,a),o.exports}a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{a.r({});var e=a("./src/frontend/frontend-shared.ts"),t=a("./src/frontend/frontend-bcdc/frontend-bcdc-api.ts"),n=a("./src/frontend/frontend-sdk/frontend-sdk-bcdc.ts"),r=function(e,t,a,n){return new(a||(a=Promise))((function(r,o){function c(e){try{i(n.next(e))}catch(e){o(e)}}function l(e){try{i(n.throw(e))}catch(e){o(e)}}function i(e){var t;e.done?r(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(c,l)}i((n=n.apply(e,t||[])).next())}))};class o extends e.PaypalPayments{constructor(){super(),this.sdkLoaded=!1,this.updateCheckout=(e=null)=>{e&&e.preventDefault(),this.triggerUpdateCheckout()},this.forceUpdateCheckout=(e=null)=>{e&&e.preventDefault(),jQuery(document.body).trigger("update_checkout")},this.triggerUpdateCheckout=this.debounce((()=>{this.forceUpdateCheckout()}),1e3),paypal_brasil_bcdc_settings.is_order_pay_page?this.initializeOrderPage():this.initializeCheckoutBcdc(),this.cartLabelTotal()}initializeOrderPage(){return r(this,void 0,void 0,(function*(){this.addPaypalBCDCButtonOnContainer(),this.renderPayPalButtonBcdc(),jQuery(document).on("updated_checkout","body",this.addPaypalBCDCButtonOnContainer),jQuery(document).on("updated_checkout","body",this.updateCheckoutButtonBcdc),jQuery("form#order_review").on("change","[name=payment_method],#payment_method_paypal-brasil-bcdc-gateway",this.updateCheckoutButtonBcdc),jQuery("form#order_review").on("change","[name=payment_method],#payment_method_paypal-brasil-bcdc-gateway",this.renderPayPalButtonBcdc),jQuery("form#order_review").on("change","[name=payment_method],#payment_method_paypal-brasil-bcdc-gateway",this.forceUpdateCheckout),this.listenInputChanges(),jQuery(document).on("updated_checkout","body",this.renderPayPalButtonBcdc)}))}initializeCheckoutBcdc(){return r(this,void 0,void 0,(function*(){jQuery(document).on("updated_checkout","body",this.addPaypalBCDCButtonOnContainer),jQuery(document).on("updated_checkout","body",this.updateCheckoutButtonBcdc),jQuery("form.woocommerce-checkout, form#order_review").on("change","[name=payment_method],#payment_method_paypal-brasil-bcdc-gateway",this.updateCheckoutButtonBcdc),jQuery("form.woocommerce-checkout, form#order_review").on("change","[name=payment_method],#payment_method_paypal-brasil-bcdc-gateway",this.renderPayPalButtonBcdc),jQuery("form.woocommerce-checkout, form#order_review").on("change","[name=payment_method],#payment_method_paypal-brasil-bcdc-gateway",this.forceUpdateCheckout),this.listenInputChanges(),jQuery(document).on("updated_checkout","body",this.renderPayPalButtonBcdc)}))}listenInputChanges(){jQuery(["[name=billing_first_name]","[name=billing_last_name]","[name=billing_cpf]","[name=billing_cnpj]","[name=billing_phone]","[name=billing_address_1]","[name=billing_number]","[name=billing_address_2]","[name=billing_neighborhood]","[name=billing_city]","[name=billing_state]","[name=billing_country]","[name=billing_email]"].join(",")).on("keyup",(()=>this.updateCheckout())),jQuery(["[name=billing_persontype]"].join(",")).on("change",(()=>this.updateCheckout()))}addPaypalBCDCButtonOnContainer(){if(!document.querySelector("#paypal-submit-button-bcdc")){var e=document.createElement("div"),t=document.createElement("div");e.className="paypal-submit-button-bcdc",t.id="paypal-button-bcdc";var a=document.querySelector("#paypal-brasil-button-container");a&&(a.appendChild(e),e.appendChild(t))}}updateCheckoutButtonBcdc(){e.PaypalPayments.isPaypalBCDCPaymentsSelected()?(e.PaypalPayments.showPaypalBCDCButton(),console.debug("bcdc change")):e.PaypalPayments.isPaypalPaymentsSelected()||(console.debug("default change"),e.PaypalPayments.showDefaultButton())}renderPayPalButtonBcdc(){return r(this,void 0,void 0,(function*(){var e=document.getElementById("payment_method_paypal-brasil-bcdc-gateway");if(e.checked){yield n.importBcdcSdk.handle();var a=document.getElementById("paypal-button-bcdc");if(a&&paypal_brasil_bcdc_settings.allowed_currency)a.innerHTML="",[paypal.FUNDING.CARD].forEach((e=>{const a=paypal.Buttons({style:{layout:"vertical",color:"black",shape:"pill",label:"paypal",size:"full",tagline:"false"},fundingSource:e,createOrder:()=>{var e,a=null!==(e=jQuery("#wc-bcdc-brasil-data").val())&&void 0!==e?e:null;try{if(a)return console.warn(a),a=JSON.parse(a),t.paymentBCDC.create(a)}catch(e){throw e}},onApprove:t.paymentBCDC.approve,onError:t.paymentBCDC.error,onCancel:t.paymentBCDC.cancel});a.isEligible()&&a.render("#paypal-button-bcdc")}))}else e.addEventListener("change",(function(){return r(this,void 0,void 0,(function*(){if(e.checked){yield n.importBcdcSdk.handle();var a=document.getElementById("paypal-button-bcdc");if(a&&paypal_brasil_bcdc_settings.allowed_currency)a.innerHTML="",[paypal.FUNDING.CARD].forEach((e=>r(this,void 0,void 0,(function*(){const a=paypal.Buttons({style:{layout:"vertical",color:"black",shape:"pill",label:"paypal",tagline:"false",size:"full"},fundingSource:e,createOrder:()=>{var e,a=null!==(e=jQuery("#wc-bcdc-brasil-data").val())&&void 0!==e?e:null;try{if(a)return console.warn(a),a=JSON.parse(a),t.paymentBCDC.create(a)}catch(e){throw e}},onApprove:t.paymentBCDC.approve,onError:t.paymentBCDC.error,onCancel:t.paymentBCDC.cancel});a.isEligible()&&a.render("#paypal-button-bcdc")}))))}}))}))}))}debounce(e,t,a=!1){let n;return function(){const r=this,o=arguments,c=a&&!n;clearTimeout(n),n=setTimeout((function(){n=null,a||e.apply(r,o)}),t),c&&e.apply(r,o)}}errorHandler(e){}cartLabelTotal(){if(paypal_brasil_bcdc_settings.is_order_pay_page){var e=document.querySelector("span.woocommerce-Price-currencySymbol");if(e.textContent)var t=e.textContent+" "+paypal_brasil_bcdc_order.order_pay_total;t&&(document.getElementById("bcdc-total-cart-label").textContent=t)}else jQuery(document.body).on("updated_checkout",(function(){var e=document.querySelector("tr.order-total");if(e){var t=e.querySelector("span.woocommerce-Price-amount");if(t){var a=t.textContent;document.getElementById("bcdc-total-cart-label").textContent=a}}}))}}new o})(),a.r(n)})(); 3 3 //# sourceMappingURL=frontend-bcdc.js.map -
paypal-brasil-para-woocommerce/trunk/assets/dist/js/frontend-bcdc.js.map
r3154165 r3170993 1 {"version":3,"file":"js/frontend-bcdc.js","mappings":";uKACO,MAAMA,EAAc,CACvBC,OAASC,IACL,GAAIA,EAAmBC,OAEnB,MADAC,QAAQC,IAAI,QACN,IAAIC,MAAMJ,EAAmBC,QAEvC,GAAID,EAAmBK,WACnB,OAAOL,EAAmBK,WAG1B,MAAM,IAAID,MAAM,kGACpB,EAEJE,QAAUC,IACNC,OAAO,0DAA0DC,IAAIF,EAAKG,SAC1EF,OAAO,0DAA0DC,IAAIF,EAAKI,SAC1EH,OAAO,wDAAwDC,IAAIF,EAAKK,WACxE,EAAAC,eAAeC,YAAY,EAE/BC,MAAQC,IACJ,MAAMC,EAAeT,OAAO,kCAAkCC,MAC9D,GAAIQ,EACA,EAAAJ,eAAeK,wBACf,EAAAL,eAAeM,WAAWC,KAAKC,MAAMJ,IACrC,EAAAJ,eAAeS,gBAEd,CACD,IAAIC,EAAS,kDACTP,EAASQ,QACT,aACJ,EAAAX,eAAeK,wBACf,EAAAL,eAAeM,WAAWI,GAC1B,EAAAV,eAAeS,WACnB,GAEJG,OAAQ,KAEJ,EAAAZ,eAAeK,w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AMC,GAAY,GAC7B,IAAIC,EACJ,OAAO,WACH,MAAMC,EAAUxI,KACVyI,EAAOC,UAMPC,EAAUL,IAAcC,EAC9BK,aAAaL,GACbA,EAAUM,YAPI,WACVN,EAAU,KACLD,GACDF,EAAKvI,MAAM2I,EAASC,EAC5B,GAG4BJ,GACxBM,GACAP,EAAKvI,MAAM2I,EAASC,EAC5B,CACJ,CACA,YAAAK,CAAatK,GAAW,CACxB,cAAAmH,GACI,GAAIzF,4BAA4BsF,kBAAmB,CAC/C,IA CIuD,EADiBxI,SAAS2F,cAAc,yCACZ8C,YAC5B,IACAC,yBAAyBC,gBAC7B3I,SAASC,eAAe,yBAAyBwI,YAAcD,CACnE,MAEIvL,OAAO+C,SAASqC,MAAMkD,GAAG,oBAAoB,WACzC,IAAIqD,EAAgB5I,SAAS2F,cAAc,kBAE3C,GAAIiD,EAAe,CAEf,IAAIC,EAAkBD,EAAcjD,cAAc,iCAElD,GAAIkD,EAAiB,CAEjB,IAAIC,EAAkBD,EAAgBJ,YACtCzI,SAASC,eAAe,yBAAyBwI,YAC7CK,CACR,CACJ,CACJ,GAER,EAEJ,IAAItE","sources":["webpack://paypal-brasil-para-woocommerce/./src/frontend/frontend-bcdc/frontend-bcdc-api.ts","webpack://paypal-brasil-para-woocommerce/./src/frontend/frontend-sdk/frontend-sdk-bcdc.ts","webpack://paypal-brasil-para-woocommerce/./src/frontend/frontend-shared.ts","webpack://paypal-brasil-para-woocommerce/webpack/bootstrap","webpack://paypal-brasil-para-woocommerce/webpack/runtime/define property getters","webpack://paypal-brasil-para-woocommerce/webpack/runtime/hasOwnProperty shorthand","webpack://paypal-brasil-para-woocommerce/webpack/runtime/make namespace object","webpack://paypal-brasil-para-woocommerce/./src/frontend/frontend-bcdc/frontend-bcdc.ts"],"names":["paymentBCDC","create","paymentCreatedData","errors","console","log","Error","payment_id","approve","data","jQuery","val","orderID","payerID","paymentID","PaypalPayments","submitForm","error","response","phpErrorData","triggerUpdateCheckout","setNotices","JSON","parse","scrollTop","notice","message","cancel","paypal_brasil_bcdc_messages","cancel_message","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","apply","importBcdcSdk","handle","this","clientId","paypal_brasil_bcdc_settings","client_id","currency","locale","existingScript","document","getElementById","src","getAttribute","script","createElement","id","async","setAttribute","head","appendChild","onload","onerror","animate","html","makeRequest","action","settings","crossDomain","url","replaceVars","paypal_brasil_settings","paypal_brasil_handler_url","ACTION","method","dataType","contentType","stringify","ajax","showDefaultButton","hide","show","showPaypalButton","showPaypalBCDCButton","isPaypalPaymentsSelected","length","isPaypalBCDCPaymentsSelected","body","trigger","triggerUpdateCart","submit","submitFormCheckout","str","replaces","replacedStr","property","hasOwnProperty","replace","RegExp","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","call","r","Symbol","toStringTag","PaypalPaymentsBCDC","constructor","super","sdkLoaded","updateCheckout","event","preventDefault","forceUpdateCheckout","debounce","is_order_pay_page","initializeOrderPage","initializeCheckoutBcdc","cartLabelTotal","addPaypalBCDCButtonOnContainer","renderPayPalButtonBcdc","on","updateCheckoutButtonBcdc","listenInputChanges","join","querySelector","submitDiv","butttonDiv","className","parentElement","debug","paymentRadio","checked","paypalButton","allowed_currency","innerHTML","paypal","FUNDING","CARD","forEach","fundingSource","button","Buttons","style","layout","color","shape","label","size","tagline","createOrder","_a","warn","onApprove","onError","onCancel","isEligible","render","addEventListener","func","wait","immediate","timeout","context","args","arguments","callNow","clearTimeout","setTimeout","errorHandler","orderTotal","textContent","paypal_brasil_bcdc_order","order_pay_total","orderTotalRow","priceAmountSpan","priceAmountText"],"sourceRoot":""}1 {"version":3,"file":"js/frontend-bcdc.js","mappings":";uKACO,MAAMA,EAAc,CACvBC,OAASC,IACL,GAAIA,EAAmBC,OAEnB,MADAC,QAAQC,IAAI,QACN,IAAIC,MAAMJ,EAAmB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AASC,eAAe,yBAAyBwI,YAC7CM,CACR,CACJ,CACJ,GAER,EAEJ,IAAIvE","sources":["webpack://paypal-brasil-para-woocommerce/./src/frontend/frontend-bcdc/frontend-bcdc-api.ts","webpack://paypal-brasil-para-woocommerce/./src/frontend/frontend-sdk/frontend-sdk-bcdc.ts","webpack://paypal-brasil-para-woocommerce/./src/frontend/frontend-shared.ts","webpack://paypal-brasil-para-woocommerce/webpack/bootstrap","webpack://paypal-brasil-para-woocommerce/webpack/runtime/define property getters","webpack://paypal-brasil-para-woocommerce/webpack/runtime/hasOwnProperty shorthand","webpack://paypal-brasil-para-woocommerce/webpack/runtime/make namespace object","webpack://paypal-brasil-para-woocommerce/./src/frontend/frontend-bcdc/frontend-bcdc.ts"],"names":["paymentBCDC","create","paymentCreatedData","errors","console","log","Error","payment_id","approve","data","jQuery","val","orderID","payerID","paymentID","PaypalPayments","submitForm","error","response","phpErrorData","triggerUpdateCheckout","setNotices","JSON","parse","scrollTop","notice","message","cancel","paypal_brasil_bcdc_messages","cancel_message","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","apply","importBcdcSdk","handle","this","clientId","paypal_brasil_bcdc_settings","client_id","currency","locale","existingScript","document","getElementById","src","getAttribute","script","createElement","id","async","setAttribute","head","appendChild","onload","onerror","animate","html","makeRequest","action","settings","crossDomain","url","replaceVars","paypal_brasil_settings","paypal_brasil_handler_url","ACTION","method","dataType","contentType","stringify","ajax","showDefaultButton","hide","show","showPaypalButton","showPaypalBCDCButton","isPaypalPaymentsSelected","length","isPaypalBCDCPaymentsSelected","body","trigger","triggerUpdateCart","submit","submitFormCheckout","str","replaces","replacedStr","property","hasOwnProperty","replace","RegExp","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","call","r","Symbol","toStringTag","PaypalPaymentsBCDC","constructor","super","sdkLoaded","updateCheckout","event","preventDefault","forceUpdateCheckout","debounce","is_order_pay_page","initializeOrderPage","initializeCheckoutBcdc","cartLabelTotal","addPaypalBCDCButtonOnContainer","renderPayPalButtonBcdc","on","updateCheckoutButtonBcdc","listenInputChanges","join","querySelector","submitDiv","butttonDiv","className","parentElement","debug","paymentRadio","checked","paypalButton","allowed_currency","innerHTML","paypal","FUNDING","CARD","forEach","fundingSource","button","Buttons","style","layout","color","shape","label","size","tagline","createOrder","_a","warn","onApprove","onError","onCancel","isEligible","render","addEventListener","func","wait","immediate","timeout","context","args","arguments","callNow","clearTimeout","setTimeout","errorHandler","currencySymbol","textContent","orderTotal","paypal_brasil_bcdc_order","order_pay_total","orderTotalRow","priceAmountSpan","priceAmountText"],"sourceRoot":""} -
paypal-brasil-para-woocommerce/trunk/includes/payment-methods/class-paypal-brasil-bcdc-gateway.php
r3154165 r3170993 87 87 self::$instance = $this; 88 88 89 add_action('woocommerce_checkout_show_terms', array($this,'disable_checkout_terms_and_conditions'), 10 );89 //add_action('woocommerce_checkout_show_terms', array($this,'disable_checkout_terms_and_conditions'), 10 ); 90 90 } 91 91 … … 1003 1003 if (!$only_digital_items) { 1004 1004 1005 if ( $shipping_method == 'local_pickup') {1005 if (isset($shipping_method) && $shipping_method == 'local_pickup') { 1006 1006 1007 1007 $shipping = array( … … 1015 1015 1016 1016 $payment_data['payment_source']['paypal']['experience_context']['shipping_preference'] = 'NO_SHIPPING'; 1017 $payment_data['purchase_units'][0] = array_merge($payment_data['purchase_units'][0], $shipping); 1017 1018 1018 1019 } else { … … 1021 1022 $shipping_address = $this->get_payer_address($data); 1022 1023 1023 $shipping = array( 1024 'shipping' => array( 1025 'type' => 'SHIPPING', 1026 'name' => array( 1027 'full_name' => $data['first_name'] . " " . $data['last_name'], 1028 ), 1029 'address' => $shipping_address 1030 ) 1031 ); 1024 if ($this->validate_address($shipping_address)) { 1025 $shipping = array( 1026 'shipping' => array( 1027 'type' => 'SHIPPING', 1028 'name' => array( 1029 'full_name' => $data['first_name'] . " " . $data['last_name'], 1030 ), 1031 'address' => $shipping_address 1032 ) 1033 ); 1034 1035 $payment_data['payment_source']['paypal']['address'] = $shipping_address; 1036 1037 $payment_data['purchase_units'][0] = array_merge($payment_data['purchase_units'][0], $shipping); 1038 } 1039 1040 1032 1041 1033 1042 $payment_data['payment_source']['paypal']['experience_context']['shipping_preference'] = 'SET_PROVIDED_ADDRESS'; … … 1035 1044 } 1036 1045 1037 $payment_data['purchase_units'][0] = array_merge($payment_data['purchase_units'][0], $shipping);1038 1046 } 1039 1047 … … 1041 1049 1042 1050 $payment_data['payment_source']['paypal'] = $this->get_payer_info($data); 1043 //Info Payer address data. 1044 $payment_data['payment_source']['paypal']['address'] = $shipping_address;1051 1052 1045 1053 1046 1054 //Capture item on the cart; … … 1084 1092 } 1085 1093 1086 $exception = new Exception(__('An unexpected error occurred, please try again. If the error persists, contact. (#56)', "paypal-brasil-para-woocommerce")); 1094 $error_message = str_replace('"', '', $error_data['message']); 1095 $exception = new Exception(__("{$error_message} An unexpected error occurred, please try again. If the error persists, contact. (#56)", "paypal-brasil-para-woocommerce")); 1087 1096 $exception->data = $exception_data; 1088 1097 … … 1172 1181 if (!$only_digital_items) { 1173 1182 1174 if ( $shipping_method == 'local_pickup') {1183 if (isset($shipping_method) && $shipping_method == 'local_pickup') { 1175 1184 1176 1185 $shipping = array( … … 1185 1194 $payment_data['payment_source']['paypal']['experience_context']['shipping_preference'] = 'NO_SHIPPING'; 1186 1195 1196 $payment_data['purchase_units'][0] = array_merge($payment_data['purchase_units'][0], $shipping); 1197 1187 1198 } else { 1188 1199 … … 1190 1201 $shipping_address = $this->get_payer_address($data); 1191 1202 1192 $shipping = array( 1193 'shipping' => array( 1194 'type' => 'SHIPPING', 1195 'name' => array( 1196 'full_name' => $data['first_name'] . " " . $data['last_name'], 1197 ), 1198 'address' => $shipping_address 1199 ) 1200 ); 1203 if ($this->validate_address($shipping_address)) { 1204 1205 $shipping = array( 1206 'shipping' => array( 1207 'type' => 'SHIPPING', 1208 'name' => array( 1209 'full_name' => $data['first_name'] . " " . $data['last_name'], 1210 ), 1211 'address' => $shipping_address 1212 ) 1213 ); 1214 1215 $payment_data['purchase_units'][0] = array_merge($payment_data['purchase_units'][0], $shipping); 1216 } 1201 1217 1202 1218 $payment_data['payment_source']['paypal']['experience_context']['shipping_preference'] = 'SET_PROVIDED_ADDRESS'; … … 1204 1220 } 1205 1221 1206 $payment_data['purchase_units'][0] = array_merge($payment_data['purchase_units'][0], $shipping);1222 1207 1223 } 1208 1224 … … 1251 1267 } 1252 1268 1253 $exception = new Exception(__('An unexpected error occurred, please try again. If the error persists, please contact us. (#56)', "paypal-brasil-para-woocommerce")); 1269 $error_message = str_replace('"', '', $error_data['message']); 1270 $exception = new Exception(__("{$error_message} An unexpected error occurred, please try again. If the error persists, contact. (#56)", "paypal-brasil-para-woocommerce")); 1254 1271 $exception->data = $exception_data; 1255 1272 … … 1275 1292 // Add the address 1276 1293 if ($data['address']) { 1277 $address_line_1[] = $data['address'];1294 //$address_line_1[] = $data['address']; 1278 1295 } 1279 1296 // Add the number … … 1305 1322 1306 1323 return $shipping_address; 1324 } 1325 1326 public function validate_address(array $data): bool{ 1327 $adressFields = ['address', 'number','neighborhood', 'address_2','state', 'city', 'postcode', 'country','address_line_1','address_line_2']; 1328 $isValid = true; 1329 foreach ($adressFields as $value) { 1330 if (!isset($data[$value])) { 1331 $isValid = false; 1332 } 1333 } 1334 1335 return $isValid; 1307 1336 } 1308 1337 -
paypal-brasil-para-woocommerce/trunk/includes/views/admin-options/admin-options-plus/admin-options-plus-template.php
r2931116 r3170993 26 26 </p> 27 27 </div> 28 <?php elseif ( ( ! empty( $_POST ) && $this->get_updated_values()['reference_enabled'] === 'yes' && get_option( $this->get_option_key() . '_reference_transaction_validator' ) === 'no' )29 || ( empty( $_POST ) && $this->reference_enabled === 'yes' && get_option( $this->get_option_key() . '_reference_transaction_validator' ) === 'no' ) ): ?>30 <div id="message" class="error inline">31 <p>32 <strong><?php _e( "It was not possible to activate the \"Save Digital Wallet\" functionality because we verified that your PayPal account does not have permission to use this product. Contact PayPal at 0800 721 6959 and request its release.","paypal-brasil-para-woocommerce" ); ?></strong>33 </p>34 </div>35 28 <?php endif; ?> 36 29 -
paypal-brasil-para-woocommerce/trunk/paypal-brasil-para-woocommerce.php
r3154165 r3170993 4 4 * Plugin Name: PayPal Brasil para WooCommerce 5 5 * Description: Adicione facilmente opções de pagamento do PayPal à sua loja do WooCommerce. 6 * Version: 1.5. 46 * Version: 1.5.5 7 7 * Author: PayPal 8 8 * Author URI: https://paypal.com.br … … 30 30 // Define files. 31 31 define( 'PAYPAL_PAYMENTS_MAIN_FILE', __FILE__ ); 32 define( 'PAYPAL_PAYMENTS_VERSION', '1.5. 4' );32 define( 'PAYPAL_PAYMENTS_VERSION', '1.5.5' ); 33 33 define('WC_PAYPAL_PLUGIN_SLUG','paypal-brasil-para-woocommerce'); 34 34 -
paypal-brasil-para-woocommerce/trunk/readme.txt
r3154165 r3170993 5 5 Requires at least: 4.4 6 6 Tested up to: 6.6.1 7 Stable tag: 1.5. 47 Stable tag: 1.5.5 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 90 90 91 91 == Changelog == 92 93 = 1.5.5 = 94 * Enhanced error messages for better clarity. 95 * Fixed undefined property error in PPP. 96 * Fixed frontend issue in transparent checkout. 92 97 93 98 = 1.5.4 = … … 222 227 == Upgrade Notice == 223 228 224 = 1.5.4 = 225 * Added new payment method to transparent checkout. 229 = 1.5.5 = 230 * Enhanced error messages for better clarity. 231 * Fixed undefined property error in PPP. 232 * Fixed frontend issue in transparent checkout. 226 233 227 234 == Screenshots == -
paypal-brasil-para-woocommerce/trunk/vendor/composer/installed.php
r3154165 r3170993 4 4 'pretty_version' => 'dev-master', 5 5 'version' => 'dev-master', 6 'reference' => ' b87f3f2a3a2052775433547144500dd5e4743e08',6 'reference' => '6307aa68d452a619473e624a07e51aa3d6b81e5a', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-master', 15 15 'version' => 'dev-master', 16 'reference' => ' b87f3f2a3a2052775433547144500dd5e4743e08',16 'reference' => '6307aa68d452a619473e624a07e51aa3d6b81e5a', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.