Changeset 3418263
- Timestamp:
- 12/12/2025 12:47:18 PM (39 hours ago)
- Location:
- finix-for-woocommerce
- Files:
-
- 107 added
- 36 edited
-
tags/1.4.0 (added)
-
tags/1.4.0/assets (added)
-
tags/1.4.0/assets/css (added)
-
tags/1.4.0/assets/css/block-checkout.css (added)
-
tags/1.4.0/assets/css/block-checkout.min.css (added)
-
tags/1.4.0/assets/css/finix-admin.css (added)
-
tags/1.4.0/assets/css/finix-admin.min.css (added)
-
tags/1.4.0/assets/css/shortcode-checkout.css (added)
-
tags/1.4.0/assets/css/shortcode-checkout.min.css (added)
-
tags/1.4.0/assets/images (added)
-
tags/1.4.0/assets/images/all-methods.svg (added)
-
tags/1.4.0/assets/images/apple-pay.svg (added)
-
tags/1.4.0/assets/images/bank.svg (added)
-
tags/1.4.0/assets/images/cards.svg (added)
-
tags/1.4.0/assets/images/finix-logo.svg (added)
-
tags/1.4.0/assets/images/finix-squared.svg (added)
-
tags/1.4.0/assets/images/google-pay.svg (added)
-
tags/1.4.0/assets/js (added)
-
tags/1.4.0/assets/js/admin-apple-pay.js (added)
-
tags/1.4.0/assets/js/admin-apple-pay.min.js (added)
-
tags/1.4.0/assets/js/block (added)
-
tags/1.4.0/assets/js/block/build (added)
-
tags/1.4.0/assets/js/block/build/apple-pay.asset.php (added)
-
tags/1.4.0/assets/js/block/build/apple-pay.js (added)
-
tags/1.4.0/assets/js/block/build/bank.asset.php (added)
-
tags/1.4.0/assets/js/block/build/bank.js (added)
-
tags/1.4.0/assets/js/block/build/card.asset.php (added)
-
tags/1.4.0/assets/js/block/build/card.js (added)
-
tags/1.4.0/assets/js/block/build/google-pay.asset.php (added)
-
tags/1.4.0/assets/js/block/build/google-pay.js (added)
-
tags/1.4.0/assets/js/finix-google-pay.js (added)
-
tags/1.4.0/assets/js/finix-google-pay.min.js (added)
-
tags/1.4.0/assets/js/finix-helpers.js (added)
-
tags/1.4.0/assets/js/finix-helpers.min.js (added)
-
tags/1.4.0/assets/js/shortcode-apple-pay.js (added)
-
tags/1.4.0/assets/js/shortcode-apple-pay.min.js (added)
-
tags/1.4.0/assets/js/shortcode-card-bank.js (added)
-
tags/1.4.0/assets/js/shortcode-card-bank.min.js (added)
-
tags/1.4.0/assets/js/shortcode-google-pay.js (added)
-
tags/1.4.0/assets/js/shortcode-google-pay.min.js (added)
-
tags/1.4.0/assets/languages (added)
-
tags/1.4.0/assets/languages/finix-for-woocommerce.pot (added)
-
tags/1.4.0/composer.json (added)
-
tags/1.4.0/finix-for-woocommerce.php (added)
-
tags/1.4.0/readme.txt (added)
-
tags/1.4.0/src (added)
-
tags/1.4.0/src/Admin (added)
-
tags/1.4.0/src/Admin/Admin.php (added)
-
tags/1.4.0/src/Events (added)
-
tags/1.4.0/src/Events/AchPaymentProcessedEvent.php (added)
-
tags/1.4.0/src/Events/AchReturnEvent.php (added)
-
tags/1.4.0/src/Events/ApplePayPaymentCompletedEvent.php (added)
-
tags/1.4.0/src/Events/ApplePayPaymentEvent.php (added)
-
tags/1.4.0/src/Events/ApplePayRegisterDomain.php (added)
-
tags/1.4.0/src/Events/ApplePaySessionEvent.php (added)
-
tags/1.4.0/src/Events/CardAchPaymentEvent.php (added)
-
tags/1.4.0/src/Events/DisputeEvent.php (added)
-
tags/1.4.0/src/Events/Event.php (added)
-
tags/1.4.0/src/Events/GooglePayPaymentCompletedEvent.php (added)
-
tags/1.4.0/src/Events/GooglePayPaymentEvent.php (added)
-
tags/1.4.0/src/Events/RefundEvent.php (added)
-
tags/1.4.0/src/Finix (added)
-
tags/1.4.0/src/Finix/API.php (added)
-
tags/1.4.0/src/Finix/ApplePay.php (added)
-
tags/1.4.0/src/Finix/BuyerIdentity.php (added)
-
tags/1.4.0/src/Finix/Endpoint.php (added)
-
tags/1.4.0/src/Finix/InstrumentToken.php (added)
-
tags/1.4.0/src/Finix/Tags.php (added)
-
tags/1.4.0/src/Finix/Transfer.php (added)
-
tags/1.4.0/src/Gateways (added)
-
tags/1.4.0/src/Gateways/ApplePayGateway.php (added)
-
tags/1.4.0/src/Gateways/BankGateway.php (added)
-
tags/1.4.0/src/Gateways/CardBankGateway.php (added)
-
tags/1.4.0/src/Gateways/CardGateway.php (added)
-
tags/1.4.0/src/Gateways/FinixGateway.php (added)
-
tags/1.4.0/src/Gateways/GooglePayGateway.php (added)
-
tags/1.4.0/src/Gateways/PaymentMethods (added)
-
tags/1.4.0/src/Gateways/PaymentMethods/ApplePay.php (added)
-
tags/1.4.0/src/Gateways/PaymentMethods/BankMethod.php (added)
-
tags/1.4.0/src/Gateways/PaymentMethods/CardBankMethod.php (added)
-
tags/1.4.0/src/Gateways/PaymentMethods/CardMethod.php (added)
-
tags/1.4.0/src/Gateways/PaymentMethods/FinixMethod.php (added)
-
tags/1.4.0/src/Gateways/PaymentMethods/GooglePay.php (added)
-
tags/1.4.0/src/Helpers (added)
-
tags/1.4.0/src/Helpers/Assets.php (added)
-
tags/1.4.0/src/Helpers/CartData.php (added)
-
tags/1.4.0/src/Helpers/Check.php (added)
-
tags/1.4.0/src/Helpers/Convert.php (added)
-
tags/1.4.0/src/Helpers/URL.php (added)
-
tags/1.4.0/src/Options.php (added)
-
tags/1.4.0/src/Payments.php (added)
-
tags/1.4.0/src/Plugin.php (added)
-
tags/1.4.0/uninstall.php (added)
-
tags/1.4.0/vendor (added)
-
tags/1.4.0/vendor/autoload.php (added)
-
tags/1.4.0/vendor/composer (added)
-
tags/1.4.0/vendor/composer/ClassLoader.php (added)
-
tags/1.4.0/vendor/composer/InstalledVersions.php (added)
-
tags/1.4.0/vendor/composer/LICENSE (added)
-
tags/1.4.0/vendor/composer/autoload_classmap.php (added)
-
tags/1.4.0/vendor/composer/autoload_namespaces.php (added)
-
tags/1.4.0/vendor/composer/autoload_psr4.php (added)
-
tags/1.4.0/vendor/composer/autoload_real.php (added)
-
tags/1.4.0/vendor/composer/autoload_static.php (added)
-
tags/1.4.0/vendor/composer/installed.json (added)
-
tags/1.4.0/vendor/composer/installed.php (added)
-
trunk/assets/js/block/build/bank.asset.php (modified) (1 diff)
-
trunk/assets/js/block/build/bank.js (modified) (1 diff)
-
trunk/assets/js/block/build/card.asset.php (modified) (1 diff)
-
trunk/assets/js/block/build/card.js (modified) (1 diff)
-
trunk/assets/js/block/build/google-pay.asset.php (modified) (1 diff)
-
trunk/assets/js/block/build/google-pay.js (modified) (1 diff)
-
trunk/assets/js/finix-google-pay.js (modified) (1 diff)
-
trunk/assets/js/finix-google-pay.min.js (modified) (1 diff)
-
trunk/assets/js/shortcode-card-bank.js (modified) (1 diff)
-
trunk/assets/js/shortcode-card-bank.min.js (modified) (1 diff)
-
trunk/assets/js/shortcode-google-pay.js (modified) (2 diffs)
-
trunk/assets/js/shortcode-google-pay.min.js (modified) (1 diff)
-
trunk/assets/languages/finix-for-woocommerce.pot (modified) (23 diffs)
-
trunk/composer.json (added)
-
trunk/finix-for-woocommerce.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (7 diffs)
-
trunk/src/Admin/Admin.php (modified) (2 diffs)
-
trunk/src/Events/ApplePayPaymentCompletedEvent.php (modified) (5 diffs)
-
trunk/src/Events/ApplePayPaymentEvent.php (modified) (1 diff)
-
trunk/src/Events/CardAchPaymentEvent.php (modified) (7 diffs)
-
trunk/src/Events/GooglePayPaymentCompletedEvent.php (modified) (5 diffs)
-
trunk/src/Events/GooglePayPaymentEvent.php (modified) (1 diff)
-
trunk/src/Gateways/ApplePayGateway.php (modified) (7 diffs)
-
trunk/src/Gateways/BankGateway.php (modified) (1 diff)
-
trunk/src/Gateways/CardBankGateway.php (modified) (4 diffs)
-
trunk/src/Gateways/CardGateway.php (modified) (1 diff)
-
trunk/src/Gateways/FinixGateway.php (modified) (7 diffs)
-
trunk/src/Gateways/GooglePayGateway.php (modified) (10 diffs)
-
trunk/src/Gateways/PaymentMethods/ApplePay.php (modified) (3 diffs)
-
trunk/src/Gateways/PaymentMethods/CardBankMethod.php (modified) (2 diffs)
-
trunk/src/Gateways/PaymentMethods/GooglePay.php (modified) (4 diffs)
-
trunk/src/Helpers/CartData.php (modified) (1 diff)
-
trunk/src/Helpers/URL.php (modified) (2 diffs)
-
trunk/src/Payments.php (modified) (3 diffs)
-
trunk/src/Plugin.php (modified) (3 diffs)
-
trunk/vendor/composer/autoload_static.php (modified) (2 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
finix-for-woocommerce/trunk/assets/js/block/build/bank.asset.php
r3375717 r3418263 1 <?php return array('dependencies' => array('react-jsx-runtime', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-settings', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => ' 3e642aa3fde434ddffe3');1 <?php return array('dependencies' => array('react-jsx-runtime', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-settings', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => 'ec1d57eff57dea20cade'); -
finix-for-woocommerce/trunk/assets/js/block/build/bank.js
r3375717 r3418263 1 (()=>{"use strict";const e=window.wp.i18n,t=window.wp.element,o=window.wc.wcBlocksRegistry,n=window.wp.htmlEntities,r=window.wc.wcSettings,s=window.wc.wcBlocksData,i=window.wp.data,a=window.ReactJSXRuntime,c="finix_bank_gateway",d=(0,r.getSetting)("finix_bank_gateway_data",{}),l=(0,n.decodeEntities)(d.title)||(0,e.__)("Pay with Bank","finix-for-woocommerce"),m=e=>{const{PaymentMethodLabel:o}=e.components,n=()=>(0,t.createElement)("img",{src:d.icon});return(0,a.jsx)(o,{text:l,icon:(0,a.jsx)(n,{})})},u=o=>{const{activePaymentMethod:n,eventRegistration:r,emitResponse:a}=o,{onPaymentSetup:l,onCheckoutFail:m}=r,[u,f]=(0,t.useState)(null),[p,w]=(0,t.useState)(""),[_,y]=(0,t.useState)(""),{totals:h}=(0,i.useSelect)(e=>e(s.cartStore).getCartData(),[]),[b,g]=(0,t.useState)("");(0,t.useEffect)(()=>{g("CAD"===h.currency_code?d.merchant:d.merchant_cad)},[h]),(0,t.useEffect)(()=>{y("")},[m]),(0,t.useEffect)(()=>{const t=jQuery("input#billing-city, input#shipping-city"),o={showAddress:d.finix_form_options.showAddress||!0,showLabels:d.finix_form_options.showLabels||!0,labels:d.finix_form_options.labels||{name:(0,e.__)("Full Name","finix-for-woocommerce")},showPlaceholders:d.finix_form_options.showPlaceholders||!0,placeholders:d.finix_form_options.placeholders||{name:d.text.full_name}, hideFields:d.finix_form_options.hideFields||["address_line1","address_line2","address_city","address_state"],requiredFields:d.finix_form_options.requiredFields||["name","address_country","address_postal_code"],hideErrorMessages:d.finix_form_options.hideErrorMessages||!1,errorMessages:d.finix_form_options.errorMessages||{name:(0,e.__)("Please enter a valid name","finix-for-woocommerce"),address_city:(0,e.__)("Please enter a valid city","finix-for-woocommerce")},styles:{default:{color:t.css("color"),backgroundColor:t.css("background-color"),border:`${t.css("border-width")} ${t.css("border-style")} ${t.css("border-color")}`,borderRadius:`${t.css("border-top-left-radius")} ${t.css("border-top-right-radius")} ${t.css("border-bottom-right-radius")} ${t.css("border-bottom-left-radius")}`,fontFamily:t.css("font-family"),fontWeight:t.css("font-weight"),lineHeight:t.css("line-height"),boxShadow:t.css("box-shadow"),maxHeight:"100%",appearance:"auto"},success:{},error:{color:"#d9534f",border:"1px solid rgba(255,0,0, 0.3)"}},onUpdate(e,t,o){},onLoad(){}};window.Finix.Auth(d.environment,b,e=>{w(e)});const n=c+"-form",r=(t,s=null)=>{t>4?document.getElementById(n).innerHTML="<p>"+(0,e.__)("Unfortunately, there was an error while loading the payment form. Please try again later.","finix-for-woocommerce")+"</p>":""===document.getElementById(n).innerHTML?(s=window.Finix.BankTokenForm(n,o),setTimeout(()=>{t++,r(t,s)},500)):f(s)};return r(0),()=>{}},[l]),(0,t.useEffect)(()=>{const t=l(async()=>{const t=document.querySelector('input[name="radio-control-wc-payment-method-options"]:checked').value;if(t!==c)return;if(t!==n)return;if(!u)return{type:a.responseTypes.ERROR,message:(0,e.__)("Unfortunately, there was an error while initializing a payment form.","finix-for-woocommerce")};let o={finix_fraud_session_id:p,finix_nonce:d.nonce};if(!_||""===_)try{const e=await(async()=>(document.querySelector("button.wc-block-components-checkout-place-order-button").disabled=!0,new Promise((e,t)=>{u.submit(d.environment,d.application,function(o,n){if(o)document.querySelector("button.wc-block-components-checkout-place-order-button").disabled=!1,t(o);else{const t=(n.data||{}).id;e(t)}})})))();return y(e),o[c+"_token"]=e,{type:a.responseTypes.SUCCESS,meta:{paymentMethodData:o}}}catch(e){return y(""),document.querySelector("button.wc-block-components-checkout-place-order-button").disabled=!1,{type:a.responseTypes.ERROR,message:e}}return o[c+"_token"]=_,{type:a.responseTypes.SUCCESS,meta:{paymentMethodData:o}}});return()=>t()},[l,u,a.responseTypes.SUCCESS,a.responseTypes.ERROR,p]);const x=jQuery("#billing-city").outerHeight()+"px !important"||0;return(0,t.createElement)("fieldset",{id:"wc-"+c+"-form",className:"finix-wc-form wc-payment-form"},(S=d.description)&&""!==S.trim()?(0,t.createElement)("div",{},(0,t.createElement)("p",{dangerouslySetInnerHTML:{__html:d.description}})):null,(0,t.createElement)("div",{id:c+"-form"}),(0,t.createElement)("style",{},`\n\t .finix-wc-form iframe {\n\t height: ${x};\n\t }\n `));var S},f=()=>{};(0,o.registerPaymentMethod)({name:c,label:(0,a.jsx)(m,{}),content:(0,a.jsx)(u,{}),edit:(0,a.jsx)(f,{}),canMakePayment:()=>!0,ariaLabel:l,supports:{features:d.supports}})})();1 (()=>{"use strict";const e=window.wp.i18n,t=window.wp.element,o=window.wc.wcBlocksRegistry,n=window.wp.htmlEntities,r=window.wc.wcSettings,s=window.wc.wcBlocksData,i=window.wp.data,a=window.ReactJSXRuntime,c="finix_bank_gateway",d=(0,r.getSetting)("finix_bank_gateway_data",{}),l=(0,n.decodeEntities)(d.title)||(0,e.__)("Pay with Bank","finix-for-woocommerce"),m=e=>{const{PaymentMethodLabel:o}=e.components,n=()=>(0,t.createElement)("img",{src:d.icon});return(0,a.jsx)(o,{text:l,icon:(0,a.jsx)(n,{})})},u=o=>{const{activePaymentMethod:n,eventRegistration:r,emitResponse:a}=o,{onPaymentSetup:l,onCheckoutFail:m}=r,[u,f]=(0,t.useState)(null),[p,w]=(0,t.useState)(""),[_,y]=(0,t.useState)(""),{totals:h}=(0,i.useSelect)(e=>e(s.cartStore).getCartData(),[]),[b,g]=(0,t.useState)("");(0,t.useEffect)(()=>{g("CAD"===h.currency_code?d.merchant:d.merchant_cad)},[h]),(0,t.useEffect)(()=>{y("")},[m]),(0,t.useEffect)(()=>{const t=jQuery("input#billing-city, input#shipping-city"),o={showAddress:d.finix_form_options.showAddress||!0,showLabels:d.finix_form_options.showLabels||!0,labels:d.finix_form_options.labels||{name:(0,e.__)("Full Name","finix-for-woocommerce")},showPlaceholders:d.finix_form_options.showPlaceholders||!0,placeholders:d.finix_form_options.placeholders||{name:d.text.full_name},defaultValues:d.finix_form_options.defaultValues,hideFields:d.finix_form_options.hideFields||["address_line1","address_line2","address_city","address_state"],requiredFields:d.finix_form_options.requiredFields||["name","address_country","address_postal_code"],hideErrorMessages:d.finix_form_options.hideErrorMessages||!1,errorMessages:d.finix_form_options.errorMessages||{name:(0,e.__)("Please enter a valid name","finix-for-woocommerce"),address_city:(0,e.__)("Please enter a valid city","finix-for-woocommerce")},styles:{default:{color:t.css("color"),backgroundColor:t.css("background-color"),border:`${t.css("border-width")} ${t.css("border-style")} ${t.css("border-color")}`,borderRadius:`${t.css("border-top-left-radius")} ${t.css("border-top-right-radius")} ${t.css("border-bottom-right-radius")} ${t.css("border-bottom-left-radius")}`,fontFamily:t.css("font-family"),fontWeight:t.css("font-weight"),lineHeight:t.css("line-height"),boxShadow:t.css("box-shadow"),maxHeight:"100%",appearance:"auto"},success:{},error:{color:"#d9534f",border:"1px solid rgba(255,0,0, 0.3)"}},onUpdate(e,t,o){},onLoad(){}};window.Finix.Auth(d.environment,b,e=>{w(e)});const n=c+"-form",r=(t,s=null)=>{t>4?document.getElementById(n).innerHTML="<p>"+(0,e.__)("Unfortunately, there was an error while loading the payment form. Please try again later.","finix-for-woocommerce")+"</p>":""===document.getElementById(n).innerHTML?(s=window.Finix.BankTokenForm(n,o),setTimeout(()=>{t++,r(t,s)},500)):f(s)};return r(0),()=>{}},[l]),(0,t.useEffect)(()=>{const t=l(async()=>{const t=document.querySelector('input[name="radio-control-wc-payment-method-options"]:checked').value;if(t!==c)return;if(t!==n)return;if(!u)return{type:a.responseTypes.ERROR,message:(0,e.__)("Unfortunately, there was an error while initializing a payment form.","finix-for-woocommerce")};let o={finix_fraud_session_id:p,finix_nonce:d.nonce};if(!_||""===_)try{const e=await(async()=>(document.querySelector("button.wc-block-components-checkout-place-order-button").disabled=!0,new Promise((e,t)=>{u.submit(d.environment,d.application,function(o,n){if(o)document.querySelector("button.wc-block-components-checkout-place-order-button").disabled=!1,t(o);else{const t=(n.data||{}).id;e(t)}})})))();return y(e),o[c+"_token"]=e,{type:a.responseTypes.SUCCESS,meta:{paymentMethodData:o}}}catch(e){return y(""),document.querySelector("button.wc-block-components-checkout-place-order-button").disabled=!1,{type:a.responseTypes.ERROR,message:e}}return o[c+"_token"]=_,{type:a.responseTypes.SUCCESS,meta:{paymentMethodData:o}}});return()=>t()},[l,u,a.responseTypes.SUCCESS,a.responseTypes.ERROR,p]);const x=jQuery("#billing-city").outerHeight()+"px !important"||0;return(0,t.createElement)("fieldset",{id:"wc-"+c+"-form",className:"finix-wc-form wc-payment-form"},(S=d.description)&&""!==S.trim()?(0,t.createElement)("div",{},(0,t.createElement)("p",{dangerouslySetInnerHTML:{__html:d.description}})):null,(0,t.createElement)("div",{id:c+"-form"}),(0,t.createElement)("style",{},`\n\t .finix-wc-form iframe {\n\t height: ${x};\n\t }\n `));var S},f=()=>{};(0,o.registerPaymentMethod)({name:c,label:(0,a.jsx)(m,{}),content:(0,a.jsx)(u,{}),edit:(0,a.jsx)(f,{}),canMakePayment:()=>!0,ariaLabel:l,supports:{features:d.supports}})})(); -
finix-for-woocommerce/trunk/assets/js/block/build/card.asset.php
r3375717 r3418263 1 <?php return array('dependencies' => array('react-jsx-runtime', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-settings', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => ' 37fbae2e33c1ca564348');1 <?php return array('dependencies' => array('react-jsx-runtime', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-settings', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => '2c64252111acd34319ce'); -
finix-for-woocommerce/trunk/assets/js/block/build/card.js
r3375717 r3418263 1 (()=>{"use strict";const e=window.wp.i18n,t=window.wp.element,o=window.wc.wcBlocksRegistry,n=window.wp.htmlEntities,r=window.wc.wcSettings,s=window.wc.wcBlocksData,i=window.wp.data,a=window.ReactJSXRuntime,c="finix_gateway",d=(0,r.getSetting)("finix_gateway_data",{}),l=(0,n.decodeEntities)(d.title)||(0,e.__)("Pay with Card","finix-for-woocommerce"),m=e=>{const{PaymentMethodLabel:o}=e.components,n=()=>(0,t.createElement)("img",{src:d.icon});return(0,a.jsx)(o,{text:l,icon:(0,a.jsx)(n,{})})},u=o=>{const{activePaymentMethod:n,eventRegistration:r,emitResponse:a}=o,{onPaymentSetup:l,onCheckoutFail:m}=r,[u,f]=(0,t.useState)(null),[p,w]=(0,t.useState)(""),[ y,h]=(0,t.useState)(""),{totals:_}=(0,i.useSelect)(e=>e(s.cartStore).getCartData(),[]),[b,g]=(0,t.useState)("");(0,t.useEffect)(()=>{g("CAD"===_.currency_code?d.merchant:d.merchant_cad)},[_]),(0,t.useEffect)(()=>{h("")},[m]),(0,t.useEffect)(()=>{const t=jQuery("input#billing-city, input#shipping-city"),o={showAddress:d.finix_form_options.showAddress||!0,showLabels:d.finix_form_options.showLabels||!0,labels:d.finix_form_options.labels||{name:(0,e.__)("Full Name","finix-for-woocommerce")},showPlaceholders:d.finix_form_options.showPlaceholders||!0,placeholders:d.finix_form_options.placeholders||{name:d.text.full_name},hideFields:d.finix_form_options.hideFields||["address_line1","address_line2","address_city","address_state"],requiredFields:d.finix_form_options.requiredFields||["name","address_country","address_postal_code"],hideErrorMessages:d.finix_form_options.hideErrorMessages||!1,errorMessages:d.finix_form_options.errorMessages||{name:(0,e.__)("Please enter a valid name","finix-for-woocommerce"),address_city:(0,e.__)("Please enter a valid city","finix-for-woocommerce")},styles:{default:{color:t.css("color"),backgroundColor:t.css("background-color"),border:`${t.css("border-width")} ${t.css("border-style")} ${t.css("border-color")}`,borderRadius:`${t.css("border-top-left-radius")} ${t.css("border-top-right-radius")} ${t.css("border-bottom-right-radius")} ${t.css("border-bottom-left-radius")}`,fontFamily:t.css("font-family"),fontWeight:t.css("font-weight"),lineHeight:t.css("line-height"),boxShadow:t.css("box-shadow"),maxHeight:"100%",appearance:"auto"},success:{},error:{color:"#d9534f",border:"1px solid rgba(255,0,0, 0.3)"}},onUpdate(e,t,o){},onLoad(){}};window.Finix.Auth(d.environment,b,e=>{w(e)});const n=c+"-form",r=(t,s=null)=>{t>4?document.getElementById(n).innerHTML="<p>"+(0,e.__)("Unfortunately, there was an error while loading the payment form. Please try again later.","finix-for-woocommerce")+"</p>":""===document.getElementById(n).innerHTML?(s=window.Finix.CardTokenForm(n,o),setTimeout(()=>{t++,r(t,s)},500)):f(s)};return r(0),()=>{}},[l]),(0,t.useEffect)(()=>{const t=l(async()=>{const t=document.querySelector('input[name="radio-control-wc-payment-method-options"]:checked').value;if(t!==c)return;if(t!==n)return;if(!u)return{type:a.responseTypes.ERROR,message:(0,e.__)("Unfortunately, there was an error while initializing a payment form.","finix-for-woocommerce")};let o={finix_fraud_session_id:p,finix_nonce:d.nonce};if(!y||""===y)try{const e=await(async()=>(document.querySelector("button.wc-block-components-checkout-place-order-button").disabled=!0,new Promise((e,t)=>{u.submit(d.environment,d.application,function(o,n){if(o)document.querySelector("button.wc-block-components-checkout-place-order-button").disabled=!1,t(o);else{const t=(n.data||{}).id;e(t)}})})))();return h(e),o[c+"_token"]=e,{type:a.responseTypes.SUCCESS,meta:{paymentMethodData:o}}}catch(e){return h(""),document.querySelector("button.wc-block-components-checkout-place-order-button").disabled=!1,{type:a.responseTypes.ERROR,message:e}}return o[c+"_token"]=y,{type:a.responseTypes.SUCCESS,meta:{paymentMethodData:o}}});return()=>t()},[l,u,a.responseTypes.SUCCESS,a.responseTypes.ERROR,p]);const x=jQuery("#billing-city").outerHeight()+"px !important"||0;return(0,t.createElement)("fieldset",{id:"wc-"+c+"-form",className:"finix-wc-form wc-payment-form"},(S=d.description)&&""!==S.trim()?(0,t.createElement)("div",{},(0,t.createElement)("p",{dangerouslySetInnerHTML:{__html:d.description}})):null,(0,t.createElement)("div",{id:c+"-form"}),(0,t.createElement)("style",{},`\n\t .finix-wc-form iframe {\n\t height: ${x};\n\t }\n `));var S},f=()=>{};(0,o.registerPaymentMethod)({name:c,label:(0,a.jsx)(m,{}),content:(0,a.jsx)(u,{}),edit:(0,a.jsx)(f,{}),canMakePayment:()=>!0,ariaLabel:l,supports:{features:d.supports}})})();1 (()=>{"use strict";const e=window.wp.i18n,t=window.wp.element,o=window.wc.wcBlocksRegistry,n=window.wp.htmlEntities,r=window.wc.wcSettings,s=window.wc.wcBlocksData,i=window.wp.data,a=window.ReactJSXRuntime,c="finix_gateway",d=(0,r.getSetting)("finix_gateway_data",{}),l=(0,n.decodeEntities)(d.title)||(0,e.__)("Pay with Card","finix-for-woocommerce"),m=e=>{const{PaymentMethodLabel:o}=e.components,n=()=>(0,t.createElement)("img",{src:d.icon});return(0,a.jsx)(o,{text:l,icon:(0,a.jsx)(n,{})})},u=o=>{const{activePaymentMethod:n,eventRegistration:r,emitResponse:a}=o,{onPaymentSetup:l,onCheckoutFail:m}=r,[u,f]=(0,t.useState)(null),[p,w]=(0,t.useState)(""),[_,y]=(0,t.useState)(""),{totals:h}=(0,i.useSelect)(e=>e(s.cartStore).getCartData(),[]),[b,g]=(0,t.useState)("");(0,t.useEffect)(()=>{g("CAD"===h.currency_code?d.merchant:d.merchant_cad)},[h]),(0,t.useEffect)(()=>{y("")},[m]),(0,t.useEffect)(()=>{const t=jQuery("input#billing-city, input#shipping-city"),o={showAddress:d.finix_form_options.showAddress||!0,showLabels:d.finix_form_options.showLabels||!0,labels:d.finix_form_options.labels||{name:(0,e.__)("Full Name","finix-for-woocommerce")},showPlaceholders:d.finix_form_options.showPlaceholders||!0,placeholders:d.finix_form_options.placeholders||{name:d.text.full_name},defaultValues:d.finix_form_options.defaultValues,hideFields:d.finix_form_options.hideFields||["address_line1","address_line2","address_city","address_state"],requiredFields:d.finix_form_options.requiredFields||["name","address_country","address_postal_code"],hideErrorMessages:d.finix_form_options.hideErrorMessages||!1,errorMessages:d.finix_form_options.errorMessages||{name:(0,e.__)("Please enter a valid name","finix-for-woocommerce"),address_city:(0,e.__)("Please enter a valid city","finix-for-woocommerce")},styles:{default:{color:t.css("color"),backgroundColor:t.css("background-color"),border:`${t.css("border-width")} ${t.css("border-style")} ${t.css("border-color")}`,borderRadius:`${t.css("border-top-left-radius")} ${t.css("border-top-right-radius")} ${t.css("border-bottom-right-radius")} ${t.css("border-bottom-left-radius")}`,fontFamily:t.css("font-family"),fontWeight:t.css("font-weight"),lineHeight:t.css("line-height"),boxShadow:t.css("box-shadow"),maxHeight:"100%",appearance:"auto"},success:{},error:{color:"#d9534f",border:"1px solid rgba(255,0,0, 0.3)"}},onUpdate(e,t,o){},onLoad(){}};window.Finix.Auth(d.environment,b,e=>{w(e)});const n=c+"-form",r=(t,s=null)=>{t>4?document.getElementById(n).innerHTML="<p>"+(0,e.__)("Unfortunately, there was an error while loading the payment form. Please try again later.","finix-for-woocommerce")+"</p>":""===document.getElementById(n).innerHTML?(s=window.Finix.CardTokenForm(n,o),setTimeout(()=>{t++,r(t,s)},500)):f(s)};return r(0),()=>{}},[l]),(0,t.useEffect)(()=>{const t=l(async()=>{const t=document.querySelector('input[name="radio-control-wc-payment-method-options"]:checked').value;if(t!==c)return;if(t!==n)return;if(!u)return{type:a.responseTypes.ERROR,message:(0,e.__)("Unfortunately, there was an error while initializing a payment form.","finix-for-woocommerce")};let o={finix_fraud_session_id:p,finix_nonce:d.nonce};if(!_||""===_)try{const e=await(async()=>(document.querySelector("button.wc-block-components-checkout-place-order-button").disabled=!0,new Promise((e,t)=>{u.submit(d.environment,d.application,function(o,n){if(o)document.querySelector("button.wc-block-components-checkout-place-order-button").disabled=!1,t(o);else{const t=(n.data||{}).id;e(t)}})})))();return y(e),o[c+"_token"]=e,{type:a.responseTypes.SUCCESS,meta:{paymentMethodData:o}}}catch(e){return y(""),document.querySelector("button.wc-block-components-checkout-place-order-button").disabled=!1,{type:a.responseTypes.ERROR,message:e}}return o[c+"_token"]=_,{type:a.responseTypes.SUCCESS,meta:{paymentMethodData:o}}});return()=>t()},[l,u,a.responseTypes.SUCCESS,a.responseTypes.ERROR,p]);const x=jQuery("#billing-city").outerHeight()+"px !important"||0;return(0,t.createElement)("fieldset",{id:"wc-"+c+"-form",className:"finix-wc-form wc-payment-form"},(S=d.description)&&""!==S.trim()?(0,t.createElement)("div",{},(0,t.createElement)("p",{dangerouslySetInnerHTML:{__html:d.description}})):null,(0,t.createElement)("div",{id:c+"-form"}),(0,t.createElement)("style",{},`\n\t .finix-wc-form iframe {\n\t height: ${x};\n\t }\n `));var S},f=()=>{};(0,o.registerPaymentMethod)({name:c,label:(0,a.jsx)(m,{}),content:(0,a.jsx)(u,{}),edit:(0,a.jsx)(f,{}),canMakePayment:()=>!0,ariaLabel:l,supports:{features:d.supports}})})(); -
finix-for-woocommerce/trunk/assets/js/block/build/google-pay.asset.php
r3375717 r3418263 1 <?php return array('dependencies' => array('react-jsx-runtime', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-settings', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => ' e247941ef06602be4cc3');1 <?php return array('dependencies' => array('react-jsx-runtime', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-settings', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => 'b70c80180425b2a86a71'); -
finix-for-woocommerce/trunk/assets/js/block/build/google-pay.js
r3375717 r3418263 1 (()=>{"use strict";const e=window.wp.element,t=window.wp.i18n,a=window.wc.wcBlocksRegistry, n=window.wp.htmlEntities,o=window.wc.wcSettings,i=window.wc.wcBlocksData,s=window.wp.data;class r{static paymentsClient=null;static baseRequest={apiVersion:2,apiVersionMinor:0};static environment="sandbox"===finix_google_pay_params.environment?"TEST":"PRODUCTION";static allowedCardNetworks=["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"];static allowedCardAuthMethods=["PAN_ONLY","CRYPTOGRAM_3DS"];static tokenizationSpecification={type:"PAYMENT_GATEWAY",parameters:{gateway:"finix",gatewayMerchantId:finix_google_pay_params.merchant_identity}};static baseCardPaymentMethod={type:"CARD",parameters:{allowedAuthMethods:r.allowedCardAuthMethods,allowedCardNetworks:r.allowedCardNetworks}};static cardPaymentMethod={...r.baseCardPaymentMethod,tokenizationSpecification:r.tokenizationSpecification};static getPaymentsClient(){return r.paymentsClient||(r.paymentsClient=new google.payments.api.PaymentsClient({environment:r.environment})),r.paymentsClient}static getIsReadyToPayRequest(){return{...r.baseRequest,allowedPaymentMethods:[r.baseCardPaymentMethod]}}static getTransactionInfo(){return{countryCode:finix_google_pay_params.merchant_country,currencyCode:finix_google_pay_params.currency_code,totalPriceStatus:"FINAL",totalPrice:finix_google_pay_params.amount}}static getPaymentDataRequest(){return{...r.baseRequest,allowedPaymentMethods:[r.cardPaymentMethod],transactionInfo:r.getTransactionInfo(),merchantInfo:{merchantId:finix_google_pay_params.google_merchant_id,merchantName:finix_google_pay_params.merchant_name}}}static prefetchPaymentData(){r.getPaymentsClient().prefetchPaymentData(r.getPaymentDataRequest())}static processPayment=async()=>{const e=(0,t.__)("There was an error while processing the payment using Google Pay.","finix-for-woocommerce");try{const t=(await r.getPaymentsClient().loadPaymentData(r.getPaymentDataRequest())).paymentMethodData.tokenizationData.token;if(!t)throw new Error(e);const a={provider:"GOOGLE_PAY",payment_token:t,process_payment:!0,merchant_identity:finix_google_pay_params.merchant_identity,wp_nonce:finix_google_pay_params.nonce,billing_info:finix_google_pay_params.billing_data},n=await fetch(finix_google_pay_params.url.webhook,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}).then(e=>e.json());if(201===n.status)return document.getElementById("finix_google_pay_success").value=!0,document.getElementById("finix_google_pay_transaction_id").value=n.response.id,!0;throw document.getElementById("finix_google_pay_success").value=!1,document.getElementById("finix_google_pay_transaction_id").value="",new Error(e)}catch(t){throw new Error(t.message||e)}};static triggerPayment(){const e=document.querySelector(".wc-block-components-checkout-place-order-button");e&&e.click()}}const _=window.ReactJSXRuntime,c="finix_google_pay_gateway",p=(0,o.getSetting)("finix_google_pay_gateway_data",{}),g=(0,n.decodeEntities)(p.title)||(0,t.__)("Pay with Google Pay","finix-for-woocommerce"),l=t=>{const{PaymentMethodLabel:a}=t.components,n=()=>(0,e.createElement)("img",{src:p.icon});return(0,_.jsx)(a,{text:g,icon:(0,_.jsx)(n,{})})},y=a=>{const{eventRegistration:n,emitResponse:o}=a,{onPaymentSetup:_}=n,{shippingAddress:g,billingAddress:l,totals:y}=(0,s.useSelect)(e=>e(i.cartStore).getCartData(),[]);return(0,e.useEffect)(()=>{finix_google_pay_params.shipping_data=g},[g]),(0,e.useEffect)(()=>{finix_google_pay_params.billing_data=l},[l]),(0,e.useEffect)(()=>{finix_google_pay_params.amount=(y.total_price/100).toFixed(2),finix_google_pay_params.currency_code=y.currency_code},[y]),(0,e.useEffect)(()=>{const e=r.getPaymentsClient();return e.isReadyToPay(r.getIsReadyToPayRequest()).then(t=>{if(t.result){const t=document.querySelector("#wc-finix-google-pay-form"),a=e.createButton({onClick:r.triggerPayment,allowedPaymentMethods:[r.cardPaymentMethod],buttonColor:finix_google_pay_params.button_color,buttonType:finix_google_pay_params.button_type,buttonRadius:finix_google_pay_params.button_radius,buttonLocale:finix_google_pay_params.button_locale});t.appendChild(a),r.prefetchPaymentData()}}).catch(e=>({type:o.responseTypes.ERROR,message:(0,t.__)("There was an error while initializing Google Pay. Please check all the details and try again.","finix-for-woocommerce")})),_(async()=>{if(!await(()=>{let e=(()=>{const e=finix_google_pay_params.billing_data,t=finix_google_pay_params.shipping_data;return{shipping_country:t.country||e.country||"",shipping_state:t.state||e.state||"",shipping_postcode:t.postcode||e.postcode||"",shipping_city:t.city||e.city||"",shipping_address_1:t.address_1||e.address1||""}})();return e.nonce=finix_google_pay_params.nonce,new Promise(t=>{fetch(finix_google_pay_params.url.ajax+"?action=validate_shipping_method",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(e=>e.json()).then(e=>{t(!0===e.success)}).catch(()=>t(!1))})})())return{type:o.responseTypes.ERROR,message:(0,t.__)("Please make sure shipping and billing information is correct and then try again.","finix-for-woocommerce")};try{return!0===await r.processPayment()?{type:o.responseTypes.SUCCESS,meta:{paymentMethodData:{finix_google_pay_success:document.getElementById("finix_google_pay_success").value,finix_google_pay_transaction_id:document.getElementById("finix_google_pay_transaction_id").value,finix_nonce:finix_google_pay_params.nonce}}}:{type:o.responseTypes.FAIL,message:finix_google_pay_params.text.error_processing}}catch(e){return{type:o.responseTypes.FAIL,message:finix_google_pay_params.text.error_processing}}})},[_]),(0,e.createElement)("fieldset",{id:"wc-"+c+"-form",style:{background:"transparent",padding:"0"}},(m=p.description)&&""!==m.trim()?(0,e.createElement)("div",{},(0,e.createElement)("p",{dangerouslySetInnerHTML:{__html:p.description}})):null,(0,e.createElement)("google-pay-button",{id:"finix-google-pay-button",buttonstyle:finix_google_pay_params.button_style,type:finix_google_pay_params.button_type,locale:finix_google_pay_params.button_locale}),(0,e.createElement)("input",{type:"hidden",name:"finix_google_pay_success",id:"finix_google_pay_success"}),(0,e.createElement)("input",{type:"hidden",name:"finix_google_pay_transaction_id",id:"finix_google_pay_transaction_id"}));var m},m=()=>{};(0,a.registerPaymentMethod)({name:c,label:(0,_.jsx)(l,{}),content:(0,_.jsx)(y,{}),edit:(0,_.jsx)(m,{}),canMakePayment:()=>void 0!==finix_google_pay_params.google_merchant_id&&""!==finix_google_pay_params.google_merchant_id&&!(!google||!google.payments)&&r.getPaymentsClient().isReadyToPay(r.getIsReadyToPayRequest()).then(e=>e.result),ariaLabel:g,supports:{features:p.supports}})})();1 (()=>{"use strict";const e=window.wp.element,t=window.wp.i18n,a=window.wc.wcBlocksRegistry,o=window.wp.htmlEntities,n=window.wc.wcSettings,i=window.wc.wcBlocksData,s=window.wp.data;class r{static paymentsClient=null;static baseRequest={apiVersion:2,apiVersionMinor:0};static environment="sandbox"===finix_google_pay_params.environment?"TEST":"PRODUCTION";static allowedCardNetworks=["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"];static allowedCardAuthMethods=["PAN_ONLY","CRYPTOGRAM_3DS"];static tokenizationSpecification={type:"PAYMENT_GATEWAY",parameters:{gateway:"finix",gatewayMerchantId:finix_google_pay_params.merchant_identity}};static baseCardPaymentMethod={type:"CARD",parameters:{allowedAuthMethods:r.allowedCardAuthMethods,allowedCardNetworks:r.allowedCardNetworks}};static cardPaymentMethod={...r.baseCardPaymentMethod,tokenizationSpecification:r.tokenizationSpecification};static getPaymentsClient(){return r.paymentsClient||(r.paymentsClient=new google.payments.api.PaymentsClient({environment:r.environment})),r.paymentsClient}static getIsReadyToPayRequest(){return{...r.baseRequest,allowedPaymentMethods:[r.baseCardPaymentMethod]}}static getTransactionInfo(){let e=[];return Object.values(finix_google_pay_params.products).forEach(t=>{0!==parseFloat(t.total)&&e.push({label:t.quantity>1?`${t.name} x${t.quantity}`:t.name,type:"LINE_ITEM",price:t.total})}),e.push({label:(0,t.__)("Subtotal","finix-for-woocommerce"),type:"SUBTOTAL",price:finix_google_pay_params.subtotal||finix_google_pay_params.amount}),e.push(...finix_google_pay_params.coupons.map(e=>({label:(0,t.__)("Discount code:","finix-for-woocommerce")+" "+e.code,type:"DISCOUNT",price:(-1*parseFloat(e.total).toFixed(2)).toString()}))),finix_google_pay_params.shipping_amount>0&&e.push({label:(0,t.__)("Shipping","finix-for-woocommerce"),type:"SHIPPING_OPTION",price:finix_google_pay_params.shipping_amount||"0.00"}),finix_google_pay_params.tax_amount>0&&e.push({label:(0,t.__)("Tax","finix-for-woocommerce"),type:"TAX",price:finix_google_pay_params.tax_amount||"0.00"}),{countryCode:finix_google_pay_params.merchant_country,currencyCode:finix_google_pay_params.currency_code,totalPriceStatus:"FINAL",totalPriceLabel:(0,t.__)("Total","finix-for-woocommerce"),totalPrice:finix_google_pay_params.amount,displayItems:e}}static getPaymentDataRequest(){return{...r.baseRequest,allowedPaymentMethods:[r.cardPaymentMethod],transactionInfo:r.getTransactionInfo(),merchantInfo:{merchantId:finix_google_pay_params.google_merchant_id,merchantName:finix_google_pay_params.merchant_name}}}static prefetchPaymentData(){r.getPaymentsClient().prefetchPaymentData(r.getPaymentDataRequest())}static processPayment=async()=>{const e=(0,t.__)("There was an error while processing the payment using Google Pay.","finix-for-woocommerce");try{const t=(await r.getPaymentsClient().loadPaymentData(r.getPaymentDataRequest())).paymentMethodData.tokenizationData.token;if(!t)throw new Error(e);const a={provider:"GOOGLE_PAY",payment_token:t,process_payment:!0,merchant_identity:finix_google_pay_params.merchant_identity,wp_nonce:finix_google_pay_params.nonce,billing_info:finix_google_pay_params.billing_data},o=await fetch(finix_google_pay_params.url.webhook,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}).then(e=>e.json());if(201===o.status)return document.getElementById("finix_google_pay_success").value=!0,document.getElementById("finix_google_pay_transaction_id").value=o.response.id,!0;throw document.getElementById("finix_google_pay_success").value=!1,document.getElementById("finix_google_pay_transaction_id").value="",new Error(e)}catch(t){throw new Error(t.message||e)}};static triggerPayment(){const e=document.querySelector(".wc-block-components-checkout-place-order-button");e&&e.click()}}const _=window.ReactJSXRuntime,p="finix_google_pay_gateway",c=(0,n.getSetting)("finix_google_pay_gateway_data",{}),l=(0,o.decodeEntities)(c.title)||(0,t.__)("Pay with Google Pay","finix-for-woocommerce"),g=t=>{const{PaymentMethodLabel:a}=t.components,o=()=>(0,e.createElement)("img",{src:c.icon});return(0,_.jsx)(a,{text:l,icon:(0,_.jsx)(o,{})})},m=a=>{const{eventRegistration:o,emitResponse:n}=a,{onPaymentSetup:_}=o,{shippingAddress:l,billingAddress:g,totals:m,coupons:y,items:d}=(0,s.useSelect)(e=>e(i.cartStore).getCartData(),[]);return(0,e.useEffect)(()=>{finix_google_pay_params.shipping_data=l},[l]),(0,e.useEffect)(()=>{finix_google_pay_params.billing_data=g},[g]),(0,e.useEffect)(()=>{finix_google_pay_params.amount=(m.total_price/100).toFixed(2),finix_google_pay_params.currency_code=m.currency_code,finix_google_pay_params.subtotal=(m.total_items/100).toFixed(2),finix_google_pay_params.shipping_amount=(m.total_shipping/100).toFixed(2),finix_google_pay_params.tax_amount=(m.total_tax/100).toFixed(2)},[m]),(0,e.useEffect)(()=>{finix_google_pay_params.coupons=y.map(e=>({code:e.code,total:(e.totals.total_discount/100).toFixed(2)}))},[y]),(0,e.useEffect)(()=>{finix_google_pay_params.products=d.map(e=>({name:e.name,quantity:e.quantity,image:e.images.length&&e.images.length>0?e.images[0].thumbnail:"",total:(e.prices.price*e.quantity/100).toFixed(2)}))},[d]),(0,e.useEffect)(()=>{const e=r.getPaymentsClient();return e.isReadyToPay(r.getIsReadyToPayRequest()).then(t=>{if(t.result){const t=document.querySelector("#wc-finix-google-pay-form"),a=e.createButton({onClick:r.triggerPayment,allowedPaymentMethods:[r.cardPaymentMethod],buttonColor:finix_google_pay_params.button_color,buttonType:finix_google_pay_params.button_type,buttonRadius:finix_google_pay_params.button_radius,buttonLocale:finix_google_pay_params.button_locale});t.appendChild(a),r.prefetchPaymentData()}}).catch(e=>({type:n.responseTypes.ERROR,message:(0,t.__)("There was an error while initializing Google Pay. Please check all the details and try again.","finix-for-woocommerce")})),_(async()=>{if(!await(()=>{let e=(()=>{const e=finix_google_pay_params.billing_data,t=finix_google_pay_params.shipping_data;return{shipping_country:t.country||e.country||"",shipping_state:t.state||e.state||"",shipping_postcode:t.postcode||e.postcode||"",shipping_city:t.city||e.city||"",shipping_address_1:t.address_1||e.address1||""}})();return e.nonce=finix_google_pay_params.nonce,new Promise(t=>{fetch(finix_google_pay_params.url.ajax+"?action=validate_shipping_method",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(e=>e.json()).then(e=>{t(!0===e.success)}).catch(()=>t(!1))})})())return{type:n.responseTypes.ERROR,message:(0,t.__)("Please make sure shipping and billing information is correct and then try again.","finix-for-woocommerce")};try{return!0===await r.processPayment()?{type:n.responseTypes.SUCCESS,meta:{paymentMethodData:{finix_google_pay_success:document.getElementById("finix_google_pay_success").value,finix_google_pay_transaction_id:document.getElementById("finix_google_pay_transaction_id").value,finix_nonce:finix_google_pay_params.nonce}}}:{type:n.responseTypes.FAIL,message:finix_google_pay_params.text.error_processing}}catch(e){return{type:n.responseTypes.FAIL,message:finix_google_pay_params.text.error_processing}}})},[_]),(0,e.createElement)("fieldset",{id:"wc-"+p+"-form",style:{background:"transparent",padding:"0"}},(u=c.description)&&""!==u.trim()?(0,e.createElement)("div",{},(0,e.createElement)("p",{dangerouslySetInnerHTML:{__html:c.description}})):null,(0,e.createElement)("google-pay-button",{id:"finix-google-pay-button",buttonstyle:finix_google_pay_params.button_style,type:finix_google_pay_params.button_type,locale:finix_google_pay_params.button_locale}),(0,e.createElement)("input",{type:"hidden",name:"finix_google_pay_success",id:"finix_google_pay_success"}),(0,e.createElement)("input",{type:"hidden",name:"finix_google_pay_transaction_id",id:"finix_google_pay_transaction_id"}));var u},y=()=>{};(0,a.registerPaymentMethod)({name:p,label:(0,_.jsx)(g,{}),content:(0,_.jsx)(m,{}),edit:(0,_.jsx)(y,{}),canMakePayment:()=>void 0!==finix_google_pay_params.google_merchant_id&&""!==finix_google_pay_params.google_merchant_id&&!(!google||!google.payments)&&r.getPaymentsClient().isReadyToPay(r.getIsReadyToPayRequest()).then(e=>e.result),ariaLabel:l,supports:{features:c.supports}})})(); -
finix-for-woocommerce/trunk/assets/js/finix-google-pay.js
r3316914 r3418263 56 56 57 57 getTransactionInfo: function () { 58 let lineItems = []; 59 60 // Add product line items if value is not zero. 61 Object.values( finix_google_pay_params.products ).forEach( ( product ) => { 62 if ( parseFloat( product.total ) !== 0 ) { 63 lineItems.push( { 64 label: product.quantity > 1 ? `${ product.name } x${ product.quantity }` : product.name, 65 type: 'LINE_ITEM', 66 price: product.total, 67 } ); 68 } 69 } ); 70 71 lineItems.push( { 72 label: finix_google_pay_params.text.subtotal, 73 type: 'SUBTOTAL', 74 price: finix_google_pay_params.subtotal || finix_google_pay_params.amount, 75 } ); 76 77 // Add any offer details to the transaction info. 78 lineItems.push( 79 ...finix_google_pay_params.coupons.map( ( offer ) => ( { 80 label: finix_google_pay_params.text.discount_code + ' ' + offer.code, 81 type: 'DISCOUNT', 82 price: (parseFloat( offer.total ) * -1).toFixed( 2 ), // Ensure negative value for discounts. 83 } ) ) 84 ); 85 86 // Add Shipping if is not Zero. 87 if ( finix_google_pay_params.shipping_amount > 0 ) { 88 lineItems.push( { 89 label: finix_google_pay_params.text.shipping, 90 type: 'SHIPPING_OPTION', 91 price: finix_google_pay_params.shipping_amount || '0.00', 92 } ); 93 } 94 95 // Add Tax if is not Zero. 96 if ( finix_google_pay_params.tax_amount > 0 ) { 97 lineItems.push( { 98 label: finix_google_pay_params.text.tax, 99 type: 'TAX', 100 price: finix_google_pay_params.tax_amount || '0.00', 101 } ); 102 } 58 103 return { 59 104 countryCode: finix_google_pay_params.merchant_country, 60 105 currencyCode: finix_google_pay_params.currency_code, 61 106 totalPriceStatus: 'FINAL', 107 totalPriceLabel: finix_google_pay_params.text.total, 62 108 totalPrice: finix_google_pay_params.amount, 109 displayItems: lineItems, 63 110 }; 64 111 }, -
finix-for-woocommerce/trunk/assets/js/finix-google-pay.min.js
r3316914 r3418263 1 var FinixGooglePay={paymentsClient:null,baseRequest:{apiVersion:2,apiVersionMinor:0},environment:"sandbox"===finix_google_pay_params.environment?"TEST":"PRODUCTION",allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"],allowedCardAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],tokenSpec:{type:"PAYMENT_GATEWAY",parameters:{gateway:"finix",gatewayMerchantId:finix_google_pay_params.merchant_identity}},baseCardMethod:{type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"]}},getCardMethod:function(){return Object.assign({},this.baseCardMethod,{tokenizationSpecification:this.tokenSpec})},getPaymentsClient:function(){return this.paymentsClient||(this.paymentsClient=new google.payments.api.PaymentsClient({environment:this.environment})),this.paymentsClient},getPaymentDataRequest:function(){var e=Object.assign({},this.baseRequest);return e.allowedPaymentMethods=[this.getCardMethod()],e.transactionInfo=this.getTransactionInfo(),e.merchantInfo={merchantId:finix_google_pay_params.google_merchant_id,merchantName:finix_google_pay_params.merchant_name},e},getIsReadyToPayRequest:function(){return Object.assign({},this.baseRequest,{allowedPaymentMethods:[this.baseCardMethod]})},prefetch:function(){var e=Object.assign({},this.baseRequest,{allowedPaymentMethods:[this.getCardMethod()]});e.transactionInfo={totalPriceStatus:"NOT_CURRENTLY_KNOWN",currencyCode:"USD"},this.getPaymentsClient().prefetchPaymentData(e)},getTransactionInfo:function(){ return{countryCode:finix_google_pay_params.merchant_country,currencyCode:finix_google_pay_params.currency_code,totalPriceStatus:"FINAL",totalPrice:finix_google_pay_params.amount}},async processPayment(e,t){var e={provider:"GOOGLE_PAY",payment_token:e,process_payment:!0,merchant_identity:finix_google_pay_params.merchant_identity,wp_nonce:finix_google_pay_params.nonce,billing_info:t},t=document.querySelector("#finix_google_pay_order_id"),a=document.querySelector("#finix_google_pay_order_key");return t&&a&&(e.order_id=t.value,e.order_key=a.value),fetch(finix_google_pay_params.url.webhook,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(e=>e.json()).then(e=>201===e.status?{success:!0,transactionId:e.response.id}:{success:!1,error:finix_google_pay_params.text.error_processing}).catch(e=>({success:!1,error:finix_google_pay_params.text.error_setting_payment}))}};1 var FinixGooglePay={paymentsClient:null,baseRequest:{apiVersion:2,apiVersionMinor:0},environment:"sandbox"===finix_google_pay_params.environment?"TEST":"PRODUCTION",allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"],allowedCardAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],tokenSpec:{type:"PAYMENT_GATEWAY",parameters:{gateway:"finix",gatewayMerchantId:finix_google_pay_params.merchant_identity}},baseCardMethod:{type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"]}},getCardMethod:function(){return Object.assign({},this.baseCardMethod,{tokenizationSpecification:this.tokenSpec})},getPaymentsClient:function(){return this.paymentsClient||(this.paymentsClient=new google.payments.api.PaymentsClient({environment:this.environment})),this.paymentsClient},getPaymentDataRequest:function(){var e=Object.assign({},this.baseRequest);return e.allowedPaymentMethods=[this.getCardMethod()],e.transactionInfo=this.getTransactionInfo(),e.merchantInfo={merchantId:finix_google_pay_params.google_merchant_id,merchantName:finix_google_pay_params.merchant_name},e},getIsReadyToPayRequest:function(){return Object.assign({},this.baseRequest,{allowedPaymentMethods:[this.baseCardMethod]})},prefetch:function(){var e=Object.assign({},this.baseRequest,{allowedPaymentMethods:[this.getCardMethod()]});e.transactionInfo={totalPriceStatus:"NOT_CURRENTLY_KNOWN",currencyCode:"USD"},this.getPaymentsClient().prefetchPaymentData(e)},getTransactionInfo:function(){let a=[];return Object.values(finix_google_pay_params.products).forEach(e=>{0!==parseFloat(e.total)&&a.push({label:1<e.quantity?e.name+" x"+e.quantity:e.name,type:"LINE_ITEM",price:e.total})}),a.push({label:finix_google_pay_params.text.subtotal,type:"SUBTOTAL",price:finix_google_pay_params.subtotal||finix_google_pay_params.amount}),a.push(...finix_google_pay_params.coupons.map(e=>({label:finix_google_pay_params.text.discount_code+" "+e.code,type:"DISCOUNT",price:(-1*parseFloat(e.total)).toFixed(2)}))),0<finix_google_pay_params.shipping_amount&&a.push({label:finix_google_pay_params.text.shipping,type:"SHIPPING_OPTION",price:finix_google_pay_params.shipping_amount||"0.00"}),0<finix_google_pay_params.tax_amount&&a.push({label:finix_google_pay_params.text.tax,type:"TAX",price:finix_google_pay_params.tax_amount||"0.00"}),{countryCode:finix_google_pay_params.merchant_country,currencyCode:finix_google_pay_params.currency_code,totalPriceStatus:"FINAL",totalPriceLabel:finix_google_pay_params.text.total,totalPrice:finix_google_pay_params.amount,displayItems:a}},async processPayment(e,a){var e={provider:"GOOGLE_PAY",payment_token:e,process_payment:!0,merchant_identity:finix_google_pay_params.merchant_identity,wp_nonce:finix_google_pay_params.nonce,billing_info:a},a=document.querySelector("#finix_google_pay_order_id"),t=document.querySelector("#finix_google_pay_order_key");return a&&t&&(e.order_id=a.value,e.order_key=t.value),fetch(finix_google_pay_params.url.webhook,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(e=>e.json()).then(e=>201===e.status?{success:!0,transactionId:e.response.id}:{success:!1,error:finix_google_pay_params.text.error_processing}).catch(e=>({success:!1,error:finix_google_pay_params.text.error_setting_payment}))}}; -
finix-for-woocommerce/trunk/assets/js/shortcode-card-bank.js
r3375717 r3418263 14 14 name: finix_params.text.full_name, 15 15 }, 16 defaultValues: finix_params.finix_form_options.defaultValues, 16 17 hideFields: finix_params.finix_form_options.hideFields || [ 'address_line1', 'address_line2', 'address_city', 'address_state' ], 17 18 requiredFields: finix_params.finix_form_options.requiredFields || [ 'name', 'address_country', 'address_postal_code' ], -
finix-for-woocommerce/trunk/assets/js/shortcode-card-bank.min.js
r3375717 r3418263 1 let FinixFormOptions={showAddress:!!finix_params.finix_form_options.showAddress,showLabels:!!finix_params.finix_form_options.showLabels,labels:finix_params.finix_form_options.labels||{name:finix_params.text.full_name},showPlaceholders:!!finix_params.finix_form_options.showPlaceholders,placeholders:finix_params.finix_form_options.placeholders||{name:finix_params.text.full_name}, hideFields:finix_params.finix_form_options.hideFields||["address_line1","address_line2","address_city","address_state"],requiredFields:finix_params.finix_form_options.requiredFields||["name","address_country","address_postal_code"],hideErrorMessages:!!finix_params.finix_form_options.hideErrorMessages,errorMessages:finix_params.finix_form_options.errorMessages||{name:finix_params.text.error_messages.name,address_city:finix_params.text.error_messages.address_city},styles:{default:{},success:{},error:{color:"#e2401c",boxShadow:"inset 2px 0 0 #e2401c"}},onUpdate(e,i,r){},onLoad(){}};function copyWooInputStylesToFinix(){var e=jQuery("input#billing_city, input#shipping_city");return FinixFormOptions.styles.default={color:e.css("color"),backgroundColor:e.css("background-color"),border:`${e.css("border-width")} ${e.css("border-style")} `+e.css("border-color"),borderRadius:`${e.css("border-top-left-radius")} ${e.css("border-top-right-radius")} ${e.css("border-bottom-right-radius")} `+e.css("border-bottom-left-radius"),fontFamily:e.css("font-family"),fontWeight:e.css("font-weight"),lineHeight:e.css("line-height"),boxShadow:e.css("box-shadow"),maxHeight:"100%",height:"100%",appearance:"auto"},FinixFormOptions}function triggerFinixSubmitError(e){var i=jQuery("form.woocommerce-checkout, form#order_review");void 0!==e&&0!==e.length||(e='<div class="woocommerce-error">'+wc_checkout_params.i18n_checkout_error+"</div>"),jQuery(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message, .is-error, .is-success").remove(),i.prepend('<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">'+e+"</div>"),i.removeClass("processing").unblock(),i.find(".input-text, select, input:checkbox").trigger("validate").trigger("blur");let r=jQuery(".woocommerce-NoticeGroup-updateOrderReview, .woocommerce-NoticeGroup-checkout");r.length||(r=i),jQuery.scroll_to_notices(r),i.find('.woocommerce-error[tabindex="-1"], .wc-block-components-notice-banner.is-error[tabindex="-1"]').trigger("focus"),jQuery(document.body).trigger("checkout_error",[e])}async function tokenRequest(e,o){return document.getElementById("place_order").disabled=!0,new Promise((r,n)=>{e.submit(finix_params.environment,finix_params.application,function(e,i){e?(triggerFinixSubmitError(),document.getElementById(o+"_token").value="",document.getElementById("place_order").disabled=!1,n(e)):(e=(i.data||{}).id,document.getElementById(o+"_token").value=e,document.getElementById("place_order").disabled=!1,r(e))})})}function initFinixForm(e){if(""===document.getElementById(e+"-form").innerHTML)switch(e){case"finix_gateway":return finix_params.finixForms.finix_gateway=window.Finix.CardTokenForm(e+"-form",FinixFormOptions),finix_params.finixForms.finix_gateway;case"finix_bank_gateway":return finix_params.finixForms.finix_bank_gateway=window.Finix.BankTokenForm(e+"-form",FinixFormOptions),finix_params.finixForms.finix_bank_gateway}return null}function processPlaceOrder(n){jQuery(document).on("click","#place_order",async function(e){var i=jQuery('input[name="payment_method"]:checked',n).val();if(!["finix_gateway","finix_bank_gateway"].includes(i))return!0;let r;switch(i){case"finix_gateway":r=finix_params.finixForms.finix_gateway;break;case"finix_bank_gateway":r=finix_params.finixForms.finix_bank_gateway}if(e.preventDefault(),e.stopImmediatePropagation(),n.find("#"+i+"_token").val())return n.trigger("submit"),!0;try{if(await tokenRequest(r,i))return n.trigger("submit"),!0}catch(e){return n.find("#"+i+"_token").val(""),triggerFinixSubmitError(),document.getElementById("place_order").disabled=!1}})}jQuery(function(){let r=jQuery("form.woocommerce-checkout, form#order_review");if(r.length){copyWooInputStylesToFinix(),window.Finix.Auth(finix_params.environment,finix_params.merchant,e=>{jQuery("#finix_fraud_session_id",r).length||r.prepend('<input type="hidden" id="finix_fraud_session_id" name="finix_fraud_session_id" value=""/>'),r.find("#finix_fraud_session_id").val(e);e=jQuery("#finix_nonce",r);e.length||r.prepend('<input type="hidden" id="finix_nonce" name="finix_nonce" value=""/>'),r.find("#finix_nonce").val(finix_params.nonce)}),finix_params.finixForms=finix_params.finixForms||{};var e=`1 let FinixFormOptions={showAddress:!!finix_params.finix_form_options.showAddress,showLabels:!!finix_params.finix_form_options.showLabels,labels:finix_params.finix_form_options.labels||{name:finix_params.text.full_name},showPlaceholders:!!finix_params.finix_form_options.showPlaceholders,placeholders:finix_params.finix_form_options.placeholders||{name:finix_params.text.full_name},defaultValues:finix_params.finix_form_options.defaultValues,hideFields:finix_params.finix_form_options.hideFields||["address_line1","address_line2","address_city","address_state"],requiredFields:finix_params.finix_form_options.requiredFields||["name","address_country","address_postal_code"],hideErrorMessages:!!finix_params.finix_form_options.hideErrorMessages,errorMessages:finix_params.finix_form_options.errorMessages||{name:finix_params.text.error_messages.name,address_city:finix_params.text.error_messages.address_city},styles:{default:{},success:{},error:{color:"#e2401c",boxShadow:"inset 2px 0 0 #e2401c"}},onUpdate(e,i,r){},onLoad(){}};function copyWooInputStylesToFinix(){var e=jQuery("input#billing_city, input#shipping_city");return FinixFormOptions.styles.default={color:e.css("color"),backgroundColor:e.css("background-color"),border:`${e.css("border-width")} ${e.css("border-style")} `+e.css("border-color"),borderRadius:`${e.css("border-top-left-radius")} ${e.css("border-top-right-radius")} ${e.css("border-bottom-right-radius")} `+e.css("border-bottom-left-radius"),fontFamily:e.css("font-family"),fontWeight:e.css("font-weight"),lineHeight:e.css("line-height"),boxShadow:e.css("box-shadow"),maxHeight:"100%",height:"100%",appearance:"auto"},FinixFormOptions}function triggerFinixSubmitError(e){var i=jQuery("form.woocommerce-checkout, form#order_review");void 0!==e&&0!==e.length||(e='<div class="woocommerce-error">'+wc_checkout_params.i18n_checkout_error+"</div>"),jQuery(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message, .is-error, .is-success").remove(),i.prepend('<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">'+e+"</div>"),i.removeClass("processing").unblock(),i.find(".input-text, select, input:checkbox").trigger("validate").trigger("blur");let r=jQuery(".woocommerce-NoticeGroup-updateOrderReview, .woocommerce-NoticeGroup-checkout");r.length||(r=i),jQuery.scroll_to_notices(r),i.find('.woocommerce-error[tabindex="-1"], .wc-block-components-notice-banner.is-error[tabindex="-1"]').trigger("focus"),jQuery(document.body).trigger("checkout_error",[e])}async function tokenRequest(e,o){return document.getElementById("place_order").disabled=!0,new Promise((r,n)=>{e.submit(finix_params.environment,finix_params.application,function(e,i){e?(triggerFinixSubmitError(),document.getElementById(o+"_token").value="",document.getElementById("place_order").disabled=!1,n(e)):(e=(i.data||{}).id,document.getElementById(o+"_token").value=e,document.getElementById("place_order").disabled=!1,r(e))})})}function initFinixForm(e){if(""===document.getElementById(e+"-form").innerHTML)switch(e){case"finix_gateway":return finix_params.finixForms.finix_gateway=window.Finix.CardTokenForm(e+"-form",FinixFormOptions),finix_params.finixForms.finix_gateway;case"finix_bank_gateway":return finix_params.finixForms.finix_bank_gateway=window.Finix.BankTokenForm(e+"-form",FinixFormOptions),finix_params.finixForms.finix_bank_gateway}return null}function processPlaceOrder(n){jQuery(document).on("click","#place_order",async function(e){var i=jQuery('input[name="payment_method"]:checked',n).val();if(!["finix_gateway","finix_bank_gateway"].includes(i))return!0;let r;switch(i){case"finix_gateway":r=finix_params.finixForms.finix_gateway;break;case"finix_bank_gateway":r=finix_params.finixForms.finix_bank_gateway}if(e.preventDefault(),e.stopImmediatePropagation(),n.find("#"+i+"_token").val())return n.trigger("submit"),!0;try{if(await tokenRequest(r,i))return n.trigger("submit"),!0}catch(e){return n.find("#"+i+"_token").val(""),triggerFinixSubmitError(),document.getElementById("place_order").disabled=!1}})}jQuery(function(){let r=jQuery("form.woocommerce-checkout, form#order_review");if(r.length){copyWooInputStylesToFinix(),window.Finix.Auth(finix_params.environment,finix_params.merchant,e=>{jQuery("#finix_fraud_session_id",r).length||r.prepend('<input type="hidden" id="finix_fraud_session_id" name="finix_fraud_session_id" value=""/>'),r.find("#finix_fraud_session_id").val(e);e=jQuery("#finix_nonce",r);e.length||r.prepend('<input type="hidden" id="finix_nonce" name="finix_nonce" value=""/>'),r.find("#finix_nonce").val(finix_params.nonce)}),finix_params.finixForms=finix_params.finixForms||{};var e=` 2 2 <style id="test"> 3 3 #finix_gateway-form .finix-form-container iframe, -
finix-for-woocommerce/trunk/assets/js/shortcode-google-pay.js
r3316914 r3418263 172 172 const billingData = retrieveBillingData(); 173 173 174 if ( ! billingData.first_name || ! billingData.last_name || ! billingData.address1 || ! billingData.city || ! billingData.state|| ! billingData.postcode || ! billingData.country || ! billingData.email ) {174 if ( ! billingData.first_name || ! billingData.last_name || ! billingData.address1 || ! billingData.city || ( billingData.country === 'US' && billingData.state === '' ) || ! billingData.postcode || ! billingData.country || ! billingData.email ) { 175 175 triggerGooglePaySubmitError( finix_google_pay_params.text.error_billing ); 176 176 return; … … 291 291 * We need to make sure we keep in sync our finix_apple_pay_params.amount value. 292 292 */ 293 jQuery(document).on('updated_checkout', function () { 294 295 finix_google_pay_params.amount = FinixHelpers.getUpdatedTotal(); 296 297 }); 298 293 jQuery( document ).on( 'updated_checkout', function () { 294 finix_google_pay_params.amount = FinixHelpers.getUpdatedValue( '.woocommerce-checkout-review-order-table .order-total .woocommerce-Price-amount' ); 295 296 // Get order details via AJAX. 297 298 fetch( finix_google_pay_params.url.ajax + '?action=get_order_tracking_details', { 299 method: 'POST', 300 headers: { 'Content-Type': 'application/json' }, 301 body: JSON.stringify( { nonce: finix_google_pay_params.nonce } ), 302 } ) 303 .then( ( response ) => response.json() ) 304 .then( ( data ) => { 305 if ( data.success === true ) { 306 finix_google_pay_params.subtotal = data.data.subtotal || finix_google_pay_params.amount; 307 finix_google_pay_params.shipping_amount = data.data.shipping_amount || 0; 308 finix_google_pay_params.tax_amount = data.data.tax_amount || 0; 309 finix_google_pay_params.products = data.data.products || []; 310 finix_google_pay_params.coupons = data.data.coupons || []; 311 } 312 } ) 313 .catch( ( err ) => {} ); 314 } ); 299 315 } ); -
finix-for-woocommerce/trunk/assets/js/shortcode-google-pay.min.js
r3316914 r3418263 1 function retrieveBillingData(){let e={};return document.querySelector("#billing_country")&&document.querySelector("#billing_email")?(e={first_name:document.querySelector("#billing_first_name")?.value||"",last_name:document.querySelector("#billing_last_name")?.value||"",address1:document.querySelector("#billing_address_1")?.value||"",city:document.querySelector("#billing_city")?.value||"",postcode:document.querySelector("#billing_postcode")?.value||"",country:document.querySelector("#billing_country")?.value||"",state:"hidden"!==document.querySelector("#billing_state")?.type&&document.querySelector("#billing_state")?.value||"",email:document.querySelector("#billing_email")?.value||""},document.querySelector("#billing_phone")?.closest("p.form-row")?.classList.contains("validate-required")&&(e.phone=document.querySelector("#billing_phone")?.value||"")):e={first_name:finix_google_pay_params.billing_data.first_name,last_name:finix_google_pay_params.billing_data.last_name,address1:finix_google_pay_params.billing_data.address_1,city:finix_google_pay_params.billing_data.city,postcode:finix_google_pay_params.billing_data.postcode,country:finix_google_pay_params.billing_data.country,state:finix_google_pay_params.billing_data.state,email:finix_google_pay_params.billing_data.email,phone:finix_google_pay_params.billing_data.phone},e}function retrieveShippingData(){var e,o,t, i,a,n=retrieveBillingData();return""===n.address1||""===n.city||"US"===n.country&&""===n.state||""===n.postcode||""===n.country?(triggerGooglePaySubmitError(finix_google_pay_params.text.error_billing),!1):(e=document.querySelector("#shipping_country")?.value||"",o=document.querySelector("#shipping_state")?.value||"",t=document.querySelector("#shipping_postcode")?.value||"",i=document.querySelector("#shipping_city")?.value||"",a=document.querySelector("#shipping_address_1")?.value||"",n={shipping_country:n.country,shipping_state:n.state,shipping_postcode:n.postcode,shipping_city:n.city,shipping_address_1:n.address1},nonEmptyValue(e)&&(n.shipping_country=e),nonEmptyValue(o)&&(n.shipping_state=o),nonEmptyValue(t)&&(n.shipping_postcode=t),nonEmptyValue(i)&&(n.shipping_city=i),nonEmptyValue(a)&&(n.shipping_address_1=a),n)}function triggerGooglePaySubmitError(e){var o=jQuery("form.woocommerce-checkout, form#order_review");void 0!==e&&0!==e.length||(e='<div class="woocommerce-error">'+finix_params.text.error_processing+"</div>"),jQuery(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message, .is-error, .is-success").remove(),o.prepend('<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">'+e+"</div>"),o.removeClass("processing").unblock(),o.find(".input-text, select, input:checkbox").trigger("validate").trigger("blur");let t=jQuery(".woocommerce-NoticeGroup-updateOrderReview, .woocommerce-NoticeGroup-checkout");t.length||(t=o),jQuery.scroll_to_notices(t),o.find('.woocommerce-error[tabindex="-1"], .wc-block-components-notice-banner.is-error[tabindex="-1"]').trigger("focus"),jQuery(document.body).trigger("checkout_error",[e])}function onGooglePayLoaded(){FinixGooglePay.getPaymentsClient().isReadyToPay(FinixGooglePay.getIsReadyToPayRequest()).then(function(e){e.result&&(addGooglePayButton(),FinixGooglePay.prefetch())}).catch(function(e){})}function validateWhetherGooglePaySelected(){var e;jQuery('input[name="payment_method"]:checked').val()===finix_google_pay_params.gateway&&(e=document.getElementById("wc-finix_google_pay_gateway-form"))&&"block"!==e.style.display&&(onGooglePayLoaded(),e.style.display="block")}function addGooglePayButton(){var e=FinixGooglePay.getPaymentsClient().createButton({onClick:onGooglePaymentButtonClicked,allowedPaymentMethods:[FinixGooglePay.getCardMethod()],buttonColor:finix_google_pay_params.button_color,buttonType:finix_google_pay_params.button_type,buttonRadius:finix_google_pay_params.button_radius,buttonLocale:finix_google_pay_params.button_locale});finix_google_pay_params.google_merchant_id&&""!==finix_google_pay_params.google_merchant_id&&void 0!==finix_google_pay_params.google_merchant_id&&document.getElementById("wc-finix_google_pay_gateway-form").appendChild(e)}function onGooglePaymentButtonClicked(){if(finix_google_pay_params.google_merchant_id&&""!==finix_google_pay_params.google_merchant_id&&void 0!==finix_google_pay_params.google_merchant_id){var t=retrieveBillingData();if(t.first_name&&t.last_name&&t.address1&&t.city&&t.state&&t.postcode&&t.country&&t.email){let e=retrieveShippingData(),o=(nonEmptyValue(e.shipping_country)&&nonEmptyValue(e.shipping_state)&&nonEmptyValue(e.shipping_postcode)&&nonEmptyValue(e.shipping_city)&&nonEmptyValue(e.shipping_address_1)||(e={shipping_country:t.country,shipping_state:t.state,shipping_postcode:t.postcode,shipping_city:t.city,shipping_address_1:t.address1}),FinixGooglePay.getPaymentsClient());e.nonce=finix_google_pay_params.nonce,fetch(finix_google_pay_params.url.ajax+"?action=validate_shipping_method",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(e=>e.json()).then(e=>{!0===e.success?((e=FinixGooglePay.getPaymentDataRequest()).transactionInfo=FinixGooglePay.getTransactionInfo(),o.loadPaymentData(e).then(e=>{processPaymentData(e)}).catch(e=>{})):triggerGooglePaySubmitError(finix_google_pay_params.text.error_shipping)}).catch(e=>{})}else triggerGooglePaySubmitError(finix_google_pay_params.text.error_billing)}else triggerGooglePaySubmitError(finix_google_pay_params.text.error_merchant_id)}async function processPaymentData(e){var o,e=e.paymentMethodData.tokenizationData.token;e?((o=retrieveBillingData()).address2=document.querySelector("#billing_address_2")?.value||"",FinixGooglePay.processPayment(e,o).then(e=>{e&&e.success?(document.querySelector("#finix_google_pay_success").value=e.success,document.querySelector("#finix_google_pay_transaction_id").value=e.transactionId||"",jQuery("form.woocommerce-checkout, form#order_review").trigger("submit")):(triggerGooglePaySubmitError(finix_google_pay_params.text.error_processing),document.querySelector("#finix_google_pay_success").value=!1)}).catch(e=>{triggerGooglePaySubmitError(finix_google_pay_params.text.error_processing),document.querySelector("#finix_google_pay_success").value=!1})):(triggerGooglePaySubmitError(finix_google_pay_params.text.error_setting_payment),document.querySelector("#finix_google_pay_success").value=!1)}function nonEmptyValue(e){return null!=e&&""!==e&&"undefined"!==e&&""!==e.trim()}jQuery(function(){let t=jQuery("form.woocommerce-checkout, form#order_review");if(t.length){let e=0,o=setInterval(function(){validateWhetherGooglePaySelected(),5<=++e&&clearInterval(o)},1e3);jQuery(document).on("click","#place_order",async function(e){if(jQuery('input[name="payment_method"]:checked',t).val()!==finix_google_pay_params.gateway)return!0;e.preventDefault(),e.stopImmediatePropagation(),onGooglePaymentButtonClicked()}),jQuery(document).on("updated_checkout",function(){finix_google_pay_params.amount=FinixHelpers.getUpdatedTotal()})}});1 function retrieveBillingData(){let e={};return document.querySelector("#billing_country")&&document.querySelector("#billing_email")?(e={first_name:document.querySelector("#billing_first_name")?.value||"",last_name:document.querySelector("#billing_last_name")?.value||"",address1:document.querySelector("#billing_address_1")?.value||"",city:document.querySelector("#billing_city")?.value||"",postcode:document.querySelector("#billing_postcode")?.value||"",country:document.querySelector("#billing_country")?.value||"",state:"hidden"!==document.querySelector("#billing_state")?.type&&document.querySelector("#billing_state")?.value||"",email:document.querySelector("#billing_email")?.value||""},document.querySelector("#billing_phone")?.closest("p.form-row")?.classList.contains("validate-required")&&(e.phone=document.querySelector("#billing_phone")?.value||"")):e={first_name:finix_google_pay_params.billing_data.first_name,last_name:finix_google_pay_params.billing_data.last_name,address1:finix_google_pay_params.billing_data.address_1,city:finix_google_pay_params.billing_data.city,postcode:finix_google_pay_params.billing_data.postcode,country:finix_google_pay_params.billing_data.country,state:finix_google_pay_params.billing_data.state,email:finix_google_pay_params.billing_data.email,phone:finix_google_pay_params.billing_data.phone},e}function retrieveShippingData(){var e,o,t,a,i,n=retrieveBillingData();return""===n.address1||""===n.city||"US"===n.country&&""===n.state||""===n.postcode||""===n.country?(triggerGooglePaySubmitError(finix_google_pay_params.text.error_billing),!1):(e=document.querySelector("#shipping_country")?.value||"",o=document.querySelector("#shipping_state")?.value||"",t=document.querySelector("#shipping_postcode")?.value||"",a=document.querySelector("#shipping_city")?.value||"",i=document.querySelector("#shipping_address_1")?.value||"",n={shipping_country:n.country,shipping_state:n.state,shipping_postcode:n.postcode,shipping_city:n.city,shipping_address_1:n.address1},nonEmptyValue(e)&&(n.shipping_country=e),nonEmptyValue(o)&&(n.shipping_state=o),nonEmptyValue(t)&&(n.shipping_postcode=t),nonEmptyValue(a)&&(n.shipping_city=a),nonEmptyValue(i)&&(n.shipping_address_1=i),n)}function triggerGooglePaySubmitError(e){var o=jQuery("form.woocommerce-checkout, form#order_review");void 0!==e&&0!==e.length||(e='<div class="woocommerce-error">'+finix_params.text.error_processing+"</div>"),jQuery(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message, .is-error, .is-success").remove(),o.prepend('<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">'+e+"</div>"),o.removeClass("processing").unblock(),o.find(".input-text, select, input:checkbox").trigger("validate").trigger("blur");let t=jQuery(".woocommerce-NoticeGroup-updateOrderReview, .woocommerce-NoticeGroup-checkout");t.length||(t=o),jQuery.scroll_to_notices(t),o.find('.woocommerce-error[tabindex="-1"], .wc-block-components-notice-banner.is-error[tabindex="-1"]').trigger("focus"),jQuery(document.body).trigger("checkout_error",[e])}function onGooglePayLoaded(){FinixGooglePay.getPaymentsClient().isReadyToPay(FinixGooglePay.getIsReadyToPayRequest()).then(function(e){e.result&&(addGooglePayButton(),FinixGooglePay.prefetch())}).catch(function(e){})}function validateWhetherGooglePaySelected(){var e;jQuery('input[name="payment_method"]:checked').val()===finix_google_pay_params.gateway&&(e=document.getElementById("wc-finix_google_pay_gateway-form"))&&"block"!==e.style.display&&(onGooglePayLoaded(),e.style.display="block")}function addGooglePayButton(){var e=FinixGooglePay.getPaymentsClient().createButton({onClick:onGooglePaymentButtonClicked,allowedPaymentMethods:[FinixGooglePay.getCardMethod()],buttonColor:finix_google_pay_params.button_color,buttonType:finix_google_pay_params.button_type,buttonRadius:finix_google_pay_params.button_radius,buttonLocale:finix_google_pay_params.button_locale});finix_google_pay_params.google_merchant_id&&""!==finix_google_pay_params.google_merchant_id&&void 0!==finix_google_pay_params.google_merchant_id&&document.getElementById("wc-finix_google_pay_gateway-form").appendChild(e)}function onGooglePaymentButtonClicked(){if(finix_google_pay_params.google_merchant_id&&""!==finix_google_pay_params.google_merchant_id&&void 0!==finix_google_pay_params.google_merchant_id){var t=retrieveBillingData();if(t.first_name&&t.last_name&&t.address1&&t.city&&("US"!==t.country||""!==t.state)&&t.postcode&&t.country&&t.email){let e=retrieveShippingData(),o=(nonEmptyValue(e.shipping_country)&&nonEmptyValue(e.shipping_state)&&nonEmptyValue(e.shipping_postcode)&&nonEmptyValue(e.shipping_city)&&nonEmptyValue(e.shipping_address_1)||(e={shipping_country:t.country,shipping_state:t.state,shipping_postcode:t.postcode,shipping_city:t.city,shipping_address_1:t.address1}),FinixGooglePay.getPaymentsClient());e.nonce=finix_google_pay_params.nonce,fetch(finix_google_pay_params.url.ajax+"?action=validate_shipping_method",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(e=>e.json()).then(e=>{!0===e.success?((e=FinixGooglePay.getPaymentDataRequest()).transactionInfo=FinixGooglePay.getTransactionInfo(),o.loadPaymentData(e).then(e=>{processPaymentData(e)}).catch(e=>{})):triggerGooglePaySubmitError(finix_google_pay_params.text.error_shipping)}).catch(e=>{})}else triggerGooglePaySubmitError(finix_google_pay_params.text.error_billing)}else triggerGooglePaySubmitError(finix_google_pay_params.text.error_merchant_id)}async function processPaymentData(e){var o,e=e.paymentMethodData.tokenizationData.token;e?((o=retrieveBillingData()).address2=document.querySelector("#billing_address_2")?.value||"",FinixGooglePay.processPayment(e,o).then(e=>{e&&e.success?(document.querySelector("#finix_google_pay_success").value=e.success,document.querySelector("#finix_google_pay_transaction_id").value=e.transactionId||"",jQuery("form.woocommerce-checkout, form#order_review").trigger("submit")):(triggerGooglePaySubmitError(finix_google_pay_params.text.error_processing),document.querySelector("#finix_google_pay_success").value=!1)}).catch(e=>{triggerGooglePaySubmitError(finix_google_pay_params.text.error_processing),document.querySelector("#finix_google_pay_success").value=!1})):(triggerGooglePaySubmitError(finix_google_pay_params.text.error_setting_payment),document.querySelector("#finix_google_pay_success").value=!1)}function nonEmptyValue(e){return null!=e&&""!==e&&"undefined"!==e&&""!==e.trim()}jQuery(function(){let t=jQuery("form.woocommerce-checkout, form#order_review");if(t.length){let e=0,o=setInterval(function(){validateWhetherGooglePaySelected(),5<=++e&&clearInterval(o)},1e3);jQuery(document).on("click","#place_order",async function(e){if(jQuery('input[name="payment_method"]:checked',t).val()!==finix_google_pay_params.gateway)return!0;e.preventDefault(),e.stopImmediatePropagation(),onGooglePaymentButtonClicked()}),jQuery(document).on("updated_checkout",function(){finix_google_pay_params.amount=FinixHelpers.getUpdatedValue(".woocommerce-checkout-review-order-table .order-total .woocommerce-Price-amount"),fetch(finix_google_pay_params.url.ajax+"?action=get_order_tracking_details",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({nonce:finix_google_pay_params.nonce})}).then(e=>e.json()).then(e=>{!0===e.success&&(finix_google_pay_params.subtotal=e.data.subtotal||finix_google_pay_params.amount,finix_google_pay_params.shipping_amount=e.data.shipping_amount||0,finix_google_pay_params.tax_amount=e.data.tax_amount||0,finix_google_pay_params.products=e.data.products||[],finix_google_pay_params.coupons=e.data.coupons||[])}).catch(e=>{})})}}); -
finix-for-woocommerce/trunk/assets/languages/finix-for-woocommerce.pot
r3375717 r3418263 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Finix for WooCommerce 1. 3.0\n"5 "Project-Id-Version: Finix for WooCommerce 1.4.0\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/finix-for-woocommerce\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025-1 0-09T12:02:03+00:00\n"12 "POT-Creation-Date: 2025-12-12T12:24:02+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" … … 27 27 #. Description of the plugin 28 28 #: finix-for-woocommerce.php 29 msgid " Take credit card, ACH, and Apple Pay payments on your store using Finix."29 msgid "Accept credit card, bank, Apple Pay, and Google Pay payments on your store using Finix." 30 30 msgstr "" 31 31 … … 53 53 #: src/Admin/Admin.php:83 54 54 #, php-format 55 msgid "<strong>All the payments will be declined.</strong> Supported currencies: %s." 55 msgid "<strong>All payments will be declined.</strong> Supported currencies: %s." 56 msgstr "" 57 58 #: src/Admin/Admin.php:114 59 msgid "Apple Pay and Google Pay can only run over HTTPS." 60 msgstr "" 61 62 #: src/Admin/Admin.php:115 63 msgid "Please enable SSL (HTTPS) on your website to use them at checkout OR disable these payment methods." 56 64 msgstr "" 57 65 … … 79 87 #: src/Events/CardAchPaymentEvent.php:136 80 88 #: src/Events/GooglePayPaymentCompletedEvent.php:38 81 msgid "Payment error: There was an error while processing your payment. Please try again."89 msgid "Payment error: There was an error processing your payment. Please try again later." 82 90 msgstr "" 83 91 … … 90 98 #: src/Events/GooglePayPaymentCompletedEvent.php:95 91 99 #: src/Events/GooglePayPaymentCompletedEvent.php:107 92 msgid "Payment error: There was an error whileprocessing your payment. Please contact support if you were charged."100 msgid "Payment error: There was an error processing your payment. Please contact support if you were charged." 93 101 msgstr "" 94 102 … … 104 112 #: src/Events/ApplePayPaymentEvent.php:79 105 113 #: src/Events/GooglePayPaymentEvent.php:79 106 msgid "There was an error while processing your payment." 114 #: src/Gateways/ApplePayGateway.php:391 115 #: src/Gateways/ApplePayGateway.php:441 116 #: src/Gateways/CardBankGateway.php:61 117 #: src/Gateways/GooglePayGateway.php:350 118 #: src/Gateways/GooglePayGateway.php:417 119 #: src/Gateways/PaymentMethods/ApplePay.php:125 120 #: src/Gateways/PaymentMethods/GooglePay.php:139 121 msgid "There was an error processing your payment. Please try again later." 107 122 msgstr "" 108 123 … … 116 131 #: src/Events/ApplePaySessionEvent.php:50 117 132 #: src/Events/GooglePayPaymentEvent.php:128 118 #: src/Gateways/ApplePayGateway.php:55 8119 #: src/Gateways/GooglePayGateway.php: 470133 #: src/Gateways/ApplePayGateway.php:557 134 #: src/Gateways/GooglePayGateway.php:504 120 135 msgid "There was an error processing the payment." 121 136 msgstr "" … … 123 138 #: src/Events/ApplePayPaymentEvent.php:144 124 139 #: src/Events/GooglePayPaymentEvent.php:144 125 #: src/Gateways/ApplePayGateway.php:50 5126 #: src/Gateways/ApplePayGateway.php:51 5127 #: src/Gateways/GooglePayGateway.php:4 32128 #: src/Gateways/GooglePayGateway.php:4 42140 #: src/Gateways/ApplePayGateway.php:504 141 #: src/Gateways/ApplePayGateway.php:514 142 #: src/Gateways/GooglePayGateway.php:466 143 #: src/Gateways/GooglePayGateway.php:476 129 144 msgid "There was an error while processing the payment. Please try again later." 130 145 msgstr "" … … 182 197 183 198 #: src/Events/CardAchPaymentEvent.php:163 184 msgid "Payment pending: There was an error while processing your payment. Please try again."199 msgid "Payment pending: There was an error processing your payment. Please try again later." 185 200 msgstr "" 186 201 … … 194 209 195 210 #: src/Events/CardAchPaymentEvent.php:191 196 msgid "Payment failed: There was an error while processing your payment. Please try again."211 msgid "Payment failed: There was an error processing your payment. Please try again later." 197 212 msgstr "" 198 213 … … 235 250 msgstr "" 236 251 252 #: src/Gateways/ApplePayGateway.php:33 253 msgid "Finix Apple Pay" 254 msgstr "" 255 237 256 #: src/Gateways/ApplePayGateway.php:34 238 msgid "Finix Apple Pay"239 msgstr ""240 241 #: src/Gateways/ApplePayGateway.php:35242 257 msgid "Accept Apple Pay payments with Finix." 243 258 msgstr "" 244 259 245 #: src/Gateways/ApplePayGateway.php: 40260 #: src/Gateways/ApplePayGateway.php:39 246 261 #: assets/js/block/src/apple-pay.js:15 247 262 msgid "Pay with Apple Pay" 248 263 msgstr "" 249 264 250 #: src/Gateways/ApplePayGateway.php:8 2265 #: src/Gateways/ApplePayGateway.php:81 251 266 #: src/Gateways/BankGateway.php:38 252 267 #: src/Gateways/CardGateway.php:47 253 #: src/Gateways/GooglePayGateway.php:8 1268 #: src/Gateways/GooglePayGateway.php:82 254 269 msgid "General Settings" 255 270 msgstr "" 256 271 257 #: src/Gateways/ApplePayGateway.php:8 7272 #: src/Gateways/ApplePayGateway.php:86 258 273 #: src/Gateways/BankGateway.php:43 259 274 #: src/Gateways/CardGateway.php:52 260 #: src/Gateways/GooglePayGateway.php:8 6275 #: src/Gateways/GooglePayGateway.php:87 261 276 msgid "Status" 262 277 msgstr "" 263 278 264 #: src/Gateways/ApplePayGateway.php:8 8265 msgid "Enable Appl yPay Gateway"266 msgstr "" 267 268 #: src/Gateways/ApplePayGateway.php:9 4279 #: src/Gateways/ApplePayGateway.php:87 280 msgid "Enable Apple Pay Gateway" 281 msgstr "" 282 283 #: src/Gateways/ApplePayGateway.php:93 269 284 #: src/Gateways/BankGateway.php:50 270 285 #: src/Gateways/CardGateway.php:59 271 #: src/Gateways/GooglePayGateway.php:9 3286 #: src/Gateways/GooglePayGateway.php:94 272 287 msgid "Title" 273 288 msgstr "" 274 289 275 #: src/Gateways/ApplePayGateway.php:9 6290 #: src/Gateways/ApplePayGateway.php:95 276 291 #: src/Gateways/BankGateway.php:52 277 292 #: src/Gateways/CardGateway.php:61 278 #: src/Gateways/GooglePayGateway.php:9 5293 #: src/Gateways/GooglePayGateway.php:96 279 294 msgid "This controls the title which the user sees during checkout." 280 295 msgstr "" 281 296 282 #: src/Gateways/ApplePayGateway.php:9 7297 #: src/Gateways/ApplePayGateway.php:96 283 298 #: src/Gateways/FinixGateway.php:262 284 299 msgid "Apple Pay" 285 300 msgstr "" 286 301 287 #: src/Gateways/ApplePayGateway.php:10 1302 #: src/Gateways/ApplePayGateway.php:100 288 303 #: src/Gateways/BankGateway.php:57 289 304 #: src/Gateways/CardGateway.php:66 290 #: src/Gateways/GooglePayGateway.php:10 0305 #: src/Gateways/GooglePayGateway.php:101 291 306 msgid "Description" 292 307 msgstr "" 293 308 294 #: src/Gateways/ApplePayGateway.php:10 3309 #: src/Gateways/ApplePayGateway.php:102 295 310 #: src/Gateways/BankGateway.php:59 296 311 #: src/Gateways/CardGateway.php:68 297 #: src/Gateways/GooglePayGateway.php:10 2312 #: src/Gateways/GooglePayGateway.php:103 298 313 msgid "This controls the description which the user sees during checkout. It will be wrapped in the paragraph tag." 299 314 msgstr "" 300 315 301 #: src/Gateways/ApplePayGateway.php:10 8316 #: src/Gateways/ApplePayGateway.php:107 302 317 msgid "Button Style" 303 318 msgstr "" 304 319 305 #: src/Gateways/ApplePayGateway.php:1 10320 #: src/Gateways/ApplePayGateway.php:109 306 321 msgid "Choose the style for the Apple Pay button." 307 322 msgstr "" 308 323 324 #: src/Gateways/ApplePayGateway.php:111 325 #: src/Gateways/GooglePayGateway.php:113 326 msgid "Black" 327 msgstr "" 328 309 329 #: src/Gateways/ApplePayGateway.php:112 310 msgid "Black" 330 #: src/Gateways/GooglePayGateway.php:114 331 msgid "White" 311 332 msgstr "" 312 333 313 334 #: src/Gateways/ApplePayGateway.php:113 314 msgid "White"315 msgstr ""316 317 #: src/Gateways/ApplePayGateway.php:114318 335 msgid "White with outline" 319 336 msgstr "" 320 337 321 #: src/Gateways/ApplePayGateway.php:1 20322 #: src/Gateways/GooglePayGateway.php:1 19338 #: src/Gateways/ApplePayGateway.php:119 339 #: src/Gateways/GooglePayGateway.php:120 323 340 msgid "Button Type" 324 341 msgstr "" 325 342 326 #: src/Gateways/ApplePayGateway.php:122 327 msgid "Choose the type of the Apple Pay button. This affects wording on a button." 343 #: src/Gateways/ApplePayGateway.php:121 344 msgid "Choose the type of the Apple Pay button. This affects the button text." 345 msgstr "" 346 347 #: src/Gateways/ApplePayGateway.php:123 348 #: src/Gateways/GooglePayGateway.php:124 349 msgid "Plain" 328 350 msgstr "" 329 351 330 352 #: src/Gateways/ApplePayGateway.php:124 331 msgid " Plain"353 msgid "Continue" 332 354 msgstr "" 333 355 334 356 #: src/Gateways/ApplePayGateway.php:125 335 msgid " Continue"357 msgid "Add Money" 336 358 msgstr "" 337 359 338 360 #: src/Gateways/ApplePayGateway.php:126 339 msgid "Add Money" 361 #: src/Gateways/GooglePayGateway.php:129 362 msgid "Book" 340 363 msgstr "" 341 364 342 365 #: src/Gateways/ApplePayGateway.php:127 343 msgid "Book" 366 #: src/Gateways/GooglePayGateway.php:125 367 msgid "Buy" 344 368 msgstr "" 345 369 346 370 #: src/Gateways/ApplePayGateway.php:128 347 msgid " Buy"371 msgid "Check Out" 348 372 msgstr "" 349 373 350 374 #: src/Gateways/ApplePayGateway.php:129 351 msgid "C heck Out"375 msgid "Contribute" 352 376 msgstr "" 353 377 354 378 #: src/Gateways/ApplePayGateway.php:130 355 msgid "Contribute" 379 #: src/Gateways/GooglePayGateway.php:127 380 msgid "Donate" 356 381 msgstr "" 357 382 358 383 #: src/Gateways/ApplePayGateway.php:131 359 msgid "Donate" 384 #: src/Gateways/GooglePayGateway.php:130 385 msgid "Order" 360 386 msgstr "" 361 387 362 388 #: src/Gateways/ApplePayGateway.php:132 363 msgid "Order" 389 #: src/Gateways/GooglePayGateway.php:131 390 msgid "Pay" 364 391 msgstr "" 365 392 366 393 #: src/Gateways/ApplePayGateway.php:133 367 msgid " Pay"394 msgid "Reload" 368 395 msgstr "" 369 396 370 397 #: src/Gateways/ApplePayGateway.php:134 371 msgid "Re load"398 msgid "Rent" 372 399 msgstr "" 373 400 374 401 #: src/Gateways/ApplePayGateway.php:135 375 msgid " Rent"402 msgid "Set Up" 376 403 msgstr "" 377 404 378 405 #: src/Gateways/ApplePayGateway.php:136 379 msgid "Set Up" 406 #: src/Gateways/GooglePayGateway.php:128 407 msgid "Subscribe" 380 408 msgstr "" 381 409 382 410 #: src/Gateways/ApplePayGateway.php:137 383 msgid "Su bscribe"411 msgid "Support" 384 412 msgstr "" 385 413 386 414 #: src/Gateways/ApplePayGateway.php:138 387 msgid " Support"415 msgid "Tip" 388 416 msgstr "" 389 417 390 418 #: src/Gateways/ApplePayGateway.php:139 391 msgid "Tip"392 msgstr ""393 394 #: src/Gateways/ApplePayGateway.php:140395 419 msgid "Top Up" 396 420 msgstr "" 397 421 398 #: src/Gateways/ApplePayGateway.php:14 6399 #: src/Gateways/GooglePayGateway.php:14 3422 #: src/Gateways/ApplePayGateway.php:145 423 #: src/Gateways/GooglePayGateway.php:144 400 424 msgid "Display Name" 401 425 msgstr "" 402 426 403 #: src/Gateways/ApplePayGateway.php:14 8427 #: src/Gateways/ApplePayGateway.php:147 404 428 msgid "This will be the merchant name shown to users when making a purchase via Apple Pay." 405 429 msgstr "" 406 430 407 #: src/Gateways/ApplePayGateway.php:16 3431 #: src/Gateways/ApplePayGateway.php:162 408 432 msgid "Apple Pay Payment Method" 409 433 msgstr "" 410 434 411 #: src/Gateways/ApplePayGateway.php:16 5412 msgid " Receive payments via Apple Pay with Finix. You can configure the available options on this page."435 #: src/Gateways/ApplePayGateway.php:164 436 msgid "Accept payments via Apple Pay with Finix. You can configure available options on this page." 413 437 msgstr "" 414 438 415 439 #. translators: %s - plugin version. 416 #: src/Gateways/ApplePayGateway.php:16 9440 #: src/Gateways/ApplePayGateway.php:168 417 441 msgid "<strong>Note:</strong> Apple Pay with Finix for WooCommerce is only supported with Live Credentials." 418 442 msgstr "" 419 443 420 #: src/Gateways/ApplePayGateway.php:18 2444 #: src/Gateways/ApplePayGateway.php:181 421 445 msgid "Register Domain" 422 446 msgstr "" 423 447 424 #: src/Gateways/ApplePayGateway.php:18 5448 #: src/Gateways/ApplePayGateway.php:184 425 449 msgid "This plugin attempts to add the domain association to your server automatically when you click the \"Register Domain\" button." 426 450 msgstr "" 427 451 428 #: src/Gateways/ApplePayGateway.php:18 7452 #: src/Gateways/ApplePayGateway.php:186 429 453 msgid "In order for Apple Pay to display you must test with an iOS device and have a payment method saved in the Apple Wallet." 430 454 msgstr "" 431 455 432 456 #. translators: %s - domain name. 433 #: src/Gateways/ApplePayGateway.php:19 5457 #: src/Gateways/ApplePayGateway.php:194 434 458 #, php-format 435 459 msgid "Register Domain: %s" 436 460 msgstr "" 437 461 462 #: src/Gateways/ApplePayGateway.php:247 463 msgid "Registering domain..." 464 msgstr "" 465 438 466 #: src/Gateways/ApplePayGateway.php:248 439 msgid "Registering domain..." 440 msgstr "" 441 442 #: src/Gateways/ApplePayGateway.php:249 467 #: src/Gateways/ApplePayGateway.php:392 468 #: src/Gateways/GooglePayGateway.php:352 469 #: src/Gateways/PaymentMethods/ApplePay.php:126 470 #: src/Gateways/PaymentMethods/GooglePay.php:140 471 msgid "Please enter a valid billing address." 472 msgstr "" 473 474 #: src/Gateways/ApplePayGateway.php:261 475 #: src/Gateways/CardBankGateway.php:80 476 #: src/Gateways/GooglePayGateway.php:194 477 msgid "TEST MODE ENABLED. All the payments will go through the sandbox." 478 msgstr "" 479 443 480 #: src/Gateways/ApplePayGateway.php:393 444 #: src/Gateways/PaymentMethods/ApplePay.php:126 445 #: src/Gateways/PaymentMethods/GooglePay.php:131 446 msgid "Please enter a valid billing address." 447 msgstr "" 448 449 #: src/Gateways/ApplePayGateway.php:262 450 #: src/Gateways/CardBankGateway.php:79 451 #: src/Gateways/GooglePayGateway.php:193 452 msgid "TEST MODE ENABLED. All the payments will go through the sandbox." 453 msgstr "" 454 455 #: src/Gateways/ApplePayGateway.php:392 456 #: src/Gateways/ApplePayGateway.php:442 457 #: src/Gateways/CardBankGateway.php:60 458 #: src/Gateways/GooglePayGateway.php:321 459 #: src/Gateways/GooglePayGateway.php:383 460 #: src/Gateways/PaymentMethods/ApplePay.php:125 461 #: src/Gateways/PaymentMethods/GooglePay.php:130 462 msgid "There was an error while processing your payment. Please try again later." 481 #: src/Gateways/GooglePayGateway.php:355 482 #: src/Gateways/PaymentMethods/ApplePay.php:127 483 #: src/Gateways/PaymentMethods/GooglePay.php:141 484 #: assets/js/block/src/apple-pay.js:288 485 #: assets/js/block/src/FinixGooglePay.js:70 486 msgid "Subtotal" 463 487 msgstr "" 464 488 465 489 #: src/Gateways/ApplePayGateway.php:394 466 #: src/Gateways/PaymentMethods/ApplePay.php:127 467 #: assets/js/block/src/apple-pay.js:288 468 msgid "Subtotal" 490 #: src/Gateways/GooglePayGateway.php:356 491 #: src/Gateways/PaymentMethods/ApplePay.php:128 492 #: src/Gateways/PaymentMethods/GooglePay.php:142 493 #: assets/js/block/src/apple-pay.js:305 494 #: assets/js/block/src/FinixGooglePay.js:87 495 msgid "Shipping" 469 496 msgstr "" 470 497 471 498 #: src/Gateways/ApplePayGateway.php:395 472 #: src/Gateways/PaymentMethods/ApplePay.php:128 473 #: assets/js/block/src/apple-pay.js:305 474 msgid "Shipping" 499 #: src/Gateways/GooglePayGateway.php:357 500 #: src/Gateways/PaymentMethods/ApplePay.php:129 501 #: src/Gateways/PaymentMethods/GooglePay.php:143 502 #: assets/js/block/src/apple-pay.js:314 503 #: assets/js/block/src/FinixGooglePay.js:96 504 msgid "Tax" 475 505 msgstr "" 476 506 477 507 #: src/Gateways/ApplePayGateway.php:396 478 #: src/Gateways/PaymentMethods/ApplePay.php:129 479 #: assets/js/block/src/apple-pay.js:314 480 msgid "Tax" 481 msgstr "" 482 483 #: src/Gateways/ApplePayGateway.php:397 508 #: src/Gateways/GooglePayGateway.php:358 484 509 #: src/Gateways/PaymentMethods/ApplePay.php:130 510 #: src/Gateways/PaymentMethods/GooglePay.php:144 485 511 #: assets/js/block/src/apple-pay.js:296 512 #: assets/js/block/src/FinixGooglePay.js:78 486 513 msgid "Discount code:" 487 514 msgstr "" … … 509 536 510 537 #: src/Gateways/BankGateway.php:75 511 msgid " Takebank payments with Finix. You can configure available options on this page."512 msgstr "" 513 514 #: src/Gateways/CardBankGateway.php:3 4538 msgid "Accept bank payments with Finix. You can configure available options on this page." 539 msgstr "" 540 541 #: src/Gateways/CardBankGateway.php:35 515 542 msgid "Pay with Finix" 516 543 msgstr "" 517 544 518 #: src/Gateways/CardBankGateway.php:141 519 #: src/Gateways/CardBankGateway.php:145 520 #: src/Gateways/CardBankGateway.php:167 521 #: src/Gateways/PaymentMethods/CardBankMethod.php:101 522 #: src/Gateways/PaymentMethods/CardBankMethod.php:105 545 #: src/Gateways/CardBankGateway.php:152 546 #: src/Helpers/CartData.php:128 547 #: src/Helpers/CartData.php:132 523 548 #: assets/js/block/src/bank.js:95 524 549 #: assets/js/block/src/card.js:95 … … 526 551 msgstr "" 527 552 528 #: src/Gateways/CardBankGateway.php:151 529 #: src/Gateways/CardBankGateway.php:169 530 #: src/Gateways/PaymentMethods/CardBankMethod.php:111 531 msgid "Please enter a valid full name" 532 msgstr "" 533 534 #: src/Gateways/CardBankGateway.php:170 535 #: assets/js/block/src/bank.js:106 536 #: assets/js/block/src/card.js:106 537 msgid "Please enter a valid city" 538 msgstr "" 539 540 #: src/Gateways/CardBankGateway.php:215 553 #: src/Gateways/CardBankGateway.php:154 554 #: src/Helpers/CartData.php:139 555 msgid "Please enter a valid full name." 556 msgstr "" 557 558 #: src/Gateways/CardBankGateway.php:155 559 msgid "Please enter a valid city." 560 msgstr "" 561 562 #: src/Gateways/CardBankGateway.php:200 541 563 msgid "Refund failed." 542 564 msgstr "" … … 564 586 565 587 #: src/Gateways/CardGateway.php:84 566 msgid " Takecard payments with Finix. You can configure available options on this page."588 msgid "Accept card payments with Finix. You can configure available options on this page." 567 589 msgstr "" 568 590 … … 593 615 594 616 #: src/Gateways/FinixGateway.php:91 595 msgid "This tag will be used to identify the source of the payment. It will be used to tag the payment details sendto Finix."617 msgid "This tag will be used to identify the source of the payment. It will be used to tag payment details sent to Finix." 596 618 msgstr "" 597 619 … … 605 627 606 628 #: src/Gateways/FinixGateway.php:106 607 msgid "This is the application ID provided on Finix dashboard -> developer menu by selecting sandbox environment"629 msgid "This is the application ID provided in Finix Dashboard > Developer menu by selecting your Sandbox environment" 608 630 msgstr "" 609 631 … … 643 665 644 666 #: src/Gateways/FinixGateway.php:143 645 msgid "This is the application ID provided on Finix dashboard -> developer menu by selecting live environment"667 msgid "This is the application ID provided in Finix Dashboard > Developer menu by selecting your Live environment" 646 668 msgstr "" 647 669 … … 672 694 673 695 #: src/Gateways/FinixGateway.php:181 674 msgid "If enabled, the plugin will listen to the dispute.created webhook event and update the order stat eif a dispute is created."696 msgid "If enabled, the plugin will listen to the dispute.created webhook event and update the order status if a dispute is created." 675 697 msgstr "" 676 698 677 699 #: src/Gateways/FinixGateway.php:186 678 msgid "Disputes Order Stat e"700 msgid "Disputes Order Status" 679 701 msgstr "" 680 702 … … 689 711 690 712 #: src/Gateways/FinixGateway.php:197 691 msgid "If enabled, the plugin will listen to ACH returns and update the order stat eif ACH return is created."713 msgid "If enabled, the plugin will listen to ACH returns and update the order status if ACH return is created." 692 714 msgstr "" 693 715 694 716 #: src/Gateways/FinixGateway.php:202 695 msgid "ACH Return Order Stat e"717 msgid "ACH Return Order Status" 696 718 msgstr "" 697 719 … … 713 735 714 736 #: src/Gateways/FinixGateway.php:263 715 #: src/Gateways/GooglePayGateway.php:9 6737 #: src/Gateways/GooglePayGateway.php:97 716 738 msgid "Google Pay" 717 739 msgstr "" 718 740 719 #: src/Gateways/FinixGateway.php:27 5720 #: src/Gateways/FinixGateway.php:27 6741 #: src/Gateways/FinixGateway.php:277 742 #: src/Gateways/FinixGateway.php:278 721 743 msgid "Finix Payments" 722 744 msgstr "" 723 745 724 #: src/Gateways/FinixGateway.php:32 1746 #: src/Gateways/FinixGateway.php:323 725 747 msgid "Webhook Configuration" 726 748 msgstr "" 727 749 728 750 #. translators: %s - Finix Dashboard URL. 729 #: src/Gateways/FinixGateway.php:32 7751 #: src/Gateways/FinixGateway.php:329 730 752 #, php-format 731 753 msgid "To enable webhook, please add the following details to your <a href=\"%s\" target=\"_blank\">Finix Dashboard</a>:" 732 754 msgstr "" 733 755 734 #: src/Gateways/FinixGateway.php:34 3756 #: src/Gateways/FinixGateway.php:345 735 757 msgid "URL:" 736 758 msgstr "" 737 759 738 #: src/Gateways/FinixGateway.php:34 7760 #: src/Gateways/FinixGateway.php:349 739 761 msgid "Authentication Type:" 740 762 msgstr "" 741 763 742 #: src/Gateways/FinixGateway.php:3 48764 #: src/Gateways/FinixGateway.php:350 743 765 msgid "Basic" 744 766 msgstr "" 745 767 746 #: src/Gateways/FinixGateway.php:35 1768 #: src/Gateways/FinixGateway.php:353 747 769 msgid "Username:" 748 770 msgstr "" 749 771 750 #: src/Gateways/FinixGateway.php:35 5772 #: src/Gateways/FinixGateway.php:357 751 773 msgid "Password:" 752 774 msgstr "" 753 775 754 #: src/Gateways/FinixGateway.php:3 59776 #: src/Gateways/FinixGateway.php:361 755 777 msgid "Required Events:" 756 778 msgstr "" 757 779 758 #: src/Gateways/GooglePayGateway.php:3 2780 #: src/Gateways/GooglePayGateway.php:33 759 781 msgid "Finix Google Pay" 760 782 msgstr "" 761 783 762 #: src/Gateways/GooglePayGateway.php:3 3784 #: src/Gateways/GooglePayGateway.php:34 763 785 msgid "Accept Google Pay payments with Finix." 764 786 msgstr "" 765 787 766 #: src/Gateways/GooglePayGateway.php:3 8788 #: src/Gateways/GooglePayGateway.php:39 767 789 #: assets/js/block/src/google-pay.js:16 768 790 msgid "Pay with Google Pay" 769 791 msgstr "" 770 792 771 #: src/Gateways/GooglePayGateway.php:8 7793 #: src/Gateways/GooglePayGateway.php:88 772 794 msgid "Enable Google Pay Gateway" 773 795 msgstr "" 774 796 775 #: src/Gateways/GooglePayGateway.php:10 7797 #: src/Gateways/GooglePayGateway.php:108 776 798 msgid "Button Color" 777 799 msgstr "" 778 800 779 #: src/Gateways/GooglePayGateway.php:109 780 msgid "Choose color for the Google Pay button." 781 msgstr "" 782 783 #: src/Gateways/GooglePayGateway.php:111 784 msgid "Default Button" 801 #: src/Gateways/GooglePayGateway.php:110 802 msgid "Choose the color for the Google Pay button." 785 803 msgstr "" 786 804 787 805 #: src/Gateways/GooglePayGateway.php:112 788 msgid "Black Button" 789 msgstr "" 790 791 #: src/Gateways/GooglePayGateway.php:113 792 msgid "White Button" 793 msgstr "" 794 795 #: src/Gateways/GooglePayGateway.php:121 806 msgid "Default" 807 msgstr "" 808 809 #: src/Gateways/GooglePayGateway.php:122 796 810 msgid "Choose which type of Google Pay button you want." 797 811 msgstr "" 798 812 799 #: src/Gateways/GooglePayGateway.php:123800 msgid "Plain Button"801 msgstr ""802 803 #: src/Gateways/GooglePayGateway.php:124804 msgid "Buy Button"805 msgstr ""806 807 #: src/Gateways/GooglePayGateway.php:125808 msgid "Checkout Button"809 msgstr ""810 811 813 #: src/Gateways/GooglePayGateway.php:126 812 msgid "Donate Button" 813 msgstr "" 814 815 #: src/Gateways/GooglePayGateway.php:127 816 msgid "Subscribe Button" 817 msgstr "" 818 819 #: src/Gateways/GooglePayGateway.php:128 820 msgid "Book Button" 821 msgstr "" 822 823 #: src/Gateways/GooglePayGateway.php:129 824 msgid "Order Button" 825 msgstr "" 826 827 #: src/Gateways/GooglePayGateway.php:130 828 msgid "Pay Button" 829 msgstr "" 830 831 #: src/Gateways/GooglePayGateway.php:136 814 msgid "Checkout" 815 msgstr "" 816 817 #: src/Gateways/GooglePayGateway.php:137 832 818 msgid "Button Corner Radius" 833 819 msgstr "" 834 820 835 #: src/Gateways/GooglePayGateway.php:13 8821 #: src/Gateways/GooglePayGateway.php:139 836 822 msgid "Choose the corner radius for the Google Pay button. Default is 5px." 837 823 msgstr "" 838 824 839 #: src/Gateways/GooglePayGateway.php:14 5825 #: src/Gateways/GooglePayGateway.php:146 840 826 msgid "This will be the merchant name shown to users when making a purchase via Google Pay." 841 827 msgstr "" 842 828 843 #: src/Gateways/GooglePayGateway.php:15 0829 #: src/Gateways/GooglePayGateway.php:151 844 830 msgid "Google Merchant ID" 845 831 msgstr "" 846 832 847 #: src/Gateways/GooglePayGateway.php:15 2833 #: src/Gateways/GooglePayGateway.php:153 848 834 msgid "This is the Google Merchant ID. You can find it on your Google Business console." 849 835 msgstr "" 850 836 851 #: src/Gateways/GooglePayGateway.php:16 7837 #: src/Gateways/GooglePayGateway.php:168 852 838 msgid "Google Pay Payment Method" 853 839 msgstr "" 854 840 855 #: src/Gateways/GooglePayGateway.php:1 69856 msgid " Receive payments via Google Pay with Finix. You can configure the available options on this page."857 msgstr "" 858 859 #: src/Gateways/GooglePayGateway.php:3 22841 #: src/Gateways/GooglePayGateway.php:170 842 msgid "Accept payments via Google Pay with Finix. You can configure available options on this page." 843 msgstr "" 844 845 #: src/Gateways/GooglePayGateway.php:351 860 846 msgid "There was an error processing the payment through Google Pay. Please try a different method or try again later." 861 847 msgstr "" 862 848 863 #: src/Gateways/GooglePayGateway.php:323 864 msgid "Please enter a valid billing details." 865 msgstr "" 866 867 #: src/Gateways/GooglePayGateway.php:324 868 msgid "Please enter a valid shipping details." 869 msgstr "" 870 871 #: src/Gateways/GooglePayGateway.php:325 849 #: src/Gateways/GooglePayGateway.php:353 850 msgid "Please enter a valid shipping address." 851 msgstr "" 852 853 #: src/Gateways/GooglePayGateway.php:354 872 854 msgid "Missing details for Google Pay. Please contact the store owner." 855 msgstr "" 856 857 #: src/Gateways/GooglePayGateway.php:359 858 #: assets/js/block/src/FinixGooglePay.js:106 859 msgid "Total" 860 msgstr "" 861 862 #: src/Helpers/CartData.php:145 863 #: src/Helpers/CartData.php:146 864 msgid "Postal Code" 865 msgstr "" 866 867 #: src/Helpers/CartData.php:147 868 #: src/Helpers/CartData.php:148 869 msgid "Province" 873 870 msgstr "" 874 871 … … 882 879 883 880 #: src/Payments.php:149 881 #: src/Payments.php:175 884 882 msgid "Please review and fill in all the required information." 885 msgstr ""886 887 #: src/Payments.php:175888 msgid "Please review and fill all the required information."889 883 msgstr "" 890 884 … … 909 903 msgstr "" 910 904 911 #: assets/js/block/src/bank.js:10 5912 #: assets/js/block/src/card.js:10 5905 #: assets/js/block/src/bank.js:106 906 #: assets/js/block/src/card.js:106 913 907 msgid "Please enter a valid name" 914 908 msgstr "" 915 909 916 #: assets/js/block/src/bank.js:148 917 #: assets/js/block/src/card.js:148 910 #: assets/js/block/src/bank.js:107 911 #: assets/js/block/src/card.js:107 912 msgid "Please enter a valid city" 913 msgstr "" 914 915 #: assets/js/block/src/bank.js:149 916 #: assets/js/block/src/card.js:149 918 917 msgid "Unfortunately, there was an error while loading the payment form. Please try again later." 919 918 msgstr "" 920 919 921 #: assets/js/block/src/bank.js:1 89922 #: assets/js/block/src/card.js:1 89920 #: assets/js/block/src/bank.js:190 921 #: assets/js/block/src/card.js:190 923 922 msgid "Unfortunately, there was an error while initializing a payment form." 924 923 msgstr "" 925 924 926 #: assets/js/block/src/FinixGooglePay.js: 81925 #: assets/js/block/src/FinixGooglePay.js:129 927 926 msgid "There was an error while processing the payment using Google Pay." 928 927 msgstr "" 929 928 930 #: assets/js/block/src/google-pay.js:1 17929 #: assets/js/block/src/google-pay.js:139 931 930 msgid "There was an error while initializing Google Pay. Please check all the details and try again." 932 931 msgstr "" 933 932 934 #: assets/js/block/src/google-pay.js:1 28933 #: assets/js/block/src/google-pay.js:150 935 934 msgid "Please make sure shipping and billing information is correct and then try again." 936 935 msgstr "" -
finix-for-woocommerce/trunk/finix-for-woocommerce.php
r3375717 r3418263 3 3 * Plugin Name: Finix for WooCommerce 4 4 * Plugin URI: https://docs.finix.com/additional-resources/plugins/woocommerce-plugin 5 * Description: Takecredit card, bank, Apple Pay, and Google Pay payments on your store using Finix.6 * Version: 1. 3.05 * Description: Accept credit card, bank, Apple Pay, and Google Pay payments on your store using Finix. 6 * Version: 1.4.0 7 7 * Author: Finix 8 8 * Author URI: https://finix.com … … 15 15 * Domain Path: /assets/languages 16 16 * 17 * WC requires at least: 9.918 * WC tested up to: 10. 217 * WC requires at least: 10.0 18 * WC tested up to: 10.4 19 19 */ 20 20 … … 22 22 23 23 // phpcs:disable WPForms.Comments.PHPDocDefine.MissPHPDoc 24 const FINIXWC_VERSION = '1. 3.0';24 const FINIXWC_VERSION = '1.4.0'; 25 25 const FINIXWC_PLUGIN_FILE = __FILE__; 26 const FINIXWC_MIN_WC_VERSION = ' 9.9.0';26 const FINIXWC_MIN_WC_VERSION = '10.0'; 27 27 28 28 define( 'FINIXWC_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); -
finix-for-woocommerce/trunk/readme.txt
r3375717 r3418263 3 3 Tags: finix, credit card, ach, apple pay, woocommerce 4 4 Requires at least: 6.7 5 Tested up to: 6. 85 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 7 Requires Plugins: woocommerce 8 WC requires at least: 9.99 WC tested up to: 10. 210 Stable tag: 1. 3.08 WC requires at least: 10.0 9 WC tested up to: 10.4 10 Stable tag: 1.4.0 11 11 License: GPLv2 or later 12 12 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 23 23 * <strong>Flexible Payment Methods:</strong> Accept major credit and debit cards, Apple Pay, and bank transfers. Offer flexibility customers expect and reduce checkout friction. 24 24 * <strong>Transparent Pricing:</strong> Finix uses interchange-plus pricing for clear, detailed fee breakdowns, ideal for high-volume merchants. 25 * <strong>Apple Pay Integration:</strong> Enable Apple Pay on supported browsers like Safari and Chrome, with customizable button styles and types that blend seamlessly into your storefront. 25 * <strong>Apple Pay Integration:</strong> Enable Apple Pay, with customizable button styles and types that blend seamlessly into your storefront. 26 * <strong>Google Pay Integration:</strong> Enable Google Pay, with customizable button styles and types that blend seamlessly into your storefront. 26 27 * <strong>Customizable Checkout Display:</strong> Match your brand’s voice by tailoring the look and language of each payment method for a more intuitive customer experience. 27 * <strong>WooCommerce Blocks Checkout Compatible</strong> Fully supports WooCommerce’s new block-based checkout and the classic flow, keeping your store aligned with the latest updates.28 * <strong>WooCommerce Blocks Checkout Compatible</strong> Fully supports WooCommerce’s new block-based checkout and the classic shortcode-based flow, keeping your store aligned with the latest updates. 28 29 * <strong>Automated Dispute & Bank Return Handling</strong> Reduce operational overhead with automatic order status updates triggered by webhook events. 29 30 … … 60 61 = How can I issue refunds through the Finix plugin? = 61 62 62 You can issue refunds directly through the WooCommerce order management interface. Simply navigate to the order you wish to refund, click the "Refund" button and follow the prompts to process the refund.63 You can issue refunds directly through the WooCommerce order management interface. Simply navigate to the order you wish to refund, click the "Refund" button, and follow the prompts to process the refund. 63 64 64 65 Once the WooCommerce processes the refund, the plugin will notify Finix to perform the same action in the Finix system. … … 92 93 * PHP version 7.4 or greater 93 94 * WordPress 6.7 or greater 94 * WooCommerce 9.9or greater95 * WooCommerce 10.0 or greater 95 96 * Finix account 96 97 … … 101 102 3. Set your Finix API credentials key at WooCommerce -> Settings -> Payments -> Finix Gateway -> Plugin Options (or use the *Settings* link in the Plugins overview). 102 103 4. You're done, the active payment methods should be visible on the checkout page of your shop. 103 5. You can configure payment methods in the Finix "Card and ACH" and "Apple Pay" settings pages.104 5. You can configure payment methods in the Finix settings pages for each individual Payment Method. 104 105 105 106 = Manual installation = … … 124 125 125 126 == Changelog == 127 128 = 1.4.0 = 129 * Added: Display a lot more relevant order information in the Google Pay payment popup - not just the total amount, but also all the products, discounts/tax/shipping if present. 130 * Changed: If the store currency is set to CAD (Canadian Dollar), the plugin will set "Canada" as a default country in payment forms for both Cards and Bank payment methods. 131 * Changed: If the store currency is set to CAD (Canadian Dollar), the plugin will adjust the address labels accordingly ("Province" and "Postal Code" instead of "Region" and "ZIP", respectively). 132 * Changed: Plugin was tested to be fully compatible with WooCommerce 10.4. 133 * Changed: Plugin was tested to be fully compatible with WordPress 6.9. 134 * Changed: Simplified and improved a lot of labels, descriptions, or error messages throughout the plugin. 135 * Fixed: Do not allow Apple Pay and Google Pay payment methods to be available for customers when the checkout page does not use HTTPS protocol. This is a requirement from Apple and Google. 126 136 127 137 = 1.3.0 = … … 160 170 * Added: Credit Card payment method, with custom title and description. 161 171 * Added: ACH or Bank payment method, with custom title and description. 162 * Added: Apple Pay payment method - Safari, Chrome and other browsers are supported, with custom title and description.172 * Added: Apple Pay payment method - Safari, Chrome, and other browsers are supported, with custom title and description. 163 173 * Added: Apple Pay button can be configured how it will look on the checkout pages (button type and style). 164 174 * Added: Live and Sandbox accounts support for all payment methods. 165 * Added: Webhooks processing support for payments, refunds, disputes and ACH returns.175 * Added: Webhooks processing support for payments, refunds, disputes, and ACH returns. 166 176 * Added: Disputes support - automatically change the order status when receiving a dispute. 167 177 * Added: ACH Returns support - automatically change the order status when receiving a notification about ACH Return. -
finix-for-woocommerce/trunk/src/Admin/Admin.php
r3375717 r3418263 81 81 printf( 82 82 wp_kses( /* translators: %s - supported currency codes. */ 83 __( '<strong>All thepayments will be declined.</strong> Supported currencies: %s.', 'finix-for-woocommerce' ),83 __( '<strong>All payments will be declined.</strong> Supported currencies: %s.', 'finix-for-woocommerce' ), 84 84 [ 85 85 'strong' => [], … … 96 96 <?php 97 97 } 98 99 /** 100 * Add a conditional notice about HTTPS requirement for Apple Pay and Google Pay. 101 */ 102 public function maybe_notify_about_https(): void { 103 104 $gateways = WC()->payment_gateways()->payment_gateways(); 105 106 if ( 107 ! is_ssl() && 108 ( 109 $gateways[ ApplePayGateway::SLUG ]->is_available() || 110 $gateways[ GooglePayGateway::SLUG ]->is_available() 111 ) 112 ) { 113 echo '<div class="notice notice-error">'; 114 echo '<p><strong>' . esc_html__( 'Apple Pay and Google Pay can only run over HTTPS.', 'finix-for-woocommerce' ) . '</strong></p>'; 115 echo '<p>' . esc_html__( 'Please enable SSL (HTTPS) on your website to use them at checkout OR disable these payment methods.', 'finix-for-woocommerce' ) . '</p>'; 116 echo '</div>'; 117 } 118 } 98 119 } -
finix-for-woocommerce/trunk/src/Events/ApplePayPaymentCompletedEvent.php
r3375717 r3418263 36 36 if ( $is_success !== 'true' || empty( $transaction_id ) ) { 37 37 wc_add_notice( 38 esc_html__( 'Payment error: There was an error while processing your payment. Please try again.', 'finix-for-woocommerce' ),38 esc_html__( 'Payment error: There was an error processing your payment. Please try again later.', 'finix-for-woocommerce' ), 39 39 'error' 40 40 ); … … 71 71 if ( $transaction_details['status'] !== 200 ) { 72 72 wc_add_notice( 73 esc_html__( 'Payment error: There was an error whileprocessing your payment. Please contact support if you were charged.', 'finix-for-woocommerce' ),73 esc_html__( 'Payment error: There was an error processing your payment. Please contact support if you were charged.', 'finix-for-woocommerce' ), 74 74 'error' 75 75 ); … … 82 82 if ( empty( $transaction_details['response']->id ) ) { 83 83 wc_add_notice( 84 esc_html__( 'Payment error: There was an error whileprocessing your payment. Please contact support if you were charged.', 'finix-for-woocommerce' ),84 esc_html__( 'Payment error: There was an error processing your payment. Please contact support if you were charged.', 'finix-for-woocommerce' ), 85 85 'error' 86 86 ); … … 93 93 if ( $transaction_details['response']->state !== 'SUCCEEDED' ) { 94 94 wc_add_notice( 95 esc_html__( 'Payment error: There was an error whileprocessing your payment. Please contact support if you were charged.', 'finix-for-woocommerce' ),95 esc_html__( 'Payment error: There was an error processing your payment. Please contact support if you were charged.', 'finix-for-woocommerce' ), 96 96 'error' 97 97 ); … … 105 105 if ( (int) $transaction_details['response']->amount !== (int) ( $this->order->get_total() * 100 ) ) { 106 106 wc_add_notice( 107 esc_html__( 'Payment error: There was an error whileprocessing your payment. Please contact support if you were charged.', 'finix-for-woocommerce' ),107 esc_html__( 'Payment error: There was an error processing your payment. Please contact support if you were charged.', 'finix-for-woocommerce' ), 108 108 'error' 109 109 ); -
finix-for-woocommerce/trunk/src/Events/ApplePayPaymentEvent.php
r3316914 r3418263 77 77 wp_send_json_error( 78 78 [ 79 'message' => esc_html__( 'There was an error while processing your payment.', 'finix-for-woocommerce' ),79 'message' => esc_html__( 'There was an error processing your payment. Please try again later.', 'finix-for-woocommerce' ), 80 80 'errors' => wp_json_encode( $buyer['response']->_embedded->errors ), 81 81 ] -
finix-for-woocommerce/trunk/src/Events/CardAchPaymentEvent.php
r3375717 r3418263 28 28 if ( empty( $this->order ) ) { 29 29 wc_add_notice( 30 esc_html__( 'Payment error: There was an error while processing your payment. Please try again.', 'finix-for-woocommerce' ),30 esc_html__( 'Payment error: There was an error processing your payment. Please try again later.', 'finix-for-woocommerce' ), 31 31 'error' 32 32 ); … … 41 41 if ( $buyer['status'] !== 201 || ! is_object( $buyer['response'] ) || empty( $buyer['response']->id ) ) { 42 42 wc_add_notice( 43 esc_html__( 'Payment error: There was an error while processing your payment. Please try again.', 'finix-for-woocommerce' ),43 esc_html__( 'Payment error: There was an error processing your payment. Please try again later.', 'finix-for-woocommerce' ), 44 44 'error' 45 45 ); … … 67 67 if ( empty( $_POST[ $this->gateway->id . '_token' ] ) ) { 68 68 wc_add_notice( 69 esc_html__( 'Payment error: There was an error while processing your payment. Please try again.', 'finix-for-woocommerce' ),69 esc_html__( 'Payment error: There was an error processing your payment. Please try again later.', 'finix-for-woocommerce' ), 70 70 'error' 71 71 ); … … 95 95 ) { 96 96 wc_add_notice( 97 esc_html__( 'Payment error: There was an error while processing your payment. Please try again.', 'finix-for-woocommerce' ),97 esc_html__( 'Payment error: There was an error processing your payment. Please try again later.', 'finix-for-woocommerce' ), 98 98 'error' 99 99 ); … … 134 134 if ( $response['status'] !== 201 ) { 135 135 wc_add_notice( 136 esc_html__( 'Payment error: There was an error while processing your payment. Please try again.', 'finix-for-woocommerce' ),136 esc_html__( 'Payment error: There was an error processing your payment. Please try again later.', 'finix-for-woocommerce' ), 137 137 'error' 138 138 ); … … 161 161 case 'UNKNOWN': 162 162 wc_add_notice( 163 esc_html__( 'Payment pending: There was an error while processing your payment. Please try again.', 'finix-for-woocommerce' ),163 esc_html__( 'Payment pending: There was an error processing your payment. Please try again later.', 'finix-for-woocommerce' ), 164 164 'notice' 165 165 ); … … 189 189 default: 190 190 wc_add_notice( 191 esc_html__( 'Payment failed: There was an error while processing your payment. Please try again.', 'finix-for-woocommerce' ),191 esc_html__( 'Payment failed: There was an error processing your payment. Please try again later.', 'finix-for-woocommerce' ), 192 192 'error' 193 193 ); -
finix-for-woocommerce/trunk/src/Events/GooglePayPaymentCompletedEvent.php
r3375717 r3418263 36 36 if ( $is_success !== 'true' || empty( $transaction_id ) ) { 37 37 wc_add_notice( 38 esc_html__( 'Payment error: There was an error while processing your payment. Please try again.', 'finix-for-woocommerce' ),38 esc_html__( 'Payment error: There was an error processing your payment. Please try again later.', 'finix-for-woocommerce' ), 39 39 'error' 40 40 ); … … 71 71 if ( $transaction_details['status'] !== 200 ) { 72 72 wc_add_notice( 73 esc_html__( 'Payment error: There was an error whileprocessing your payment. Please contact support if you were charged.', 'finix-for-woocommerce' ),73 esc_html__( 'Payment error: There was an error processing your payment. Please contact support if you were charged.', 'finix-for-woocommerce' ), 74 74 'error' 75 75 ); … … 82 82 if ( empty( $transaction_details['response']->id ) ) { 83 83 wc_add_notice( 84 esc_html__( 'Payment error: There was an error whileprocessing your payment. Please contact support if you were charged.', 'finix-for-woocommerce' ),84 esc_html__( 'Payment error: There was an error processing your payment. Please contact support if you were charged.', 'finix-for-woocommerce' ), 85 85 'error' 86 86 ); … … 93 93 if ( $transaction_details['response']->state !== 'SUCCEEDED' ) { 94 94 wc_add_notice( 95 esc_html__( 'Payment error: There was an error whileprocessing your payment. Please contact support if you were charged.', 'finix-for-woocommerce' ),95 esc_html__( 'Payment error: There was an error processing your payment. Please contact support if you were charged.', 'finix-for-woocommerce' ), 96 96 'error' 97 97 ); … … 105 105 if ( (int) $transaction_details['response']->amount !== (int) ( $this->order->get_total() * 100 ) ) { 106 106 wc_add_notice( 107 esc_html__( 'Payment error: There was an error whileprocessing your payment. Please contact support if you were charged.', 'finix-for-woocommerce' ),107 esc_html__( 'Payment error: There was an error processing your payment. Please contact support if you were charged.', 'finix-for-woocommerce' ), 108 108 'error' 109 109 ); -
finix-for-woocommerce/trunk/src/Events/GooglePayPaymentEvent.php
r3316914 r3418263 77 77 wp_send_json_error( 78 78 [ 79 'message' => esc_html__( 'There was an error while processing your payment.', 'finix-for-woocommerce' ),79 'message' => esc_html__( 'There was an error processing your payment. Please try again later.', 'finix-for-woocommerce' ), 80 80 'errors' => wp_json_encode( $buyer['response']->_embedded->errors ), 81 81 ] -
finix-for-woocommerce/trunk/src/Gateways/ApplePayGateway.php
r3375717 r3418263 3 3 namespace FinixWC\Gateways; 4 4 5 use FinixWC\Events\ApplePayPaymentCompletedEvent; 5 6 use FinixWC\Events\ApplePayPaymentEvent; 7 use FinixWC\Events\ApplePayRegisterDomain; 6 8 use FinixWC\Events\ApplePaySessionEvent; 7 use FinixWC\Events\ApplePayPaymentCompletedEvent;8 use FinixWC\Events\ApplePayRegisterDomain;9 9 use FinixWC\Events\RefundEvent; 10 10 use FinixWC\Helpers\Assets; 11 use FinixWC\Helpers\CartData; 11 12 use FinixWC\Helpers\Convert; 12 use FinixWC\Helpers\CartData;13 use stdClass;14 13 15 14 /** … … 86 85 'enabled' => [ 87 86 'title' => __( 'Status', 'finix-for-woocommerce' ), 88 'label' => __( 'Enable Appl yPay Gateway', 'finix-for-woocommerce' ),87 'label' => __( 'Enable Apple Pay Gateway', 'finix-for-woocommerce' ), 89 88 'type' => 'checkbox', 90 89 'description' => '', … … 120 119 'title' => __( 'Button Type', 'finix-for-woocommerce' ), 121 120 'type' => 'select', 122 'description' => __( 'Choose the type of the Apple Pay button. This affects wording on a button.', 'finix-for-woocommerce' ),121 'description' => __( 'Choose the type of the Apple Pay button. This affects the button text.', 'finix-for-woocommerce' ), 123 122 'options' => [ 124 123 'plain' => __( 'Plain', 'finix-for-woocommerce' ), … … 163 162 <h2><?php esc_html_e( 'Apple Pay Payment Method', 'finix-for-woocommerce' ); ?></h2> 164 163 <p> 165 <?php esc_html_e( ' Receive payments via Apple Pay with Finix. You can configure the available options on this page.', 'finix-for-woocommerce' ); ?>164 <?php esc_html_e( 'Accept payments via Apple Pay with Finix. You can configure available options on this page.', 'finix-for-woocommerce' ); ?> 166 165 <br> 167 166 <?php … … 384 383 'gateway' => esc_html( $this->id ), 385 384 'billing_data' => WC()->customer->get_billing(), 386 'products' => $order_details['products'] ?? new stdClass(),385 'products' => $order_details['products'], 387 386 'subtotal' => $order_details['subtotal'], 388 387 'shipping_amount' => $order_details['shipping_amount'], … … 390 389 'coupons' => $order_details['coupons'] ?? [], 391 390 'text' => [ 392 'error_processing' => esc_html__( 'There was an error whileprocessing your payment. Please try again later.', 'finix-for-woocommerce' ),391 'error_processing' => esc_html__( 'There was an error processing your payment. Please try again later.', 'finix-for-woocommerce' ), 393 392 'error_billing' => esc_html__( 'Please enter a valid billing address.', 'finix-for-woocommerce' ), 394 393 'subtotal' => esc_html__( 'Subtotal', 'finix-for-woocommerce' ), … … 440 439 if ( empty( $_POST['finix_apple_pay_transaction_id'] ) ) { 441 440 wc_add_notice( 442 esc_html__( 'There was an error whileprocessing your payment. Please try again later.', 'finix-for-woocommerce' ),441 esc_html__( 'There was an error processing your payment. Please try again later.', 'finix-for-woocommerce' ), 443 442 'error' 444 443 ); -
finix-for-woocommerce/trunk/src/Gateways/BankGateway.php
r3375717 r3418263 73 73 <div class="links-content"> 74 74 <h2><?php esc_html_e( 'Bank Payment Method', 'finix-for-woocommerce' ); ?></h2> 75 <p><?php esc_html_e( ' Takebank payments with Finix. You can configure available options on this page.', 'finix-for-woocommerce' ); ?></p>75 <p><?php esc_html_e( 'Accept bank payments with Finix. You can configure available options on this page.', 'finix-for-woocommerce' ); ?></p> 76 76 </div> 77 77 </div> -
finix-for-woocommerce/trunk/src/Gateways/CardBankGateway.php
r3375717 r3418263 9 9 use FinixWC\Events\RefundEvent; 10 10 use FinixWC\Helpers\Assets; 11 use FinixWC\Helpers\CartData; 11 12 use WP_Error; 12 13 … … 58 59 ) { 59 60 wc_add_notice( 60 esc_html__( 'There was an error whileprocessing your payment. Please try again later.', 'finix-for-woocommerce' ),61 esc_html__( 'There was an error processing your payment. Please try again later.', 'finix-for-woocommerce' ), 61 62 'error' 62 63 ); … … 135 136 $finix_form_options = apply_filters( 136 137 'finixwc_cardbankgateway_finix_form_params', 137 [ 138 'showAddress' => true, 139 'showLabels' => true, 140 'labels' => [ 141 'name' => esc_html__( 'Full Name', 'finix-for-woocommerce' ), 142 ], 143 'showPlaceholders' => true, 144 'placeholders' => [ 145 'name' => esc_attr__( 'Full Name', 'finix-for-woocommerce' ), 146 ], 147 'hideFields' => [ 'address_line1', 'address_line2', 'address_city', 'address_state' ], 148 'requiredFields' => [ 'name', 'address_country', 'address_postal_code' ], 149 'hideErrorMessages' => false, 150 'errorMessages' => [ 151 'name' => esc_html__( 'Please enter a valid full name', 'finix-for-woocommerce' ), 152 ], 153 ], 138 CartData::get_finix_form_default_data(), 154 139 $this->id 155 140 ); … … 167 152 'full_name' => esc_html__( 'Full Name', 'finix-for-woocommerce' ), 168 153 'error_messages' => [ 169 'name' => esc_html__( 'Please enter a valid full name ', 'finix-for-woocommerce' ),170 'address_city' => esc_html__( 'Please enter a valid city ', 'finix-for-woocommerce' ),154 'name' => esc_html__( 'Please enter a valid full name.', 'finix-for-woocommerce' ), 155 'address_city' => esc_html__( 'Please enter a valid city.', 'finix-for-woocommerce' ), 171 156 ], 172 157 ], -
finix-for-woocommerce/trunk/src/Gateways/CardGateway.php
r3375717 r3418263 82 82 <div class="links-content"> 83 83 <h2><?php esc_html_e( 'Card Payment Method', 'finix-for-woocommerce' ); ?></h2> 84 <p><?php esc_html_e( ' Takecard payments with Finix. You can configure available options on this page.', 'finix-for-woocommerce' ); ?></p>84 <p><?php esc_html_e( 'Accept card payments with Finix. You can configure available options on this page.', 'finix-for-woocommerce' ); ?></p> 85 85 </div> 86 86 </div> -
finix-for-woocommerce/trunk/src/Gateways/FinixGateway.php
r3375717 r3418263 89 89 'title' => __( 'Custom Source Tag', 'finix-for-woocommerce' ), 90 90 'type' => 'text', 91 'description' => __( 'This tag will be used to identify the source of the payment. It will be used to tag the payment details sendto Finix.', 'finix-for-woocommerce' ),91 'description' => __( 'This tag will be used to identify the source of the payment. It will be used to tag payment details sent to Finix.', 'finix-for-woocommerce' ), 92 92 'default' => 'woocommerce', 93 93 'desc_tip' => true, … … 104 104 'title' => __( 'Sandbox Application ID', 'finix-for-woocommerce' ), 105 105 'type' => 'text', 106 'description' => __( 'This is the application ID provided on Finix dashboard -> developer menu by selecting sandbox environment', 'finix-for-woocommerce' ),106 'description' => __( 'This is the application ID provided in Finix Dashboard > Developer menu by selecting your Sandbox environment', 'finix-for-woocommerce' ), 107 107 'default' => '', 108 108 'desc_tip' => true, … … 141 141 'title' => __( 'Live Application ID', 'finix-for-woocommerce' ), 142 142 'type' => 'text', 143 'description' => __( 'This is the application ID provided on Finix dashboard -> developer menu by selecting live environment', 'finix-for-woocommerce' ),143 'description' => __( 'This is the application ID provided in Finix Dashboard > Developer menu by selecting your Live environment', 'finix-for-woocommerce' ), 144 144 'default' => '', 145 145 'desc_tip' => true, … … 179 179 'label' => __( 'Dispute Created', 'finix-for-woocommerce' ), 180 180 'type' => 'checkbox', 181 'description' => __( 'If enabled, the plugin will listen to the dispute.created webhook event and update the order stat eif a dispute is created.', 'finix-for-woocommerce' ),181 'description' => __( 'If enabled, the plugin will listen to the dispute.created webhook event and update the order status if a dispute is created.', 'finix-for-woocommerce' ), 182 182 'default' => 'yes', 183 183 'desc_tip' => true, 184 184 ], 185 185 'disputes_order_state' => [ 186 'title' => __( 'Disputes Order Stat e', 'finix-for-woocommerce' ),186 'title' => __( 'Disputes Order Status', 'finix-for-woocommerce' ), 187 187 'type' => 'select', 188 188 'description' => __( 'Choose an order status when a payment dispute is received.', 'finix-for-woocommerce' ), … … 195 195 'label' => __( 'ACH Return Created', 'finix-for-woocommerce' ), 196 196 'type' => 'checkbox', 197 'description' => __( 'If enabled, the plugin will listen to ACH returns and update the order stat eif ACH return is created.', 'finix-for-woocommerce' ),197 'description' => __( 'If enabled, the plugin will listen to ACH returns and update the order status if ACH return is created.', 'finix-for-woocommerce' ), 198 198 'default' => 'yes', 199 199 'desc_tip' => true, 200 200 ], 201 201 'ach_return_order_state' => [ 202 'title' => __( 'ACH Return Order Stat e', 'finix-for-woocommerce' ),202 'title' => __( 'ACH Return Order Status', 'finix-for-woocommerce' ), 203 203 'type' => 'select', 204 204 'description' => __( 'Choose an order status when an ACH Return is received.', 'finix-for-woocommerce' ), … … 266 266 267 267 <?php finixwc()->admin->maybe_notify_about_unsupported_currency(); ?> 268 269 <?php finixwc()->admin->maybe_notify_about_https(); ?> 268 270 269 271 <div class="global-container"> … … 414 416 415 417 // phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage 416 $icon = '<img src="' . esc_url( WC_HTTPS::force_https_url( $this->icon_checkout ) ) . '" alt="' . esc_attr( $this->get_title() ) . '" />'; 417 418 /** 419 * Filter the gateway icon. 418 return '<img src="' . esc_url( WC_HTTPS::force_https_url( $this->icon_checkout ) ) . '" alt="' . esc_attr( $this->get_title() ) . '" />'; 419 } 420 421 /** 422 * Get the provider links list. 423 */ 424 public function get_provider_links( $country_code ): array { 425 /* 426 * These constants require WooCommerce 10.4. 427 * Until we drop support for older versions, we will not use them. 420 428 * 421 * @since 1.5.8 422 * 423 * @param string $icon Gateway icon. 424 * @param string $id Gateway ID. 425 * 426 * @return string 429 * PaymentsProviders::LINK_TYPE_SUPPORT = 'support'; 430 * PaymentsProviders::LINK_TYPE_DOCS = 'documentation'; 431 * PaymentsProviders::LINK_TYPE_ABOUT = 'about'; 432 * PaymentsProviders::LINK_TYPE_TERMS = 'terms'; 433 * PaymentsProviders::LINK_TYPE_PRICING = 'pricing'; 427 434 */ 428 return apply_filters( 'woocommerce_gateway_icon', $icon, $this->id ); 435 436 return [ 437 [ 438 '_type' => 'about', 439 'url' => URL::add_utm( 'https://finix.com/about-finix', 'WooSettingsPayments', 'about', 'link' ), 440 ], 441 [ 442 '_type' => 'documentation', 443 'url' => URL::add_utm( 'https://docs.finix.com/additional-resources/plugins/woocommerce-plugin', 'WooSettingsPayments', 'docs', 'link' ), 444 ], 445 [ 446 '_type' => 'terms', 447 'url' => URL::add_utm( 'https://finix.com/terms-and-policies', 'WooSettingsPayments', 'terms', 'link' ), 448 ], 449 [ 450 '_type' => 'support', 451 'url' => URL::add_utm( 'https://docs.finix.com/guides/getting-started/support-at-finix', 'WooSettingsPayments', 'support', 'link' ), 452 ], 453 [ 454 '_type' => 'pricing', 455 'url' => URL::add_utm( 'https://finix.com/pricing', 'WooSettingsPayments', 'pricing', 'link' ), 456 ], 457 ]; 429 458 } 430 459 -
finix-for-woocommerce/trunk/src/Gateways/GooglePayGateway.php
r3375717 r3418263 3 3 namespace FinixWC\Gateways; 4 4 5 use FinixWC\Events\GooglePayPaymentCompletedEvent; 5 6 use FinixWC\Events\GooglePayPaymentEvent; 6 use FinixWC\Events\GooglePayPaymentCompletedEvent;7 7 use FinixWC\Events\RefundEvent; 8 8 use FinixWC\Helpers\Assets; 9 use FinixWC\Helpers\CartData; 9 10 use FinixWC\Helpers\Convert; 10 11 … … 107 108 'title' => __( 'Button Color', 'finix-for-woocommerce' ), 108 109 'type' => 'select', 109 'description' => __( 'Choose color for the Google Pay button.', 'finix-for-woocommerce' ),110 'description' => __( 'Choose the color for the Google Pay button.', 'finix-for-woocommerce' ), 110 111 'options' => [ 111 'default' => __( 'Default Button', 'finix-for-woocommerce' ),112 'black' => __( 'Black Button', 'finix-for-woocommerce' ),113 'white' => __( 'White Button', 'finix-for-woocommerce' ),112 'default' => __( 'Default', 'finix-for-woocommerce' ), 113 'black' => __( 'Black', 'finix-for-woocommerce' ), 114 'white' => __( 'White', 'finix-for-woocommerce' ), 114 115 ], 115 116 'default' => 'default', … … 121 122 'description' => __( 'Choose which type of Google Pay button you want.', 'finix-for-woocommerce' ), 122 123 'options' => [ 123 'plain' => __( 'Plain Button', 'finix-for-woocommerce' ),124 'buy' => __( 'Buy Button', 'finix-for-woocommerce' ),125 'checkout' => __( 'Checkout Button', 'finix-for-woocommerce' ),126 'donate' => __( 'Donate Button', 'finix-for-woocommerce' ),127 'subscribe' => __( 'Subscribe Button', 'finix-for-woocommerce' ),128 'book' => __( 'Book Button', 'finix-for-woocommerce' ),129 'order' => __( 'Order Button', 'finix-for-woocommerce' ),130 'pay' => __( 'Pay Button', 'finix-for-woocommerce' ),124 'plain' => __( 'Plain', 'finix-for-woocommerce' ), 125 'buy' => __( 'Buy', 'finix-for-woocommerce' ), 126 'checkout' => __( 'Checkout', 'finix-for-woocommerce' ), 127 'donate' => __( 'Donate', 'finix-for-woocommerce' ), 128 'subscribe' => __( 'Subscribe', 'finix-for-woocommerce' ), 129 'book' => __( 'Book', 'finix-for-woocommerce' ), 130 'order' => __( 'Order', 'finix-for-woocommerce' ), 131 'pay' => __( 'Pay', 'finix-for-woocommerce' ), 131 132 ], 132 133 'default' => 'plain', … … 167 168 <h2><?php esc_html_e( 'Google Pay Payment Method', 'finix-for-woocommerce' ); ?></h2> 168 169 <p> 169 <?php esc_html_e( ' Receive payments via Google Pay with Finix. You can configure the available options on this page.', 'finix-for-woocommerce' ); ?>170 <?php esc_html_e( 'Accept payments via Google Pay with Finix. You can configure available options on this page.', 'finix-for-woocommerce' ); ?> 170 171 </p> 171 172 </div> … … 211 212 $order_key = sanitize_text_field( wp_unslash( $_GET['key'] ?? '' ) ); 212 213 ?> 213 <input type="hidden" id="finix_google_pay_order_id" name="finix_google_pay_order_id" value="<?php echo absint( $wp->query_vars['order-pay'] ?? 0 ); ?>"> 214 <input type="hidden" id="finix_google_pay_order_key" name="finix_google_pay_order_key" value="<?php echo esc_attr( $order_key ); ?>"> 214 <input type="hidden" id="finix_google_pay_order_id" name="finix_google_pay_order_id" 215 value="<?php echo absint( $wp->query_vars['order-pay'] ?? 0 ); ?>"> 216 <input type="hidden" id="finix_google_pay_order_key" name="finix_google_pay_order_key" 217 value="<?php echo esc_attr( $order_key ); ?>"> 215 218 <?php endif; ?> 216 219 </fieldset> … … 222 225 * Enqueue the payment script and styles for shortcode-based checkout. 223 226 */ 224 public function payment_scripts(): void { 227 public function payment_scripts(): void { // phpcs:ignore Generic.Metrics.CyclomaticComplexity 225 228 226 229 // Only if gateway is enabled. … … 303 306 ); 304 307 308 $is_order_pay_page = false; 309 $order_id = 0; 310 311 // We might not have a cart over here, so retrieve the data from the current order page. 312 if ( is_checkout_pay_page() ) { 313 global $wp; 314 315 $order_id = absint( $wp->query_vars['order-pay'] ); 316 $order = wc_get_order( $order_id ); 317 318 if ( $order ) { 319 $order_amount = $order->get_total(); 320 } 321 } else { 322 // Get the current cart total as we are most likely on the Checkout page. 323 $order_amount = (string) WC()->cart->get_total( '' ); 324 } 325 326 // Get data for order details. 327 $order_details = CartData::prepare_order_tracking_details(); 328 305 329 $finix_google_pay_params = [ 306 330 'nonce' => wp_create_nonce( 'get_secret_action' ), … … 313 337 'gateway' => esc_html( $this->id ), 314 338 'billing_data' => WC()->customer->get_billing(), 339 'products' => $order_details['products'], 340 'subtotal' => $order_details['subtotal'], 341 'shipping_amount' => $order_details['shipping_amount'], 342 'tax_amount' => $order_details['tax_amount'], 343 'coupons' => $order_details['coupons'] ?? [], 315 344 'button_color' => $this->button_color, 316 345 'button_type' => $this->button_type, … … 319 348 'google_merchant_id' => esc_html( $this->google_merchant_id ), 320 349 'text' => [ 321 'error_processing' => esc_html__( 'There was an error whileprocessing your payment. Please try again later.', 'finix-for-woocommerce' ),350 'error_processing' => esc_html__( 'There was an error processing your payment. Please try again later.', 'finix-for-woocommerce' ), 322 351 'error_setting_payment' => esc_html__( 'There was an error processing the payment through Google Pay. Please try a different method or try again later.', 'finix-for-woocommerce' ), 323 'error_billing' => esc_html__( 'Please enter a valid billing details.', 'finix-for-woocommerce' ),324 'error_shipping' => esc_html__( 'Please enter a valid shipping details.', 'finix-for-woocommerce' ),352 'error_billing' => esc_html__( 'Please enter a valid billing address.', 'finix-for-woocommerce' ), 353 'error_shipping' => esc_html__( 'Please enter a valid shipping address.', 'finix-for-woocommerce' ), 325 354 'error_merchant_id' => esc_html__( 'Missing details for Google Pay. Please contact the store owner.', 'finix-for-woocommerce' ), 355 'subtotal' => esc_html__( 'Subtotal', 'finix-for-woocommerce' ), 356 'shipping' => esc_html__( 'Shipping', 'finix-for-woocommerce' ), 357 'tax' => esc_html__( 'Tax', 'finix-for-woocommerce' ), 358 'discount_code' => esc_html__( 'Discount code:', 'finix-for-woocommerce' ), 359 'total' => esc_html__( 'Total', 'finix-for-woocommerce' ), 326 360 ], 327 361 'url' => [ … … 381 415 if ( empty( $_POST['finix_google_pay_transaction_id'] ) ) { 382 416 wc_add_notice( 383 esc_html__( 'There was an error whileprocessing your payment. Please try again later.', 'finix-for-woocommerce' ),417 esc_html__( 'There was an error processing your payment. Please try again later.', 'finix-for-woocommerce' ), 384 418 'error' 385 419 ); -
finix-for-woocommerce/trunk/src/Gateways/PaymentMethods/ApplePay.php
r3375717 r3418263 5 5 use FinixWC\Gateways\ApplePayGateway; 6 6 use FinixWC\Helpers\Assets; 7 use FinixWC\Helpers\CartData; 7 8 use FinixWC\Helpers\Convert; 8 use FinixWC\Helpers\CartData;9 9 10 10 /** … … 117 117 'gateway' => esc_html( $this->gateway->id ), 118 118 'billing_data' => WC()->customer->get_billing(), 119 'products' => $order_details['products'] ?? new stdClass(),119 'products' => $order_details['products'], 120 120 'subtotal' => $order_details['subtotal'], 121 121 'shipping_amount' => $order_details['shipping_amount'], … … 123 123 'coupons' => $order_details['coupons'] ?? [], 124 124 'text' => [ 125 'error_processing' => esc_html__( 'There was an error whileprocessing your payment. Please try again later.', 'finix-for-woocommerce' ),125 'error_processing' => esc_html__( 'There was an error processing your payment. Please try again later.', 'finix-for-woocommerce' ), 126 126 'error_billing' => esc_html__( 'Please enter a valid billing address.', 'finix-for-woocommerce' ), 127 127 'subtotal' => esc_html__( 'Subtotal', 'finix-for-woocommerce' ), -
finix-for-woocommerce/trunk/src/Gateways/PaymentMethods/CardBankMethod.php
r3375717 r3418263 4 4 5 5 use FinixWC\Helpers\Assets; 6 use FinixWC\Helpers\CartData; 6 7 7 8 /** … … 95 96 return apply_filters( 96 97 'finixwc_cardbankgateway_finix_form_params', 97 [ 98 'showAddress' => true, 99 'showLabels' => true, 100 'labels' => [ 101 'name' => esc_html__( 'Full Name', 'finix-for-woocommerce' ), 102 ], 103 'showPlaceholders' => true, 104 'placeholders' => [ 105 'name' => esc_attr__( 'Full Name', 'finix-for-woocommerce' ), 106 ], 107 'hideFields' => [ 'address_line1', 'address_line2', 'address_city', 'address_state' ], 108 'requiredFields' => [ 'name', 'address_country', 'address_postal_code' ], 109 'hideErrorMessages' => false, 110 'errorMessages' => [ 111 'name' => esc_html__( 'Please enter a valid full name', 'finix-for-woocommerce' ), 112 ], 113 ], 98 CartData::get_finix_form_default_data(), 114 99 $this->name 115 100 ); -
finix-for-woocommerce/trunk/src/Gateways/PaymentMethods/GooglePay.php
r3316914 r3418263 5 5 use FinixWC\Gateways\GooglePayGateway; 6 6 use FinixWC\Helpers\Assets; 7 use FinixWC\Helpers\CartData; 7 8 use FinixWC\Helpers\Convert; 8 9 … … 109 110 } 110 111 112 // Get data for order details. 113 $order_details = CartData::prepare_order_tracking_details(); 114 111 115 wp_localize_script( 112 116 'finix_google_pay_gateway-checkout-block', … … 122 126 'gateway' => esc_html( $this->gateway->id ), 123 127 'billing_data' => WC()->customer->get_billing(), 128 'products' => $order_details['products'], 129 'subtotal' => $order_details['subtotal'], 130 'shipping_amount' => $order_details['shipping_amount'], 131 'tax_amount' => $order_details['tax_amount'], 132 'coupons' => $order_details['coupons'] ?? [], 124 133 'button_color' => esc_html( $this->gateway->button_color ), 125 134 'button_type' => esc_html( $this->gateway->button_type ), … … 128 137 'google_merchant_id' => esc_html( $this->gateway->google_merchant_id ), 129 138 'text' => [ 130 'error_processing' => esc_html__( 'There was an error whileprocessing your payment. Please try again later.', 'finix-for-woocommerce' ),139 'error_processing' => esc_html__( 'There was an error processing your payment. Please try again later.', 'finix-for-woocommerce' ), 131 140 'error_billing' => esc_html__( 'Please enter a valid billing address.', 'finix-for-woocommerce' ), 141 'subtotal' => esc_html__( 'Subtotal', 'finix-for-woocommerce' ), 142 'shipping' => esc_html__( 'Shipping', 'finix-for-woocommerce' ), 143 'tax' => esc_html__( 'Tax', 'finix-for-woocommerce' ), 144 'discount_code' => esc_html__( 'Discount code:', 'finix-for-woocommerce' ), 132 145 ], 133 146 'url' => [ -
finix-for-woocommerce/trunk/src/Helpers/CartData.php
r3375717 r3418263 116 116 ]; 117 117 } 118 119 /** 120 * Return the default data for finix form options based on currency. 121 */ 122 public static function get_finix_form_default_data(): array { 123 124 $default_data = [ 125 'showAddress' => true, 126 'showLabels' => true, 127 'labels' => [ 128 'name' => esc_html__( 'Full Name', 'finix-for-woocommerce' ), 129 ], 130 'showPlaceholders' => true, 131 'placeholders' => [ 132 'name' => esc_attr__( 'Full Name', 'finix-for-woocommerce' ), 133 ], 134 'defaultValues' => [], 135 'hideFields' => [ 'address_line1', 'address_line2', 'address_city', 'address_state' ], 136 'requiredFields' => [ 'name', 'address_country', 'address_postal_code' ], 137 'hideErrorMessages' => false, 138 'errorMessages' => [ 139 'name' => esc_html__( 'Please enter a valid full name.', 'finix-for-woocommerce' ), 140 ], 141 ]; 142 143 if ( get_woocommerce_currency() === 'CAD' ) { 144 $default_data['defaultValues']['address_country'] = 'CAN'; 145 $default_data['labels']['address_postal_code'] = esc_html__( 'Postal Code', 'finix-for-woocommerce' ); 146 $default_data['placeholders']['address_postal_code'] = esc_attr__( 'Postal Code', 'finix-for-woocommerce' ); 147 $default_data['labels']['address_region'] = esc_html__( 'Province', 'finix-for-woocommerce' ); 148 $default_data['placeholders']['address_region'] = esc_attr__( 'Province', 'finix-for-woocommerce' ); 149 } 150 151 return $default_data; 152 } 118 153 } -
finix-for-woocommerce/trunk/src/Helpers/URL.php
r3278388 r3418263 14 14 * @param string $medium The page or location description. Example: "plugin_admin". 15 15 * @param string $content The feature's name, the button's content, the link's text. Example: "logo". 16 * @param string $term The feature's type. Example: "link", or "image". 16 17 */ 17 public static function add_utm( string $url, string $medium, string $content = '' ): string {18 public static function add_utm( string $url, string $medium, string $content = '', string $term = '' ): string { 18 19 19 20 return add_query_arg( … … 24 25 'utm_medium' => rawurlencode( $medium ), 25 26 'utm_content' => rawurlencode( $content ), 27 'utm_term' => rawurlencode( $term ), 26 28 ] 27 29 ), -
finix-for-woocommerce/trunk/src/Payments.php
r3375717 r3418263 4 4 5 5 use FinixWC\Gateways\CardGateway; 6 use FinixWC\Helpers\CartData; 6 7 use FinixWC\Helpers\Convert; 7 use FinixWC\Helpers\CartData;8 8 9 9 /** … … 173 173 wp_send_json_error( 174 174 [ 175 'message' => esc_html__( 'Please review and fill all the required information.', 'finix-for-woocommerce' ),175 'message' => esc_html__( 'Please review and fill in all the required information.', 'finix-for-woocommerce' ), 176 176 ] 177 177 ); … … 253 253 254 254 /** 255 * Return sdata for order tracking details based on WC.255 * Return data for order tracking details based on WC. 256 256 */ 257 257 public function get_order_tracking_details(): void { -
finix-for-woocommerce/trunk/src/Plugin.php
r3375717 r3418263 8 8 use FinixWC\Admin\Admin; 9 9 use FinixWC\Finix\API; 10 use FinixWC\Gateways\PaymentMethods\BankMethod;11 use FinixWC\Gateways\PaymentMethods\CardMethod;12 use FinixWC\Gateways\PaymentMethods\ApplePay;13 use FinixWC\Gateways\PaymentMethods\GooglePay;14 10 use FinixWC\Gateways\ApplePayGateway; 15 11 use FinixWC\Gateways\BankGateway; 16 12 use FinixWC\Gateways\CardGateway; 17 13 use FinixWC\Gateways\GooglePayGateway; 14 use FinixWC\Gateways\PaymentMethods\ApplePay; 15 use FinixWC\Gateways\PaymentMethods\BankMethod; 16 use FinixWC\Gateways\PaymentMethods\CardMethod; 17 use FinixWC\Gateways\PaymentMethods\GooglePay; 18 18 19 19 /** … … 100 100 101 101 add_action( 'woocommerce_blocks_loaded', [ $this, 'register_payment_method_types' ] ); 102 103 add_filter( 'woocommerce_available_payment_gateways', [ $this, 'remove_unsupported_methods_on_http' ] ); 102 104 } 103 105 … … 170 172 171 173 /** 174 * Remove unsupported payment methods on HTTP (Apple Pay and Google Pay). 175 */ 176 public function remove_unsupported_methods_on_http( $available_gateways ) { 177 178 // If not HTTPS, remove Apple Pay and Google Pay gateways. 179 if ( ! is_ssl() ) { 180 unset( 181 $available_gateways[ ApplePayGateway::SLUG ], 182 $available_gateways[ GooglePayGateway::SLUG ] 183 ); 184 } 185 186 return $available_gateways; 187 } 188 189 /** 172 190 * Cloning is forbidden. 173 191 */ -
finix-for-woocommerce/trunk/vendor/composer/autoload_static.php
r3375717 r3418263 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( 10 'F' => 10 'F' => 11 11 array ( 12 12 'FinixWC\\' => 8, … … 15 15 16 16 public static $prefixDirsPsr4 = array ( 17 'FinixWC\\' => 17 'FinixWC\\' => 18 18 array ( 19 19 0 => __DIR__ . '/../..' . '/src', -
finix-for-woocommerce/trunk/vendor/composer/installed.php
r3375717 r3418263 2 2 'root' => array( 3 3 'name' => 'finix-payments/finix-for-woocommerce', 4 'pretty_version' => '1. 3.0',5 'version' => '1. 3.0.0',4 'pretty_version' => '1.4.0', 5 'version' => '1.4.0.0', 6 6 'reference' => null, 7 7 'type' => 'library', … … 12 12 'versions' => array( 13 13 'finix-payments/finix-for-woocommerce' => array( 14 'pretty_version' => '1. 3.0',15 'version' => '1. 3.0.0',14 'pretty_version' => '1.4.0', 15 'version' => '1.4.0.0', 16 16 'reference' => null, 17 17 'type' => 'library',
Note: See TracChangeset
for help on using the changeset viewer.