Plugin Directory

Changeset 3197940


Ignore:
Timestamp:
11/27/2024 08:28:06 AM (16 months ago)
Author:
monei
Message:

Update to version 6.1.1 from GitHub

Location:
monei
Files:
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • monei/tags/6.1.1/assets/js/monei-block-checkout-cc.js

    r3197607 r3197940  
    319319            <fieldset className="monei-fieldset monei-card-fieldset wc-block-components-form">
    320320                { moneiData?.description && <p>{ moneiData.description }</p> }
    321                 <div className="monei-input-container">
     321                <div className="monei-input-container  wc-block-components-text-input">
    322322                    <input
    323323                        type="text"
     
    326326                        placeholder={ __( 'Cardholder Name', 'monei' ) }
    327327                        required
    328                         className="monei-input wc-block-components-text-input"
     328                        className="monei-input"
    329329                    />
    330330                    <div
     
    333333                    ></div>
    334334                </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" />
    336336                <input
    337337                    type="hidden"
  • monei/tags/6.1.1/class-woocommerce-gateway-monei.php

    r3197607 r3197940  
    66 * @category Core
    77 * @package  Woocommerce_Gateway_Monei
    8  * @version  6.1.0
     8 * @version  6.1.1
    99 */
    1010if ( ! class_exists( 'Woocommerce_Gateway_Monei' ) ) :
     
    1717         * @var string
    1818         */
    19         public $version = '6.1.0';
     19        public $version = '6.1.1';
    2020
    2121        /**
  • monei/tags/6.1.1/includes/payment-methods/class-wc-gateway-monei-cc.php

    r3197607 r3197940  
    288288        <fieldset class="monei-fieldset monei-card-fieldset wc-block-components-form" id="wc-<?php echo esc_attr($this->id); ?>-cc-form">
    289289            <!-- Cardholder Name Input -->
    290             <div class="monei-input-container">
     290            <div class="monei-input-container wc-block-components-text-input">
    291291                <input
    292292                        type="text"
     
    295295                        placeholder="<?php echo __('Cardholder Name', 'monei'); ?>"
    296296                        required
    297                         class="monei-input wc-block-components-text-input">
     297                        class="monei-input">
    298298                <div
    299299                        id="monei-cardholder-name-error"
     
    302302            </div>
    303303            <!-- 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">
    306306                </div>
    307307                <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  
    44Requires at least: 5.0
    55Tested up to: 6.7
    6 Stable tag: 6.1.0
     6Stable tag: 6.1.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    103103== Changelog ==
    104104
     105= 6.1.1 =
     106* Fix - Default css class in container
     107
    105108= 6.1.0 =
    106109* Add - Multibanco payment method
  • monei/tags/6.1.1/woocommerce-gateway-monei.php

    r3197607 r3197940  
    1111 * Plugin URI: https://wordpress.org/plugins/monei/
    1212 * Description: Accept Card, Apple Pay, Google Pay, Bizum, PayPal and many more payment methods in your store.
    13  * Version: 6.1.0
     13 * Version: 6.1.1
    1414 * Author: MONEI
    1515 * Author URI: https://www.monei.com/
  • monei/trunk/assets/js/monei-block-checkout-cc.js

    r3197607 r3197940  
    319319            <fieldset className="monei-fieldset monei-card-fieldset wc-block-components-form">
    320320                { moneiData?.description && <p>{ moneiData.description }</p> }
    321                 <div className="monei-input-container">
     321                <div className="monei-input-container  wc-block-components-text-input">
    322322                    <input
    323323                        type="text"
     
    326326                        placeholder={ __( 'Cardholder Name', 'monei' ) }
    327327                        required
    328                         className="monei-input wc-block-components-text-input"
     328                        className="monei-input"
    329329                    />
    330330                    <div
     
    333333                    ></div>
    334334                </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" />
    336336                <input
    337337                    type="hidden"
  • monei/trunk/class-woocommerce-gateway-monei.php

    r3197607 r3197940  
    66 * @category Core
    77 * @package  Woocommerce_Gateway_Monei
    8  * @version  6.1.0
     8 * @version  6.1.1
    99 */
    1010if ( ! class_exists( 'Woocommerce_Gateway_Monei' ) ) :
     
    1717         * @var string
    1818         */
    19         public $version = '6.1.0';
     19        public $version = '6.1.1';
    2020
    2121        /**
  • monei/trunk/includes/payment-methods/class-wc-gateway-monei-cc.php

    r3197607 r3197940  
    288288        <fieldset class="monei-fieldset monei-card-fieldset wc-block-components-form" id="wc-<?php echo esc_attr($this->id); ?>-cc-form">
    289289            <!-- Cardholder Name Input -->
    290             <div class="monei-input-container">
     290            <div class="monei-input-container wc-block-components-text-input">
    291291                <input
    292292                        type="text"
     
    295295                        placeholder="<?php echo __('Cardholder Name', 'monei'); ?>"
    296296                        required
    297                         class="monei-input wc-block-components-text-input">
     297                        class="monei-input">
    298298                <div
    299299                        id="monei-cardholder-name-error"
     
    302302            </div>
    303303            <!-- 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">
    306306                </div>
    307307                <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  
    44Requires at least: 5.0
    55Tested up to: 6.7
    6 Stable tag: 6.1.0
     6Stable tag: 6.1.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    103103== Changelog ==
    104104
     105= 6.1.1 =
     106* Fix - Default css class in container
     107
    105108= 6.1.0 =
    106109* Add - Multibanco payment method
  • monei/trunk/woocommerce-gateway-monei.php

    r3197607 r3197940  
    1111 * Plugin URI: https://wordpress.org/plugins/monei/
    1212 * Description: Accept Card, Apple Pay, Google Pay, Bizum, PayPal and many more payment methods in your store.
    13  * Version: 6.1.0
     13 * Version: 6.1.1
    1414 * Author: MONEI
    1515 * Author URI: https://www.monei.com/
Note: See TracChangeset for help on using the changeset viewer.