Changeset 3267715
- Timestamp:
- 04/07/2025 08:44:58 AM (12 months ago)
- Location:
- ecommpay-payments/trunk
- Files:
-
- 6 added
- 5 deleted
- 57 edited
-
build/index.asset.php (modified) (1 diff)
-
build/index.js (modified) (1 diff)
-
common/EcpCore.php (modified) (2 diffs)
-
common/api/EcpGatewayAPIPayment.php (modified) (6 diffs)
-
common/api/EcpGatewayAPISubscription.php (modified) (9 diffs)
-
common/gateways/EcpApplepay.php (modified) (2 diffs)
-
common/gateways/EcpBlik.php (modified) (2 diffs)
-
common/gateways/EcpBrazilOnlineBanks.php (modified) (2 diffs)
-
common/gateways/EcpCard.php (modified) (3 diffs)
-
common/gateways/EcpDirectDebitBACS.php (modified) (2 diffs)
-
common/gateways/EcpDirectDebitSEPA.php (modified) (2 diffs)
-
common/gateways/EcpGateway.php (modified) (2 diffs)
-
common/gateways/EcpGiropay.php (modified) (2 diffs)
-
common/gateways/EcpGooglepay.php (modified) (2 diffs)
-
common/gateways/EcpIdeal.php (modified) (2 diffs)
-
common/gateways/EcpKlarna.php (modified) (2 diffs)
-
common/gateways/EcpMore.php (modified) (2 diffs)
-
common/gateways/EcpPayPal.php (modified) (2 diffs)
-
common/gateways/EcpPayPalPayLater.php (modified) (2 diffs)
-
common/helpers/EcpGatewayAPIProtocol.php (modified) (8 diffs)
-
common/includes/EcpCallbacksHandler.php (modified) (2 diffs)
-
common/includes/EcpGatewayOrder.php (modified) (2 diffs)
-
common/includes/EcpGatewayOrderExtension.php (modified) (3 diffs)
-
common/includes/EcpOrderManager.php (modified) (1 diff)
-
common/includes/filters/EcpApiFilterList.php (deleted)
-
common/includes/filters/EcpApiFilters.php (added)
-
common/includes/filters/EcpAppendsFilterList.php (deleted)
-
common/includes/filters/EcpAppendsFilters.php (added)
-
common/includes/filters/EcpFilters.php (added)
-
common/includes/filters/EcpFiltersList.php (deleted)
-
common/includes/filters/EcpHtmlFilterList.php (deleted)
-
common/includes/filters/EcpHtmlFilters.php (added)
-
common/includes/filters/EcpWCFilterList.php (deleted)
-
common/includes/filters/EcpWCFilters.php (added)
-
common/includes/filters/EcpWPFilters.php (added)
-
common/modules/EcpModuleAuth.php (modified) (2 diffs)
-
common/modules/EcpModulePaymentPage.php (modified) (15 diffs)
-
common/settings/EcpSettings.php (modified) (2 diffs)
-
common/settings/EcpSettingsApplepay.php (modified) (2 diffs)
-
common/settings/EcpSettingsBanks.php (modified) (2 diffs)
-
common/settings/EcpSettingsBlik.php (modified) (2 diffs)
-
common/settings/EcpSettingsBrazilOnline_Banks.php (modified) (2 diffs)
-
common/settings/EcpSettingsCard.php (modified) (2 diffs)
-
common/settings/EcpSettingsDirectDebitBACS.php (modified) (2 diffs)
-
common/settings/EcpSettingsDirectDebitSEPA.php (modified) (2 diffs)
-
common/settings/EcpSettingsGeneral.php (modified) (2 diffs)
-
common/settings/EcpSettingsGiropay.php (modified) (2 diffs)
-
common/settings/EcpSettingsGooglepay.php (modified) (2 diffs)
-
common/settings/EcpSettingsIdeal.php (modified) (2 diffs)
-
common/settings/EcpSettingsKlarna.php (modified) (2 diffs)
-
common/settings/EcpSettingsMore.php (modified) (2 diffs)
-
common/settings/EcpSettingsPayPal.php (modified) (2 diffs)
-
common/settings/EcpSettingsPayPalPayLater.php (modified) (2 diffs)
-
common/settings/EcpSettingsProducts.php (modified) (2 diffs)
-
common/settings/EcpSettingsSofort.php (modified) (2 diffs)
-
common/settings/EcpSettingsSubscriptions.php (modified) (2 diffs)
-
common/settings/forms/EcpForm.php (modified) (5 diffs)
-
common/settings/forms/EcpSettingsManager.php (modified) (2 diffs)
-
common/settings/forms/EcpTabManager.php (modified) (2 diffs)
-
gateway-ecommpay.php (modified) (1 diff)
-
helpers/ecp-order.php (modified) (2 diffs)
-
helpers/ecp-payment.php (modified) (3 diffs)
-
helpers/ecp-subscription.php (modified) (6 diffs)
-
helpers/notices.php (modified) (4 diffs)
-
helpers/permissions.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
-
src/components/WidgetEmbedded.tsx (modified) (1 diff)
-
src/components/WidgetPopup.tsx (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ecommpay-payments/trunk/build/index.asset.php
r3158829 r3267715 1 <?php return array('dependencies' => array('react', 'wp-element', 'wp-html-entities'), 'version' => ' c849c8efab5f9621cc9a');1 <?php return array('dependencies' => array('react', 'wp-element', 'wp-html-entities'), 'version' => 'af9eb17cb39243c860e1'); -
ecommpay-payments/trunk/build/index.js
r3158829 r3267715 1 (()=>{"use strict";const e=window.React,i=window.wp.htmlEntities,n=window.wp.element;const t=["billing_address","billing_city","billing_country","billing_postal","customer_first_name","customer_last_name","customer_phone","customer_zip","customer_address","customer_city","customer_country","customer_email"],a=function(e){const i={};return Object.keys(e).forEach((n=>{let a;a=t.includes(n)?"BillingInfo["+n+"]":n,"billing_country"===n?i["BillingInfo[country]"]=e[n]:i[a]=e[n]})),i},l=()=>({back:(0,n.useCallback)((()=>{const e=[];e.push({name:"action",value:"ecommpay_break"}),window.ECP.order_id>0&&e.push({name:"order_id",value:window.ECP.order_id}),window.jQuery.ajax({type:"POST",url:window.ECP.ajax_url+"?"+window.location.href.split("?")[1],data:e,dataType:"json",success:function(e){console.log(e)},error:function(e,i,n){console.error(e,i,n)}})}),[])}),s=function(e){const[i,t]=(0,n.useState)(e);return{value:i,setTrue:(0,n.useCallback)((()=>{t(!0)}),[]),setFalse:(0,n.useCallback)((()=>{t(!1)}),[]),toggle:(0,n.useCallback)((()=>{t((e=>!e))}),[])}},r=function(i){const{darkMode:n}=i;return(0,e.createElement)("img",{style:{display:"block"},src:n?"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBzdHlsZT0ibWFyZ2luOiBhdXRvOyBkaXNwbGF5OiBibG9jazsgc2hhc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kdGg9IjYiIGhlaWdodD0iMjUiIGZpbGw9IiMwMDU3OWUiPgogICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ib3BhY2l0eSIgdmFsdWVzPSIxOzAiIGtleVRpbWVzPSIwOzEiIGR1cj0iMXMiIGJlZ2luPSItMC4xMjVzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPgogIDwvcmVjdD4KPC9nPjxnIHRyYW5zZm9ybT0icm90YXRlKDMxNSA1MCA1MCkiPgogIDxyZWN0IHg9IjQ4LjUiIHk9IjYiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjYiIGhlaWdodD0iMjUiIGZpbGw9IiMwMDU3OWUiPgogICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ib3BhY2l0eSIgdmFsdWVzPSIxOzAiIGtleVRpbWVzPSIwOzEiIGR1cj0iMXMiIGJlZ2luPSIwcyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiPjwvYW5pbWF0ZT4KICA8L3JlY3Q+CjwvZz4KPCEtLSBbbGRpb10gZ2VuZXJhdGVkIGJ5IGh0dHBzOi8vbG9hZGluZy5pby8gLS0+PC9zdmc+",alt:"Loading...",width:34,height:34})},d=function(i){const{show:t}=i,a=function(e,i){const[t,a]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{let n;return e&&!t?a(!0):!e&&t&&(n=setTimeout((()=>a(!1)),i)),()=>clearTimeout(n)}),[e,i,t]),t}(t,300),l=(0,n.useMemo)((()=>{var e;return null!==(e=window.ECP.darkMode)&&void 0!==e?e:window.matchMedia("(prefers-color-scheme: dark)").matches}),[]);return(0,n.useEffect)((()=>(document.body.style.overflow=t?"hidden":"auto",()=>{document.body.style.overflow="auto"})),[t]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("style",null,"\n @keyframes fade-in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n "),a&&(0,e.createElement)("div",{id:"ecommpay-loader-embedded",style:{display:"flex",position:"fixed",top:0,left:0,width:"100%",height:"100%",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px",backgroundColor:l?"rgba(0, 0, 0, 0.9)":"rgba(255, 255, 255, 0.9)",opacity:t?1:0,animation:"fade-in 300ms",transition:"opacity 500ms",zIndex:9999}},(0,e.createElement)(r,{darkMode:l})))},o=function(i){const{value:t,setTrue:r,setFalse:o}=s(!1),{value:c,setTrue:I}=s(!1),{value:m,setFalse:g}=s(!0),{back:u}=l(),p=(0,n.useCallback)((e=>{const i=document.createElement("form");i.setAttribute("method",e.method),i.setAttribute("action",e.url),i.setAttribute("style","display:none;"),i.setAttribute("name","3dsForm");for(let n in e.body){const t=document.createElement("input");t.name=n,t.value=e.body[n],i.appendChild(t)}document.body.appendChild(i),i.submit()}),[]),b=(0,n.useCallback)((e=>{if(e.origin!==window.ECP.origin_url)return;const i=JSON.parse(e.data);switch(i.message){case"epframe.show_clarification_page":return window.ECP.listeners.onShowClarificationPage();case"epframe.embedded_mode.check_validation_response":return window.ECP.listeners.onEmbeddedModeCheckValidationResponse(i);case"epframe.payment.success":case"epframe.card.verify.success":return window.ECP.listeners.onSuccess();case"epframe.payment.fail":case"epframe.card.verify.fail":return window.ECP.listeners.onFail()}}),[]),y=(0,n.useCallback)((e=>new Promise((n=>{window.ECP.listeners={onShowClarificationPage:()=>{I(),o(),n({type:i.emitResponse.responseTypes.ERROR,messageContext:i.emitResponse.noticeContexts.PAYMENTS,message:"Clarification required"})},onEmbeddedModeCheckValidationResponse:t=>{if(l='[for="radio-control-wc-payment-method-options-ecommpay-card"]',document.querySelector(l)?.scrollIntoView({behavior:"smooth"}),0===Object.keys(t.data).length)window.postMessage(JSON.stringify({message:"epframe.embedded_mode.submit",fields:a(e),from_another_domain:!0}));else{const e=Array.from(new Set(Object.values(t.data)));n({type:i.emitResponse.responseTypes.ERROR,messageContext:i.emitResponse.noticeContexts.PAYMENTS,message:"<b>Validation failed:</b> <ul><li>"+e.join("</li><li>")+"</li></ul>",retry:!0})}var l},onSuccess:()=>{o(),n({type:i.emitResponse.responseTypes.SUCCESS,redirectUrl:e.redirect_success_url})},onFail:()=>{o(), n({type:i.emitResponse.responseTypes.FAIL,messageContext:i.emitResponse.noticeContexts.PAYMENTS,message:"Payment failed"})}},setTimeout((()=>{window.postMessage(JSON.stringify({message:"epframe.embedded_mode.check_validation",from_another_domain:!0}))}),2e3)}))),[]),w=function(i,n,t){var a=this,l=(0,e.useRef)(null),s=(0,e.useRef)(0),r=(0,e.useRef)(null),d=(0,e.useRef)([]),o=(0,e.useRef)(),c=(0,e.useRef)(),I=(0,e.useRef)(i),m=(0,e.useRef)(!0);I.current=i;var g="undefined"!=typeof window,u=!n&&0!==n&&g;if("function"!=typeof i)throw new TypeError("Expected a function");n=+n||0;var p=!!(t=t||{}).leading,b=!("trailing"in t)||!!t.trailing,y="maxWait"in t,w="debounceOnServer"in t&&!!t.debounceOnServer,P=y?Math.max(+t.maxWait||0,n):null;(0,e.useEffect)((function(){return m.current=!0,function(){m.current=!1}}),[]);var Z=(0,e.useMemo)((function(){var e=function(e){var i=d.current,n=o.current;return d.current=o.current=null,s.current=e,c.current=I.current.apply(n,i)},i=function(e,i){u&&cancelAnimationFrame(r.current),r.current=u?requestAnimationFrame(e):setTimeout(e,i)},t=function(e){if(!m.current)return!1;var i=e-l.current;return!l.current||i>=n||i<0||y&&e-s.current>=P},Z=function(i){return r.current=null,b&&d.current?e(i):(d.current=o.current=null,c.current)},C=function e(){var a=Date.now();if(t(a))return Z(a);if(m.current){var r=n-(a-l.current),d=y?Math.min(r,P-(a-s.current)):r;i(e,d)}},h=function(){if(g||w){var I=Date.now(),u=t(I);if(d.current=[].slice.call(arguments),o.current=a,l.current=I,u){if(!r.current&&m.current)return s.current=l.current,i(C,n),p?e(l.current):c.current;if(y)return i(C,n),e(l.current)}return r.current||i(C,n),c.current}};return h.cancel=function(){r.current&&(u?cancelAnimationFrame(r.current):clearTimeout(r.current)),s.current=0,d.current=l.current=o.current=r.current=null},h.isPending=function(){return!!r.current},h.flush=function(){return r.current?Z(Date.now()):c.current},h}),[p,y,n,P,b,u,g,w]);return Z}((()=>{const e=[{name:"action",value:"get_data_for_payment_form"}];window.ECP.order_id>0&&e.push({name:"order_id",value:window.ECP.order_id}),window.jQuery.ajax({type:"POST",url:window.ECP.ajax_url+"?"+window.location.href.split("?")[1],data:e,dataType:"json",success:function(e){window.ECP={...window.ECP,isEmbeddedMode:!0,paramsForEmbeddedPP:{...e,onExit:u,onDestroy:u,onLoaded:g,onEnterKeyPressed:i.onSubmit,onPaymentSent:r,onSubmitClarificationForm:r,onEmbeddedModeRedirect3dsParentPage:p}},window.EPayWidget.run(window.ECP.paramsForEmbeddedPP,"POST")},error:function(e,i,n){console.error(e,i,n)}})}),2e3);return(0,n.useEffect)((()=>{const e=i.eventRegistration.onPaymentSetup((async()=>{if(!c)return{type:i.emitResponse.responseTypes.SUCCESS,meta:{paymentMethodData:{payment_id:window.ECP.paramsForEmbeddedPP.payment_id}}};window.postMessage(JSON.stringify({message:"epframe.embedded_mode.submit",fields:{},from_another_domain:!0}))}),0),n=i.eventRegistration.onCheckoutSuccess((async e=>{window.ECP.order_id=e.orderId;const n=JSON.parse(e.processingResponse.paymentDetails.optionsJson),t=n.payment_amount,a=i.billing.currency.minorUnit-(["BIF","CLP","DJF","GNF","ISK","JPY","KMF","KRW","PYG","RWF","UGX","UYI","VND","VUV","XAF","XOF","XPF"].includes(i.billing.currency.code)?0:2),l=t===Math.round(i.billing.cartTotal.value/Math.pow(10,a)),s=i.billing.currency.code===n.payment_currency;return l&&s?await y(n):{type:i.emitResponse.responseTypes.ERROR,messageContext:i.emitResponse.noticeContexts.CHECKOUT,message:"Cart amount has changed, please refresh the page and try again"}}),0);return()=>{e(),n()}}),[i.eventRegistration.onCheckoutSuccess]),(0,n.useEffect)((()=>{w()}),[i.billing.appliedCoupons,i.billing.billingAddress.address_1,i.billing.billingAddress.address_2,i.billing.billingAddress.city,i.billing.billingAddress.company,i.billing.billingAddress.country,i.billing.billingAddress.email,i.billing.billingAddress.first_name,i.billing.billingAddress.last_name,i.billing.billingAddress.phone,i.billing.billingAddress.postcode,i.billing.billingAddress.state,i.billing.billingData.address_1,i.billing.billingData.address_2,i.billing.billingData.city,i.billing.billingData.company,i.billing.billingData.country,i.billing.billingData.email,i.billing.billingData.first_name,i.billing.billingData.last_name,i.billing.billingData.phone,i.billing.billingData.postcode,i.billing.billingData.state,i.billing.cartTotal.label,i.billing.cartTotal.value,i.billing.cartTotalItems,i.billing.currency.code,i.billing.currency.decimalSeparator,i.billing.currency.minorUnit,i.billing.currency.prefix,i.billing.currency.suffix,i.billing.currency.symbol,i.billing.currency.thousandSeparator,i.billing.customerId,i.billing.displayPricesIncludingTax,i.shippingData.isSelectingRate,i.shippingData.needsShipping,i.shippingData.selectedRates,i.shippingData.shippingAddress.address_1,i.shippingData.shippingAddress.address_2,i.shippingData.shippingAddress.city,i.shippingData.shippingAddress.company,i.shippingData.shippingAddress.country,i.shippingData.shippingAddress.first_name,i.shippingData.shippingAddress.last_name,i.shippingData.shippingAddress.phone,i.shippingData.shippingAddress.postcode,i.shippingData.shippingAddress.state,i.shippingData.shippingRates,i.shippingData.shippingRatesLoading,i.cartData.cartFees,i.cartData.cartItems,i.cartData.extensions,i.shouldSavePayment]),(0,n.useEffect)((()=>(window.ECP.listeners={},window.addEventListener("message",b),()=>{window.removeEventListener("message",b),window.ECP.listeners={}})),[b]),(0,e.createElement)(e.Fragment,null,m&&"Loading...",(0,e.createElement)("div",{id:"ecommpay-iframe-embedded",style:{height:m?"0":"auto"}}),(0,e.createElement)(d,{show:t}))},c=function(e){const{back:i}=l(),t=(0,n.useCallback)((n=>new Promise((t=>{window.EPayWidget.run({...n,onPaymentSuccess:()=>{t({type:e.emitResponse.responseTypes.SUCCESS,redirectUrl:""})},onPaymentFail:()=>{t({type:e.emitResponse.responseTypes.ERROR,messageContext:e.emitResponse.noticeContexts.PAYMENTS,message:"Payment failed",retry:!0})},onExit:()=>{i(),t({type:e.emitResponse.responseTypes.ERROR,messageContext:e.emitResponse.noticeContexts.CHECKOUT_ACTIONS,message:"Payment cancelled",retry:!0})},onDestroy:()=>{i(),t({type:e.emitResponse.responseTypes.ERROR,messageContext:e.emitResponse.noticeContexts.CHECKOUT_ACTIONS,message:"Payment cancelled",retry:!0})}},"POST")}))),[i]);return(0,n.useEffect)((()=>{const i=e.eventRegistration.onCheckoutSuccess((async e=>{window.ECP.order_id=e.orderId;const i=JSON.parse(e.processingResponse.paymentDetails.optionsJson);return await t(i)}),0);return()=>{i()}}),[e.eventRegistration.onCheckoutSuccess,t]),e.children},I=function(t){const a=(0,n.useMemo)((()=>(0,i.decodeEntities)(t.data.description)),[t.data.description]);return(0,n.useMemo)((()=>"embedded"===t.data.pp_mode&&"ecommpay-card"===t.activePaymentMethod?(0,e.createElement)(o,{...t}):"popup"===t.data.pp_mode?(0,e.createElement)(c,{...t},a):a),[t])},m=function(n){return(0,e.createElement)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"10px"}},(0,i.decodeEntities)(n.data.title),n.data.icon&&(0,e.createElement)("img",{src:n.data.icon,alt:""}))},{getSetting:g}=window.wc.wcSettings,{registerPaymentMethod:u}=window.wc.wcBlocksRegistry,p=n=>{const t=g(`${n}_data`,null);if(!t)return;const a={name:n,label:(0,e.createElement)(m,{data:t}),content:(0,e.createElement)(I,{data:t}),edit:(0,e.createElement)(I,{data:t}),canMakePayment:()=>"ecommpay-apple-pay"!==n||Object.prototype.hasOwnProperty.call(window,"ApplePaySession")&&ApplePaySession.canMakePayments(),placeOrderButtonLabel:t.checkout_button_text,ariaLabel:(0,i.decodeEntities)(t.title),supports:{showSavedCards:!1,showSaveOption:!1,features:t.supports}};u(a)};for(const e of window.ECP.gateways)p(e)})();1 (()=>{"use strict";const e=window.React,i=window.wp.htmlEntities,n=window.wp.element;const t=["billing_address","billing_city","billing_country","billing_postal","customer_first_name","customer_last_name","customer_phone","customer_zip","customer_address","customer_city","customer_country","customer_email"],a=function(e){const i={};return Object.keys(e).forEach((n=>{let a;a=t.includes(n)?"BillingInfo["+n+"]":n,"billing_country"===n?i["BillingInfo[country]"]=e[n]:i[a]=e[n]})),i},l=()=>({back:(0,n.useCallback)((()=>{const e=[];e.push({name:"action",value:"ecommpay_break"}),window.ECP.order_id>0&&e.push({name:"order_id",value:window.ECP.order_id}),window.jQuery.ajax({type:"POST",url:window.ECP.ajax_url+"?"+window.location.href.split("?")[1],data:e,dataType:"json",success:function(e){console.log(e)},error:function(e,i,n){console.error(e,i,n)}})}),[])}),s=function(e){const[i,t]=(0,n.useState)(e);return{value:i,setTrue:(0,n.useCallback)((()=>{t(!0)}),[]),setFalse:(0,n.useCallback)((()=>{t(!1)}),[]),toggle:(0,n.useCallback)((()=>{t((e=>!e))}),[])}},r=function(i){const{darkMode:n}=i;return(0,e.createElement)("img",{style:{display:"block"},src:n?"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBzdHlsZT0ibWFyZ2luOiBhdXRvOyBkaXNwbGF5OiBibG9jazsgc2hhcGUtcmVuZGVyaW5nOiBhdXRvOyIgd2lkdGg9IjM0cHgiIGhlaWdodD0iMzRweCIgdmlld0JveD0iMCAwIDEwMCAxMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIj4KPGcgdHJhbnNmb3JtPSJyb3RhdGUoMCA1MCA1MCkiPgogIDxyZWN0IHg9IjQ4LjUiIHk9IjYiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjYiIGhlaWdodD0iMjUiIGZpbGw9IiNmZmYiPgogICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ib3BhY2l0eSIgdmFsdWVzPSIxOzAiIGtleVRpbWVzPSIwO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IGZpbGw9IiMwMDU3OWUiPgogICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ib3BhY2l0eSIgdmFsdWVzPSIxOzAiIGtleVRpbWVzPSIwOzEiIGR1cj0iMXMiIGJlZ2luPSIwcyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiPjwvYW5pbWF0ZT4KICA8L3JlY3Q+CjwvZz4KPCEtLSBbbGRpb10gZ2VuZXJhdGVkIGJ5IGh0dHBzOi8vbG9hZGluZy5pby8gLS0+PC9zdmc+",alt:"Loading...",width:34,height:34})},d=function(i){const{show:t}=i,a=function(e,i){const[t,a]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{let n;return e&&!t?a(!0):!e&&t&&(n=setTimeout((()=>a(!1)),i)),()=>clearTimeout(n)}),[e,i,t]),t}(t,300),l=(0,n.useMemo)((()=>{var e;return null!==(e=window.ECP.darkMode)&&void 0!==e?e:window.matchMedia("(prefers-color-scheme: dark)").matches}),[]);return(0,n.useEffect)((()=>(document.body.style.overflow=t?"hidden":"auto",()=>{document.body.style.overflow="auto"})),[t]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("style",null,"\n @keyframes fade-in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n "),a&&(0,e.createElement)("div",{id:"ecommpay-loader-embedded",style:{display:"flex",position:"fixed",top:0,left:0,width:"100%",height:"100%",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px",backgroundColor:l?"rgba(0, 0, 0, 0.9)":"rgba(255, 255, 255, 0.9)",opacity:t?1:0,animation:"fade-in 300ms",transition:"opacity 500ms",zIndex:9999}},(0,e.createElement)(r,{darkMode:l})))},o=function(i){const{value:t,setTrue:r,setFalse:o}=s(!1),{value:c,setTrue:I}=s(!1),{value:m,setFalse:g}=s(!0),{back:u}=l(),p=(0,n.useCallback)((e=>{const i=document.createElement("form");i.setAttribute("method",e.method),i.setAttribute("action",e.url),i.setAttribute("style","display:none;"),i.setAttribute("name","3dsForm");for(let n in e.body){const t=document.createElement("input");t.name=n,t.value=e.body[n],i.appendChild(t)}document.body.appendChild(i),i.submit()}),[]),b=(0,n.useCallback)((e=>{if(e.origin!==window.ECP.origin_url)return;const i=JSON.parse(e.data);switch(i.message){case"epframe.show_clarification_page":return window.ECP.listeners.onShowClarificationPage();case"epframe.embedded_mode.check_validation_response":return window.ECP.listeners.onEmbeddedModeCheckValidationResponse(i);case"epframe.payment.success":case"epframe.card.verify.success":return window.ECP.listeners.onSuccess();case"epframe.payment.fail":case"epframe.card.verify.fail":return window.ECP.listeners.onFail()}}),[]),y=(0,n.useCallback)((e=>new Promise((n=>{window.ECP.listeners={onShowClarificationPage:()=>{I(),o(),n({type:i.emitResponse.responseTypes.ERROR,messageContext:i.emitResponse.noticeContexts.PAYMENTS,message:"Clarification required"})},onEmbeddedModeCheckValidationResponse:t=>{if(l='[for="radio-control-wc-payment-method-options-ecommpay-card"]',document.querySelector(l)?.scrollIntoView({behavior:"smooth"}),0===Object.keys(t.data).length)window.postMessage(JSON.stringify({message:"epframe.embedded_mode.submit",fields:a(e),from_another_domain:!0}));else{const e=Array.from(new Set(Object.values(t.data)));n({type:i.emitResponse.responseTypes.ERROR,messageContext:i.emitResponse.noticeContexts.PAYMENTS,message:"<b>Validation failed:</b> <ul><li>"+e.join("</li><li>")+"</li></ul>",retry:!0})}var l},onSuccess:()=>{o(),n({type:i.emitResponse.responseTypes.SUCCESS,redirectUrl:e.redirect_success_url})},onFail:()=>{o(),w(),n({type:i.emitResponse.responseTypes.FAIL,messageContext:i.emitResponse.noticeContexts.PAYMENTS,message:"Payment failed"})}},setTimeout((()=>{window.postMessage(JSON.stringify({message:"epframe.embedded_mode.check_validation",from_another_domain:!0}))}),2e3)}))),[]),w=function(i,n,t){var a=this,l=(0,e.useRef)(null),s=(0,e.useRef)(0),r=(0,e.useRef)(null),d=(0,e.useRef)([]),o=(0,e.useRef)(),c=(0,e.useRef)(),I=(0,e.useRef)(i),m=(0,e.useRef)(!0);I.current=i;var g="undefined"!=typeof window,u=!n&&0!==n&&g;if("function"!=typeof i)throw new TypeError("Expected a function");n=+n||0;var p=!!(t=t||{}).leading,b=!("trailing"in t)||!!t.trailing,y="maxWait"in t,w="debounceOnServer"in t&&!!t.debounceOnServer,P=y?Math.max(+t.maxWait||0,n):null;(0,e.useEffect)((function(){return m.current=!0,function(){m.current=!1}}),[]);var Z=(0,e.useMemo)((function(){var e=function(e){var i=d.current,n=o.current;return d.current=o.current=null,s.current=e,c.current=I.current.apply(n,i)},i=function(e,i){u&&cancelAnimationFrame(r.current),r.current=u?requestAnimationFrame(e):setTimeout(e,i)},t=function(e){if(!m.current)return!1;var i=e-l.current;return!l.current||i>=n||i<0||y&&e-s.current>=P},Z=function(i){return r.current=null,b&&d.current?e(i):(d.current=o.current=null,c.current)},C=function e(){var a=Date.now();if(t(a))return Z(a);if(m.current){var r=n-(a-l.current),d=y?Math.min(r,P-(a-s.current)):r;i(e,d)}},h=function(){if(g||w){var I=Date.now(),u=t(I);if(d.current=[].slice.call(arguments),o.current=a,l.current=I,u){if(!r.current&&m.current)return s.current=l.current,i(C,n),p?e(l.current):c.current;if(y)return i(C,n),e(l.current)}return r.current||i(C,n),c.current}};return h.cancel=function(){r.current&&(u?cancelAnimationFrame(r.current):clearTimeout(r.current)),s.current=0,d.current=l.current=o.current=r.current=null},h.isPending=function(){return!!r.current},h.flush=function(){return r.current?Z(Date.now()):c.current},h}),[p,y,n,P,b,u,g,w]);return Z}((()=>{const e=[{name:"action",value:"get_data_for_payment_form"}];window.ECP.order_id>0&&e.push({name:"order_id",value:window.ECP.order_id}),window.jQuery.ajax({type:"POST",url:window.ECP.ajax_url+"?"+window.location.href.split("?")[1],data:e,dataType:"json",success:function(e){window.ECP={...window.ECP,isEmbeddedMode:!0,paramsForEmbeddedPP:{...e,onExit:u,onDestroy:u,onLoaded:g,onEnterKeyPressed:i.onSubmit,onPaymentSent:r,onSubmitClarificationForm:r,onEmbeddedModeRedirect3dsParentPage:p}},window.EPayWidget.run(window.ECP.paramsForEmbeddedPP,"POST")},error:function(e,i,n){console.error(e,i,n)}})}),2e3);return(0,n.useEffect)((()=>{const e=i.eventRegistration.onPaymentSetup((async()=>{if(!c)return{type:i.emitResponse.responseTypes.SUCCESS,meta:{paymentMethodData:{payment_id:window.ECP.paramsForEmbeddedPP.payment_id}}};window.postMessage(JSON.stringify({message:"epframe.embedded_mode.submit",fields:{},from_another_domain:!0}))}),0),n=i.eventRegistration.onCheckoutSuccess((async e=>{window.ECP.order_id=e.orderId;const n=JSON.parse(e.processingResponse.paymentDetails.optionsJson),t=n.payment_amount,a=i.billing.currency.minorUnit-(["BIF","CLP","DJF","GNF","ISK","JPY","KMF","KRW","PYG","RWF","UGX","UYI","VND","VUV","XAF","XOF","XPF"].includes(i.billing.currency.code)?0:2),l=t===Math.round(i.billing.cartTotal.value/Math.pow(10,a)),s=i.billing.currency.code===n.payment_currency;return l&&s?await y(n):{type:i.emitResponse.responseTypes.ERROR,messageContext:i.emitResponse.noticeContexts.CHECKOUT,message:"Cart amount has changed, please refresh the page and try again"}}),0);return()=>{e(),n()}}),[i.eventRegistration.onCheckoutSuccess]),(0,n.useEffect)((()=>{w()}),[i.billing.appliedCoupons,i.billing.billingAddress.address_1,i.billing.billingAddress.address_2,i.billing.billingAddress.city,i.billing.billingAddress.company,i.billing.billingAddress.country,i.billing.billingAddress.email,i.billing.billingAddress.first_name,i.billing.billingAddress.last_name,i.billing.billingAddress.phone,i.billing.billingAddress.postcode,i.billing.billingAddress.state,i.billing.billingData.address_1,i.billing.billingData.address_2,i.billing.billingData.city,i.billing.billingData.company,i.billing.billingData.country,i.billing.billingData.email,i.billing.billingData.first_name,i.billing.billingData.last_name,i.billing.billingData.phone,i.billing.billingData.postcode,i.billing.billingData.state,i.billing.cartTotal.label,i.billing.cartTotal.value,i.billing.cartTotalItems,i.billing.currency.code,i.billing.currency.decimalSeparator,i.billing.currency.minorUnit,i.billing.currency.prefix,i.billing.currency.suffix,i.billing.currency.symbol,i.billing.currency.thousandSeparator,i.billing.customerId,i.billing.displayPricesIncludingTax,i.shippingData.isSelectingRate,i.shippingData.needsShipping,i.shippingData.selectedRates,i.shippingData.shippingAddress.address_1,i.shippingData.shippingAddress.address_2,i.shippingData.shippingAddress.city,i.shippingData.shippingAddress.company,i.shippingData.shippingAddress.country,i.shippingData.shippingAddress.first_name,i.shippingData.shippingAddress.last_name,i.shippingData.shippingAddress.phone,i.shippingData.shippingAddress.postcode,i.shippingData.shippingAddress.state,i.shippingData.shippingRates,i.shippingData.shippingRatesLoading,i.cartData.cartFees,i.cartData.cartItems,i.cartData.extensions,i.shouldSavePayment]),(0,n.useEffect)((()=>(window.ECP.listeners={},window.addEventListener("message",b),()=>{window.removeEventListener("message",b),window.ECP.listeners={}})),[b]),(0,e.createElement)(e.Fragment,null,m&&"Loading...",(0,e.createElement)("div",{id:"ecommpay-iframe-embedded",style:{height:m?"0":"auto"}}),(0,e.createElement)(d,{show:t}))},c=function(e){const{back:i}=l(),t=(0,n.useCallback)((n=>new Promise((t=>{window.EPayWidget.run({...n,onPaymentSuccess:()=>{t({type:e.emitResponse.responseTypes.SUCCESS,redirectUrl:""})},onPaymentFail:()=>{t({type:e.emitResponse.responseTypes.ERROR,messageContext:e.emitResponse.noticeContexts.PAYMENTS,message:"Payment was declined. You can try another payment method.",retry:!0})},onExit:()=>{i(),t({type:e.emitResponse.responseTypes.ERROR,messageContext:e.emitResponse.noticeContexts.CHECKOUT_ACTIONS,message:"Payment cancelled",retry:!0})},onDestroy:()=>{i(),t({type:e.emitResponse.responseTypes.ERROR,messageContext:e.emitResponse.noticeContexts.CHECKOUT_ACTIONS,message:"Payment cancelled",retry:!0})}},"POST")}))),[i]);return(0,n.useEffect)((()=>{const i=e.eventRegistration.onCheckoutSuccess((async e=>{window.ECP.order_id=e.orderId;const i=JSON.parse(e.processingResponse.paymentDetails.optionsJson);return await t(i)}),0);return()=>{i()}}),[e.eventRegistration.onCheckoutSuccess,t]),e.children},I=function(t){const a=(0,n.useMemo)((()=>(0,i.decodeEntities)(t.data.description)),[t.data.description]);return(0,n.useMemo)((()=>"embedded"===t.data.pp_mode&&"ecommpay-card"===t.activePaymentMethod?(0,e.createElement)(o,{...t}):"popup"===t.data.pp_mode?(0,e.createElement)(c,{...t},a):a),[t])},m=function(n){return(0,e.createElement)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"10px"}},(0,i.decodeEntities)(n.data.title),n.data.icon&&(0,e.createElement)("img",{src:n.data.icon,alt:""}))},{getSetting:g}=window.wc.wcSettings,{registerPaymentMethod:u}=window.wc.wcBlocksRegistry,p=n=>{const t=g(`${n}_data`,null);if(!t)return;const a={name:n,label:(0,e.createElement)(m,{data:t}),content:(0,e.createElement)(I,{data:t}),edit:(0,e.createElement)(I,{data:t}),canMakePayment:()=>"ecommpay-apple-pay"!==n||Object.prototype.hasOwnProperty.call(window,"ApplePaySession")&&ApplePaySession.canMakePayments(),placeOrderButtonLabel:t.checkout_button_text,ariaLabel:(0,i.decodeEntities)(t.title),supports:{showSavedCards:!1,showSaveOption:!1,features:t.supports}};u(a)};for(const e of window.ECP.gateways)p(e)})(); -
ecommpay-payments/trunk/common/EcpCore.php
r3245713 r3267715 63 63 * @since 2.0.0 64 64 */ 65 public const WC_ECP_VERSION = '4. 0.4';65 public const WC_ECP_VERSION = '4.1.0'; 66 66 67 67 public const ECOMMPAY_PAYMENT_METHOD = 'ecommpay'; … … 160 160 161 161 add_filter( 162 includes\filters\EcpFilters List::FILTER_ACTION_LINKS,162 includes\filters\EcpFilters::FILTER_ACTION_LINKS, 163 163 [ $this, 'add_action_links' ] 164 164 ); -
ecommpay-payments/trunk/common/api/EcpGatewayAPIPayment.php
r3218798 r3267715 7 7 use common\includes\EcpGatewayOrder; 8 8 use common\includes\EcpGatewayRefund; 9 use common\includes\filters\EcpAppendsFilter List;9 use common\includes\filters\EcpAppendsFilters; 10 10 use common\models\EcpGatewayInfoResponse; 11 11 use common\models\EcpGatewayInfoStatus; … … 65 65 $this->post( 66 66 self::STATUS_API_ENDPOINT, 67 apply_filters( EcpAppendsFilter List::ECP_APPEND_SIGNATURE, $this->create_status_request_form_data( $order ) )67 apply_filters( EcpAppendsFilters::ECP_APPEND_SIGNATURE, $this->create_status_request_form_data( $order ) ) 68 68 ) 69 69 ); … … 126 126 'refund' 127 127 ), 128 apply_filters( EcpAppendsFilter List::ECP_APPEND_SIGNATURE, $data )128 apply_filters( EcpAppendsFilters::ECP_APPEND_SIGNATURE, $data ) 129 129 ); 130 130 … … 150 150 apply_filters( 151 151 'ecp_append_merchant_callback_url', 152 apply_filters( 'ecp_create_payment_data', $ order)152 apply_filters( 'ecp_create_payment_data', $refund ) 153 153 ) 154 154 ); … … 163 163 $data = $this->create_general_request_form_data( $order ); 164 164 $url = $this->getMethodEndpoint( $order->get_payment_method(), EcpGatewayAPI::CANCEL_ENDPOINT ); 165 $response = $this->post( $url, apply_filters( EcpAppendsFilter List::ECP_APPEND_SIGNATURE, $data ) );165 $response = $this->post( $url, apply_filters( EcpAppendsFilters::ECP_APPEND_SIGNATURE, $data ) ); 166 166 $response = new EcpGatewayInfoResponse( $response ); 167 167 $order->set_transaction_order_id( $response->get_request_id(), EcpGatewayOperationType::CANCEL ); … … 207 207 $data = $this->create_general_request_form_data( $order ); 208 208 $url = $this->getMethodEndpoint( $order->get_payment_method(), EcpGatewayAPI::CAPTURE_ENDPOINT ); 209 $response = $this->post( $url, apply_filters( EcpAppendsFilter List::ECP_APPEND_SIGNATURE, $data ) );209 $response = $this->post( $url, apply_filters( EcpAppendsFilters::ECP_APPEND_SIGNATURE, $data ) ); 210 210 $response = new EcpGatewayInfoResponse( $response ); 211 211 $order->set_transaction_order_id( $response->get_request_id(), self::CAPTURE_OPERATION ); -
ecommpay-payments/trunk/common/api/EcpGatewayAPISubscription.php
r3218798 r3267715 6 6 use common\helpers\EcpGatewayPaymentMethods; 7 7 use common\includes\EcpGatewayOrder; 8 use common\includes\filters\EcpApiFilter List;9 use common\includes\filters\EcpAppendsFilter List;10 use common\includes\filters\EcpFilters List;8 use common\includes\filters\EcpApiFilters; 9 use common\includes\filters\EcpAppendsFilters; 10 use common\includes\filters\EcpFilters; 11 11 use common\models\EcpGatewayInfoResponse; 12 12 use WC_Subscriptions_Order; … … 78 78 79 79 // Create form data 80 $data = apply_filters( EcpApiFilter List::ECP_API_RECURRING_FORM_DATA, $subscription_id, $order );80 $data = apply_filters( EcpApiFilters::ECP_API_RECURRING_FORM_DATA, $subscription_id, $order ); 81 81 82 82 // Run request … … 84 84 $this->post( 85 85 sprintf( '%s/%s', $payment_method, 'recurring' ), 86 apply_filters( EcpAppendsFilter List::ECP_APPEND_SIGNATURE, $data )86 apply_filters( EcpAppendsFilters::ECP_APPEND_SIGNATURE, $data ) 87 87 ) 88 88 ); … … 106 106 107 107 // Create form data 108 $data = apply_filters( EcpFilters List::ECP_CREATE_GENERAL_DATA, $request_id );108 $data = apply_filters( EcpFilters::ECP_CREATE_GENERAL_DATA, $request_id ); 109 109 110 110 // Run request … … 112 112 $this->post( 113 113 'status/request', 114 apply_filters( EcpAppendsFilter List::ECP_APPEND_SIGNATURE, $data )114 apply_filters( EcpAppendsFilters::ECP_APPEND_SIGNATURE, $data ) 115 115 ) 116 116 ); … … 153 153 $data = $this->create_general_section( 154 154 apply_filters( 155 EcpAppendsFilter List::ECP_APPEND_MERCHANT_CALLBACK_URL,156 apply_filters( EcpFilters List::ECP_CREATE_GENERAL_DATA, $order )157 ) 158 ); 159 $data = apply_filters( EcpApiFilter List::ECP_API_APPEND_RECURRING_DATA, $data, $subscription_id );160 $data = apply_filters( EcpAppendsFilter List::ECP_APPEND_PAYMENT_SECTION, $data, $order );155 EcpAppendsFilters::ECP_APPEND_MERCHANT_CALLBACK_URL, 156 apply_filters( EcpFilters::ECP_CREATE_GENERAL_DATA, $order ) 157 ) 158 ); 159 $data = apply_filters( EcpApiFilters::ECP_API_APPEND_RECURRING_DATA, $data, $subscription_id ); 160 $data = apply_filters( EcpAppendsFilters::ECP_APPEND_PAYMENT_SECTION, $data, $order ); 161 161 162 162 $ip_address = $order->get_ecp_meta( '_customer_ip_address' ); … … 166 166 ]; 167 167 168 return apply_filters( EcpAppendsFilter List::ECP_APPEND_INTERFACE_TYPE, $data );168 return apply_filters( EcpAppendsFilters::ECP_APPEND_INTERFACE_TYPE, $data ); 169 169 } 170 170 … … 182 182 183 183 return apply_filters( 184 EcpAppendsFilter List::ECP_APPEND_INTERFACE_TYPE,184 EcpAppendsFilters::ECP_APPEND_INTERFACE_TYPE, 185 185 $this->create_general_section( 186 186 apply_filters( 187 EcpApiFilter List::ECP_API_APPEND_RECURRING_DATA,187 EcpApiFilters::ECP_API_APPEND_RECURRING_DATA, 188 188 apply_filters( 189 EcpAppendsFilter List::ECP_APPEND_MERCHANT_CALLBACK_URL,190 apply_filters( EcpFilters List::ECP_CREATE_GENERAL_DATA, $order )189 EcpAppendsFilters::ECP_APPEND_MERCHANT_CALLBACK_URL, 190 apply_filters( EcpFilters::ECP_CREATE_GENERAL_DATA, $order ) 191 191 ), 192 192 $subscription_id … … 220 220 parent::hooks(); 221 221 222 add_filter( EcpApiFilter List::ECP_API_RECURRING_FORM_DATA, [222 add_filter( EcpApiFilters::ECP_API_RECURRING_FORM_DATA, [ 223 223 $this, 224 224 'create_recurring_request_form_data' 225 225 ], 10, 2 ); 226 add_filter( EcpApiFilter List::ECP_API_APPEND_RECURRING_DATA, [ $this, 'append_recurring_data' ], 10, 2 );227 add_filter( EcpApiFilter List::ECP_API_RECURRING_CANCEL_FORM_DATA, [226 add_filter( EcpApiFilters::ECP_API_APPEND_RECURRING_DATA, [ $this, 'append_recurring_data' ], 10, 2 ); 227 add_filter( EcpApiFilters::ECP_API_RECURRING_CANCEL_FORM_DATA, [ 228 228 $this, 229 229 'create_cancel_request_form_data' -
ecommpay-payments/trunk/common/gateways/EcpApplepay.php
r3218798 r3267715 4 4 5 5 use common\helpers\EcpGatewayPaymentMethods; 6 use common\includes\filters\EcpAppendsFilter List;6 use common\includes\filters\EcpAppendsFilters; 7 7 use common\modules\EcpModuleRefund; 8 8 use common\settings\EcpSettingsApplepay; … … 63 63 $amount = ecp_price_multiply( $order->get_total(), $order->get_currency() ); 64 64 65 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_OPERATION_MODE, $values, $amount > 0 ? self::MODE_PURCHASE : self::MODE_CARD_VERIFY );66 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_FORCE_MODE, $values, self::PAYMENT_METHOD );67 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_RECURRING, $values, $order );65 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_OPERATION_MODE, $values, $amount > 0 ? self::MODE_PURCHASE : self::MODE_CARD_VERIFY ); 66 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_FORCE_MODE, $values, self::PAYMENT_METHOD ); 67 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_RECURRING, $values, $order ); 68 68 69 69 return parent::apply_payment_args( $values, $order ); -
ecommpay-payments/trunk/common/gateways/EcpBlik.php
r3218798 r3267715 3 3 namespace common\gateways; 4 4 5 use common\includes\filters\EcpAppendsFilter List;5 use common\includes\filters\EcpAppendsFilters; 6 6 use common\modules\EcpModuleRefund; 7 7 use common\settings\EcpSettingsBlik; … … 52 52 */ 53 53 public function apply_payment_args( $values, $order ): array { 54 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_FORCE_MODE, $values, self::PAYMENT_METHOD );54 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_FORCE_MODE, $values, self::PAYMENT_METHOD ); 55 55 56 56 return parent::apply_payment_args( $values, $order ); -
ecommpay-payments/trunk/common/gateways/EcpBrazilOnlineBanks.php
r3218798 r3267715 3 3 namespace common\gateways; 4 4 5 use common\includes\filters\EcpAppendsFilter List;5 use common\includes\filters\EcpAppendsFilters; 6 6 use common\modules\EcpModuleRefund; 7 7 use common\settings\EcpSettingsBrazilOnline_Banks; … … 52 52 */ 53 53 public function apply_payment_args( $values, $order ): array { 54 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_FORCE_MODE, $values, self::PAYMENT_METHOD );54 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_FORCE_MODE, $values, self::PAYMENT_METHOD ); 55 55 56 56 return parent::apply_payment_args( $values, $order ); -
ecommpay-payments/trunk/common/gateways/EcpCard.php
r3218798 r3267715 5 5 use common\exceptions\EcpGatewayErrorException; 6 6 use common\helpers\EcpGatewayPaymentMethods; 7 use common\includes\filters\EcpAppendsFilter List;7 use common\includes\filters\EcpAppendsFilters; 8 8 use common\modules\EcpModuleRefund; 9 9 use common\settings\EcpSettings; … … 69 69 $display_mode = $this->get_option( EcpSettings::OPTION_MODE, EcpSettings::MODE_REDIRECT ); 70 70 71 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_CARD_OPERATION_TYPE, $values, $order );71 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_CARD_OPERATION_TYPE, $values, $order ); 72 72 // Setup Payment Page Operation Mode 73 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_OPERATION_MODE, $values, $amount > 0 ? self::MODE_PURCHASE : self::MODE_CARD_VERIFY );73 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_OPERATION_MODE, $values, $amount > 0 ? self::MODE_PURCHASE : self::MODE_CARD_VERIFY ); 74 74 // Setup Payment Page Force Mode 75 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_FORCE_MODE, $values, self::PAYMENT_METHOD );75 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_FORCE_MODE, $values, self::PAYMENT_METHOD ); 76 76 // Setup Payment Page Display Mode 77 77 $values = apply_filters( … … 82 82 ); 83 83 // Setup Recurring (Subscriptions) 84 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_RECURRING, $values, $order );84 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_RECURRING, $values, $order ); 85 85 86 86 return parent::apply_payment_args( $values, $order ); -
ecommpay-payments/trunk/common/gateways/EcpDirectDebitBACS.php
r3239955 r3267715 4 4 5 5 use common\helpers\EcpGatewayPaymentMethods; 6 use common\includes\filters\EcpAppendsFilter List;6 use common\includes\filters\EcpAppendsFilters; 7 7 use common\modules\EcpModuleRefund; 8 8 use common\settings\EcpSettingsDirectDebitBACS; … … 62 62 $amount = ecp_price_multiply( $order->get_total(), $order->get_currency() ); 63 63 64 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_CARD_OPERATION_TYPE, $values, $order );64 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_CARD_OPERATION_TYPE, $values, $order ); 65 65 // Setup Payment Page Operation Mode 66 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_OPERATION_MODE, $values, $amount > 0 ? self::MODE_PURCHASE : self::MODE_CARD_VERIFY );66 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_OPERATION_MODE, $values, $amount > 0 ? self::MODE_PURCHASE : self::MODE_CARD_VERIFY ); 67 67 // Setup Payment Page Force Mode 68 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_FORCE_MODE, $values, self::PAYMENT_METHOD );68 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_FORCE_MODE, $values, self::PAYMENT_METHOD ); 69 69 // Setup Recurring (Subscriptions) 70 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_RECURRING, $values, $order );70 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_RECURRING, $values, $order ); 71 71 72 72 return parent::apply_payment_args( $values, $order ); -
ecommpay-payments/trunk/common/gateways/EcpDirectDebitSEPA.php
r3239955 r3267715 4 4 5 5 use common\helpers\EcpGatewayPaymentMethods; 6 use common\includes\filters\EcpAppendsFilter List;6 use common\includes\filters\EcpAppendsFilters; 7 7 use common\modules\EcpModuleRefund; 8 8 use common\settings\EcpSettingsDirectDebitSEPA; … … 62 62 $amount = ecp_price_multiply( $order->get_total(), $order->get_currency() ); 63 63 64 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_CARD_OPERATION_TYPE, $values, $order );64 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_CARD_OPERATION_TYPE, $values, $order ); 65 65 // Setup Payment Page Operation Mode 66 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_OPERATION_MODE, $values, $amount > 0 ? self::MODE_PURCHASE : self::MODE_CARD_VERIFY );66 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_OPERATION_MODE, $values, $amount > 0 ? self::MODE_PURCHASE : self::MODE_CARD_VERIFY ); 67 67 // Setup Payment Page Force Mode 68 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_FORCE_MODE, $values, self::PAYMENT_METHOD );68 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_FORCE_MODE, $values, self::PAYMENT_METHOD ); 69 69 // Setup Recurring (Subscriptions) 70 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_RECURRING, $values, $order );70 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_RECURRING, $values, $order ); 71 71 72 72 return parent::apply_payment_args( $values, $order ); -
ecommpay-payments/trunk/common/gateways/EcpGateway.php
r3227972 r3267715 4 4 5 5 use common\includes\EcpGatewayOrder; 6 use common\includes\filters\EcpApiFilter List;7 use common\includes\filters\EcpAppendsFilter List;8 use common\includes\filters\EcpWCFilter List;6 use common\includes\filters\EcpApiFilters; 7 use common\includes\filters\EcpAppendsFilters; 8 use common\includes\filters\EcpWCFilters; 9 9 use common\modules\EcpModuleSubscription; 10 10 use common\settings\EcpSettings; … … 69 69 } 70 70 71 add_action( EcpWCFilter List::WOOCOMMERCE_UPDATE_OPTIONS_PAYMENT_GATEWAYS . $this->id, [71 add_action( EcpWCFilters::WOOCOMMERCE_UPDATE_OPTIONS_PAYMENT_GATEWAYS . $this->id, [ 72 72 EcpForm::get_instance(), 73 73 'save' 74 74 ] ); 75 add_filter( EcpAppendsFilter List::ECP_APPEND_GATEWAY_ARGUMENTS . $this->id, [75 add_filter( EcpAppendsFilters::ECP_APPEND_GATEWAY_ARGUMENTS . $this->id, [ 76 76 $this, 77 77 'apply_payment_args' 78 78 ], 10, 2 ); 79 add_filter( EcpApiFilter List::ECP_API_REFUND_ENDPOINT. $this->id, [ $this, 'get_refund_endpoint' ] );79 add_filter( EcpApiFilters::ECP_API_REFUND_ENDPOINT_PREFIX . $this->id, [ $this, 'get_refund_endpoint' ] ); 80 80 } 81 81 -
ecommpay-payments/trunk/common/gateways/EcpGiropay.php
r3218798 r3267715 3 3 namespace common\gateways; 4 4 5 use common\includes\filters\EcpAppendsFilter List;5 use common\includes\filters\EcpAppendsFilters; 6 6 use common\modules\EcpModuleRefund; 7 7 use common\settings\EcpSettingsGiropay; … … 51 51 */ 52 52 public function apply_payment_args( $values, $order ): array { 53 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_FORCE_MODE, $values, self::PAYMENT_METHOD );53 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_FORCE_MODE, $values, self::PAYMENT_METHOD ); 54 54 55 55 return parent::apply_payment_args( $values, $order ); -
ecommpay-payments/trunk/common/gateways/EcpGooglepay.php
r3218798 r3267715 4 4 5 5 use common\helpers\EcpGatewayPaymentMethods; 6 use common\includes\filters\EcpAppendsFilter List;6 use common\includes\filters\EcpAppendsFilters; 7 7 use common\modules\EcpModuleRefund; 8 8 use common\settings\EcpSettingsGooglepay; … … 62 62 $amount = ecp_price_multiply( $order->get_total(), $order->get_currency() ); 63 63 64 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_OPERATION_MODE, $values, $amount > 0 ? self::MODE_PURCHASE : self::MODE_CARD_VERIFY );65 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_FORCE_MODE, $values, self::PAYMENT_METHOD );66 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_RECURRING, $values, $order );64 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_OPERATION_MODE, $values, $amount > 0 ? self::MODE_PURCHASE : self::MODE_CARD_VERIFY ); 65 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_FORCE_MODE, $values, self::PAYMENT_METHOD ); 66 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_RECURRING, $values, $order ); 67 67 68 68 return parent::apply_payment_args( $values, $order ); -
ecommpay-payments/trunk/common/gateways/EcpIdeal.php
r3218798 r3267715 3 3 namespace common\gateways; 4 4 5 use common\includes\filters\EcpAppendsFilter List;5 use common\includes\filters\EcpAppendsFilters; 6 6 use common\modules\EcpModuleRefund; 7 7 use common\settings\EcpSettingsIdeal; … … 51 51 */ 52 52 public function apply_payment_args( $values, $order ): array { 53 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_FORCE_MODE, $values, self::PAYMENT_METHOD );53 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_FORCE_MODE, $values, self::PAYMENT_METHOD ); 54 54 55 55 return parent::apply_payment_args( $values, $order ); -
ecommpay-payments/trunk/common/gateways/EcpKlarna.php
r3218798 r3267715 3 3 namespace common\gateways; 4 4 5 use common\includes\filters\EcpAppendsFilter List;5 use common\includes\filters\EcpAppendsFilters; 6 6 use common\modules\EcpModuleRefund; 7 7 use common\settings\EcpSettingsKlarna; … … 55 55 $values = apply_filters( 'ecp_append_billing_country', $values, $order ); 56 56 $values = apply_filters( 'ecp_append_receipt_data', $values, $order, true ); 57 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_FORCE_MODE, $values, self::PAYMENT_METHOD );57 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_FORCE_MODE, $values, self::PAYMENT_METHOD ); 58 58 59 59 return parent::apply_payment_args( $values, $order ); -
ecommpay-payments/trunk/common/gateways/EcpMore.php
r3218798 r3267715 3 3 namespace common\gateways; 4 4 5 use common\includes\filters\EcpAppendsFilter List;5 use common\includes\filters\EcpAppendsFilters; 6 6 use common\settings\EcpSettings; 7 7 use common\settings\EcpSettingsMore; … … 60 60 61 61 if ( $force !== null && $force !== '' ) { 62 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_FORCE_MODE, $values, $force );62 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_FORCE_MODE, $values, $force ); 63 63 } 64 64 -
ecommpay-payments/trunk/common/gateways/EcpPayPal.php
r3218798 r3267715 3 3 namespace common\gateways; 4 4 5 use common\includes\filters\EcpAppendsFilter List;5 use common\includes\filters\EcpAppendsFilters; 6 6 use common\modules\EcpModuleRefund; 7 7 use common\settings\EcpSettingsPayPal; … … 51 51 */ 52 52 public function apply_payment_args( $values, $order ): array { 53 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_FORCE_MODE, $values, self::PAYMENT_METHOD );53 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_FORCE_MODE, $values, self::PAYMENT_METHOD ); 54 54 55 55 return parent::apply_payment_args( $values, $order ); -
ecommpay-payments/trunk/common/gateways/EcpPayPalPayLater.php
r3218798 r3267715 4 4 5 5 use common\includes\EcpGatewayOrder; 6 use common\includes\filters\EcpAppendsFilter List;6 use common\includes\filters\EcpAppendsFilters; 7 7 use common\modules\EcpModuleRefund; 8 8 use common\settings\EcpSettingsPayPalPayLater; … … 49 49 */ 50 50 public function apply_payment_args( array $values, EcpGatewayOrder $order ): array { 51 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_FORCE_MODE, $values, self::PAYMENT_METHOD );51 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_FORCE_MODE, $values, self::PAYMENT_METHOD ); 52 52 $values['payment_methods_options'] = '{"submethod_code": "paylater"}'; 53 53 -
ecommpay-payments/trunk/common/helpers/EcpGatewayAPIProtocol.php
r3227972 r3267715 7 7 use common\includes\EcpGatewayOrder; 8 8 use common\includes\EcpGatewayRefund; 9 use common\includes\filters\EcpAppendsFilter List;10 use common\includes\filters\EcpFilters List;9 use common\includes\filters\EcpAppendsFilters; 10 use common\includes\filters\EcpFilters; 11 11 use common\modules\EcpModuleCapture; 12 12 use common\settings\EcpSettings; … … 143 143 ecp_get_log()->info( __( 'Append customer data to the form data.', 'woo-ecommpay' ) ); 144 144 145 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_CUSTOMER_COUNTRY, $values, $order );146 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_CUSTOMER_STATE, $values, $order );147 $values = apply_filters( EcpFilters List::ECP_APPEND_CUSTOMER_CITY, $values, $order );148 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_CUSTOMER_ADDRESS, $values, $order );149 150 return apply_filters( EcpAppendsFilter List::ECP_APPEND_CUSTOMER_ZIP, $values, $order );145 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_CUSTOMER_COUNTRY, $values, $order ); 146 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_CUSTOMER_STATE, $values, $order ); 147 $values = apply_filters( EcpFilters::ECP_APPEND_CUSTOMER_CITY, $values, $order ); 148 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_CUSTOMER_ADDRESS, $values, $order ); 149 150 return apply_filters( EcpAppendsFilters::ECP_APPEND_CUSTOMER_ZIP, $values, $order ); 151 151 } 152 152 … … 355 355 */ 356 356 public function append_billing_data( array $values, EcpGatewayOrder $order ): array { 357 $values = apply_filters( EcpFilters List::ECP_APPEND_BILLING_ADDRESS, $values, $order );358 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_BILLING_CITY, $values, $order );359 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_BILLING_COUNTRY, $values, $order );360 361 return apply_filters( EcpAppendsFilter List::ECP_APPEND_BILLING_POSTAL, $values, $order );357 $values = apply_filters( EcpFilters::ECP_APPEND_BILLING_ADDRESS, $values, $order ); 358 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_BILLING_CITY, $values, $order ); 359 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_BILLING_COUNTRY, $values, $order ); 360 361 return apply_filters( EcpAppendsFilters::ECP_APPEND_BILLING_POSTAL, $values, $order ); 362 362 } 363 363 … … 504 504 /** 505 505 * @param array $values 506 * @param string|null $value 507 * 508 * @return array 509 */ 510 public function append_redirect_return_url( array $values, ?string $value ): array { 511 $this->append_argument( 'redirect_return_url', $value, $values ); 512 513 return $values; 514 } 515 516 /** 517 * @param array $values 506 518 * @param $url 507 519 * 508 520 * @return array 509 521 */ 510 public function append_redirect_ url( array $values,$url ): array {522 public function append_redirect_success_url( array $values, string $url ): array { 511 523 $this->append_argument( 'redirect_success_enabled', 2, $values ); 512 524 $this->append_argument( 'redirect_success_mode', 'parent_page', $values ); 513 525 $this->append_argument( 'redirect_success_url', $url, $values ); 526 return $values; 527 } 528 529 /** 530 * @param array $values 531 * @param $url 532 * 533 * @return array 534 */ 535 public function append_redirect_fail_url( array $values, string $url ): array { 514 536 $this->append_argument( 'redirect_fail_enabled', 2, $values ); 515 537 $this->append_argument( 'redirect_fail_mode', 'parent_page', $values ); 516 538 $this->append_argument( 'redirect_fail_url', $url, $values ); 517 518 539 return $values; 519 540 } … … 612 633 */ 613 634 public function append_custom_variables( $values, EcpGatewayOrder $order ): array { 614 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_CUSTOMER_ID, $values, $order );615 616 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_CUSTOMER_PHONE, $values, $order );617 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_CUSTOMER_EMAIL, $values, $order );618 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_CUSTOMER_FIRST_NAME, $values, $order );619 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_CUSTOMER_LAST_NAME, $values, $order );620 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_CUSTOMER_DATA, $values, $order );621 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_BILLING_DATA, $values, $order );622 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_RECEIPT_DATA, $values, $order, true );623 $values = apply_filters( EcpAppendsFilter List::ECP_APPEND_AVS_POST_CODE, $values, $order );624 625 return apply_filters( EcpAppendsFilter List::ECP_APPEND_AVS_STREET_ADDRESS, $values, $order );635 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_CUSTOMER_ID, $values, $order ); 636 637 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_CUSTOMER_PHONE, $values, $order ); 638 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_CUSTOMER_EMAIL, $values, $order ); 639 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_CUSTOMER_FIRST_NAME, $values, $order ); 640 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_CUSTOMER_LAST_NAME, $values, $order ); 641 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_CUSTOMER_DATA, $values, $order ); 642 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_BILLING_DATA, $values, $order ); 643 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_RECEIPT_DATA, $values, $order, true ); 644 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_AVS_POST_CODE, $values, $order ); 645 646 return apply_filters( EcpAppendsFilters::ECP_APPEND_AVS_STREET_ADDRESS, $values, $order ); 626 647 } 627 648 … … 724 745 $data = $this->receipt_data( $order ); 725 746 726 apply_filters( EcpFilters List::ECP_PAYMENT_PAGE_CLEAN_PARAMETERS, $data );747 apply_filters( EcpFilters::ECP_PAYMENT_PAGE_CLEAN_PARAMETERS, $data ); 727 748 728 749 if ( count( $data ) <= 0 ) { … … 869 890 ]; 870 891 871 apply_filters( EcpFilters List::ECP_PAYMENT_PAGE_CLEAN_PARAMETERS, $shipping_args );892 apply_filters( EcpFilters::ECP_PAYMENT_PAGE_CLEAN_PARAMETERS, $shipping_args ); 872 893 873 894 if ( count( $shipping_args ) <= 0 ) { … … 889 910 */ 890 911 protected function init(): void { 891 add_filter( EcpFilters List::ECP_CREATE_GENERAL_DATA_FILTER, [ $this, 'create_general_info' ] );892 add_filter( EcpFilters List::ECP_CREATE_PAYMENT_DATA, [ $this, 'create_payment_data' ] );893 add_filter( EcpFilters List::ECP_CREATE_PAYMENT_INFO, [ $this, 'create_payment_info' ] );912 add_filter( EcpFilters::ECP_CREATE_GENERAL_DATA_FILTER, [ $this, 'create_general_info' ] ); 913 add_filter( EcpFilters::ECP_CREATE_PAYMENT_DATA, [ $this, 'create_payment_data' ] ); 914 add_filter( EcpFilters::ECP_CREATE_PAYMENT_INFO, [ $this, 'create_payment_info' ] ); 894 915 895 916 // register filters for appending payment arguments 896 add_filter( EcpAppendsFilter List::ECP_APPEND_PROJECT_ID, [ $this, 'append_project_id' ] );897 add_filter( EcpAppendsFilter List::ECP_APPEND_INTERFACE_TYPE, [ $this, 'append_interface_type' ], 10, 2 );898 add_filter( EcpAppendsFilter List::ECP_APPEND_CARD_OPERATION_TYPE, [917 add_filter( EcpAppendsFilters::ECP_APPEND_PROJECT_ID, [ $this, 'append_project_id' ] ); 918 add_filter( EcpAppendsFilters::ECP_APPEND_INTERFACE_TYPE, [ $this, 'append_interface_type' ], 10, 2 ); 919 add_filter( EcpAppendsFilters::ECP_APPEND_CARD_OPERATION_TYPE, [ 899 920 $this, 900 921 'append_card_operation_type' 901 922 ], 10, 2 ); 902 add_filter( EcpAppendsFilter List::ECP_APPEND_OPERATION_MODE, [ $this, 'append_operation_mode' ], 10, 2 );903 add_filter( EcpAppendsFilter List::ECP_APPEND_FORCE_MODE, [ $this, 'append_force_mode' ], 10, 2 );904 add_filter( EcpAppendsFilter List::ECP_APPEND_DISPLAY_MODE, [ $this, 'append_display_mode' ], 10, 3 );905 add_filter( EcpAppendsFilter List::ECP_APPEND_PAYMENT_SECTION, [ $this, 'append_payment_section' ], 10, 2 );906 add_filter( EcpAppendsFilter List::ECP_APPEND_LANGUAGE_CODE, [ $this, 'append_language' ] );907 add_filter( EcpAppendsFilter List::ECP_APPEND_MERCHANT_SUCCESS_URL, [923 add_filter( EcpAppendsFilters::ECP_APPEND_OPERATION_MODE, [ $this, 'append_operation_mode' ], 10, 2 ); 924 add_filter( EcpAppendsFilters::ECP_APPEND_FORCE_MODE, [ $this, 'append_force_mode' ], 10, 2 ); 925 add_filter( EcpAppendsFilters::ECP_APPEND_DISPLAY_MODE, [ $this, 'append_display_mode' ], 10, 3 ); 926 add_filter( EcpAppendsFilters::ECP_APPEND_PAYMENT_SECTION, [ $this, 'append_payment_section' ], 10, 2 ); 927 add_filter( EcpAppendsFilters::ECP_APPEND_LANGUAGE_CODE, [ $this, 'append_language' ] ); 928 add_filter( EcpAppendsFilters::ECP_APPEND_MERCHANT_SUCCESS_URL, [ 908 929 $this, 909 930 'append_merchant_success_url' 910 931 ], 10, 2 ); 911 add_filter( EcpAppendsFilterList::ECP_APPEND_MERCHANT_FAIL_URL, [ $this, 'append_merchant_fail_url' ], 10, 2 ); 912 add_filter( EcpAppendsFilterList::ECP_APPEND_MERCHANT_RETURN_URL, [ 932 add_filter( EcpAppendsFilters::ECP_APPEND_MERCHANT_FAIL_URL, [ $this, 'append_merchant_fail_url' ], 10, 2 ); 933 add_filter( EcpAppendsFilters::ECP_APPEND_REDIRECT_RETURN_URL, [ 934 $this, 935 'append_redirect_return_url' 936 ], 10, 2 ); 937 add_filter( EcpAppendsFilters::ECP_APPEND_MERCHANT_RETURN_URL, [ 913 938 $this, 914 939 'append_merchant_return_url' 915 940 ], 10, 2 ); 916 add_filter( EcpAppendsFilterList::ECP_APPEND_REDIRECT_URL, [ $this, 'append_redirect_url' ], 10, 2 ); 917 add_filter( EcpAppendsFilterList::ECP_APPEND_MERCHANT_CALLBACK_URL, [ $this, 'append_merchant_callback_url' ] ); 918 add_filter( EcpAppendsFilterList::ECP_APPEND_CUSTOMER_DATA, [ $this, 'append_customer_data' ], 10, 2 ); 919 add_filter( EcpAppendsFilterList::ECP_APPEND_CUSTOMER_ID, [ $this, 'append_customer_id' ], 10, 2 ); 920 add_filter( EcpAppendsFilterList::ECP_APPEND_CUSTOMER_PHONE, [ $this, 'append_customer_phone' ], 10, 2 ); 921 add_filter( EcpAppendsFilterList::ECP_APPEND_CUSTOMER_EMAIL, [ $this, 'append_customer_email' ], 10, 2 ); 922 add_filter( EcpAppendsFilterList::ECP_APPEND_CUSTOMER_LAST_NAME, [ 941 add_filter( EcpAppendsFilters::ECP_APPEND_REDIRECT_SUCCESS_URL, [ $this, 'append_redirect_success_url' ], 10, 2 ); 942 add_filter( EcpAppendsFilters::ECP_APPEND_REDIRECT_FAIL_URL, [ $this, 'append_redirect_fail_url' ], 10, 2 ); 943 add_filter( EcpAppendsFilters::ECP_APPEND_MERCHANT_CALLBACK_URL, [ $this, 'append_merchant_callback_url' ] ); 944 add_filter( EcpAppendsFilters::ECP_APPEND_CUSTOMER_DATA, [ $this, 'append_customer_data' ], 10, 2 ); 945 add_filter( EcpAppendsFilters::ECP_APPEND_CUSTOMER_ID, [ $this, 'append_customer_id' ], 10, 2 ); 946 add_filter( EcpAppendsFilters::ECP_APPEND_CUSTOMER_PHONE, [ $this, 'append_customer_phone' ], 10, 2 ); 947 add_filter( EcpAppendsFilters::ECP_APPEND_CUSTOMER_EMAIL, [ $this, 'append_customer_email' ], 10, 2 ); 948 add_filter( EcpAppendsFilters::ECP_APPEND_CUSTOMER_LAST_NAME, [ 923 949 $this, 924 950 'append_customer_last_name' 925 951 ], 10, 2 ); 926 add_filter( EcpAppendsFilter List::ECP_APPEND_CUSTOMER_FIRST_NAME, [952 add_filter( EcpAppendsFilters::ECP_APPEND_CUSTOMER_FIRST_NAME, [ 927 953 $this, 928 954 'append_customer_first_name' 929 955 ], 10, 2 ); 930 add_filter( EcpAppendsFilter List::ECP_APPEND_CUSTOMER_COUNTRY, [ $this, 'append_customer_country' ], 10, 2 );931 add_filter( EcpAppendsFilter List::ECP_APPEND_CUSTOMER_STATE, [ $this, 'append_customer_state' ], 10, 2 );932 add_filter( EcpFilters List::ECP_APPEND_CUSTOMER_CITY, [ $this, 'append_customer_city' ], 10, 2 );933 add_filter( EcpAppendsFilter List::ECP_APPEND_CUSTOMER_ADDRESS, [ $this, 'append_customer_address' ], 10, 2 );934 add_filter( EcpAppendsFilter List::ECP_APPEND_CUSTOMER_ZIP, [ $this, 'append_customer_zip' ], 10, 2 );935 add_filter( EcpAppendsFilter List::ECP_APPEND_AVS_POST_CODE, [ $this, 'append_avs_post_code' ], 10, 2 );936 add_filter( EcpAppendsFilter List::ECP_APPEND_AVS_STREET_ADDRESS, [956 add_filter( EcpAppendsFilters::ECP_APPEND_CUSTOMER_COUNTRY, [ $this, 'append_customer_country' ], 10, 2 ); 957 add_filter( EcpAppendsFilters::ECP_APPEND_CUSTOMER_STATE, [ $this, 'append_customer_state' ], 10, 2 ); 958 add_filter( EcpFilters::ECP_APPEND_CUSTOMER_CITY, [ $this, 'append_customer_city' ], 10, 2 ); 959 add_filter( EcpAppendsFilters::ECP_APPEND_CUSTOMER_ADDRESS, [ $this, 'append_customer_address' ], 10, 2 ); 960 add_filter( EcpAppendsFilters::ECP_APPEND_CUSTOMER_ZIP, [ $this, 'append_customer_zip' ], 10, 2 ); 961 add_filter( EcpAppendsFilters::ECP_APPEND_AVS_POST_CODE, [ $this, 'append_avs_post_code' ], 10, 2 ); 962 add_filter( EcpAppendsFilters::ECP_APPEND_AVS_STREET_ADDRESS, [ 937 963 $this, 938 964 'append_avs_street_address' 939 965 ], 10, 2 ); 940 add_filter( EcpAppendsFilter List::ECP_APPEND_BILLING_DATA, [ $this, 'append_billing_data' ], 10, 2 );941 add_filter( EcpFilters List::ECP_APPEND_BILLING_ADDRESS, [ $this, 'append_billing_address' ], 10, 2 );942 add_filter( EcpAppendsFilter List::ECP_APPEND_BILLING_CITY, [ $this, 'append_billing_city' ], 10, 2 );943 add_filter( EcpAppendsFilter List::ECP_APPEND_BILLING_COUNTRY, [ $this, 'append_billing_country' ], 10, 2 );944 add_filter( EcpAppendsFilter List::ECP_APPEND_BILLING_POSTAL, [ $this, 'append_billing_postal' ], 10, 2 );945 add_filter( EcpAppendsFilter List::ECP_APPEND_BILLING_REGION, [ $this, 'append_billing_region' ], 10, 2 );946 add_filter( EcpAppendsFilter List::ECP_APPEND_BILLING_REGION_CODE, [966 add_filter( EcpAppendsFilters::ECP_APPEND_BILLING_DATA, [ $this, 'append_billing_data' ], 10, 2 ); 967 add_filter( EcpFilters::ECP_APPEND_BILLING_ADDRESS, [ $this, 'append_billing_address' ], 10, 2 ); 968 add_filter( EcpAppendsFilters::ECP_APPEND_BILLING_CITY, [ $this, 'append_billing_city' ], 10, 2 ); 969 add_filter( EcpAppendsFilters::ECP_APPEND_BILLING_COUNTRY, [ $this, 'append_billing_country' ], 10, 2 ); 970 add_filter( EcpAppendsFilters::ECP_APPEND_BILLING_POSTAL, [ $this, 'append_billing_postal' ], 10, 2 ); 971 add_filter( EcpAppendsFilters::ECP_APPEND_BILLING_REGION, [ $this, 'append_billing_region' ], 10, 2 ); 972 add_filter( EcpAppendsFilters::ECP_APPEND_BILLING_REGION_CODE, [ 947 973 $this, 948 974 'append_billing_region_code' 949 975 ], 10, 2 ); 950 add_filter( EcpAppendsFilter List::ECP_APPEND_ADDITIONAL_VARIABLES, [976 add_filter( EcpAppendsFilters::ECP_APPEND_ADDITIONAL_VARIABLES, [ 951 977 $this, 952 978 'append_custom_variables' 953 979 ], 10, 2 ); 954 add_filter( EcpFilters List::ECP_PAYMENT_PAGE_CLEAN_PARAMETERS, [ $this, 'filter_clean' ] );955 add_filter( EcpAppendsFilter List::ECP_APPEND_RECURRING, [ $this, 'append_recurring' ], 10, 2 );956 add_filter( EcpAppendsFilter List::ECP_APPEND_SHIPPING_DATA, [ $this, 'filter_shipping_data' ], 10, 2 );957 add_filter( EcpAppendsFilter List::ECP_APPEND_RECEIPT_DATA, [ $this, 'filter_receipt_data' ], 10, 3 );958 add_filter( EcpAppendsFilter List::ECP_APPEND_CASH_VOUCHER_DATA, [ $this, 'filter_cash_voucher_data' ], 10, 2 );959 add_filter( EcpAppendsFilter List::ECP_APPEND_VERSIONS, [ $this, 'append_versions' ] );960 add_filter( EcpAppendsFilter List::ECP_APPEND_SIGNATURE, [ $this, 'append_signature' ] );980 add_filter( EcpFilters::ECP_PAYMENT_PAGE_CLEAN_PARAMETERS, [ $this, 'filter_clean' ] ); 981 add_filter( EcpAppendsFilters::ECP_APPEND_RECURRING, [ $this, 'append_recurring' ], 10, 2 ); 982 add_filter( EcpAppendsFilters::ECP_APPEND_SHIPPING_DATA, [ $this, 'filter_shipping_data' ], 10, 2 ); 983 add_filter( EcpAppendsFilters::ECP_APPEND_RECEIPT_DATA, [ $this, 'filter_receipt_data' ], 10, 3 ); 984 add_filter( EcpAppendsFilters::ECP_APPEND_CASH_VOUCHER_DATA, [ $this, 'filter_cash_voucher_data' ], 10, 2 ); 985 add_filter( EcpAppendsFilters::ECP_APPEND_VERSIONS, [ $this, 'append_versions' ] ); 986 add_filter( EcpAppendsFilters::ECP_APPEND_SIGNATURE, [ $this, 'append_signature' ] ); 961 987 } 962 988 -
ecommpay-payments/trunk/common/includes/EcpCallbacksHandler.php
r3218798 r3267715 130 130 */ 131 131 private function get_order( EcpGatewayInfoCallback $info ): EcpGatewayOrder { 132 // Fetch order number; 132 $payment_id = $info->get_payment()->get_id() ?? $_GET['payment_id']; 133 133 134 $order_number = EcpGatewayOrder::get_order_id_from_callback( $info ); 134 135 $order = ecp_get_order( $order_number ); 136 137 $last_payment_id = $order->get_payment_id(); 138 139 if ( $payment_id !== $last_payment_id ) { 140 $message = sprintf('Order with payment id %s found but it already has a new payment id %s', $payment_id, $last_payment_id); 141 ecp_get_log()->info( __( $message, 'woo-ecommpay' ) ); 142 http_response_code( 200 ); 143 die ( $message ); 144 } 135 145 136 146 if ( ! $order ) { … … 168 178 do_action( 'ecp_accepted_callback_before_processing', $order, $callback ); 169 179 do_action( 'ecp_accepted_callback_before_processing_' . $callback->get_operation()->get_type(), $order, $callback ); 170 171 // Clear card - payment is not initial.172 WC()->cart->empty_cart();173 180 174 181 if ( array_key_exists( $callback->get_operation()->get_type(), $this->operations ) ) { -
ecommpay-payments/trunk/common/includes/EcpGatewayOrder.php
r3227972 r3267715 47 47 private const META_PAYMENT_METHOD_CHANGE_COUNT = '_ecommpay_payment_method_change_count'; 48 48 49 private const ORDER_PAY_ECOMMPAY_ACTION_NAME = 'ecommpay_process'; 50 49 51 /** 50 52 * @var ?EcpGatewayPayment … … 104 106 */ 105 107 public function create_payment_id(): string { 106 $_payment_id = $this->get_ecp_meta( '_payment_id' ); 107 if ( $_payment_id != '' & ( $_REQUEST['action'] != 'ecommpay_process' ) ) { 108 $id = $_payment_id; 109 } else if ( ! empty ( $_REQUEST['payment_id'] ) ) { 110 $id = $_REQUEST['payment_id']; 111 } else { 112 $id = $this->get_id() . '_' . ( $this->get_failed_ecommpay_payment_count() + 1 ); 113 } 114 115 $this->set_payment_id( $id ); 108 $embeddedModePaymentId = $this->getEmbeddedModePaymentId(); 109 $paymentId = $embeddedModePaymentId ? : generateNewPaymentId($this); 110 111 $this->set_payment_id( $paymentId ); 116 112 $this->set_ecp_payment_status( EcpGatewayPaymentStatus::INITIAL ); 117 113 $this->save_meta_data(); 118 114 119 ecp_get_log()->debug( __( 'New payment identifier created:', 'woo-ecommpay' ), $id ); 120 121 return $id; 115 ecp_get_log()->debug( __( 'New payment identifier created:', 'woo-ecommpay' ), $paymentId ); 116 117 return $paymentId; 118 } 119 120 private function getEmbeddedModePaymentId(): ?string { 121 return $_POST['payment_id'] ?? null; 122 122 } 123 123 -
ecommpay-payments/trunk/common/includes/EcpGatewayOrderExtension.php
r3227972 r3267715 19 19 $this->add_order_note( __( 'New payment id is ' . $value, 'woocommerce' ) ); 20 20 } 21 $this->set_ecp_meta( '_payment_id', $value );21 $this->set_ecp_meta( '_payment_id', $value, false ); 22 22 } 23 23 } … … 29 29 */ 30 30 public function get_payment_id(): string { 31 return $this->get_ecp_meta( '_payment_id' ); 31 $meta_data = $this->get_ecp_meta( '_payment_id', false ); 32 $meta_object = end( $meta_data ); 33 if ( is_object( $meta_object )) { 34 return $meta_object->value; 35 } 36 return $meta_object; 32 37 } 33 38 … … 36 41 * 37 42 * @param $key 38 * @param bool $single 43 * @param bool $single Return type, array if false 39 44 * @param string $context 40 45 * 41 * @return string 42 */ 43 public function get_ecp_meta( $key, bool $single = true, string $context = 'view' ) : string{46 * @return string|array|WC_Meta_Data[] 47 */ 48 public function get_ecp_meta( $key, bool $single = true, string $context = 'view' ) { 44 49 $meta = $this->get_meta( $key, $single, $context ); 45 50 -
ecommpay-payments/trunk/common/includes/EcpOrderManager.php
r3218798 r3267715 151 151 ecp_get_log()->debug( __( 'Run success process.', 'woo-ecommpay' ), $order->get_id() ); 152 152 $order->payment_complete( $callback->get_operation()->get_request_id() ); 153 WC()->cart->empty_cart(); 153 154 ecp_get_log()->debug( __( 'Success process completed.', 'woo-ecommpay' ), $order->get_id() ); 154 155 -
ecommpay-payments/trunk/common/modules/EcpModuleAuth.php
r3218798 r3267715 6 6 7 7 use common\helpers\EcpGatewayRegistry; 8 use common\includes\filters\EcpWCFilter List;8 use common\includes\filters\EcpWCFilters; 9 9 use common\settings\EcpSettingsApplepay; 10 10 use common\settings\EcpSettingsCard; … … 41 41 42 42 protected function init(): void { 43 add_filter( EcpWCFilter List::WOOCOMMERCE_AVAILABLE_PAYMENT_GATEWAYS, [43 add_filter( EcpWCFilters::WOOCOMMERCE_AVAILABLE_PAYMENT_GATEWAYS, [ 44 44 $this, 45 45 'filterPaymentMethodsAuthOnly' -
ecommpay-payments/trunk/common/modules/EcpModulePaymentPage.php
r3245713 r3267715 10 10 use common\includes\EcpGatewayFormHandler; 11 11 use common\includes\EcpGatewayOrder; 12 use common\includes\filters\EcpApiFilterList; 13 use common\includes\filters\EcpAppendsFilterList; 14 use common\includes\filters\EcpFiltersList; 15 use common\includes\filters\EcpWCFilterList; 12 use common\includes\filters\EcpApiFilters; 13 use common\includes\filters\EcpAppendsFilters; 14 use common\includes\filters\EcpFilters; 15 use common\includes\filters\EcpWCFilters; 16 use common\includes\filters\EcpWPFilters; 16 17 use Exception; 17 18 use WC_Payment_Gateways; … … 49 50 private const HOST = 'paymentpage.ecommpay.com'; 50 51 52 private const FAILED_URI = '/checkout?payment_failed=1'; 51 53 52 54 /** … … 118 120 */ 119 121 private function get_data_for_payment_form() { 120 if ( wc_get_var( $_GET['pay_for_order'], '' ) != "" && wc_get_var( $_GET['key'], '' ) != "" ) { 121 $order_key = wc_get_var( $_GET['key'], '' ); 122 $order_id = wc_get_order_id_by_order_key( $order_key ); 123 $order = ecp_get_order( $order_id ); 122 if ( $order = $this->hasOrderOnOrderPayPage() ) { 124 123 $payment_currency = $order->get_currency(); 125 124 $payment_amount = ecp_price_multiply( $order->get_total(), $order->get_currency() ); … … 129 128 $payment_amount = ecp_price_multiply( WC()->cart->total, $payment_currency ); 130 129 } 131 130 $payment_id = generateNewPaymentId($order ? : $this->getCreatedOrderForRePayment()); 132 131 $data = [ 133 132 'mode' => $payment_amount > 0 ? self::MODE_PURCHASE : self::MODE_CARD_VERIFY, … … 135 134 'payment_currency' => $payment_currency, 136 135 'project_id' => ecommpay()->get_project_id(), 137 'payment_id' => uniqid( 'wp_' ),136 'payment_id' => $payment_id, 138 137 'force_payment_method' => 'card', 139 138 'target_element' => 'ecommpay-iframe-embedded', … … 143 142 ]; 144 143 145 $data = apply_filters( EcpAppendsFilter List::ECP_APPEND_INTERFACE_TYPE, $data, true );144 $data = apply_filters( EcpAppendsFilters::ECP_APPEND_INTERFACE_TYPE, $data, true ); 146 145 147 146 $data = $this->append_recurring_total_form_cart( $data ); 148 147 149 148 if ( isset ( $order ) ) { 150 $data = apply_filters( EcpAppendsFilter List::ECP_APPEND_CARD_OPERATION_TYPE, $data, $order );151 $data = apply_filters( EcpAppendsFilter List::ECP_APPEND_RECEIPT_DATA, $data, $order, true );152 $data = apply_filters( EcpAppendsFilter List::ECP_APPEND_CUSTOMER_ID, $data, $order );149 $data = apply_filters( EcpAppendsFilters::ECP_APPEND_CARD_OPERATION_TYPE, $data, $order ); 150 $data = apply_filters( EcpAppendsFilters::ECP_APPEND_RECEIPT_DATA, $data, $order, true ); 151 $data = apply_filters( EcpAppendsFilters::ECP_APPEND_CUSTOMER_ID, $data, $order ); 153 152 } else { 154 $data = apply_filters( EcpAppendsFilter List::ECP_APPEND_CARD_OPERATION_TYPE, $data );153 $data = apply_filters( EcpAppendsFilters::ECP_APPEND_CARD_OPERATION_TYPE, $data ); 155 154 $data = $this->append_receipt_data_from_cart( $data ); 156 155 if ( WC()->cart->get_customer()->id ) { … … 159 158 } 160 159 161 $data = apply_filters( EcpAppendsFilter List::ECP_APPEND_LANGUAGE_CODE, $data );160 $data = apply_filters( EcpAppendsFilters::ECP_APPEND_LANGUAGE_CODE, $data ); 162 161 163 162 ecp_debug( 'Payment page data: ', $data ); … … 165 164 $data = EcpSigner::get_instance()->sign( $data ); 166 165 wp_send_json( $data ); 166 } 167 168 private function hasOrderOnOrderPayPage(): ?EcpGatewayOrder { 169 $order_key = wc_get_var( $_GET['key'], '' ); 170 $pay_for_order = wc_get_var( $_GET['pay_for_order'], '' ); 171 if ( $pay_for_order === "" || $order_key === "" ) { 172 return null; 173 } 174 $order_id = wc_get_order_id_by_order_key( $order_key ); 175 return ecp_get_order( $order_id ); 176 } 177 178 private function getCreatedOrderForRePayment(): ?EcpGatewayOrder { 179 if ( ! WC()->session->has_session() ) { 180 return null; 181 } 182 $orderId = WC()->session->get( 'order_awaiting_payment' ); 183 if ( ! $orderId ) { 184 return null; 185 } 186 return ecp_get_order( $orderId ); 167 187 } 168 188 … … 389 409 */ 390 410 public function get_request_url( EcpGatewayOrder $order, $gateway ): array { 391 return apply_filters( EcpAppendsFilter List::ECP_APPEND_SIGNATURE, $this->get_form_data( $order, $gateway ) );411 return apply_filters( EcpAppendsFilters::ECP_APPEND_SIGNATURE, $this->get_form_data( $order, $gateway ) ); 392 412 } 393 413 … … 402 422 */ 403 423 private function get_form_data( EcpGatewayOrder $order, EcpGateway $gateway ): array { 404 $return_url = esc_url_raw( add_query_arg( 'utm_nooverride', '1', $gateway->get_return_url( $order ) ) );405 $info = apply_filters( EcpFiltersList::ECP_CREATE_PAYMENT_INFO, $order );406 407 424 // General options 408 $values = apply_filters( EcpFilters List::ECP_CREATE_PAYMENT_DATA, $order );425 $values = apply_filters( EcpFilters::ECP_CREATE_PAYMENT_DATA, $order ); 409 426 $values['baseUrl'] = $this->endpoint; 410 427 411 428 // Set payment information 429 $info = apply_filters( EcpFilters::ECP_CREATE_PAYMENT_INFO, $order ); 412 430 foreach ( $info as $key => $value ) { 413 431 $values[ 'payment_' . $key ] = $value; 414 432 } 415 433 416 $values = apply_filters( EcpAppendsFilterList::ECP_APPEND_LANGUAGE_CODE, $values ); 417 $values = apply_filters( EcpAppendsFilterList::ECP_APPEND_ADDITIONAL_VARIABLES, $values, $order ); 418 $values = apply_filters( EcpAppendsFilterList::ECP_APPEND_MERCHANT_SUCCESS_URL, $values, $return_url ); 419 $values = apply_filters( EcpAppendsFilterList::ECP_APPEND_MERCHANT_FAIL_URL, $values, $return_url ); 420 $values = apply_filters( EcpAppendsFilterList::ECP_APPEND_MERCHANT_RETURN_URL, $values, esc_url_raw( $order->get_checkout_payment_url() ) ); 421 $values = apply_filters( EcpAppendsFilterList::ECP_APPEND_MERCHANT_CALLBACK_URL, $values ); 422 $values = apply_filters( EcpAppendsFilterList::ECP_APPEND_REDIRECT_URL, $values, $return_url ); 423 $values = apply_filters( EcpAppendsFilterList::ECP_APPEND_GATEWAY_ARGUMENTS . $gateway->id, $values, $order ); 424 $values = apply_filters( EcpAppendsFilterList::ECP_APPEND_VERSIONS, $values ); 425 $values = apply_filters( EcpAppendsFilterList::ECP_APPEND_INTERFACE_TYPE, $values, true ); 426 $values = apply_filters( EcpAppendsFilterList::ECP_APPEND_CARD_OPERATION_TYPE, $values, $order ); 434 $return_url = esc_url_raw( add_query_arg( 'utm_nooverride', '1', $gateway->get_return_url( $order ) ) ); 435 $fail_url = home_url( self::FAILED_URI ); 436 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_LANGUAGE_CODE, $values ); 437 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_ADDITIONAL_VARIABLES, $values, $order ); 438 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_MERCHANT_SUCCESS_URL, $values, $return_url ); 439 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_MERCHANT_FAIL_URL, $values, $fail_url ); 440 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_REDIRECT_RETURN_URL, $values, home_url( '/checkout' ) ); 441 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_MERCHANT_RETURN_URL, $values, esc_url_raw( $order->get_checkout_payment_url() ) ); 442 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_MERCHANT_CALLBACK_URL, $values ); 443 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_REDIRECT_SUCCESS_URL, $values, $return_url ); 444 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_REDIRECT_FAIL_URL, $values, $fail_url ); 445 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_GATEWAY_ARGUMENTS . $gateway->id, $values, $order ); 446 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_VERSIONS, $values ); 447 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_INTERFACE_TYPE, $values, true ); 448 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_CARD_OPERATION_TYPE, $values, $order ); 427 449 428 450 // Clean arguments and return 429 return apply_filters( EcpFilters List::ECP_PAYMENT_PAGE_CLEAN_PARAMETERS, $values );451 return apply_filters( EcpFilters::ECP_PAYMENT_PAGE_CLEAN_PARAMETERS, $values ); 430 452 } 431 453 … … 440 462 $order_id = wc_get_order_id_by_order_key( $order_key ); 441 463 $order = ecp_get_order( $order_id ); 464 if ( ! $order->is_ecp() ) { 465 return; 466 } 442 467 443 468 ?> … … 445 470 // order-receive page status (ty page or failed) 446 471 const order_is_failed = <?= ( $order->get_status() == 'failed' ) ? 'true' : 'false' ?>; 472 473 jQuery(document).ready(() => { 474 jQuery(document.body).append( 475 '<div id="ecommpay-overlay-loader" class="blockUI blockOverlay ecommpay-loader-overlay" style="display: none;"></div>' 476 ) 477 }) 478 function showOverlayLoader() { 479 jQuery('#ecommpay-overlay-loader').show() 480 } 481 function hideOverlayLoader() { 482 jQuery('#ecommpay-overlay-loader').hide() 483 } 447 484 448 485 let result = {} … … 465 502 location.reload() 466 503 } else { 467 let loader = jQuery('.blockUI') 468 if (loader.length > 0) { 469 loader[0].remove() 470 } 504 hideOverlayLoader(); 471 505 return 472 506 } 473 } else if ((jQuery('.blockUI').length < 1) && (document.getElementsByTagName('body').length > 0)){474 document.getElementsByTagName('body')[0].innerHTML += '<div class="blockUI blockOverlay ecommpay-loader-overlay"></div>'507 } else { 508 showOverlayLoader(); 475 509 } 476 510 setTimeout(get_status, 400) … … 493 527 494 528 // register hooks for AJAX requests 495 add_action( EcpApiFilter List::WP_AJAX_ECOMMPAY_PROCESS, [ $this, 'ajax_process' ] ); // Authorised user496 add_action( EcpApiFilter List::WP_AJAX_ECOMMPAY_BREAK, [ $this, 'ajax_process' ] ); // Authorised user497 add_action( EcpApiFilter List::WP_AJAX_NOPRIV_ECOMMPAY_PROCESS, [529 add_action( EcpApiFilters::WP_AJAX_ECOMMPAY_PROCESS, [ $this, 'ajax_process' ] ); // Authorised user 530 add_action( EcpApiFilters::WP_AJAX_ECOMMPAY_BREAK, [ $this, 'ajax_process' ] ); // Authorised user 531 add_action( EcpApiFilters::WP_AJAX_NOPRIV_ECOMMPAY_PROCESS, [ 498 532 $this, 499 533 'ajax_process' 500 534 ] ); // Non-authorised user: Guest access 501 add_action( EcpApiFilter List::WP_AJAX_NOPRIV_ECOMMPAY_BREAK, [535 add_action( EcpApiFilters::WP_AJAX_NOPRIV_ECOMMPAY_BREAK, [ 502 536 $this, 503 537 'ajax_process' 504 538 ] ); // Non-authorised user: Guest access 505 add_action( EcpApiFilter List::WP_AJAX_GET_DATA_FOR_PAYMENT_FORM, [ $this, 'ajax_process' ] ); // Authorised user506 add_action( EcpApiFilter List::WP_AJAX_NOPRIV_GET_DATA_FOR_PAYMENT_FORM, [539 add_action( EcpApiFilters::WP_AJAX_GET_DATA_FOR_PAYMENT_FORM, [ $this, 'ajax_process' ] ); // Authorised user 540 add_action( EcpApiFilters::WP_AJAX_NOPRIV_GET_DATA_FOR_PAYMENT_FORM, [ 507 541 $this, 508 542 'ajax_process' 509 543 ] ); // Non-authorised user: Guest access 510 add_action( EcpApiFilter List::WP_AJAX_GET_PAYMENT_STATUS, [ $this, 'ajax_process' ] ); // Authorised user511 add_action( EcpApiFilter List::WP_AJAX_NOPRIV_GET_PAYMENT_STATUS, [544 add_action( EcpApiFilters::WP_AJAX_GET_PAYMENT_STATUS, [ $this, 'ajax_process' ] ); // Authorised user 545 add_action( EcpApiFilters::WP_AJAX_NOPRIV_GET_PAYMENT_STATUS, [ 512 546 $this, 513 547 'ajax_process' 514 548 ] ); // Non-authorised user: Guest access 515 add_action( EcpApiFilter List::WP_AJAX_CHECK_CART_AMOUNT, [ $this, 'ajax_process' ] ); // Authorised user516 add_action( EcpApiFilter List::WP_AJAX_NOPRIV_CHECK_CART_AMOUNT, [549 add_action( EcpApiFilters::WP_AJAX_CHECK_CART_AMOUNT, [ $this, 'ajax_process' ] ); // Authorised user 550 add_action( EcpApiFilters::WP_AJAX_NOPRIV_CHECK_CART_AMOUNT, [ 517 551 $this, 518 552 'ajax_process' 519 553 ] ); // Non-authorised user: Guest access 520 add_action( EcpApiFilter List::WP_AJAX_ADD_PAYMENT_ID_TO_ORDER, [ $this, 'ajax_process' ] ); // Authorised user521 add_action( EcpApiFilter List::WP_AJAX_NOPRIV_ADD_PAYMENT_ID_TO_ORDER, [554 add_action( EcpApiFilters::WP_AJAX_ADD_PAYMENT_ID_TO_ORDER, [ $this, 'ajax_process' ] ); // Authorised user 555 add_action( EcpApiFilters::WP_AJAX_NOPRIV_ADD_PAYMENT_ID_TO_ORDER, [ 522 556 $this, 523 557 'ajax_process' … … 526 560 527 561 // register hooks for display payment form on block-based checkout page 528 add_action( EcpWCFilter List::WOOCOMMERCE_BLOCKS_ENQUEUE_CHECKOUT_BLOCK_SCRIPTS_BEFORE, [562 add_action( EcpWCFilters::WOOCOMMERCE_BLOCKS_ENQUEUE_CHECKOUT_BLOCK_SCRIPTS_BEFORE, [ 529 563 $this, 530 564 'include_new_checkout_scripts' 531 565 ] ); 532 add_action( Ecp FiltersList::ENQUEUE_BLOCK_EDITOR_ASSETS, [ $this, 'include_new_checkout_scripts' ] );566 add_action( EcpWPFilters::ENQUEUE_BLOCK_EDITOR_ASSETS, [ $this, 'include_new_checkout_scripts' ] ); 533 567 534 568 // register hooks for additional container on checkout pages 535 add_filter( EcpFiltersList::THE_CONTENT, [ $this, 'append_iframe_container' ] ); 536 537 add_action( EcpFiltersList::WP_HEAD, [ $this, 'wc_custom_redirect_after_purchase' ] ); 569 add_filter( EcpWPFilters::THE_CONTENT, [ $this, 'append_iframe_container' ] ); 570 571 add_action( EcpWPFilters::WP_HEAD, [ $this, 'wc_custom_redirect_after_purchase' ] ); 572 573 add_action( EcpWPFilters::TEMPLATE_REDIRECT, [ $this, 'payment_fail_notice' ] ); 574 } 575 576 /** 577 * @return void 578 */ 579 public function payment_fail_notice() { 580 if ( is_checkout() && isset( $_GET['payment_failed'] ) ) { 581 wc_add_notice( __( 'Payment was declined. You can try another payment method.', 'woo-ecommpay' ), 'error' ); 582 } 538 583 } 539 584 -
ecommpay-payments/trunk/common/settings/EcpSettings.php
r3239955 r3267715 3 3 namespace common\settings; 4 4 5 use common\includes\filters\EcpFilters List;5 use common\includes\filters\EcpFilters; 6 6 7 7 defined( 'ABSPATH' ) || exit; … … 148 148 */ 149 149 public function get_settings(): array { 150 return apply_filters( EcpFilters List::ECP_PREFIX_GET_SETTINGS . $this->id, [] );150 return apply_filters( EcpFilters::ECP_PREFIX_GET_SETTINGS . $this->id, [] ); 151 151 } 152 152 -
ecommpay-payments/trunk/common/settings/EcpSettingsApplepay.php
r3218798 r3267715 3 3 namespace common\settings; 4 4 5 use common\includes\filters\EcpFilters List;5 use common\includes\filters\EcpFilters; 6 6 7 7 defined( 'ABSPATH' ) || exit; … … 40 40 parent::__construct(); 41 41 42 add_filter( EcpFilters List::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_apple_pay_methods' ] );42 add_filter( EcpFilters::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_apple_pay_methods' ] ); 43 43 } 44 44 -
ecommpay-payments/trunk/common/settings/EcpSettingsBanks.php
r3218798 r3267715 3 3 namespace common\settings; 4 4 5 use common\includes\filters\EcpFilters List;5 use common\includes\filters\EcpFilters; 6 6 7 7 defined( 'ABSPATH' ) || exit; … … 40 40 parent::__construct(); 41 41 42 add_filter( EcpFilters List::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_banks_methods' ] );42 add_filter( EcpFilters::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_banks_methods' ] ); 43 43 } 44 44 -
ecommpay-payments/trunk/common/settings/EcpSettingsBlik.php
r3218798 r3267715 3 3 namespace common\settings; 4 4 5 use common\includes\filters\EcpFilters List;5 use common\includes\filters\EcpFilters; 6 6 7 7 defined( 'ABSPATH' ) || exit; … … 40 40 parent::__construct(); 41 41 42 add_filter( EcpFilters List::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_blik_methods' ] );42 add_filter( EcpFilters::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_blik_methods' ] ); 43 43 } 44 44 -
ecommpay-payments/trunk/common/settings/EcpSettingsBrazilOnline_Banks.php
r3218798 r3267715 3 3 namespace common\settings; 4 4 5 use common\includes\filters\EcpFilters List;5 use common\includes\filters\EcpFilters; 6 6 7 7 defined( 'ABSPATH' ) || exit; … … 40 40 parent::__construct(); 41 41 42 add_filter( EcpFilters List::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_brazil_methods' ] );42 add_filter( EcpFilters::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_brazil_methods' ] ); 43 43 } 44 44 -
ecommpay-payments/trunk/common/settings/EcpSettingsCard.php
r3218798 r3267715 3 3 namespace common\settings; 4 4 5 use common\includes\filters\EcpFilters List;5 use common\includes\filters\EcpFilters; 6 6 7 7 defined( 'ABSPATH' ) || exit; … … 38 38 parent::__construct(); 39 39 40 add_filter( EcpFilters List::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_card' ] );40 add_filter( EcpFilters::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_card' ] ); 41 41 } 42 42 -
ecommpay-payments/trunk/common/settings/EcpSettingsDirectDebitBACS.php
r3218798 r3267715 3 3 namespace common\settings; 4 4 5 use common\includes\filters\EcpFilters List;5 use common\includes\filters\EcpFilters; 6 6 7 7 defined( 'ABSPATH' ) || exit; … … 40 40 parent::__construct(); 41 41 42 add_filter( EcpFilters List::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_directdebit_bacs' ] );42 add_filter( EcpFilters::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_directdebit_bacs' ] ); 43 43 } 44 44 -
ecommpay-payments/trunk/common/settings/EcpSettingsDirectDebitSEPA.php
r3218798 r3267715 3 3 namespace common\settings; 4 4 5 use common\includes\filters\EcpFilters List;5 use common\includes\filters\EcpFilters; 6 6 7 7 defined( 'ABSPATH' ) || exit; … … 40 40 parent::__construct(); 41 41 42 add_filter( EcpFilters List::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_directdebit_sepa' ] );42 add_filter( EcpFilters::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_directdebit_sepa' ] ); 43 43 } 44 44 -
ecommpay-payments/trunk/common/settings/EcpSettingsGeneral.php
r3239955 r3267715 3 3 namespace common\settings; 4 4 5 use common\includes\filters\EcpFilters List;5 use common\includes\filters\EcpFilters; 6 6 use WC_Log_Levels; 7 7 … … 77 77 78 78 add_filter( 'ecp_' . $this->id . '_settings', [ $this, 'add_uninstall_setting' ] ); 79 add_filter( EcpFilters List::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_general' ] );79 add_filter( EcpFilters::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_general' ] ); 80 80 } 81 81 -
ecommpay-payments/trunk/common/settings/EcpSettingsGiropay.php
r3218798 r3267715 3 3 namespace common\settings; 4 4 5 use common\includes\filters\EcpFilters List;5 use common\includes\filters\EcpFilters; 6 6 7 7 defined( 'ABSPATH' ) || exit; … … 40 40 parent::__construct(); 41 41 42 add_filter( EcpFilters List::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_giropay_methods' ] );42 add_filter( EcpFilters::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_giropay_methods' ] ); 43 43 } 44 44 -
ecommpay-payments/trunk/common/settings/EcpSettingsGooglepay.php
r3218798 r3267715 3 3 namespace common\settings; 4 4 5 use common\includes\filters\EcpFilters List;5 use common\includes\filters\EcpFilters; 6 6 7 7 defined( 'ABSPATH' ) || exit; … … 40 40 parent::__construct(); 41 41 42 add_filter( EcpFilters List::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_google_pay_methods' ] );42 add_filter( EcpFilters::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_google_pay_methods' ] ); 43 43 } 44 44 -
ecommpay-payments/trunk/common/settings/EcpSettingsIdeal.php
r3218798 r3267715 3 3 namespace common\settings; 4 4 5 use common\includes\filters\EcpFilters List;5 use common\includes\filters\EcpFilters; 6 6 7 7 defined( 'ABSPATH' ) || exit; … … 40 40 parent::__construct(); 41 41 42 add_filter( EcpFilters List::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_ideal_methods' ] );42 add_filter( EcpFilters::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_ideal_methods' ] ); 43 43 } 44 44 -
ecommpay-payments/trunk/common/settings/EcpSettingsKlarna.php
r3218798 r3267715 3 3 namespace common\settings; 4 4 5 use common\includes\filters\EcpFilters List;5 use common\includes\filters\EcpFilters; 6 6 7 7 defined( 'ABSPATH' ) || exit; … … 40 40 parent::__construct(); 41 41 42 add_filter( EcpFilters List::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_klarna_methods' ] );42 add_filter( EcpFilters::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_klarna_methods' ] ); 43 43 } 44 44 -
ecommpay-payments/trunk/common/settings/EcpSettingsMore.php
r3218798 r3267715 3 3 namespace common\settings; 4 4 5 use common\includes\filters\EcpFilters List;5 use common\includes\filters\EcpFilters; 6 6 7 7 defined( 'ABSPATH' ) || exit; … … 39 39 parent::__construct(); 40 40 41 add_filter( EcpFilters List::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_more_methods' ] );41 add_filter( EcpFilters::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_more_methods' ] ); 42 42 } 43 43 -
ecommpay-payments/trunk/common/settings/EcpSettingsPayPal.php
r3218798 r3267715 3 3 namespace common\settings; 4 4 5 use common\includes\filters\EcpFilters List;5 use common\includes\filters\EcpFilters; 6 6 7 7 defined( 'ABSPATH' ) || exit; … … 40 40 parent::__construct(); 41 41 42 add_filter( EcpFilters List::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_paypal_methods' ] );42 add_filter( EcpFilters::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_paypal_methods' ] ); 43 43 } 44 44 -
ecommpay-payments/trunk/common/settings/EcpSettingsPayPalPayLater.php
r3218798 r3267715 3 3 namespace common\settings; 4 4 5 use common\includes\filters\EcpFilters List;5 use common\includes\filters\EcpFilters; 6 6 7 7 defined( 'ABSPATH' ) || exit; … … 34 34 parent::__construct(); 35 35 36 add_filter( EcpFilters List::ECP_PREFIX_GET_SETTINGS . $this->id, [36 add_filter( EcpFilters::ECP_PREFIX_GET_SETTINGS . $this->id, [ 37 37 $this, 38 38 'get_settings_paypal_paylater_methods' -
ecommpay-payments/trunk/common/settings/EcpSettingsProducts.php
r3218798 r3267715 3 3 namespace common\settings; 4 4 5 use common\includes\filters\EcpFilters List;5 use common\includes\filters\EcpFilters; 6 6 7 7 defined( 'ABSPATH' ) || exit; … … 30 30 $this->context = self::CONTEXT; 31 31 32 add_filter( EcpFilters List::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_products' ] );32 add_filter( EcpFilters::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_products' ] ); 33 33 34 34 parent::__construct(); -
ecommpay-payments/trunk/common/settings/EcpSettingsSofort.php
r3218798 r3267715 3 3 namespace common\settings; 4 4 5 use common\includes\filters\EcpFilters List;5 use common\includes\filters\EcpFilters; 6 6 7 7 defined( 'ABSPATH' ) || exit; … … 40 40 parent::__construct(); 41 41 42 add_filter( EcpFilters List::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_sofort_methods' ] );42 add_filter( EcpFilters::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_sofort_methods' ] ); 43 43 } 44 44 -
ecommpay-payments/trunk/common/settings/EcpSettingsSubscriptions.php
r3218798 r3267715 3 3 namespace common\settings; 4 4 5 use common\includes\filters\EcpFilters List;5 use common\includes\filters\EcpFilters; 6 6 7 7 defined( 'ABSPATH' ) || exit; … … 31 31 $this->context = self::CONTEXT; 32 32 33 add_filter( EcpFilters List::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_subscriptions' ] );33 add_filter( EcpFilters::ECP_PREFIX_GET_SETTINGS . $this->id, [ $this, 'get_settings_subscriptions' ] ); 34 34 35 35 parent::__construct(); -
ecommpay-payments/trunk/common/settings/forms/EcpForm.php
r3239955 r3267715 4 4 5 5 use common\helpers\EcpGatewayRegistry; 6 use common\includes\filters\EcpFiltersList; 7 use common\includes\filters\EcpHtmlFilterList; 6 use common\includes\filters\EcpFilters; 7 use common\includes\filters\EcpHtmlFilters; 8 use common\includes\filters\EcpWPFilters; 8 9 use common\settings\EcpSettings; 9 10 use common\settings\EcpSettingsGeneral; … … 102 103 } 103 104 104 $value = apply_filters( EcpFilters List::ECP_FIELD_NORMALISATION, $value );105 $value = apply_filters( EcpFilters::ECP_FIELD_NORMALISATION, $value ); 105 106 do_action( 106 107 'ecp_html_render_field_' . $value['type'], … … 271 272 $this, 272 273 'set_defaults' 273 ], apply_filters( EcpFilters List::ECP_PREFIX_GET_SETTINGS . $tab->get_id(), [] ) )274 ], apply_filters( EcpFilters::ECP_PREFIX_GET_SETTINGS . $tab->get_id(), [] ) ) 274 275 ) 275 276 ); … … 295 296 $this, 296 297 'set_defaults' 297 ], apply_filters( EcpFilters List::ECP_PREFIX_GET_SETTINGS . $current_tab, [] ) )298 ], apply_filters( EcpFilters::ECP_PREFIX_GET_SETTINGS . $current_tab, [] ) ) 298 299 ); 299 300 } … … 434 435 */ 435 436 protected function init(): void { 436 add_filter( EcpFilters List::ECP_FIELD_NORMALISATION, [ $this, 'normalize_field' ] );437 438 add_action( EcpHtmlFilter List::ECP_HTML_RENDER_FIELD_SECTION_START, [ $this, 'render_fieldset_start' ] );439 add_action( EcpHtmlFilter List::ECP_HTML_RENDER_FIELD_SECTION_END, [ $this, 'render_fieldset_end' ] );440 add_action( EcpHtmlFilter List::ECP_HTML_RENDER_FIELD_SECTION_DESCRIPTION, [437 add_filter( EcpFilters::ECP_FIELD_NORMALISATION, [ $this, 'normalize_field' ] ); 438 439 add_action( EcpHtmlFilters::ECP_HTML_RENDER_FIELD_SECTION_START, [ $this, 'render_fieldset_start' ] ); 440 add_action( EcpHtmlFilters::ECP_HTML_RENDER_FIELD_SECTION_END, [ $this, 'render_fieldset_end' ] ); 441 add_action( EcpHtmlFilters::ECP_HTML_RENDER_FIELD_SECTION_DESCRIPTION, [ 441 442 $this, 442 443 'render_field_description' 443 444 ] ); 444 445 445 add_action( EcpHtmlFilter List::ECP_HTML_RENDER_FIELD_TOGGLE_START, [ $this, 'render_toggle_start' ] );446 add_action( EcpHtmlFilter List::ECP_HTML_RENDER_FIELD_TOGGLE_END, [ $this, 'render_toggle_end' ] );447 add_action( EcpHtmlFilter List::ECP_HTML_RENDER_FIELD_TEXT, [ $this, 'render_field_input' ] );448 add_action( EcpHtmlFilter List::ECP_HTML_RENDER_FIELD_PASSWORD, [ $this, 'render_field_input' ] );449 add_action( EcpHtmlFilter List::ECP_HTML_RENDER_FIELD_DATETIME, [ $this, 'render_field_input' ] );450 add_action( EcpHtmlFilter List::ECP_HTML_RENDER_FIELD_DATETIME_LOCAL, [ $this, 'render_field_input' ] );451 add_action( EcpHtmlFilter List::ECP_HTML_RENDER_FIELD_DATE, [ $this, 'render_field_input' ] );452 add_action( EcpHtmlFilter List::ECP_HTML_RENDER_FIELD_MONTH, [ $this, 'render_field_input' ] );453 add_action( EcpHtmlFilter List::ECP_HTML_RENDER_FIELD_TIME, [ $this, 'render_field_input' ] );454 add_action( EcpHtmlFilter List::ECP_HTML_RENDER_FIELD_WEEK, [ $this, 'render_field_input' ] );455 add_action( EcpHtmlFilter List::ECP_HTML_RENDER_FIELD_NUMBER, [ $this, 'render_field_input' ] );456 add_action( EcpHtmlFilter List::ECP_HTML_RENDER_FIELD_EMAIL, [ $this, 'render_field_input' ] );457 add_action( EcpHtmlFilter List::ECP_HTML_RENDER_FIELD_URL, [ $this, 'render_field_input' ] );458 add_action( EcpHtmlFilter List::ECP_HTML_RENDER_FIELD_TEL, [ $this, 'render_field_input' ] );459 add_action( EcpHtmlFilter List::ECP_HTML_RENDER_FIELD_COLOR, [ $this, 'render_field_color' ] );460 add_action( EcpHtmlFilter List::ECP_HTML_RENDER_FIELD_TEXTAREA, [ $this, 'render_field_text' ] );461 add_action( EcpHtmlFilter List::ECP_HTML_RENDER_FIELD_SELECT, [ $this, 'render_field_select' ] );462 add_action( EcpHtmlFilter List::ECP_HTML_RENDER_FIELD_MULTISELECT, [ $this, 'render_field_select' ] );463 add_action( EcpHtmlFilter List::ECP_HTML_RENDER_FIELD_RADIO, [ $this, 'render_field_radio' ] );464 add_action( EcpHtmlFilter List::ECP_HTML_RENDER_FIELD_CHECKBOX, [ $this, 'render_field_checkbox' ] );465 add_action( EcpHtmlFilter List::ECP_HTML_RENDER_FIELD_SINGLE_SELECT_PAGE, [446 add_action( EcpHtmlFilters::ECP_HTML_RENDER_FIELD_TOGGLE_START, [ $this, 'render_toggle_start' ] ); 447 add_action( EcpHtmlFilters::ECP_HTML_RENDER_FIELD_TOGGLE_END, [ $this, 'render_toggle_end' ] ); 448 add_action( EcpHtmlFilters::ECP_HTML_RENDER_FIELD_TEXT, [ $this, 'render_field_input' ] ); 449 add_action( EcpHtmlFilters::ECP_HTML_RENDER_FIELD_PASSWORD, [ $this, 'render_field_input' ] ); 450 add_action( EcpHtmlFilters::ECP_HTML_RENDER_FIELD_DATETIME, [ $this, 'render_field_input' ] ); 451 add_action( EcpHtmlFilters::ECP_HTML_RENDER_FIELD_DATETIME_LOCAL, [ $this, 'render_field_input' ] ); 452 add_action( EcpHtmlFilters::ECP_HTML_RENDER_FIELD_DATE, [ $this, 'render_field_input' ] ); 453 add_action( EcpHtmlFilters::ECP_HTML_RENDER_FIELD_MONTH, [ $this, 'render_field_input' ] ); 454 add_action( EcpHtmlFilters::ECP_HTML_RENDER_FIELD_TIME, [ $this, 'render_field_input' ] ); 455 add_action( EcpHtmlFilters::ECP_HTML_RENDER_FIELD_WEEK, [ $this, 'render_field_input' ] ); 456 add_action( EcpHtmlFilters::ECP_HTML_RENDER_FIELD_NUMBER, [ $this, 'render_field_input' ] ); 457 add_action( EcpHtmlFilters::ECP_HTML_RENDER_FIELD_EMAIL, [ $this, 'render_field_input' ] ); 458 add_action( EcpHtmlFilters::ECP_HTML_RENDER_FIELD_URL, [ $this, 'render_field_input' ] ); 459 add_action( EcpHtmlFilters::ECP_HTML_RENDER_FIELD_TEL, [ $this, 'render_field_input' ] ); 460 add_action( EcpHtmlFilters::ECP_HTML_RENDER_FIELD_COLOR, [ $this, 'render_field_color' ] ); 461 add_action( EcpHtmlFilters::ECP_HTML_RENDER_FIELD_TEXTAREA, [ $this, 'render_field_text' ] ); 462 add_action( EcpHtmlFilters::ECP_HTML_RENDER_FIELD_SELECT, [ $this, 'render_field_select' ] ); 463 add_action( EcpHtmlFilters::ECP_HTML_RENDER_FIELD_MULTISELECT, [ $this, 'render_field_select' ] ); 464 add_action( EcpHtmlFilters::ECP_HTML_RENDER_FIELD_RADIO, [ $this, 'render_field_radio' ] ); 465 add_action( EcpHtmlFilters::ECP_HTML_RENDER_FIELD_CHECKBOX, [ $this, 'render_field_checkbox' ] ); 466 add_action( EcpHtmlFilters::ECP_HTML_RENDER_FIELD_SINGLE_SELECT_PAGE, [ 466 467 $this, 467 468 'render_field_single_select_page' 468 469 ] ); 469 add_action( EcpHtmlFilter List::ECP_HTML_RENDER_FIELD_SINGLE_SELECT_COUNTRY, [470 add_action( EcpHtmlFilters::ECP_HTML_RENDER_FIELD_SINGLE_SELECT_COUNTRY, [ 470 471 $this, 471 472 'render_field_single_select_country' 472 473 ] ); 473 add_action( Ecp FiltersList::WP_ADMIN_NOTICES_FILTER, [ $this, 'admin_notice_settings' ] );474 add_action( EcpWPFilters::WP_ADMIN_NOTICES_FILTER, [ $this, 'admin_notice_settings' ] ); 474 475 475 476 $this->ecp_tab_manager->init_tabs(); -
ecommpay-payments/trunk/common/settings/forms/EcpSettingsManager.php
r3227972 r3267715 3 3 namespace common\settings\forms; 4 4 5 use common\includes\filters\EcpFilters List;5 use common\includes\filters\EcpFilters; 6 6 use common\install\EcpGatewayInstall; 7 7 use common\settings\EcpSettings; … … 89 89 apply_filters( 'woocommerce_settings_api_form_fields_' . $tab->get_id(), 90 90 array_map( [ $this->ecp_form, 'set_defaults' ], 91 apply_filters( EcpFilters List::ECP_PREFIX_GET_SETTINGS . $tab->get_id(), [] ) ) ) as $value91 apply_filters( EcpFilters::ECP_PREFIX_GET_SETTINGS . $tab->get_id(), [] ) ) ) as $value 92 92 ) { 93 93 $default = $this->get_field_default( $value ); -
ecommpay-payments/trunk/common/settings/forms/EcpTabManager.php
r3218798 r3267715 3 3 namespace common\settings\forms; 4 4 5 use common\includes\filters\EcpHtmlFilter List;5 use common\includes\filters\EcpHtmlFilters; 6 6 use common\settings\EcpSettings; 7 7 use common\settings\EcpSettingsApplepay; … … 63 63 ]; 64 64 65 $this->tabs = apply_filters( EcpHtmlFilter List::ECP_GET_SETTINGS_PAGES, $tabs );65 $this->tabs = apply_filters( EcpHtmlFilters::ECP_GET_SETTINGS_PAGES, $tabs ); 66 66 } 67 67 } -
ecommpay-payments/trunk/gateway-ecommpay.php
r3245713 r3267715 5 5 * GitHub Plugin URI: 6 6 * Description: Easy payment from WooCommerce by different methods in single Payment Page. 7 * Version: 4. 0.47 * Version: 4.1.0 8 8 * License: GPL2 9 9 * License URI: https://www.gnu.org/licenses/gpl-2.0.html -
ecommpay-payments/trunk/helpers/ecp-order.php
r3218798 r3267715 8 8 use common\includes\EcpGatewayRefund; 9 9 use common\includes\EcpGatewaySubscription; 10 use common\includes\filters\EcpWCFilter List;10 use common\includes\filters\EcpWCFilters; 11 11 12 12 const NON_DECIMAL_CURRENCIES = [ … … 139 139 } 140 140 141 $args = apply_filters( EcpWCFilter List::WOOCOMMERCE_ECOMMPAY_CALLBACK_ARGS, $args, $post_id );141 $args = apply_filters( EcpWCFilters::WOOCOMMERCE_ECOMMPAY_CALLBACK_ARGS, $args, $post_id ); 142 142 143 143 // For testing purposes 144 144 $callback_url = getenv( 'WORDPRESS_CALLBACK_URL' ) ?: home_url( '/' ); 145 145 146 return apply_filters( EcpWCFilter List::WOOCOMMERCE_ECOMMPAY_CALLBACK_URL, add_query_arg( $args, $callback_url ), $args, $post_id );146 return apply_filters( EcpWCFilters::WOOCOMMERCE_ECOMMPAY_CALLBACK_URL, add_query_arg( $args, $callback_url ), $args, $post_id ); 147 147 } 148 148 -
ecommpay-payments/trunk/helpers/ecp-payment.php
r3218798 r3267715 6 6 use common\helpers\EcpGatewayOperationType; 7 7 use common\helpers\EcpGatewayPaymentStatus; 8 use common\includes\filters\EcpFilters List;8 use common\includes\filters\EcpFilters; 9 9 10 10 /** … … 18 18 $payment_statuses = EcpGatewayPaymentStatus::get_status_names(); 19 19 20 return apply_filters( EcpFilters List::ECP_PAYMENT_STATUSES, $payment_statuses );20 return apply_filters( EcpFilters::ECP_PAYMENT_STATUSES, $payment_statuses ); 21 21 } 22 22 … … 56 56 return EcpGatewayOperationType::get_status_name( $status ); 57 57 } 58 59 function generateNewPaymentId( ?WC_Order $order ): string { 60 $paymentId = uniqid( 'wp_' ); 61 if ( $orderId = $order ? $order->get_id() : null ) { 62 $paymentId = $paymentId . '_' . (string)($orderId); 63 } 64 return $paymentId; 65 } -
ecommpay-payments/trunk/helpers/ecp-subscription.php
r3218798 r3267715 5 5 6 6 use common\includes\EcpGatewayOrder; 7 use common\includes\filters\EcpWCFilterList;8 7 use common\includes\EcpGatewaySubscription; 8 use common\includes\filters\EcpWCFilters; 9 9 10 10 /** … … 55 55 * 56 56 * @return EcpGatewaySubscription|EcpGatewaySubscription[] 57 * @noinspection PhpUndefinedClassInspection58 57 */ 59 58 function ecp_get_subscriptions_for_renewal_order( $order, bool $single = false ) { 60 59 if ( function_exists( 'wcs_get_subscriptions_for_renewal_order' ) ) { 61 60 add_filter( 62 EcpWCFilter List::WOOCOMMERCE_ORDER_CLASS,61 EcpWCFilters::WOOCOMMERCE_ORDER_CLASS, 63 62 [ ecommpay(), 'type_wrapper' ], 64 63 101, … … 69 68 70 69 remove_filter( 71 EcpWCFilter List::WOOCOMMERCE_ORDER_CLASS,70 EcpWCFilters::WOOCOMMERCE_ORDER_CLASS, 72 71 [ ecommpay(), 'type_wrapper' ], 73 72 101 … … 95 94 * 96 95 * @return false|WC_Subscription|WC_Subscription[] 97 * @noinspection PhpUndefinedClassInspection98 96 */ 99 97 function ecp_get_subscriptions_for_resubscribe_order( $order, bool $single = false ) { 100 98 if ( function_exists( 'wcs_get_subscriptions_for_resubscribe_order' ) ) { 101 99 add_filter( 102 EcpWCFilter List::WOOCOMMERCE_ORDER_CLASS,100 EcpWCFilters::WOOCOMMERCE_ORDER_CLASS, 103 101 [ ecommpay(), 'type_wrapper' ], 104 102 101, … … 109 107 110 108 remove_filter( 111 EcpWCFilter List::WOOCOMMERCE_ORDER_CLASS,109 EcpWCFilters::WOOCOMMERCE_ORDER_CLASS, 112 110 [ ecommpay(), 'type_wrapper' ], 113 111 101 … … 134 132 * 135 133 * @return WC_Subscription[] 136 * @noinspection PhpUndefinedClassInspection137 134 */ 138 135 function ecp_get_subscriptions_for_order( $order ): array { -
ecommpay-payments/trunk/helpers/notices.php
r3218798 r3267715 5 5 6 6 use common\exceptions\EcpGatewayErrorException; 7 use common\includes\filters\Ecp FiltersList;7 use common\includes\filters\EcpWPFilters; 8 8 9 9 /** … … 109 109 } 110 110 111 add_action( Ecp FiltersList::WP_ADMIN_NOTICES_FILTER, 'woocommerce_ecommpay_display_admin_notices', 100 );111 add_action( EcpWPFilters::WP_ADMIN_NOTICES_FILTER, 'woocommerce_ecommpay_display_admin_notices', 100 ); 112 112 113 113 /** … … 132 132 } 133 133 134 add_action( Ecp FiltersList::WP_ADMIN_NOTICES_FILTER, 'woocommerce_ecommpay_display_dismissible_admin_notices', 100 );134 add_action( EcpWPFilters::WP_ADMIN_NOTICES_FILTER, 'woocommerce_ecommpay_display_dismissible_admin_notices', 100 ); 135 135 136 136 /** … … 164 164 || version_compare( PHP_VERSION, $required_php_version, '<' ) 165 165 || version_compare( WC_VERSION, $required_wc_version, '<' ) ) { 166 add_action( Ecp FiltersList::WP_ADMIN_NOTICES_FILTER, function () use ( $required_wp_version, $required_php_version, $required_wc_version ) {166 add_action( EcpWPFilters::WP_ADMIN_NOTICES_FILTER, function () use ( $required_wp_version, $required_php_version, $required_wc_version ) { 167 167 $ecommpay_domain = 'woo-ecommpay'; 168 168 $woo_website = 'https://woocommerce.com/document/update-php-wordpress/'; -
ecommpay-payments/trunk/helpers/permissions.php
r3218798 r3267715 1 1 <?php 2 2 3 use common\includes\filters\EcpWCFilter List;3 use common\includes\filters\EcpWCFilters; 4 4 5 5 defined( 'ABSPATH' ) || exit; … … 10 10 */ 11 11 function woocommerce_ecommpay_can_user_empty_logs() { 12 return apply_filters( EcpWCFilter List::WOOCOMMERCE_ECOMMPAY_CAN_USER_EMPTY_LOGS, current_user_can( 'administrator' ) );12 return apply_filters( EcpWCFilters::WOOCOMMERCE_ECOMMPAY_CAN_USER_EMPTY_LOGS, current_user_can( 'administrator' ) ); 13 13 } 14 14 } … … 19 19 */ 20 20 function woocommerce_ecommpay_can_user_flush_cache() { 21 return apply_filters( EcpWCFilter List::WOOCOMMERCE_ECOMMPAY_CAN_USER_FLUSH_CACHE, current_user_can( 'administrator' ) );21 return apply_filters( EcpWCFilters::WOOCOMMERCE_ECOMMPAY_CAN_USER_FLUSH_CACHE, current_user_can( 'administrator' ) ); 22 22 } 23 23 } … … 32 32 $default_cap = current_user_can( 'manage_woocommerce' ); 33 33 34 $cap = apply_filters( EcpWCFilter List::WOOCOMMERCE_ECOMMPAY_CAN_USER_MANAGE_PAYMENT, $default_cap );34 $cap = apply_filters( EcpWCFilters::WOOCOMMERCE_ECOMMPAY_CAN_USER_MANAGE_PAYMENT, $default_cap ); 35 35 36 36 if ( ! empty ( $action ) ) { 37 $cap = apply_filters( EcpWCFilter List::WOOCOMMERCE_ECOMMPAY_CAN_USER_MANAGE_PAYMENT_PREFIX . $action, $default_cap );37 $cap = apply_filters( EcpWCFilters::WOOCOMMERCE_ECOMMPAY_CAN_USER_MANAGE_PAYMENT_PREFIX . $action, $default_cap ); 38 38 } 39 39 -
ecommpay-payments/trunk/readme.txt
r3245713 r3267715 4 4 Requires at least: 6.2 5 5 Tested up to: 6.7 6 Stable tag: 4. 0.46 Stable tag: 4.1.0 7 7 License: GPLv2 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 62 62 63 63 == Changelog == 64 = 4.1.0 = 65 * Added a convenient option to make a repeat payment 66 64 67 = 4.0.1 = 65 68 * Dev: Code reformatting -
ecommpay-payments/trunk/src/components/WidgetEmbedded.tsx
r3218798 r3267715 100 100 onFail: () => { 101 101 hideOverlayLoader() 102 runIframe() 102 103 resolve({ 103 104 type: props.emitResponse.responseTypes.FAIL, -
ecommpay-payments/trunk/src/components/WidgetPopup.tsx
r3218798 r3267715 26 26 type: props.emitResponse.responseTypes.ERROR, 27 27 messageContext: props.emitResponse.noticeContexts.PAYMENTS, 28 message: 'Payment failed',28 message: 'Payment was declined. You can try another payment method.', 29 29 retry: true, 30 30 })
Note: See TracChangeset
for help on using the changeset viewer.