Changeset 3197940
- Timestamp:
- 11/27/2024 08:28:06 AM (16 months ago)
- Location:
- monei
- Files:
-
- 14 edited
- 1 copied
-
tags/6.1.1 (copied) (copied from monei/trunk)
-
tags/6.1.1/assets/js/monei-block-checkout-cc.js (modified) (3 diffs)
-
tags/6.1.1/class-woocommerce-gateway-monei.php (modified) (2 diffs)
-
tags/6.1.1/includes/payment-methods/class-wc-gateway-monei-cc.php (modified) (3 diffs)
-
tags/6.1.1/public/js/monei-block-checkout-cc.min.asset.php (modified) (1 diff)
-
tags/6.1.1/public/js/monei-block-checkout-cc.min.js (modified) (1 diff)
-
tags/6.1.1/readme.txt (modified) (2 diffs)
-
tags/6.1.1/woocommerce-gateway-monei.php (modified) (1 diff)
-
trunk/assets/js/monei-block-checkout-cc.js (modified) (3 diffs)
-
trunk/class-woocommerce-gateway-monei.php (modified) (2 diffs)
-
trunk/includes/payment-methods/class-wc-gateway-monei-cc.php (modified) (3 diffs)
-
trunk/public/js/monei-block-checkout-cc.min.asset.php (modified) (1 diff)
-
trunk/public/js/monei-block-checkout-cc.min.js (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/woocommerce-gateway-monei.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
monei/tags/6.1.1/assets/js/monei-block-checkout-cc.js
r3197607 r3197940 319 319 <fieldset className="monei-fieldset monei-card-fieldset wc-block-components-form"> 320 320 { moneiData?.description && <p>{ moneiData.description }</p> } 321 <div className="monei-input-container ">321 <div className="monei-input-container wc-block-components-text-input"> 322 322 <input 323 323 type="text" … … 326 326 placeholder={ __( 'Cardholder Name', 'monei' ) } 327 327 required 328 className="monei-input wc-block-components-text-input"328 className="monei-input" 329 329 /> 330 330 <div … … 333 333 ></div> 334 334 </div> 335 <div id="monei-card-input" className="monei-card-input wc-block-components-text-input" />335 <div id="monei-card-input" className="monei-card-input" /> 336 336 <input 337 337 type="hidden" -
monei/tags/6.1.1/class-woocommerce-gateway-monei.php
r3197607 r3197940 6 6 * @category Core 7 7 * @package Woocommerce_Gateway_Monei 8 * @version 6.1. 08 * @version 6.1.1 9 9 */ 10 10 if ( ! class_exists( 'Woocommerce_Gateway_Monei' ) ) : … … 17 17 * @var string 18 18 */ 19 public $version = '6.1. 0';19 public $version = '6.1.1'; 20 20 21 21 /** -
monei/tags/6.1.1/includes/payment-methods/class-wc-gateway-monei-cc.php
r3197607 r3197940 288 288 <fieldset class="monei-fieldset monei-card-fieldset wc-block-components-form" id="wc-<?php echo esc_attr($this->id); ?>-cc-form"> 289 289 <!-- Cardholder Name Input --> 290 <div class="monei-input-container ">290 <div class="monei-input-container wc-block-components-text-input"> 291 291 <input 292 292 type="text" … … 295 295 placeholder="<?php echo __('Cardholder Name', 'monei'); ?>" 296 296 required 297 class="monei-input wc-block-components-text-input">297 class="monei-input"> 298 298 <div 299 299 id="monei-cardholder-name-error" … … 302 302 </div> 303 303 <!-- Card Input Container --> 304 <div id="payment-form" class="monei-input-container ">305 <div id="monei-card-input" class="monei-card-input wc-block-components-text-input">304 <div id="payment-form" class="monei-input-container wc-block-components-text-input"> 305 <div id="monei-card-input" class="monei-card-input"> 306 306 </div> 307 307 <div -
monei/tags/6.1.1/public/js/monei-block-checkout-cc.min.asset.php
r3197607 r3197940 1 <?php return array('dependencies' => array('react-jsx-runtime'), 'version' => ' 8c2106c89bbc7b19ec48');1 <?php return array('dependencies' => array('react-jsx-runtime'), 'version' => '61b555c7aa39b7b91733'); -
monei/tags/6.1.1/public/js/monei-block-checkout-cc.min.js
r3197607 r3197940 1 (()=>{"use strict";const e=window.ReactJSXRuntime;!function(){const{registerPaymentMethod:o}=wc.wcBlocksRegistry,{__}=wp.i18n,{useEffect:n}=wp.element,t=wc.wcSettings.getSetting("monei_data"),r=o=>{const{responseTypes:r}=o.emitResponse,a="yes"===t.redirect,{onPaymentSetup:c,onCheckoutValidation:s,onCheckoutSuccess:i}=o.eventRegistration;let l=!0,d=null,m=null;const u=/^[A-Za-zÀ-ú- ]{5,50}$/,p=o.shouldSavePayment,y=(e,o)=>{d=document.getElementById(o),d.innerHTML=e},h=e=>{document.getElementById(e).innerHTML=""};if(a)return(0,e.jsx)("div",{className:"wc-block-components-text-input wc-block-components-address-form__email",children:(0,e.jsx)("p",{children:__("You will be redirected to the payment page","monei")})});const g=()=>{const e="monei-cardholder-name-error",o=document.querySelector("#cardholder_name").value;return u.test(o)?(h(e),!0):(y(__("Please enter a valid name. Special characters are not allowed.","monei"),e),!1)};n((()=>{const e=document.querySelector("#cardholder_name");return e&&e.addEventListener("blur",g),()=>{e&&e.removeEventListener("blur",g)}}),[]),n((()=>{"undefined"!=typeof monei&&monei.CardInput?k():console.error("MONEI SDK is not available")}),[]);const k=()=>{const e=document.getElementById("monei-card-input");d=monei.CardInput({accountId:t.accountId,sessionId:t.sessionId,language:t.language,style:{input:{color:"hsla(0,0%,7%,.8)",fontSize:"16px","box-sizing":"border-box","::placeholder":{color:"hsla(0,0%,7%,.8)"},"-webkit-autofill":{backgroundColor:"#FAFFBD"}},invalid:{color:"#fa755a"}},onFocus(){e.classList.add("is-focused")},onBlur(){e.classList.remove("is-focused")},onChange(o){o.isTouched&&o.error?(e.classList.add("is-invalid"),y(o.error,"monei-card-error"),l=!0):(e.classList.remove("is-invalid"),h("monei-card-error"),o.isTouched&&(l=!1))},onEnter(){b()}}),d.render(e)},b=()=>monei.createToken(d).then((e=>e.error?(y(e.error,"monei-card-error"),null):(document.querySelector("#monei_payment_token").value=e.token,m=e.token,e.token))).catch((e=>(y(e.message,"monei-card-error"),null)));return n((()=>{const e=s((()=>g()?!1!==l?{errorMessage:__("Please check your card details.","monei")}:!!m||b().then((e=>!!e)):{errorMessage:__("Please enter a valid name. Special characters are not allowed.","monei")}));return()=>{e()}}),[s,l]),n((()=>{const e=c((()=>{const e=document.querySelector("#cardholder_name").value;return m?{type:r.SUCCESS,meta:{paymentMethodData:{monei_payment_token:m,monei_cardholder_name:e,monei_is_block_checkout:"yes"}}}:b().then((o=>o&&o.length?{type:r.SUCCESS,meta:{paymentMethodData:{monei_payment_token:o,monei_cardholder_name:e,monei_is_block_checkout:"yes"}}}:{type:"error",message:__("MONEI token could not be generated.","monei")}))}));return()=>{e()}}),[c]),n((()=>{const e=i((({processingResponse:e})=>{const{paymentDetails:o}=e;if(o&&o.paymentId){const e=o.paymentId,n=o.token;monei.confirmPayment({paymentId:e,paymentToken:n,paymentMethod:{card:{cardholderName:document.querySelector("#cardholder_name").value}}}).then((n=>{if("FAILED"===n.status)window.location.href=`${o.failUrl}&status=FAILED`;else{let n=o.completeUrl;const t=o.orderId;!0===p&&(n=`${o.completeUrl}&id=${e}&orderId=${t}`),window.location.href=n}})).catch((e=>{console.error("Error during payment confirmation:",e),window.location.href=o.failUrl}))}else console.error("No paymentId found in paymentDetails");return!0}));return()=>{e()}}),[i,p]),(0,e.jsxs)("fieldset",{className:"monei-fieldset monei-card-fieldset wc-block-components-form",children:[t?.description&&(0,e.jsx)("p",{children:t.description}),(0,e.jsxs)("div",{className:"monei-input-container ",children:[(0,e.jsx)("input",{type:"text",id:"cardholder_name",name:"cardholder_name",placeholder:__("Cardholder Name","monei"),required:!0,className:"monei-input wc-block-components-text-input"}),(0,e.jsx)("div",{id:"monei-cardholder-name-error",className:"wc-block-components-validation-error"})]}),(0,e.jsx)("div",{id:"monei-card-input",className:"monei-card-input wc-block-components-text-input"}),(0,e.jsx)("input",{type:"hidden",id:"monei_payment_token",name:"monei_payment_token",value:""}),(0,e.jsx)("div",{id:"monei-card-error",className:"wc-block-components-validation-error"})]})},a=o=>{const{responseTypes:r}=o.emitResponse,{onPaymentSetup:a,onCheckoutValidation:c,onCheckoutSuccess:s}=o.eventRegistration,{activePaymentMethod:i}=o;let l=null;n((()=>{const e=document.querySelector(".wc-block-components-button.wp-element-button.wc-block-components-checkout-place-order-button.wc-block-components-checkout-place-order-button--full-width.contained");return"monei_apple_google"===i&&e&&(e.style.color="black",e.style.backgroundColor="#ccc",e.disabled=!0),()=>{e&&(e.style.color="",e.style.backgroundColor="",e.disabled=!1)}}),[i]),n((()=>{"undefined"!=typeof monei&&monei.PaymentRequest?d():console.error("MONEI SDK is not available")}),[]);const d=()=>{window.paymentRequest&&window.paymentRequest.close();const e=monei.PaymentRequest({accountId:t.accountId,sessionId:t.sessionId,language:t.language,amount:parseInt(100*t.total),currency:t.currency,onSubmit(e){if(e.token){l=e.token;const o=document.querySelector(".wc-block-components-button.wp-element-button.wc-block-components-checkout-place-order-button.wc-block-components-checkout-place-order-button--full-width.contained");o?(o.style.color="",o.style.backgroundColor="",o.disabled=!1,o.click()):console.error("Place Order button not found.")}},onError(e){console.error(e),console.error(e)}}),o=document.getElementById("payment-request-container");e.render(o)};return n((()=>{const e=a((()=>l?{type:r.SUCCESS,meta:{paymentMethodData:{monei_payment_request_token:l}}}:{type:"error",message:__("MONEI token could not be generated.","monei")}));return()=>{e()}}),[a]),(0,e.jsxs)("fieldset",{className:"monei-fieldset monei-payment-request-fieldset",children:[(0,e.jsx)("div",{id:"payment-request-container",className:"monei-payment-request-container"}),(0,e.jsx)("input",{type:"hidden",id:"monei_payment_token",name:"monei_payment_token",value:""}),(0,e.jsx)("div",{id:"monei-card-error",className:"monei-error"})]})},c={name:"monei",label:(0,e.jsxs)("div",{children:[" ",(0,e.jsxs)("div",{className:"monei-label-container",children:[(0,e.jsx)("span",{className:"monei-text",children:__(t.title,"monei")}),t?.logo&&(0,e.jsx)("div",{className:"monei-logo",children:(0,e.jsx)("img",{src:t.logo,alt:""})})]})," "]}),ariaLabel:__("MONEI Payment Gateway","monei"),content:(0,e.jsx)(r,{}),edit:(0,e.jsx)("div",{children:__("MONEI Payment Form (Edit Mode)","monei")}),canMakePayment:()=>!0,supports:wc.wcSettings.getSetting("monei_data").supports},s={name:"monei_apple_google",paymentMethodId:"monei",label:(0,e.jsxs)("div",{children:[" ",(()=>{const o=window.ApplePaySession?.canMakePayments(),n=o?t.logo_apple:t.logo_google,r=__(o?"Apple Pay":"Google Pay","monei"),a=o&&t?.logo_apple||!o&&t?.logo_google;return(0,e.jsxs)("div",{className:"monei-label-container",children:[(0,e.jsx)("span",{className:"monei-text",children:r}),a&&(0,e.jsx)("div",{className:"monei-logo",children:(0,e.jsx)("img",{src:n,alt:""})})]})})()," "]}),ariaLabel:__("Apple/Google Pay Payment Gateway","monei"),content:(0,e.jsx)(a,{}),edit:(0,e.jsx)("div",{children:__("MONEI Payment Form (Edit Mode)","monei")}),canMakePayment:()=>!0,supports:{features:["products"]}};o(c),o(s)}()})();1 (()=>{"use strict";const e=window.ReactJSXRuntime;!function(){const{registerPaymentMethod:o}=wc.wcBlocksRegistry,{__}=wp.i18n,{useEffect:n}=wp.element,t=wc.wcSettings.getSetting("monei_data"),r=o=>{const{responseTypes:r}=o.emitResponse,a="yes"===t.redirect,{onPaymentSetup:c,onCheckoutValidation:s,onCheckoutSuccess:i}=o.eventRegistration;let l=!0,d=null,m=null;const u=/^[A-Za-zÀ-ú- ]{5,50}$/,p=o.shouldSavePayment,y=(e,o)=>{d=document.getElementById(o),d.innerHTML=e},h=e=>{document.getElementById(e).innerHTML=""};if(a)return(0,e.jsx)("div",{className:"wc-block-components-text-input wc-block-components-address-form__email",children:(0,e.jsx)("p",{children:__("You will be redirected to the payment page","monei")})});const g=()=>{const e="monei-cardholder-name-error",o=document.querySelector("#cardholder_name").value;return u.test(o)?(h(e),!0):(y(__("Please enter a valid name. Special characters are not allowed.","monei"),e),!1)};n((()=>{const e=document.querySelector("#cardholder_name");return e&&e.addEventListener("blur",g),()=>{e&&e.removeEventListener("blur",g)}}),[]),n((()=>{"undefined"!=typeof monei&&monei.CardInput?k():console.error("MONEI SDK is not available")}),[]);const k=()=>{const e=document.getElementById("monei-card-input");d=monei.CardInput({accountId:t.accountId,sessionId:t.sessionId,language:t.language,style:{input:{color:"hsla(0,0%,7%,.8)",fontSize:"16px","box-sizing":"border-box","::placeholder":{color:"hsla(0,0%,7%,.8)"},"-webkit-autofill":{backgroundColor:"#FAFFBD"}},invalid:{color:"#fa755a"}},onFocus(){e.classList.add("is-focused")},onBlur(){e.classList.remove("is-focused")},onChange(o){o.isTouched&&o.error?(e.classList.add("is-invalid"),y(o.error,"monei-card-error"),l=!0):(e.classList.remove("is-invalid"),h("monei-card-error"),o.isTouched&&(l=!1))},onEnter(){b()}}),d.render(e)},b=()=>monei.createToken(d).then((e=>e.error?(y(e.error,"monei-card-error"),null):(document.querySelector("#monei_payment_token").value=e.token,m=e.token,e.token))).catch((e=>(y(e.message,"monei-card-error"),null)));return n((()=>{const e=s((()=>g()?!1!==l?{errorMessage:__("Please check your card details.","monei")}:!!m||b().then((e=>!!e)):{errorMessage:__("Please enter a valid name. Special characters are not allowed.","monei")}));return()=>{e()}}),[s,l]),n((()=>{const e=c((()=>{const e=document.querySelector("#cardholder_name").value;return m?{type:r.SUCCESS,meta:{paymentMethodData:{monei_payment_token:m,monei_cardholder_name:e,monei_is_block_checkout:"yes"}}}:b().then((o=>o&&o.length?{type:r.SUCCESS,meta:{paymentMethodData:{monei_payment_token:o,monei_cardholder_name:e,monei_is_block_checkout:"yes"}}}:{type:"error",message:__("MONEI token could not be generated.","monei")}))}));return()=>{e()}}),[c]),n((()=>{const e=i((({processingResponse:e})=>{const{paymentDetails:o}=e;if(o&&o.paymentId){const e=o.paymentId,n=o.token;monei.confirmPayment({paymentId:e,paymentToken:n,paymentMethod:{card:{cardholderName:document.querySelector("#cardholder_name").value}}}).then((n=>{if("FAILED"===n.status)window.location.href=`${o.failUrl}&status=FAILED`;else{let n=o.completeUrl;const t=o.orderId;!0===p&&(n=`${o.completeUrl}&id=${e}&orderId=${t}`),window.location.href=n}})).catch((e=>{console.error("Error during payment confirmation:",e),window.location.href=o.failUrl}))}else console.error("No paymentId found in paymentDetails");return!0}));return()=>{e()}}),[i,p]),(0,e.jsxs)("fieldset",{className:"monei-fieldset monei-card-fieldset wc-block-components-form",children:[t?.description&&(0,e.jsx)("p",{children:t.description}),(0,e.jsxs)("div",{className:"monei-input-container wc-block-components-text-input",children:[(0,e.jsx)("input",{type:"text",id:"cardholder_name",name:"cardholder_name",placeholder:__("Cardholder Name","monei"),required:!0,className:"monei-input"}),(0,e.jsx)("div",{id:"monei-cardholder-name-error",className:"wc-block-components-validation-error"})]}),(0,e.jsx)("div",{id:"monei-card-input",className:"monei-card-input"}),(0,e.jsx)("input",{type:"hidden",id:"monei_payment_token",name:"monei_payment_token",value:""}),(0,e.jsx)("div",{id:"monei-card-error",className:"wc-block-components-validation-error"})]})},a=o=>{const{responseTypes:r}=o.emitResponse,{onPaymentSetup:a,onCheckoutValidation:c,onCheckoutSuccess:s}=o.eventRegistration,{activePaymentMethod:i}=o;let l=null;n((()=>{const e=document.querySelector(".wc-block-components-button.wp-element-button.wc-block-components-checkout-place-order-button.wc-block-components-checkout-place-order-button--full-width.contained");return"monei_apple_google"===i&&e&&(e.style.color="black",e.style.backgroundColor="#ccc",e.disabled=!0),()=>{e&&(e.style.color="",e.style.backgroundColor="",e.disabled=!1)}}),[i]),n((()=>{"undefined"!=typeof monei&&monei.PaymentRequest?d():console.error("MONEI SDK is not available")}),[]);const d=()=>{window.paymentRequest&&window.paymentRequest.close();const e=monei.PaymentRequest({accountId:t.accountId,sessionId:t.sessionId,language:t.language,amount:parseInt(100*t.total),currency:t.currency,onSubmit(e){if(e.token){l=e.token;const o=document.querySelector(".wc-block-components-button.wp-element-button.wc-block-components-checkout-place-order-button.wc-block-components-checkout-place-order-button--full-width.contained");o?(o.style.color="",o.style.backgroundColor="",o.disabled=!1,o.click()):console.error("Place Order button not found.")}},onError(e){console.error(e),console.error(e)}}),o=document.getElementById("payment-request-container");e.render(o)};return n((()=>{const e=a((()=>l?{type:r.SUCCESS,meta:{paymentMethodData:{monei_payment_request_token:l}}}:{type:"error",message:__("MONEI token could not be generated.","monei")}));return()=>{e()}}),[a]),(0,e.jsxs)("fieldset",{className:"monei-fieldset monei-payment-request-fieldset",children:[(0,e.jsx)("div",{id:"payment-request-container",className:"monei-payment-request-container"}),(0,e.jsx)("input",{type:"hidden",id:"monei_payment_token",name:"monei_payment_token",value:""}),(0,e.jsx)("div",{id:"monei-card-error",className:"monei-error"})]})},c={name:"monei",label:(0,e.jsxs)("div",{children:[" ",(0,e.jsxs)("div",{className:"monei-label-container",children:[(0,e.jsx)("span",{className:"monei-text",children:__(t.title,"monei")}),t?.logo&&(0,e.jsx)("div",{className:"monei-logo",children:(0,e.jsx)("img",{src:t.logo,alt:""})})]})," "]}),ariaLabel:__("MONEI Payment Gateway","monei"),content:(0,e.jsx)(r,{}),edit:(0,e.jsx)("div",{children:__("MONEI Payment Form (Edit Mode)","monei")}),canMakePayment:()=>!0,supports:wc.wcSettings.getSetting("monei_data").supports},s={name:"monei_apple_google",paymentMethodId:"monei",label:(0,e.jsxs)("div",{children:[" ",(()=>{const o=window.ApplePaySession?.canMakePayments(),n=o?t.logo_apple:t.logo_google,r=__(o?"Apple Pay":"Google Pay","monei"),a=o&&t?.logo_apple||!o&&t?.logo_google;return(0,e.jsxs)("div",{className:"monei-label-container",children:[(0,e.jsx)("span",{className:"monei-text",children:r}),a&&(0,e.jsx)("div",{className:"monei-logo",children:(0,e.jsx)("img",{src:n,alt:""})})]})})()," "]}),ariaLabel:__("Apple/Google Pay Payment Gateway","monei"),content:(0,e.jsx)(a,{}),edit:(0,e.jsx)("div",{children:__("MONEI Payment Form (Edit Mode)","monei")}),canMakePayment:()=>!0,supports:{features:["products"]}};o(c),o(s)}()})(); -
monei/tags/6.1.1/readme.txt
r3197607 r3197940 4 4 Requires at least: 5.0 5 5 Tested up to: 6.7 6 Stable tag: 6.1. 06 Stable tag: 6.1.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 103 103 == Changelog == 104 104 105 = 6.1.1 = 106 * Fix - Default css class in container 107 105 108 = 6.1.0 = 106 109 * Add - Multibanco payment method -
monei/tags/6.1.1/woocommerce-gateway-monei.php
r3197607 r3197940 11 11 * Plugin URI: https://wordpress.org/plugins/monei/ 12 12 * Description: Accept Card, Apple Pay, Google Pay, Bizum, PayPal and many more payment methods in your store. 13 * Version: 6.1. 013 * Version: 6.1.1 14 14 * Author: MONEI 15 15 * Author URI: https://www.monei.com/ -
monei/trunk/assets/js/monei-block-checkout-cc.js
r3197607 r3197940 319 319 <fieldset className="monei-fieldset monei-card-fieldset wc-block-components-form"> 320 320 { moneiData?.description && <p>{ moneiData.description }</p> } 321 <div className="monei-input-container ">321 <div className="monei-input-container wc-block-components-text-input"> 322 322 <input 323 323 type="text" … … 326 326 placeholder={ __( 'Cardholder Name', 'monei' ) } 327 327 required 328 className="monei-input wc-block-components-text-input"328 className="monei-input" 329 329 /> 330 330 <div … … 333 333 ></div> 334 334 </div> 335 <div id="monei-card-input" className="monei-card-input wc-block-components-text-input" />335 <div id="monei-card-input" className="monei-card-input" /> 336 336 <input 337 337 type="hidden" -
monei/trunk/class-woocommerce-gateway-monei.php
r3197607 r3197940 6 6 * @category Core 7 7 * @package Woocommerce_Gateway_Monei 8 * @version 6.1. 08 * @version 6.1.1 9 9 */ 10 10 if ( ! class_exists( 'Woocommerce_Gateway_Monei' ) ) : … … 17 17 * @var string 18 18 */ 19 public $version = '6.1. 0';19 public $version = '6.1.1'; 20 20 21 21 /** -
monei/trunk/includes/payment-methods/class-wc-gateway-monei-cc.php
r3197607 r3197940 288 288 <fieldset class="monei-fieldset monei-card-fieldset wc-block-components-form" id="wc-<?php echo esc_attr($this->id); ?>-cc-form"> 289 289 <!-- Cardholder Name Input --> 290 <div class="monei-input-container ">290 <div class="monei-input-container wc-block-components-text-input"> 291 291 <input 292 292 type="text" … … 295 295 placeholder="<?php echo __('Cardholder Name', 'monei'); ?>" 296 296 required 297 class="monei-input wc-block-components-text-input">297 class="monei-input"> 298 298 <div 299 299 id="monei-cardholder-name-error" … … 302 302 </div> 303 303 <!-- Card Input Container --> 304 <div id="payment-form" class="monei-input-container ">305 <div id="monei-card-input" class="monei-card-input wc-block-components-text-input">304 <div id="payment-form" class="monei-input-container wc-block-components-text-input"> 305 <div id="monei-card-input" class="monei-card-input"> 306 306 </div> 307 307 <div -
monei/trunk/public/js/monei-block-checkout-cc.min.asset.php
r3197607 r3197940 1 <?php return array('dependencies' => array('react-jsx-runtime'), 'version' => ' 8c2106c89bbc7b19ec48');1 <?php return array('dependencies' => array('react-jsx-runtime'), 'version' => '61b555c7aa39b7b91733'); -
monei/trunk/public/js/monei-block-checkout-cc.min.js
r3197607 r3197940 1 (()=>{"use strict";const e=window.ReactJSXRuntime;!function(){const{registerPaymentMethod:o}=wc.wcBlocksRegistry,{__}=wp.i18n,{useEffect:n}=wp.element,t=wc.wcSettings.getSetting("monei_data"),r=o=>{const{responseTypes:r}=o.emitResponse,a="yes"===t.redirect,{onPaymentSetup:c,onCheckoutValidation:s,onCheckoutSuccess:i}=o.eventRegistration;let l=!0,d=null,m=null;const u=/^[A-Za-zÀ-ú- ]{5,50}$/,p=o.shouldSavePayment,y=(e,o)=>{d=document.getElementById(o),d.innerHTML=e},h=e=>{document.getElementById(e).innerHTML=""};if(a)return(0,e.jsx)("div",{className:"wc-block-components-text-input wc-block-components-address-form__email",children:(0,e.jsx)("p",{children:__("You will be redirected to the payment page","monei")})});const g=()=>{const e="monei-cardholder-name-error",o=document.querySelector("#cardholder_name").value;return u.test(o)?(h(e),!0):(y(__("Please enter a valid name. Special characters are not allowed.","monei"),e),!1)};n((()=>{const e=document.querySelector("#cardholder_name");return e&&e.addEventListener("blur",g),()=>{e&&e.removeEventListener("blur",g)}}),[]),n((()=>{"undefined"!=typeof monei&&monei.CardInput?k():console.error("MONEI SDK is not available")}),[]);const k=()=>{const e=document.getElementById("monei-card-input");d=monei.CardInput({accountId:t.accountId,sessionId:t.sessionId,language:t.language,style:{input:{color:"hsla(0,0%,7%,.8)",fontSize:"16px","box-sizing":"border-box","::placeholder":{color:"hsla(0,0%,7%,.8)"},"-webkit-autofill":{backgroundColor:"#FAFFBD"}},invalid:{color:"#fa755a"}},onFocus(){e.classList.add("is-focused")},onBlur(){e.classList.remove("is-focused")},onChange(o){o.isTouched&&o.error?(e.classList.add("is-invalid"),y(o.error,"monei-card-error"),l=!0):(e.classList.remove("is-invalid"),h("monei-card-error"),o.isTouched&&(l=!1))},onEnter(){b()}}),d.render(e)},b=()=>monei.createToken(d).then((e=>e.error?(y(e.error,"monei-card-error"),null):(document.querySelector("#monei_payment_token").value=e.token,m=e.token,e.token))).catch((e=>(y(e.message,"monei-card-error"),null)));return n((()=>{const e=s((()=>g()?!1!==l?{errorMessage:__("Please check your card details.","monei")}:!!m||b().then((e=>!!e)):{errorMessage:__("Please enter a valid name. Special characters are not allowed.","monei")}));return()=>{e()}}),[s,l]),n((()=>{const e=c((()=>{const e=document.querySelector("#cardholder_name").value;return m?{type:r.SUCCESS,meta:{paymentMethodData:{monei_payment_token:m,monei_cardholder_name:e,monei_is_block_checkout:"yes"}}}:b().then((o=>o&&o.length?{type:r.SUCCESS,meta:{paymentMethodData:{monei_payment_token:o,monei_cardholder_name:e,monei_is_block_checkout:"yes"}}}:{type:"error",message:__("MONEI token could not be generated.","monei")}))}));return()=>{e()}}),[c]),n((()=>{const e=i((({processingResponse:e})=>{const{paymentDetails:o}=e;if(o&&o.paymentId){const e=o.paymentId,n=o.token;monei.confirmPayment({paymentId:e,paymentToken:n,paymentMethod:{card:{cardholderName:document.querySelector("#cardholder_name").value}}}).then((n=>{if("FAILED"===n.status)window.location.href=`${o.failUrl}&status=FAILED`;else{let n=o.completeUrl;const t=o.orderId;!0===p&&(n=`${o.completeUrl}&id=${e}&orderId=${t}`),window.location.href=n}})).catch((e=>{console.error("Error during payment confirmation:",e),window.location.href=o.failUrl}))}else console.error("No paymentId found in paymentDetails");return!0}));return()=>{e()}}),[i,p]),(0,e.jsxs)("fieldset",{className:"monei-fieldset monei-card-fieldset wc-block-components-form",children:[t?.description&&(0,e.jsx)("p",{children:t.description}),(0,e.jsxs)("div",{className:"monei-input-container ",children:[(0,e.jsx)("input",{type:"text",id:"cardholder_name",name:"cardholder_name",placeholder:__("Cardholder Name","monei"),required:!0,className:"monei-input wc-block-components-text-input"}),(0,e.jsx)("div",{id:"monei-cardholder-name-error",className:"wc-block-components-validation-error"})]}),(0,e.jsx)("div",{id:"monei-card-input",className:"monei-card-input wc-block-components-text-input"}),(0,e.jsx)("input",{type:"hidden",id:"monei_payment_token",name:"monei_payment_token",value:""}),(0,e.jsx)("div",{id:"monei-card-error",className:"wc-block-components-validation-error"})]})},a=o=>{const{responseTypes:r}=o.emitResponse,{onPaymentSetup:a,onCheckoutValidation:c,onCheckoutSuccess:s}=o.eventRegistration,{activePaymentMethod:i}=o;let l=null;n((()=>{const e=document.querySelector(".wc-block-components-button.wp-element-button.wc-block-components-checkout-place-order-button.wc-block-components-checkout-place-order-button--full-width.contained");return"monei_apple_google"===i&&e&&(e.style.color="black",e.style.backgroundColor="#ccc",e.disabled=!0),()=>{e&&(e.style.color="",e.style.backgroundColor="",e.disabled=!1)}}),[i]),n((()=>{"undefined"!=typeof monei&&monei.PaymentRequest?d():console.error("MONEI SDK is not available")}),[]);const d=()=>{window.paymentRequest&&window.paymentRequest.close();const e=monei.PaymentRequest({accountId:t.accountId,sessionId:t.sessionId,language:t.language,amount:parseInt(100*t.total),currency:t.currency,onSubmit(e){if(e.token){l=e.token;const o=document.querySelector(".wc-block-components-button.wp-element-button.wc-block-components-checkout-place-order-button.wc-block-components-checkout-place-order-button--full-width.contained");o?(o.style.color="",o.style.backgroundColor="",o.disabled=!1,o.click()):console.error("Place Order button not found.")}},onError(e){console.error(e),console.error(e)}}),o=document.getElementById("payment-request-container");e.render(o)};return n((()=>{const e=a((()=>l?{type:r.SUCCESS,meta:{paymentMethodData:{monei_payment_request_token:l}}}:{type:"error",message:__("MONEI token could not be generated.","monei")}));return()=>{e()}}),[a]),(0,e.jsxs)("fieldset",{className:"monei-fieldset monei-payment-request-fieldset",children:[(0,e.jsx)("div",{id:"payment-request-container",className:"monei-payment-request-container"}),(0,e.jsx)("input",{type:"hidden",id:"monei_payment_token",name:"monei_payment_token",value:""}),(0,e.jsx)("div",{id:"monei-card-error",className:"monei-error"})]})},c={name:"monei",label:(0,e.jsxs)("div",{children:[" ",(0,e.jsxs)("div",{className:"monei-label-container",children:[(0,e.jsx)("span",{className:"monei-text",children:__(t.title,"monei")}),t?.logo&&(0,e.jsx)("div",{className:"monei-logo",children:(0,e.jsx)("img",{src:t.logo,alt:""})})]})," "]}),ariaLabel:__("MONEI Payment Gateway","monei"),content:(0,e.jsx)(r,{}),edit:(0,e.jsx)("div",{children:__("MONEI Payment Form (Edit Mode)","monei")}),canMakePayment:()=>!0,supports:wc.wcSettings.getSetting("monei_data").supports},s={name:"monei_apple_google",paymentMethodId:"monei",label:(0,e.jsxs)("div",{children:[" ",(()=>{const o=window.ApplePaySession?.canMakePayments(),n=o?t.logo_apple:t.logo_google,r=__(o?"Apple Pay":"Google Pay","monei"),a=o&&t?.logo_apple||!o&&t?.logo_google;return(0,e.jsxs)("div",{className:"monei-label-container",children:[(0,e.jsx)("span",{className:"monei-text",children:r}),a&&(0,e.jsx)("div",{className:"monei-logo",children:(0,e.jsx)("img",{src:n,alt:""})})]})})()," "]}),ariaLabel:__("Apple/Google Pay Payment Gateway","monei"),content:(0,e.jsx)(a,{}),edit:(0,e.jsx)("div",{children:__("MONEI Payment Form (Edit Mode)","monei")}),canMakePayment:()=>!0,supports:{features:["products"]}};o(c),o(s)}()})();1 (()=>{"use strict";const e=window.ReactJSXRuntime;!function(){const{registerPaymentMethod:o}=wc.wcBlocksRegistry,{__}=wp.i18n,{useEffect:n}=wp.element,t=wc.wcSettings.getSetting("monei_data"),r=o=>{const{responseTypes:r}=o.emitResponse,a="yes"===t.redirect,{onPaymentSetup:c,onCheckoutValidation:s,onCheckoutSuccess:i}=o.eventRegistration;let l=!0,d=null,m=null;const u=/^[A-Za-zÀ-ú- ]{5,50}$/,p=o.shouldSavePayment,y=(e,o)=>{d=document.getElementById(o),d.innerHTML=e},h=e=>{document.getElementById(e).innerHTML=""};if(a)return(0,e.jsx)("div",{className:"wc-block-components-text-input wc-block-components-address-form__email",children:(0,e.jsx)("p",{children:__("You will be redirected to the payment page","monei")})});const g=()=>{const e="monei-cardholder-name-error",o=document.querySelector("#cardholder_name").value;return u.test(o)?(h(e),!0):(y(__("Please enter a valid name. Special characters are not allowed.","monei"),e),!1)};n((()=>{const e=document.querySelector("#cardholder_name");return e&&e.addEventListener("blur",g),()=>{e&&e.removeEventListener("blur",g)}}),[]),n((()=>{"undefined"!=typeof monei&&monei.CardInput?k():console.error("MONEI SDK is not available")}),[]);const k=()=>{const e=document.getElementById("monei-card-input");d=monei.CardInput({accountId:t.accountId,sessionId:t.sessionId,language:t.language,style:{input:{color:"hsla(0,0%,7%,.8)",fontSize:"16px","box-sizing":"border-box","::placeholder":{color:"hsla(0,0%,7%,.8)"},"-webkit-autofill":{backgroundColor:"#FAFFBD"}},invalid:{color:"#fa755a"}},onFocus(){e.classList.add("is-focused")},onBlur(){e.classList.remove("is-focused")},onChange(o){o.isTouched&&o.error?(e.classList.add("is-invalid"),y(o.error,"monei-card-error"),l=!0):(e.classList.remove("is-invalid"),h("monei-card-error"),o.isTouched&&(l=!1))},onEnter(){b()}}),d.render(e)},b=()=>monei.createToken(d).then((e=>e.error?(y(e.error,"monei-card-error"),null):(document.querySelector("#monei_payment_token").value=e.token,m=e.token,e.token))).catch((e=>(y(e.message,"monei-card-error"),null)));return n((()=>{const e=s((()=>g()?!1!==l?{errorMessage:__("Please check your card details.","monei")}:!!m||b().then((e=>!!e)):{errorMessage:__("Please enter a valid name. Special characters are not allowed.","monei")}));return()=>{e()}}),[s,l]),n((()=>{const e=c((()=>{const e=document.querySelector("#cardholder_name").value;return m?{type:r.SUCCESS,meta:{paymentMethodData:{monei_payment_token:m,monei_cardholder_name:e,monei_is_block_checkout:"yes"}}}:b().then((o=>o&&o.length?{type:r.SUCCESS,meta:{paymentMethodData:{monei_payment_token:o,monei_cardholder_name:e,monei_is_block_checkout:"yes"}}}:{type:"error",message:__("MONEI token could not be generated.","monei")}))}));return()=>{e()}}),[c]),n((()=>{const e=i((({processingResponse:e})=>{const{paymentDetails:o}=e;if(o&&o.paymentId){const e=o.paymentId,n=o.token;monei.confirmPayment({paymentId:e,paymentToken:n,paymentMethod:{card:{cardholderName:document.querySelector("#cardholder_name").value}}}).then((n=>{if("FAILED"===n.status)window.location.href=`${o.failUrl}&status=FAILED`;else{let n=o.completeUrl;const t=o.orderId;!0===p&&(n=`${o.completeUrl}&id=${e}&orderId=${t}`),window.location.href=n}})).catch((e=>{console.error("Error during payment confirmation:",e),window.location.href=o.failUrl}))}else console.error("No paymentId found in paymentDetails");return!0}));return()=>{e()}}),[i,p]),(0,e.jsxs)("fieldset",{className:"monei-fieldset monei-card-fieldset wc-block-components-form",children:[t?.description&&(0,e.jsx)("p",{children:t.description}),(0,e.jsxs)("div",{className:"monei-input-container wc-block-components-text-input",children:[(0,e.jsx)("input",{type:"text",id:"cardholder_name",name:"cardholder_name",placeholder:__("Cardholder Name","monei"),required:!0,className:"monei-input"}),(0,e.jsx)("div",{id:"monei-cardholder-name-error",className:"wc-block-components-validation-error"})]}),(0,e.jsx)("div",{id:"monei-card-input",className:"monei-card-input"}),(0,e.jsx)("input",{type:"hidden",id:"monei_payment_token",name:"monei_payment_token",value:""}),(0,e.jsx)("div",{id:"monei-card-error",className:"wc-block-components-validation-error"})]})},a=o=>{const{responseTypes:r}=o.emitResponse,{onPaymentSetup:a,onCheckoutValidation:c,onCheckoutSuccess:s}=o.eventRegistration,{activePaymentMethod:i}=o;let l=null;n((()=>{const e=document.querySelector(".wc-block-components-button.wp-element-button.wc-block-components-checkout-place-order-button.wc-block-components-checkout-place-order-button--full-width.contained");return"monei_apple_google"===i&&e&&(e.style.color="black",e.style.backgroundColor="#ccc",e.disabled=!0),()=>{e&&(e.style.color="",e.style.backgroundColor="",e.disabled=!1)}}),[i]),n((()=>{"undefined"!=typeof monei&&monei.PaymentRequest?d():console.error("MONEI SDK is not available")}),[]);const d=()=>{window.paymentRequest&&window.paymentRequest.close();const e=monei.PaymentRequest({accountId:t.accountId,sessionId:t.sessionId,language:t.language,amount:parseInt(100*t.total),currency:t.currency,onSubmit(e){if(e.token){l=e.token;const o=document.querySelector(".wc-block-components-button.wp-element-button.wc-block-components-checkout-place-order-button.wc-block-components-checkout-place-order-button--full-width.contained");o?(o.style.color="",o.style.backgroundColor="",o.disabled=!1,o.click()):console.error("Place Order button not found.")}},onError(e){console.error(e),console.error(e)}}),o=document.getElementById("payment-request-container");e.render(o)};return n((()=>{const e=a((()=>l?{type:r.SUCCESS,meta:{paymentMethodData:{monei_payment_request_token:l}}}:{type:"error",message:__("MONEI token could not be generated.","monei")}));return()=>{e()}}),[a]),(0,e.jsxs)("fieldset",{className:"monei-fieldset monei-payment-request-fieldset",children:[(0,e.jsx)("div",{id:"payment-request-container",className:"monei-payment-request-container"}),(0,e.jsx)("input",{type:"hidden",id:"monei_payment_token",name:"monei_payment_token",value:""}),(0,e.jsx)("div",{id:"monei-card-error",className:"monei-error"})]})},c={name:"monei",label:(0,e.jsxs)("div",{children:[" ",(0,e.jsxs)("div",{className:"monei-label-container",children:[(0,e.jsx)("span",{className:"monei-text",children:__(t.title,"monei")}),t?.logo&&(0,e.jsx)("div",{className:"monei-logo",children:(0,e.jsx)("img",{src:t.logo,alt:""})})]})," "]}),ariaLabel:__("MONEI Payment Gateway","monei"),content:(0,e.jsx)(r,{}),edit:(0,e.jsx)("div",{children:__("MONEI Payment Form (Edit Mode)","monei")}),canMakePayment:()=>!0,supports:wc.wcSettings.getSetting("monei_data").supports},s={name:"monei_apple_google",paymentMethodId:"monei",label:(0,e.jsxs)("div",{children:[" ",(()=>{const o=window.ApplePaySession?.canMakePayments(),n=o?t.logo_apple:t.logo_google,r=__(o?"Apple Pay":"Google Pay","monei"),a=o&&t?.logo_apple||!o&&t?.logo_google;return(0,e.jsxs)("div",{className:"monei-label-container",children:[(0,e.jsx)("span",{className:"monei-text",children:r}),a&&(0,e.jsx)("div",{className:"monei-logo",children:(0,e.jsx)("img",{src:n,alt:""})})]})})()," "]}),ariaLabel:__("Apple/Google Pay Payment Gateway","monei"),content:(0,e.jsx)(a,{}),edit:(0,e.jsx)("div",{children:__("MONEI Payment Form (Edit Mode)","monei")}),canMakePayment:()=>!0,supports:{features:["products"]}};o(c),o(s)}()})(); -
monei/trunk/readme.txt
r3197607 r3197940 4 4 Requires at least: 5.0 5 5 Tested up to: 6.7 6 Stable tag: 6.1. 06 Stable tag: 6.1.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 103 103 == Changelog == 104 104 105 = 6.1.1 = 106 * Fix - Default css class in container 107 105 108 = 6.1.0 = 106 109 * Add - Multibanco payment method -
monei/trunk/woocommerce-gateway-monei.php
r3197607 r3197940 11 11 * Plugin URI: https://wordpress.org/plugins/monei/ 12 12 * Description: Accept Card, Apple Pay, Google Pay, Bizum, PayPal and many more payment methods in your store. 13 * Version: 6.1. 013 * Version: 6.1.1 14 14 * Author: MONEI 15 15 * Author URI: https://www.monei.com/
Note: See TracChangeset
for help on using the changeset viewer.