From e1e14715da43e091e062d7ae119bf6d70c16ff20 Mon Sep 17 00:00:00 2001 From: Artur Kozubski Date: Tue, 12 May 2026 19:03:00 +0200 Subject: [PATCH 01/67] FN-14460 Removed unused test files and deprecated code. --- .claude/memory/MEMORY.md | 3 + resources/js/front/paywall-block.js | 285 -------- resources/js/front/paywall-block.min.js | 14 - resources/js/front/paywall-init.js | 49 -- resources/js/front/paywall-init.min.js | 3 - .../comfino/shop-plugins-shared/bin/composer | 14 - vendor/comfino/shop-plugins-shared/bin/php | 3 - .../comfino/shop-plugins-shared/bin/phpunit | 7 - .../tests/Extended/Api/ExtendedClientTest.php | 13 - .../tests/ExtendedClientTestTrait.php | 156 ----- .../tests/ReflectionTrait.php | 60 -- vendor/psr/log/Psr/Log/Test/DummyTest.php | 11 - .../log/Psr/Log/Test/LoggerInterfaceTest.php | 78 --- vendor/psr/log/Psr/Log/Test/TestLogger.php | 122 ---- vendor/sunrise/http-client-curl/.gitignore | 9 - vendor/sunrise/http-client-curl/composer.json | 5 +- .../http-client-curl/tests/ClientTest.php | 108 --- vendor/sunrise/http-factory/.gitignore | 9 - vendor/sunrise/http-factory/composer.json | 3 +- .../http-factory/tests/FactoryTest.php | 58 -- vendor/sunrise/http-header/.gitignore | 9 - vendor/sunrise/http-header/composer.json | 3 +- vendor/sunrise/http-message/.gitignore | 9 - vendor/sunrise/http-message/composer.json | 3 +- .../http-message/tests/MessageTest.php | 481 -------------- .../http-message/tests/RequestFactoryTest.php | 86 --- .../http-message/tests/RequestTest.php | 357 ---------- .../tests/ResponseFactoryTest.php | 91 --- .../http-message/tests/ResponseTest.php | 152 ----- vendor/sunrise/http-server-request/.gitignore | 9 - .../sunrise/http-server-request/composer.json | 5 +- .../tests/AbstractTestCase.php | 21 - .../tests/ServerRequestFactoryTest.php | 338 ---------- .../tests/ServerRequestTest.php | 230 ------- .../tests/UploadedFileFactoryTest.php | 64 -- .../tests/UploadedFileTest.php | 183 ----- vendor/sunrise/stream/.gitignore | 9 - vendor/sunrise/stream/composer.json | 5 +- .../stream/tests/StreamFactoryTest.php | 59 -- vendor/sunrise/stream/tests/StreamTest.php | 375 ----------- vendor/sunrise/uri/.gitignore | 9 - vendor/sunrise/uri/composer.json | 5 +- vendor/sunrise/uri/tests/UriFactoryTest.php | 45 -- vendor/sunrise/uri/tests/UriParserTest.php | 104 --- vendor/sunrise/uri/tests/UriTest.php | 624 ------------------ vendor/symfony/yaml/Command/LintCommand.php | 198 ------ views/front/api-error.php | 26 - views/front/paywall-disabled.php | 24 - views/front/paywall.php | 27 - 49 files changed, 21 insertions(+), 4540 deletions(-) create mode 100644 .claude/memory/MEMORY.md delete mode 100644 resources/js/front/paywall-block.js delete mode 100644 resources/js/front/paywall-block.min.js delete mode 100644 resources/js/front/paywall-init.js delete mode 100644 resources/js/front/paywall-init.min.js delete mode 100755 vendor/comfino/shop-plugins-shared/bin/composer delete mode 100755 vendor/comfino/shop-plugins-shared/bin/php delete mode 100755 vendor/comfino/shop-plugins-shared/bin/phpunit delete mode 100644 vendor/comfino/shop-plugins-shared/tests/Extended/Api/ExtendedClientTest.php delete mode 100644 vendor/comfino/shop-plugins-shared/tests/ExtendedClientTestTrait.php delete mode 100644 vendor/comfino/shop-plugins-shared/tests/ReflectionTrait.php delete mode 100644 vendor/psr/log/Psr/Log/Test/DummyTest.php delete mode 100644 vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php delete mode 100644 vendor/psr/log/Psr/Log/Test/TestLogger.php delete mode 100644 vendor/sunrise/http-client-curl/.gitignore delete mode 100644 vendor/sunrise/http-client-curl/tests/ClientTest.php delete mode 100644 vendor/sunrise/http-factory/.gitignore delete mode 100644 vendor/sunrise/http-factory/tests/FactoryTest.php delete mode 100644 vendor/sunrise/http-header/.gitignore delete mode 100644 vendor/sunrise/http-message/.gitignore delete mode 100644 vendor/sunrise/http-message/tests/MessageTest.php delete mode 100644 vendor/sunrise/http-message/tests/RequestFactoryTest.php delete mode 100644 vendor/sunrise/http-message/tests/RequestTest.php delete mode 100644 vendor/sunrise/http-message/tests/ResponseFactoryTest.php delete mode 100644 vendor/sunrise/http-message/tests/ResponseTest.php delete mode 100644 vendor/sunrise/http-server-request/.gitignore delete mode 100644 vendor/sunrise/http-server-request/tests/AbstractTestCase.php delete mode 100644 vendor/sunrise/http-server-request/tests/ServerRequestFactoryTest.php delete mode 100644 vendor/sunrise/http-server-request/tests/ServerRequestTest.php delete mode 100644 vendor/sunrise/http-server-request/tests/UploadedFileFactoryTest.php delete mode 100644 vendor/sunrise/http-server-request/tests/UploadedFileTest.php delete mode 100644 vendor/sunrise/stream/.gitignore delete mode 100644 vendor/sunrise/stream/tests/StreamFactoryTest.php delete mode 100644 vendor/sunrise/stream/tests/StreamTest.php delete mode 100644 vendor/sunrise/uri/.gitignore delete mode 100644 vendor/sunrise/uri/tests/UriFactoryTest.php delete mode 100644 vendor/sunrise/uri/tests/UriParserTest.php delete mode 100644 vendor/sunrise/uri/tests/UriTest.php delete mode 100644 vendor/symfony/yaml/Command/LintCommand.php delete mode 100644 views/front/api-error.php delete mode 100644 views/front/paywall-disabled.php delete mode 100644 views/front/paywall.php diff --git a/.claude/memory/MEMORY.md b/.claude/memory/MEMORY.md new file mode 100644 index 00000000..c007612d --- /dev/null +++ b/.claude/memory/MEMORY.md @@ -0,0 +1,3 @@ +# Memory Index + +- [Test procedure for WooCommerce plugin](feedback_test_procedure.md) — PHPUnit must run from deploy sandbox `~/Devel/comfino/deploy/WooCommerce`, not plugin source dir \ No newline at end of file diff --git a/resources/js/front/paywall-block.js b/resources/js/front/paywall-block.js deleted file mode 100644 index 6458ed07..00000000 --- a/resources/js/front/paywall-block.js +++ /dev/null @@ -1,285 +0,0 @@ -const comfinoSettings = wc.wcSettings.getSetting('comfino_data', {}); - -window.Comfino = { - label: wp.htmlEntities.decodeEntities(comfinoSettings.title) || wp.i18n.__('Comfino payments', 'comfino-payment-gateway'), - isSelected: false, - loanParams: { loanAmount: 0, loanType: '', loanTerm: 0 }, - shippingMethods: null, - paywallTemplate: null, - initialized: false, - iframeLoaded: false, - Label: () => { - ComfinoPaywallFrontend.logEvent('Comfino.Label', 'debug', Comfino.label, comfinoSettings.icon); - - if (comfinoSettings.icon) { - return wp.element.RawHTML({ - children: Comfino.label + '' - }); - } - - return Comfino.label; - }, - Content: (properties) => { - const { eventRegistration, emitResponse } = properties; - const { onPaymentSetup } = eventRegistration; - - if (Comfino.paywallTemplate === null) { - ComfinoPaywallFrontend.logEvent('Comfino.Content', 'debug', properties); - } - - // Handle payment setup. - wp.element.useEffect(() => { - const unsubscribe = onPaymentSetup(async () => { - return { - type: emitResponse.responseTypes.SUCCESS, - meta: { - paymentMethodData: { - comfino_loan_amount: Comfino.loanParams.loanAmount.toString(), - comfino_loan_type: Comfino.loanParams.loanType, - comfino_loan_term: Comfino.loanParams.loanTerm.toString(), - } - } - }; - }); - - return () => { unsubscribe(); }; - }, - [emitResponse.responseTypes.SUCCESS, onPaymentSetup] - ); - - // Initialize paywall in useEffect to ensure DOM is ready. - wp.element.useEffect(() => { - if (!Comfino.initialized && typeof ComfinoPaywallFrontend !== 'undefined') { - ComfinoPaywallFrontend.logEvent('Comfino.Content - initializing paywall frontend.', 'debug'); - - // Setup callbacks. - comfinoSettings.paywallOptions.onUpdateOrderPaymentState = (loanParams) => { - ComfinoPaywallFrontend.logEvent('updateOrderPaymentState WooCommerce (Payment Blocks)', 'debug', loanParams); - - if (loanParams.loanTerm !== 0) { - Comfino.loanParams.loanAmount = loanParams.loanAmount; - Comfino.loanParams.loanType = loanParams.loanType; - Comfino.loanParams.loanTerm = loanParams.loanTerm; - } - }; - - comfinoSettings.paywallOptions.onOfferLoadSuccess = (loanParams) => { - ComfinoPaywallFrontend.logEvent('onOfferLoadSuccess WooCommerce (Payment Blocks)', 'debug', loanParams); - }; - - // Monitor iframe load state since lazy loading delays the onload event. - const monitorIframeLoad = () => { - const iframe = document.getElementById('comfino-paywall-container'); - - if (!iframe) { - return; - } - - // Check if iframe is visible and not yet loaded. - if (iframe.style.display === 'block' && !Comfino.iframeLoaded) { - // Check if iframe content is actually loaded. - if (iframe.contentWindow && iframe.contentWindow.location) { - try { - // Try to check if iframe has loaded content. - const iframeDoc = iframe.contentDocument || iframe.contentWindow.document; - - if (iframeDoc && iframeDoc.readyState === 'complete') { - ComfinoPaywallFrontend.logEvent('Iframe loaded while visible, triggering onload.', 'debug'); - ComfinoPaywallFrontend.onload( - iframe, - comfinoSettings.paywallOptions.platformName, - comfinoSettings.paywallOptions.platformVersion - ); - - Comfino.iframeLoaded = true; - - return; - } - } catch (e) { - // Cross-origin iframe, can't access contentDocument. Iframe is loading from external source, attach load listener. - ComfinoPaywallFrontend.logEvent('Setting up load listener for cross-origin iframe.', 'debug'); - - iframe.addEventListener('load', function onIframeLoad() { - ComfinoPaywallFrontend.logEvent('Iframe load event fired.', 'debug'); - - if (!Comfino.iframeLoaded) { - ComfinoPaywallFrontend.onload( - iframe, - comfinoSettings.paywallOptions.platformName, - comfinoSettings.paywallOptions.platformVersion - ); - } - - iframe.removeEventListener('load', onIframeLoad); - }, { once: true }); - - return; - } - } - } - - // Keep checking until loaded. - if (Comfino.isSelected && !Comfino.iframeLoaded) { - setTimeout(monitorIframeLoad, 100); - } - }; - - // Start monitoring when Comfino is selected. - Comfino.startLoadMonitor = monitorIframeLoad; - - // Wait for iframe to be in DOM. - const checkAndInitialize = () => { - const iframe = document.getElementById('comfino-paywall-container'); - - if (iframe !== null) { - ComfinoPaywallFrontend.logEvent('Paywall iframe found, initializing...', 'debug', iframe); - ComfinoPaywallFrontend.init(null, iframe, comfinoSettings.paywallOptions); - - Comfino.initialized = true; - - // If already selected, make iframe visible and execute click logic. - if (Comfino.isSelected) { - ComfinoPaywallFrontend.logEvent('Comfino already selected, making iframe visible.', 'debug'); - iframe.style.display = 'block'; - ComfinoPaywallFrontend.executeClickLogic(); - } - } else { - // Retry after a short delay. - setTimeout(checkAndInitialize, 50); - } - }; - - checkAndInitialize(); - monitorIframeLoad(); - } - }, []); - - if (Comfino.paywallTemplate === null) { - const paywallTemplate = new DOMParser().parseFromString(comfinoSettings.iframeTemplate, 'text/html'); - paywallTemplate.body.firstChild.innerHTML = ComfinoPaywallFrontend.renderPaywallIframe(comfinoSettings.paywallUrl, comfinoSettings.paywallOptions); - Comfino.paywallTemplate = paywallTemplate.body.innerHTML; - - ComfinoPaywallFrontend.logEvent('Comfino paywall template initialized.', 'debug', paywallTemplate.body.firstChild); - } - - return wp.element.RawHTML({ children: wp.htmlEntities.decodeEntities(Comfino.paywallTemplate) }); - }, - EditContent: () => { - return wp.element.RawHTML({ children: '[Comfino Panel]' }); - }, - /** - * Updates paywall when cart total changes (shipping method, etc.). - * - * orderData: - * { - * cart: Cart, - * cartTotals: CartTotals, - * cartNeedsShipping: boolean, - * shippingAddress: CartShippingAddress, - * billingAddress: CartBillingAddress, - * selectedShippingMethods: Record, - * paymentRequirements: string[] - * } - * - * @param {Object} orderData - */ - updatePaywallIfNeeded: (orderData) => { - if (!ComfinoPaywallFrontend.isInitialized() || !orderData.cartTotals) { - return; - } - - if (Comfino.loanParams.loanAmount > 0) { - const cartTotal = parseInt(orderData.cartTotals.total_price); - - if (Comfino.loanParams.loanAmount !== cartTotal) { - ComfinoPaywallFrontend.logEvent('Total value changed, reloading paywall.', 'debug', Comfino.loanParams.loanAmount, cartTotal); - ComfinoPaywallFrontend.reloadPaywall(); - } - } - } -} - -wp.hooks.addAction('experimental__woocommerce_blocks-checkout-render-checkout-form', 'comfino', () => { - const payment = wp.data.select('wc/store/payment'); - - ComfinoPaywallFrontend.logEvent( - 'woocommerce_blocks-checkout-render-checkout-form', - 'debug', - payment.getActivePaymentMethod(), - payment.getAvailablePaymentMethods(), - payment.getPaymentMethodData(), - payment.getState() - ); - - Comfino.isSelected = (payment.getActivePaymentMethod() === 'comfino'); -}); - -wp.hooks.addAction('experimental__woocommerce_blocks-checkout-set-active-payment-method', 'comfino', (paymentMethod) => { - ComfinoPaywallFrontend.logEvent('woocommerce_blocks-checkout-set-active-payment-method', 'debug', paymentMethod); - - if (paymentMethod.paymentMethodSlug === 'comfino') { - Comfino.isSelected = true - - /* Wait for iframe to appear in DOM (React needs time to re-render Content component). - This is necessary because the hook fires before React re-renders the payment method content. */ - const makeIframeVisible = () => { - const iframe = document.getElementById('comfino-paywall-container'); - - if (iframe) { - ComfinoPaywallFrontend.logEvent('Making iframe visible (payment method selected).', 'debug'); - - iframe.style.display = 'block'; - - if (ComfinoPaywallFrontend.isInitialized()) { - /* Re-initialize to update the iframe reference in case React recreated it. - This prevents "Cannot read properties of null (reading 'postMessage')" errors - when switching between payment methods. */ - Comfino.iframeLoaded = false; - - ComfinoPaywallFrontend.init(null, iframe, comfinoSettings.paywallOptions); - ComfinoPaywallFrontend.executeClickLogic(); - - // Start monitoring for lazy-loaded iframe. - if (Comfino.startLoadMonitor) { - Comfino.startLoadMonitor(); - } - } - } else { - // Retry after a short delay to allow React to re-render. - setTimeout(makeIframeVisible, 50); - } - }; - - makeIframeVisible(); - } else { - Comfino.isSelected = false - } -}); - -wc.wcBlocksRegistry.registerPaymentMethod({ - name: 'comfino', - label: Object(wp.element.createElement)(Comfino.Label, null), - icon: 'money-alt', - content: Object(wp.element.createElement)(Comfino.Content, null), - edit: Object(wp.element.createElement)(Comfino.EditContent, null), - canMakePayment: (orderData) => { - ComfinoPaywallFrontend.logEvent('canMakePayment', 'debug', orderData); - - // Check if shipping method changed and update paywall if needed. - if (Comfino.shippingMethods !== null && - Comfino.shippingMethods.toString() !== Object.values(orderData.selectedShippingMethods).toString() - ) { - ComfinoPaywallFrontend.logEvent('Shipping method changed, updating paywall', 'debug'); - Comfino.updatePaywallIfNeeded(orderData); - } - - Comfino.shippingMethods = Object.values(orderData.selectedShippingMethods); - - return true; - }, - ariaLabel: Comfino.label, - supports: { - features: comfinoSettings.supports - } -}); diff --git a/resources/js/front/paywall-block.min.js b/resources/js/front/paywall-block.min.js deleted file mode 100644 index 799e9cdc..00000000 --- a/resources/js/front/paywall-block.min.js +++ /dev/null @@ -1,14 +0,0 @@ -const comfinoSettings=wc.wcSettings.getSetting("comfino_data",{}); -window.Comfino={label:wp.htmlEntities.decodeEntities(comfinoSettings.title)||wp.i18n.__("Comfino payments","comfino-payment-gateway"),isSelected:!1,loanParams:{loanAmount:0,loanType:"",loanTerm:0},shippingMethods:null,paywallTemplate:null,initialized:!1,iframeLoaded:!1,Label:()=>{ComfinoPaywallFrontend.logEvent("Comfino.Label","debug",Comfino.label,comfinoSettings.icon);return comfinoSettings.icon?wp.element.RawHTML({children:Comfino.label+''}):Comfino.label},Content:a=>{const {eventRegistration:e,emitResponse:c}=a,{onPaymentSetup:g}=e;null===Comfino.paywallTemplate&&ComfinoPaywallFrontend.logEvent("Comfino.Content","debug",a);wp.element.useEffect(()=>{const d=g(async()=>({type:c.responseTypes.SUCCESS,meta:{paymentMethodData:{comfino_loan_amount:Comfino.loanParams.loanAmount.toString(),comfino_loan_type:Comfino.loanParams.loanType,comfino_loan_term:Comfino.loanParams.loanTerm.toString()}}})); -return()=>{d()}},[c.responseTypes.SUCCESS,g]);wp.element.useEffect(()=>{if(!Comfino.initialized&&"undefined"!==typeof ComfinoPaywallFrontend){ComfinoPaywallFrontend.logEvent("Comfino.Content - initializing paywall frontend.","debug");comfinoSettings.paywallOptions.onUpdateOrderPaymentState=b=>{ComfinoPaywallFrontend.logEvent("updateOrderPaymentState WooCommerce (Payment Blocks)","debug",b);0!==b.loanTerm&&(Comfino.loanParams.loanAmount=b.loanAmount,Comfino.loanParams.loanType=b.loanType,Comfino.loanParams.loanTerm= -b.loanTerm)};comfinoSettings.paywallOptions.onOfferLoadSuccess=b=>{ComfinoPaywallFrontend.logEvent("onOfferLoadSuccess WooCommerce (Payment Blocks)","debug",b)};const d=()=>{const b=document.getElementById("comfino-paywall-container");if(b){if("block"===b.style.display&&!Comfino.iframeLoaded&&b.contentWindow&&b.contentWindow.location)try{const f=b.contentDocument||b.contentWindow.document;if(f&&"complete"===f.readyState){ComfinoPaywallFrontend.logEvent("Iframe loaded while visible, triggering onload.", -"debug");ComfinoPaywallFrontend.onload(b,comfinoSettings.paywallOptions.platformName,comfinoSettings.paywallOptions.platformVersion);Comfino.iframeLoaded=!0;return}}catch(f){ComfinoPaywallFrontend.logEvent("Setting up load listener for cross-origin iframe.","debug");b.addEventListener("load",function k(){ComfinoPaywallFrontend.logEvent("Iframe load event fired.","debug");if(!Comfino.iframeLoaded)ComfinoPaywallFrontend.onload(b,comfinoSettings.paywallOptions.platformName,comfinoSettings.paywallOptions.platformVersion); -b.removeEventListener("load",k)},{once:!0});return}Comfino.isSelected&&!Comfino.iframeLoaded&&setTimeout(d,100)}};Comfino.startLoadMonitor=d;const h=()=>{const b=document.getElementById("comfino-paywall-container");null!==b?(ComfinoPaywallFrontend.logEvent("Paywall iframe found, initializing...","debug",b),ComfinoPaywallFrontend.init(null,b,comfinoSettings.paywallOptions),Comfino.initialized=!0,Comfino.isSelected&&(ComfinoPaywallFrontend.logEvent("Comfino already selected, making iframe visible.", -"debug"),b.style.display="block",ComfinoPaywallFrontend.executeClickLogic())):setTimeout(h,50)};h();d()}},[]);null===Comfino.paywallTemplate&&(a=(new DOMParser).parseFromString(comfinoSettings.iframeTemplate,"text/html"),a.body.firstChild.innerHTML=ComfinoPaywallFrontend.renderPaywallIframe(comfinoSettings.paywallUrl,comfinoSettings.paywallOptions),Comfino.paywallTemplate=a.body.innerHTML,ComfinoPaywallFrontend.logEvent("Comfino paywall template initialized.","debug",a.body.firstChild));return wp.element.RawHTML({children:wp.htmlEntities.decodeEntities(Comfino.paywallTemplate)})}, -EditContent:()=>wp.element.RawHTML({children:"[Comfino Panel]"}),updatePaywallIfNeeded:a=>{ComfinoPaywallFrontend.isInitialized()&&a.cartTotals&&0{const a=wp.data.select("wc/store/payment");ComfinoPaywallFrontend.logEvent("woocommerce_blocks-checkout-render-checkout-form","debug",a.getActivePaymentMethod(),a.getAvailablePaymentMethods(),a.getPaymentMethodData(),a.getState());Comfino.isSelected="comfino"===a.getActivePaymentMethod()}); -wp.hooks.addAction("experimental__woocommerce_blocks-checkout-set-active-payment-method","comfino",a=>{ComfinoPaywallFrontend.logEvent("woocommerce_blocks-checkout-set-active-payment-method","debug",a);if("comfino"===a.paymentMethodSlug){Comfino.isSelected=!0;const e=()=>{const c=document.getElementById("comfino-paywall-container");c?(ComfinoPaywallFrontend.logEvent("Making iframe visible (payment method selected).","debug"),c.style.display="block",ComfinoPaywallFrontend.isInitialized()&&(Comfino.iframeLoaded= -!1,ComfinoPaywallFrontend.init(null,c,comfinoSettings.paywallOptions),ComfinoPaywallFrontend.executeClickLogic(),Comfino.startLoadMonitor&&Comfino.startLoadMonitor())):setTimeout(e,50)};e()}else Comfino.isSelected=!1}); -wc.wcBlocksRegistry.registerPaymentMethod({name:"comfino",label:Object(wp.element.createElement)(Comfino.Label,null),icon:"money-alt",content:Object(wp.element.createElement)(Comfino.Content,null),edit:Object(wp.element.createElement)(Comfino.EditContent,null),canMakePayment:a=>{ComfinoPaywallFrontend.logEvent("canMakePayment","debug",a);null!==Comfino.shippingMethods&&Comfino.shippingMethods.toString()!==Object.values(a.selectedShippingMethods).toString()&&(ComfinoPaywallFrontend.logEvent("Shipping method changed, updating paywall", -"debug"),Comfino.updatePaywallIfNeeded(a));Comfino.shippingMethods=Object.values(a.selectedShippingMethods);return!0},ariaLabel:Comfino.label,supports:{features:comfinoSettings.supports}}); diff --git a/resources/js/front/paywall-init.js b/resources/js/front/paywall-init.js deleted file mode 100644 index db448366..00000000 --- a/resources/js/front/paywall-init.js +++ /dev/null @@ -1,49 +0,0 @@ -window.ComfinoPaywallInit = { - init: () => { - const iframeContainer = document.getElementById('comfino-iframe-container'); - - if (iframeContainer.querySelector('#comfino-paywall-container') !== null) { - ComfinoPaywallFrontend.logEvent('Comfino paywall iframe already initialized.', 'info', iframeContainer); - - return; - } - - const iframe = ComfinoPaywallFrontend.createPaywallIframe(ComfinoPaywallData.paywallUrl, ComfinoPaywallData.paywallOptions); - const frontendInitElement = document.getElementById('payment_method_comfino'); - - let priceModifier = 0; - - if ('priceModifier' in frontendInitElement.dataset) { - priceModifier = parseInt(frontendInitElement.dataset.priceModifier); - - if (!Number.isNaN(priceModifier)) { - iframe.src += ('&priceModifier=' + priceModifier); - } else { - priceModifier = 0; - } - } - - ComfinoPaywallData.paywallOptions.onUpdateOrderPaymentState = (loanParams) => { - ComfinoPaywallFrontend.logEvent('updateOrderPaymentState WooCommerce', 'debug', loanParams); - - document.getElementById('comfino-loan-amount').value = loanParams.loanAmount; - document.getElementById('comfino-loan-type').value = loanParams.loanType; - document.getElementById('comfino-loan-term').value = loanParams.loanTerm; - document.getElementById('comfino-price-modifier').value = priceModifier; - } - - iframeContainer.appendChild(iframe); - - ComfinoPaywallFrontend.init(frontendInitElement, iframe, ComfinoPaywallData.paywallOptions); - } -} - -if (document.readyState === 'complete') { - ComfinoPaywallInit.init(); -} else { - document.addEventListener('readystatechange', () => { - if (document.readyState === 'complete') { - ComfinoPaywallInit.init(); - } - }); -} diff --git a/resources/js/front/paywall-init.min.js b/resources/js/front/paywall-init.min.js deleted file mode 100644 index a75e3b5d..00000000 --- a/resources/js/front/paywall-init.min.js +++ /dev/null @@ -1,3 +0,0 @@ -window.ComfinoPaywallInit={init:()=>{const d=document.getElementById("comfino-iframe-container");if(null!==d.querySelector("#comfino-paywall-container"))ComfinoPaywallFrontend.logEvent("Comfino paywall iframe already initialized.","info",d);else{var b=ComfinoPaywallFrontend.createPaywallIframe(ComfinoPaywallData.paywallUrl,ComfinoPaywallData.paywallOptions),e=document.getElementById("payment_method_comfino"),a=0;"priceModifier"in e.dataset&&(a=parseInt(e.dataset.priceModifier),Number.isNaN(a)?a=0: -b.src+="&priceModifier="+a);ComfinoPaywallData.paywallOptions.onUpdateOrderPaymentState=c=>{ComfinoPaywallFrontend.logEvent("updateOrderPaymentState WooCommerce","debug",c);document.getElementById("comfino-loan-amount").value=c.loanAmount;document.getElementById("comfino-loan-type").value=c.loanType;document.getElementById("comfino-loan-term").value=c.loanTerm;document.getElementById("comfino-price-modifier").value=a};d.appendChild(b);ComfinoPaywallFrontend.init(e,b,ComfinoPaywallData.paywallOptions)}}}; -"complete"===document.readyState?ComfinoPaywallInit.init():document.addEventListener("readystatechange",()=>{"complete"===document.readyState&&ComfinoPaywallInit.init()}); diff --git a/vendor/comfino/shop-plugins-shared/bin/composer b/vendor/comfino/shop-plugins-shared/bin/composer deleted file mode 100755 index d22ffc06..00000000 --- a/vendor/comfino/shop-plugins-shared/bin/composer +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -if command -v docker-compose >/dev/null; then - docker-compose exec shop-plugins-shared-php composer "$@" -else - composer "$@" -fi - -if [ -d ./vendor/phpspec/prophecy-phpunit ]; then - if [ -f ./vendor/phpspec/prophecy-phpunit/ProphecyTestCase.php ]; then - # Fix bug in Prophecy PhpUnit integration library (PHP 7.1 compatibility issue: conflict with old PHPUnit 5.7.x). - sed -i 's~protected function onNotSuccessfulTest(\\Exception $e)~protected function onNotSuccessfulTest(/*\\Exception*/ $e)~g' ./vendor/phpspec/prophecy-phpunit/ProphecyTestCase.php - fi -fi diff --git a/vendor/comfino/shop-plugins-shared/bin/php b/vendor/comfino/shop-plugins-shared/bin/php deleted file mode 100755 index 5ff84bf4..00000000 --- a/vendor/comfino/shop-plugins-shared/bin/php +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -docker-compose exec shop-plugins-shared-php php "$@" diff --git a/vendor/comfino/shop-plugins-shared/bin/phpunit b/vendor/comfino/shop-plugins-shared/bin/phpunit deleted file mode 100755 index d452947b..00000000 --- a/vendor/comfino/shop-plugins-shared/bin/phpunit +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -if command -v docker-compose > /dev/null; then - docker-compose exec shop-plugins-shared-php php ./vendor/bin/phpunit "$@" -else - php ./vendor/bin/phpunit "$@" -fi diff --git a/vendor/comfino/shop-plugins-shared/tests/Extended/Api/ExtendedClientTest.php b/vendor/comfino/shop-plugins-shared/tests/Extended/Api/ExtendedClientTest.php deleted file mode 100644 index 35fc95c0..00000000 --- a/vendor/comfino/shop-plugins-shared/tests/Extended/Api/ExtendedClientTest.php +++ /dev/null @@ -1,13 +0,0 @@ - 'value1', 'attrib2' => 'value2'], - '123EF', - 'Error message.' - ); - $hashKey = 'Comfino API client ' . Client::CLIENT_VERSION; - $errorDetails = gzcompress('{"host":"host","platform":"platform","environment":{"attrib1":"value1","attrib2":"value2"},"error_code":"123EF","error_message":"Error message.","api_request_url":null,"api_request":null,"api_response":null,"stack_trace":null}', 9); - $encodedErrorDetails = base64_encode($errorDetails); - - $request = [ - 'error_details' => $encodedErrorDetails, - 'hash' => hash_hmac('sha3-256', $encodedErrorDetails, $hashKey), - ]; - - $apiClient = $this->initApiClient('/v1/log-plugin-error', 'POST', null, (new JsonSerializer())->serialize($request), null, 'API-KEY'); - - $this->assertTrue($apiClient->sendLoggedError($shopPluginError)); - } - - public function testSendLoggedErrorFailure(): void - { - $shopPluginError = new ShopPluginError( - 'host', - 'platform', - ['attrib1' => 'value1', 'attrib2' => 'value2'], - '123EF', - 'Error message.' - ); - $hashKey = 'Comfino API client ' . Client::CLIENT_VERSION; - $errorDetails = gzcompress('{"host":"host","platform":"platform","environment":{"attrib1":"value1","attrib2":"value2"},"error_code":"123EF","error_message":"Error message.","api_request_url":null,"api_request":null,"api_response":null,"stack_trace":null}', 9); - $encodedErrorDetails = base64_encode($errorDetails); - - $request = [ - 'error_details' => $encodedErrorDetails, - 'hash' => hash_hmac('sha3-256', $encodedErrorDetails, $hashKey), - ]; - - $apiClient = $this->initApiClient('/v1/log-plugin-error', 'POST', null, (new JsonSerializer())->serialize($request), null, 'API-KEY', false, 500); - - $this->assertFalse($apiClient->sendLoggedError($shopPluginError)); - } - - public function testNotifyPluginRemoval(): void - { - $apiClient = $this->initApiClient('/v1/log-plugin-remove', 'PUT', null, null, null, 'API-KEY'); - - $this->assertTrue($apiClient->notifyPluginRemoval()); - } - - public function testNotifyPluginRemovalFailure(): void - { - $apiClient = $this->initFailingApiClient(); - - $this->assertFalse($apiClient->notifyPluginRemoval()); - } - - public function testNotifyAbandonedCart(): void - { - $requestBody = (new JsonSerializer())->serialize(['type' => 'cart_created']); - $apiClient = $this->initApiClient('/v1/abandoned_cart', 'POST', null, $requestBody, null, 'API-KEY'); - - $this->assertTrue($apiClient->notifyAbandonedCart('cart_created')); - } - - public function testNotifyAbandonedCartFailure(): void - { - $apiClient = $this->initFailingApiClient(); - - $this->assertFalse($apiClient->notifyAbandonedCart('cart_updated')); - } - - /** - * @throws \ReflectionException - */ - protected function setUp(): void - { - $this->productionApiHost = parse_url($this->getConstantFromClass(Client::class, 'PRODUCTION_HOST'), PHP_URL_HOST); - } - - private function initApiClient(string $endpointPath, string $method, ?array $queryParameters = null, ?string $requestBody = null, $responseData = null, ?string $apiKey = null, bool $isPublicEndpoint = false, int $responseStatus = 200): ExtendedClient - { - $client = new \Http\Mock\Client(); - $client->on( - new RequestMatcher($endpointPath, $this->productionApiHost, $method, 'https'), - function (RequestInterface $request) use ($queryParameters, $requestBody, $responseData, $apiKey, $isPublicEndpoint, $responseStatus) { - return $this->processRequest($request, $queryParameters, $requestBody, $responseData, $apiKey, $isPublicEndpoint, $responseStatus); - } - ); - - return new ExtendedClient(new RequestFactory(), new StreamFactory(), $client, $apiKey); - } - - private function initFailingApiClient(): ExtendedClient - { - $client = new \Http\Mock\Client(); - $client->on( - new RequestMatcher(null, null, null, 'https'), - function (RequestInterface $request) { - throw new \RuntimeException('Simulated network error'); - } - ); - - return new ExtendedClient(new RequestFactory(), new StreamFactory(), $client, 'API-KEY'); - } - - private function processRequest(RequestInterface $request, ?array $queryParameters = null, ?string $requestBody = null, $responseData = null, ?string $apiKey = null, bool $isPublicEndpoint = false, int $responseStatus = 200): ResponseInterface - { - if (!$isPublicEndpoint && (!$request->hasHeader('Api-Key') || $request->getHeaderLine('Api-Key') !== $apiKey)) { - return (new ResponseFactory())->createJsonResponse(401, ['message' => 'Invalid credentials.']); - } - - if ($requestBody !== null) { - $this->assertEquals($requestBody, $request->getBody()->getContents(), 'Request body is invalid.'); - } else { - $this->assertEquals('', $request->getBody()->getContents(), 'Request body is invalid.'); - } - - if (is_array($queryParameters) && count($queryParameters)) { - $this->assertEquals(http_build_query($queryParameters), $request->getUri()->getQuery(), 'Request URL query string is invalid.'); - } else { - $this->assertEquals('', $request->getUri()->getQuery(), 'Request URL query string is invalid.'); - } - - return (new ResponseFactory())->createJsonResponse($responseStatus, $responseData); - } -} diff --git a/vendor/comfino/shop-plugins-shared/tests/ReflectionTrait.php b/vendor/comfino/shop-plugins-shared/tests/ReflectionTrait.php deleted file mode 100644 index d203fc57..00000000 --- a/vendor/comfino/shop-plugins-shared/tests/ReflectionTrait.php +++ /dev/null @@ -1,60 +0,0 @@ -getConstant($name); - } - - /** - * @throws \ReflectionException - * @param string $class - * @param string $name - * @return mixed - */ - public function getConstantFromClass($class, $name) - { - return (new \ReflectionClass($class))->getConstant($name); - } - - /** - * @throws \ReflectionException - * @param object $object - * @param string $propertyName - * @return mixed - */ - public function getPropertyValue($object, $propertyName) - { - $reflection = new \ReflectionObject($object); - $property = $reflection->getProperty($propertyName); - $property->setAccessible(true); - - return $property->getValue($object); - } - - /** - * @throws \ReflectionException - * @param object $object - * @param string $methodName - * @param mixed[] $arguments - * @return mixed - */ - public function getMethodResult($object, $methodName, $arguments = []) - { - $reflection = new \ReflectionObject($object); - $method = $reflection->getMethod($methodName); - $method->setAccessible(true); - - return $method->invokeArgs($object, $arguments); - } -} diff --git a/vendor/psr/log/Psr/Log/Test/DummyTest.php b/vendor/psr/log/Psr/Log/Test/DummyTest.php deleted file mode 100644 index c4a4ce6a..00000000 --- a/vendor/psr/log/Psr/Log/Test/DummyTest.php +++ /dev/null @@ -1,11 +0,0 @@ -assertInstanceOf('ComfinoExternal\Psr\Log\LoggerInterface', $this->getLogger()); - } - - public function testLogsAtAllLevels($level, $message) - { - $logger = $this->getLogger(); - $logger->{$level}($message, array('user' => 'Bob')); - $logger->log($level, $message, array('user' => 'Bob')); - $expected = array($level . ' message of level ' . $level . ' with context: Bob', $level . ' message of level ' . $level . ' with context: Bob'); - $this->assertEquals($expected, $this->getLogs()); - } - public function provideLevelsAndMessages() - { - return array(LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'), LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'), LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'), LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'), LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'), LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'), LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'), LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}')); - } - - public function testThrowsOnInvalidLevel() - { - $logger = $this->getLogger(); - $logger->log('invalid level', 'Foo'); - } - public function testContextReplacement() - { - $logger = $this->getLogger(); - $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar')); - $expected = array('info {Message {nothing} Bob Bar a}'); - $this->assertEquals($expected, $this->getLogs()); - } - public function testObjectCastToString() - { - if (method_exists($this, 'createPartialMock')) { - $dummy = $this->createPartialMock('ComfinoExternal\Psr\Log\Test\DummyTest', array('__toString')); - } else { - $dummy = $this->getMock('ComfinoExternal\Psr\Log\Test\DummyTest', array('__toString')); - } - $dummy->expects($this->once())->method('__toString')->will($this->returnValue('DUMMY')); - $this->getLogger()->warning($dummy); - $expected = array('warning DUMMY'); - $this->assertEquals($expected, $this->getLogs()); - } - public function testContextCanContainAnything() - { - $closed = fopen('php://memory', 'r'); - fclose($closed); - $context = array('bool' => \true, 'null' => null, 'string' => 'Foo', 'int' => 0, 'float' => 0.5, 'nested' => array('with object' => new DummyTest()), 'object' => new \DateTime(), 'resource' => fopen('php://memory', 'r'), 'closed' => $closed); - $this->getLogger()->warning('Crazy context data', $context); - $expected = array('warning Crazy context data'); - $this->assertEquals($expected, $this->getLogs()); - } - public function testContextExceptionKeyCanBeExceptionOrOtherValues() - { - $logger = $this->getLogger(); - $logger->warning('Random message', array('exception' => 'oops')); - $logger->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail'))); - $expected = array('warning Random message', 'critical Uncaught Exception!'); - $this->assertEquals($expected, $this->getLogs()); - } -} diff --git a/vendor/psr/log/Psr/Log/Test/TestLogger.php b/vendor/psr/log/Psr/Log/Test/TestLogger.php deleted file mode 100644 index 63303dfa..00000000 --- a/vendor/psr/log/Psr/Log/Test/TestLogger.php +++ /dev/null @@ -1,122 +0,0 @@ - $level, 'message' => $message, 'context' => $context]; - $this->recordsByLevel[$record['level']][] = $record; - $this->records[] = $record; - } - public function hasRecords($level) - { - return isset($this->recordsByLevel[$level]); - } - public function hasRecord($record, $level) - { - if (is_string($record)) { - $record = ['message' => $record]; - } - return $this->hasRecordThatPasses(function ($rec) use ($record) { - if ($rec['message'] !== $record['message']) { - return \false; - } - if (isset($record['context']) && $rec['context'] !== $record['context']) { - return \false; - } - return \true; - }, $level); - } - public function hasRecordThatContains($message, $level) - { - return $this->hasRecordThatPasses(function ($rec) use ($message) { - return strpos($rec['message'], $message) !== \false; - }, $level); - } - public function hasRecordThatMatches($regex, $level) - { - return $this->hasRecordThatPasses(function ($rec) use ($regex) { - return preg_match($regex, $rec['message']) > 0; - }, $level); - } - public function hasRecordThatPasses(callable $predicate, $level) - { - if (!isset($this->recordsByLevel[$level])) { - return \false; - } - foreach ($this->recordsByLevel[$level] as $i => $rec) { - if (call_user_func($predicate, $rec, $i)) { - return \true; - } - } - return \false; - } - public function __call($method, $args) - { - if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) { - $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3]; - $level = strtolower($matches[2]); - if (method_exists($this, $genericMethod)) { - $args[] = $level; - return call_user_func_array([$this, $genericMethod], $args); - } - } - throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()'); - } - public function reset() - { - $this->records = []; - $this->recordsByLevel = []; - } -} diff --git a/vendor/sunrise/http-client-curl/.gitignore b/vendor/sunrise/http-client-curl/.gitignore deleted file mode 100644 index a6bde413..00000000 --- a/vendor/sunrise/http-client-curl/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -/.php_cs.cache -/.phpunit.result.cache -/composer.lock -/coverage.xml -/phpbench.json -/phpcs.xml -/phpunit.xml -/psalm.xml -/vendor/ diff --git a/vendor/sunrise/http-client-curl/composer.json b/vendor/sunrise/http-client-curl/composer.json index e2acbed8..aa35aedd 100644 --- a/vendor/sunrise/http-client-curl/composer.json +++ b/vendor/sunrise/http-client-curl/composer.json @@ -23,7 +23,7 @@ "homepage": "https://github.com/fenric" }, { - "name": "李昀陞 (Peter)", + "name": "\u674e\u6600\u965e (Peter)", "email": "peter279k@gmail.com", "homepage": "https://github.com/peter279k" } @@ -59,5 +59,6 @@ "phpdoc -d src/ -t phpdoc/", "XDEBUG_MODE=coverage phpunit --coverage-html coverage/" ] - } + }, + "version": "v1.4.6" } diff --git a/vendor/sunrise/http-client-curl/tests/ClientTest.php b/vendor/sunrise/http-client-curl/tests/ClientTest.php deleted file mode 100644 index ea246128..00000000 --- a/vendor/sunrise/http-client-curl/tests/ClientTest.php +++ /dev/null @@ -1,108 +0,0 @@ -assertInstanceOf(ClientInterface::class, $client); - } - - public function testSendRequest() - { - $client = new Client(new ResponseFactory()); - $request = (new RequestFactory)->createRequest('GET', 'https://www.php.net/'); - $response = $client->sendRequest($request); - $this->assertInstanceOf(ResponseInterface::class, $response); - $this->assertSame(200, $response->getStatusCode()); - $this->assertTrue($response->hasHeader('X-Request-Time')); - } - - public function testSendRequests() - { - $client = new Client(new ResponseFactory()); - $requests = []; - $requests[] = (new RequestFactory)->createRequest('GET', 'https://www.php.net/'); - $requests[] = (new RequestFactory)->createRequest('GET', 'https://www.php.net/'); - $responses = $client->sendRequests(...$requests); - - $this->assertInstanceOf(ResponseInterface::class, $responses[0]); - $this->assertSame(200, $responses[0]->getStatusCode()); - $this->assertTrue($responses[0]->hasHeader('X-Request-Time')); - - $this->assertInstanceOf(ResponseInterface::class, $responses[1]); - $this->assertSame(200, $responses[1]->getStatusCode()); - $this->assertTrue($responses[1]->hasHeader('X-Request-Time')); - } - - public function testSendRequestWithEmptyUri() - { - $client = new Client(new ResponseFactory()); - $request = (new RequestFactory)->createRequest('GET', ''); - - $this->expectException(NetworkExceptionInterface::class); - - $client->sendRequest($request); - } - - public function testClientException() - { - $previous = new RuntimeException(); - - $exception = new ClientException('foo', 42, $previous); - $this->assertInstanceOf(RuntimeException::class, $exception); - $this->assertInstanceOf(ClientExceptionInterface::class, $exception); - - $this->assertSame('foo', $exception->getMessage()); - $this->assertSame(42, $exception->getCode()); - $this->assertSame($previous, $exception->getPrevious()); - } - - public function testNetworkException() - { - $request = (new RequestFactory)->createRequest('GET', 'http://php.net/'); - $previous = new RuntimeException(); - - $exception = new NetworkException($request, 'foo', 42, $previous); - $this->assertInstanceOf(ClientException::class, $exception); - $this->assertInstanceOf(NetworkExceptionInterface::class, $exception); - - $this->assertSame($request, $exception->getRequest()); - $this->assertSame('foo', $exception->getMessage()); - $this->assertSame(42, $exception->getCode()); - $this->assertSame($previous, $exception->getPrevious()); - } - - public function testRequestException() - { - $request = (new RequestFactory)->createRequest('GET', 'http://php.net/'); - $previous = new RuntimeException(); - - $exception = new RequestException($request, 'foo', 42, $previous); - $this->assertInstanceOf(ClientException::class, $exception); - $this->assertInstanceOf(RequestExceptionInterface::class, $exception); - - $this->assertSame($request, $exception->getRequest()); - $this->assertSame('foo', $exception->getMessage()); - $this->assertSame(42, $exception->getCode()); - $this->assertSame($previous, $exception->getPrevious()); - } -} diff --git a/vendor/sunrise/http-factory/.gitignore b/vendor/sunrise/http-factory/.gitignore deleted file mode 100644 index a6bde413..00000000 --- a/vendor/sunrise/http-factory/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -/.php_cs.cache -/.phpunit.result.cache -/composer.lock -/coverage.xml -/phpbench.json -/phpcs.xml -/phpunit.xml -/psalm.xml -/vendor/ diff --git a/vendor/sunrise/http-factory/composer.json b/vendor/sunrise/http-factory/composer.json index 811580d2..c057df58 100644 --- a/vendor/sunrise/http-factory/composer.json +++ b/vendor/sunrise/http-factory/composer.json @@ -50,5 +50,6 @@ "XDEBUG_MODE=coverage phpunit --coverage-html coverage/" ] }, - "abandoned": "sunrise/http-message" + "abandoned": "sunrise/http-message", + "version": "v2.0.3" } diff --git a/vendor/sunrise/http-factory/tests/FactoryTest.php b/vendor/sunrise/http-factory/tests/FactoryTest.php deleted file mode 100644 index 52753cae..00000000 --- a/vendor/sunrise/http-factory/tests/FactoryTest.php +++ /dev/null @@ -1,58 +0,0 @@ -assertInstanceOf( - \Sunrise\Http\Message\RequestFactory::class, - new \Sunrise\Http\Factory\RequestFactory() - ); - } - - public function testResponseFactory() : void - { - $this->assertInstanceOf( - \Sunrise\Http\Message\ResponseFactory::class, - new \Sunrise\Http\Factory\ResponseFactory() - ); - } - - public function testServerRequestFactory() : void - { - $this->assertInstanceOf( - \Sunrise\Http\ServerRequest\ServerRequestFactory::class, - new \Sunrise\Http\Factory\ServerRequestFactory() - ); - } - - public function testStreamFactory() : void - { - $this->assertInstanceOf( - \Sunrise\Stream\StreamFactory::class, - new \Sunrise\Http\Factory\StreamFactory() - ); - } - - public function testUploadedFileFactory() : void - { - $this->assertInstanceOf( - \Sunrise\Http\ServerRequest\UploadedFileFactory::class, - new \Sunrise\Http\Factory\UploadedFileFactory() - ); - } - - public function testUriFactory() : void - { - $this->assertInstanceOf( - \Sunrise\Uri\UriFactory::class, - new \Sunrise\Http\Factory\UriFactory() - ); - } -} diff --git a/vendor/sunrise/http-header/.gitignore b/vendor/sunrise/http-header/.gitignore deleted file mode 100644 index a6bde413..00000000 --- a/vendor/sunrise/http-header/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -/.php_cs.cache -/.phpunit.result.cache -/composer.lock -/coverage.xml -/phpbench.json -/phpcs.xml -/phpunit.xml -/psalm.xml -/vendor/ diff --git a/vendor/sunrise/http-header/composer.json b/vendor/sunrise/http-header/composer.json index 9c071b09..8e3f56c3 100644 --- a/vendor/sunrise/http-header/composer.json +++ b/vendor/sunrise/http-header/composer.json @@ -32,5 +32,6 @@ "phpcs", "psalm" ] - } + }, + "version": "v2.0.2" } diff --git a/vendor/sunrise/http-message/.gitignore b/vendor/sunrise/http-message/.gitignore deleted file mode 100644 index a6bde413..00000000 --- a/vendor/sunrise/http-message/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -/.php_cs.cache -/.phpunit.result.cache -/composer.lock -/coverage.xml -/phpbench.json -/phpcs.xml -/phpunit.xml -/psalm.xml -/vendor/ diff --git a/vendor/sunrise/http-message/composer.json b/vendor/sunrise/http-message/composer.json index 0015c249..0378dccc 100644 --- a/vendor/sunrise/http-message/composer.json +++ b/vendor/sunrise/http-message/composer.json @@ -57,5 +57,6 @@ "phpdoc -d src/ -t phpdoc/", "XDEBUG_MODE=coverage phpunit --coverage-html coverage/" ] - } + }, + "version": "v2.1.3" } diff --git a/vendor/sunrise/http-message/tests/MessageTest.php b/vendor/sunrise/http-message/tests/MessageTest.php deleted file mode 100644 index 962182f2..00000000 --- a/vendor/sunrise/http-message/tests/MessageTest.php +++ /dev/null @@ -1,481 +0,0 @@ -assertInstanceOf(MessageInterface::class, $mess); - } - - /** - * @return void - */ - public function testConstructor() : void - { - $headers = ['X-Foo' => ['bar', 'baz'], 'X-Bar' => ['baz']]; - $body = (new StreamFactory)->createStreamFromResource(\STDOUT); - $protocol = '2.0'; - - $mess = new Message($headers, $body, $protocol); - - $this->assertSame($headers, $mess->getHeaders()); - $this->assertSame($body, $mess->getBody()); - $this->assertSame($protocol, $mess->getProtocolVersion()); - } - - /** - * @return void - */ - public function testProtocolVersion() : void - { - $mess = new Message(); - $copy = $mess->withProtocolVersion('2.0'); - - $this->assertInstanceOf(MessageInterface::class, $copy); - $this->assertNotEquals($mess, $copy); - - $this->assertSame('1.1', $mess->getProtocolVersion()); - - $this->assertSame('2.0', $copy->getProtocolVersion()); - } - - /** - * @return void - */ - public function testInvalidProtocolVersion($protocolVersion) : void - { - $this->expectException(\InvalidArgumentException::class); - - (new Message)->withProtocolVersion($protocolVersion); - } - - /** - * @return void - */ - public function testSetHeader() : void - { - $mess = new Message(); - $copy = $mess->withHeader('X-Foo', 'bar'); - - $this->assertInstanceOf(MessageInterface::class, $copy); - $this->assertNotEquals($mess, $copy); - $this->assertSame([], $mess->getHeaders()); - $this->assertSame(['X-Foo' => ['bar']], $copy->getHeaders()); - } - - /** - * @return void - */ - public function testSetHeaderWithSeveralValues() : void - { - $mess = (new Message)->withHeader('X-Foo', ['bar', 'baz']); - - $this->assertSame(['X-Foo' => ['bar', 'baz']], $mess->getHeaders()); - } - - /** - * @return void - */ - public function testSetSeveralHeaders() : void - { - $mess = (new Message) - ->withHeader('X-Foo', ['bar', 'baz']) - ->withHeader('X-Quux', ['quuux', 'quuuux']); - - $this->assertSame([ - 'X-Foo' => ['bar', 'baz'], - 'X-Quux' => ['quuux', 'quuuux'], - ], $mess->getHeaders()); - } - - /** - * @return void - */ - public function testSetHeaderLowercase() : void - { - $mess = (new Message)->withHeader('x-foo', 'bar'); - - $this->assertSame(['X-Foo' => ['bar']], $mess->getHeaders()); - } - - /** - * @return void - */ - public function testSetInvalidHeaderName($headerName) : void - { - $this->expectException(\InvalidArgumentException::class); - - (new Message)->withHeader($headerName, 'bar'); - } - - /** - * @return void - */ - public function testSetInvalidHeaderValue($headerValue) : void - { - $this->expectException(\InvalidArgumentException::class); - - (new Message)->withHeader('X-Foo', $headerValue); - } - - /** - * @return void - */ - public function testSetInvalidHeaderValueItem($headerValue) : void - { - $this->expectException(\InvalidArgumentException::class); - - (new Message)->withHeader('X-Foo', ['bar', $headerValue, 'baz']); - } - - /** - * @return void - */ - public function testAddHeader() : void - { - $mess = (new Message)->withHeader('X-Foo', 'bar'); - $copy = $mess->withAddedHeader('X-Foo', 'baz'); - - $this->assertInstanceOf(MessageInterface::class, $copy); - $this->assertNotEquals($mess, $copy); - $this->assertSame(['X-Foo' => ['bar']], $mess->getHeaders()); - $this->assertSame(['X-Foo' => ['bar', 'baz']], $copy->getHeaders()); - } - - /** - * @return void - */ - public function testAddHeaderWithSeveralValues() : void - { - $mess = (new Message) - ->withHeader('X-Foo', ['bar', 'baz']) - ->withAddedHeader('X-Foo', ['quux', 'quuux']); - - $this->assertSame(['X-Foo' => ['bar', 'baz', 'quux', 'quuux']], $mess->getHeaders()); - } - - /** - * @return void - */ - public function testAddSeveralHeaders() : void - { - $mess = (new Message) - ->withHeader('X-Foo', 'bar') - ->withHeader('X-Baz', 'quux') - ->withAddedHeader('X-Foo', 'quuux') - ->withAddedHeader('X-Baz', 'quuuux'); - - $this->assertSame([ - 'X-Foo' => ['bar', 'quuux'], - 'X-Baz' => ['quux', 'quuuux'], - ], $mess->getHeaders()); - } - - /** - * @return void - */ - public function testAddHeaderLowercase() : void - { - $mess = (new Message) - ->withHeader('x-foo', 'bar') - ->withAddedHeader('x-foo', 'baz'); - - $this->assertSame(['X-Foo' => ['bar', 'baz']], $mess->getHeaders()); - } - - /** - * @return void - */ - public function testAddInvalidHeaderName($headerName) : void - { - $this->expectException(\InvalidArgumentException::class); - - (new Message)->withAddedHeader($headerName, 'bar'); - } - - /** - * @return void - */ - public function testAddInvalidHeaderValue($headerValue) : void - { - $this->expectException(\InvalidArgumentException::class); - - (new Message)->withAddedHeader('X-Foo', $headerValue); - } - - /** - * @return void - */ - public function testAddInvalidHeaderValueItem($headerValue) : void - { - $this->expectException(\InvalidArgumentException::class); - - (new Message)->withAddedHeader('X-Foo', ['bar', $headerValue, 'baz']); - } - - /** - * @return void - */ - public function testDeleteHeader() : void - { - $mess = (new Message)->withHeader('X-Foo', 'bar'); - $copy = $mess->withoutHeader('X-Foo'); - - $this->assertInstanceOf(MessageInterface::class, $copy); - $this->assertNotEquals($mess, $copy); - $this->assertSame(['X-Foo' => ['bar']], $mess->getHeaders()); - $this->assertSame([], $copy->getHeaders()); - } - - /** - * @return void - */ - public function testDeleteHeaderCaseInsensitive() : void - { - $mess = (new Message) - ->withHeader('x-foo', 'bar') - ->withoutHeader('X-Foo'); - - $this->assertSame([], $mess->getHeaders()); - } - - /** - * @return void - */ - public function testReplaceHeader() : void - { - $mess = (new Message)->withHeader('X-Foo', 'bar'); - $copy = $mess->withHeader('X-Foo', 'baz'); - - $this->assertSame(['X-Foo' => ['bar']], $mess->getHeaders()); - $this->assertSame(['X-Foo' => ['baz']], $copy->getHeaders()); - } - - /** - * @return void - */ - public function testReplaceHeaderCaseInsensitive() : void - { - $mess = (new Message) - ->withHeader('x-foo', 'bar') - ->withHeader('X-Foo', 'baz'); - - $this->assertSame(['X-Foo' => ['baz']], $mess->getHeaders()); - } - - /** - * @return void - */ - public function testHasHeader() : void - { - $mess = (new Message)->withHeader('X-Foo', 'bar'); - - $this->assertTrue($mess->hasHeader('X-Foo')); - $this->assertFalse($mess->hasHeader('X-Bar')); - } - - /** - * @return void - */ - public function testHasHeaderCaseInsensitive() : void - { - $mess = (new Message)->withHeader('x-foo', 'bar'); - - $this->assertTrue($mess->hasHeader('x-foo')); - $this->assertTrue($mess->hasHeader('X-Foo')); - $this->assertTrue($mess->hasHeader('X-FOO')); - } - - /** - * @return void - */ - public function testGetHeader() : void - { - $mess = (new Message)->withHeader('X-Foo', 'bar'); - - $this->assertSame(['bar'], $mess->getHeader('X-Foo')); - $this->assertSame([], $mess->getHeader('X-Bar')); - } - - /** - * @return void - */ - public function testGetHeaderCaseInsensitive() : void - { - $mess = (new Message)->withHeader('x-foo', 'bar'); - - $this->assertSame(['bar'], $mess->getHeader('x-foo')); - $this->assertSame(['bar'], $mess->getHeader('X-Foo')); - $this->assertSame(['bar'], $mess->getHeader('X-FOO')); - } - - /** - * @return void - */ - public function testGetHeaderWithSeveralValues() : void - { - $mess = (new Message)->withHeader('X-Foo', ['bar', 'baz', 'quux']); - - $this->assertSame(['bar', 'baz', 'quux'], $mess->getHeader('X-Foo')); - } - - /** - * @return void - */ - public function testGetHeaderLine() : void - { - $mess = (new Message)->withHeader('X-Foo', 'bar'); - - $this->assertSame('bar', $mess->getHeaderLine('X-Foo')); - $this->assertSame('', $mess->getHeaderLine('X-Bar')); - } - - /** - * @return void - */ - public function testGetHeaderLineCaseInsensitive() : void - { - $mess = (new Message)->withHeader('x-foo', 'bar'); - - $this->assertSame('bar', $mess->getHeaderLine('x-foo')); - $this->assertSame('bar', $mess->getHeaderLine('X-Foo')); - $this->assertSame('bar', $mess->getHeaderLine('X-FOO')); - } - - /** - * @return void - */ - public function testGetHeaderLineWithSeveralValues() : void - { - $mess = (new Message)->withHeader('X-Foo', ['bar', 'baz', 'quux']); - - $this->assertSame('bar, baz, quux', $mess->getHeaderLine('X-Foo')); - } - - /** - * @return void - */ - public function testBody() : void - { - $body = (new StreamFactory)->createStreamFromResource(\STDOUT); - $mess = new Message(); - $copy = $mess->withBody($body); - - $this->assertInstanceOf(MessageInterface::class, $copy); - $this->assertNotEquals($mess, $copy); - - $this->assertNotSame($body, $mess->getBody()); - - $this->assertSame($body, $copy->getBody()); - } - - /** - * @return array - */ - public function invalidProtocolVersionProvider() : array - { - return [ - [''], - ['.'], - ['1.'], - ['.1'], - ['1.1.'], - ['.1.1'], - ['1.1.1'], - ['a'], - ['a.'], - ['.a'], - ['a.a'], - ['HTTP/1.1'], - - [true], - [false], - [1], - [1.1], - [[]], - [new \stdClass], - [\STDOUT], - [null], - [function () { - }], - ]; - } - - /** - * @return array - */ - public function invalidHeaderNameProvider() : array - { - return [ - [''], - ['x foo'], - ['x-foo:'], - ["x\0foo"], - ["x\tfoo"], - ["x\rfoo"], - ["x\nfoo"], - - [true], - [false], - [1], - [1.1], - [[]], - [new \stdClass], - [\STDOUT], - [null], - [function () { - }], - ]; - } - - /** - * @return array - */ - public function invalidHeaderValueProvider() : array - { - return [ - ["field \0 value"], - ["field \r value"], - ["field \n value"], - [["field \0 value"]], - [["field \r value"]], - [["field \n value"]], - - [true], - [false], - [1], - [1.1], - [[]], - [new \stdClass], - [\STDOUT], - [null], - [function () { - }], - - [[true]], - [[false]], - [[1]], - [[1.1]], - [[[]]], - [[new \stdClass]], - [[\STDOUT]], - [[null]], - [[function () { - }]], - ]; - } -} diff --git a/vendor/sunrise/http-message/tests/RequestFactoryTest.php b/vendor/sunrise/http-message/tests/RequestFactoryTest.php deleted file mode 100644 index 914fbbe3..00000000 --- a/vendor/sunrise/http-message/tests/RequestFactoryTest.php +++ /dev/null @@ -1,86 +0,0 @@ -assertInstanceOf(RequestFactoryInterface::class, $factory); - } - - /** - * @return void - */ - public function testCreateRequest() : void - { - $method = 'POST'; - $uri = (new UriFactory)->createUri('/'); - $request = (new RequestFactory)->createRequest($method, $uri); - - $this->assertInstanceOf(RequestInterface::class, $request); - $this->assertSame($method, $request->getMethod()); - $this->assertSame($uri, $request->getUri()); - - $this->assertInstanceOf(StreamInterface::class, $request->getBody()); - $this->assertTrue($request->getBody()->isSeekable()); - $this->assertTrue($request->getBody()->isWritable()); - $this->assertTrue($request->getBody()->isReadable()); - $this->assertSame('php://temp', $request->getBody()->getMetadata('uri')); - } - - /** - * @return void - */ - public function testCreateRequestWithUriAsString() : void - { - $uri = 'http://user:password@localhost:3000/path?query#fragment'; - $request = (new RequestFactory)->createRequest('GET', $uri); - - $this->assertInstanceOf(UriInterface::class, $request->getUri()); - $this->assertSame($uri, (string) $request->getUri()); - } - - /** - * @return void - */ - public function testCreateJsonRequest() : void - { - $payload = ['foo' => '']; - $options = \JSON_HEX_TAG; - - $request = (new RequestFactory)->createJsonRequest('GET', '/foo', $payload, $options); - - $this->assertInstanceOf(RequestInterface::class, $request); - $this->assertSame('GET', $request->getMethod()); - $this->assertSame('/foo', (string) $request->getUri()); - $this->assertSame('application/json; charset=UTF-8', $request->getHeaderLine('Content-Type')); - $this->assertSame(\json_encode($payload, $options), (string) $request->getBody()); - } - - /** - * @return void - */ - public function testCreateJsonRequestWithInvalidJson() : void - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Maximum stack depth exceeded'); - - $request = (new RequestFactory)->createJsonRequest('GET', '/', [[]], 0, 1); - } -} diff --git a/vendor/sunrise/http-message/tests/RequestTest.php b/vendor/sunrise/http-message/tests/RequestTest.php deleted file mode 100644 index c5c06d9f..00000000 --- a/vendor/sunrise/http-message/tests/RequestTest.php +++ /dev/null @@ -1,357 +0,0 @@ -assertInstanceOf(Message::class, $mess); - $this->assertInstanceOf(RequestInterface::class, $mess); - } - - /** - * @return void - */ - public function testConstructor() : void - { - $method = 'POST'; - $uri = '/foo?bar'; - $headers = ['X-Foo' => ['bar', 'baz'], 'X-Bar' => ['baz']]; - $body = (new StreamFactory)->createStreamFromResource(\STDOUT); - $target = '/bar?baz'; - $protocol = '2.0'; - - $mess = new Request( - $method, - $uri, - $headers, - $body, - $target, - $protocol - ); - - $this->assertSame($method, $mess->getMethod()); - $this->assertSame('/foo', $mess->getUri()->getPath()); - $this->assertSame('bar', $mess->getUri()->getQuery()); - $this->assertSame($headers, $mess->getHeaders()); - $this->assertSame($body, $mess->getBody()); - $this->assertSame($target, $mess->getRequestTarget()); - $this->assertSame($protocol, $mess->getProtocolVersion()); - } - - /** - * @return void - */ - public function testMethod() : void - { - $mess = new Request(); - $copy = $mess->withMethod('POST'); - - $this->assertInstanceOf(Message::class, $copy); - $this->assertInstanceOf(RequestInterface::class, $copy); - $this->assertNotEquals($mess, $copy); - - $this->assertSame('GET', $mess->getMethod()); - - $this->assertSame('POST', $copy->getMethod()); - } - - /** - * @return void - */ - public function testLowercasedMethod() : void - { - $mess = (new Request)->withMethod('post'); - - $this->assertSame('POST', $mess->getMethod()); - } - - /** - * @return void - */ - public function testFigMethod($method) : void - { - $mess = (new Request)->withMethod($method); - - $this->assertSame($method, $mess->getMethod()); - } - - /** - * @return void - */ - public function testInvalidMethod($method) : void - { - $this->expectException(\InvalidArgumentException::class); - - (new Request)->withMethod($method); - } - - /** - * @return void - */ - public function testRequestTarget() : void - { - $mess = new Request(); - $copy = $mess->withRequestTarget('/path?query'); - - $this->assertInstanceOf(Message::class, $copy); - $this->assertInstanceOf(RequestInterface::class, $copy); - $this->assertNotEquals($mess, $copy); - - $this->assertSame('/', $mess->getRequestTarget()); - - $this->assertSame('/path?query', $copy->getRequestTarget()); - } - - /** - * @return void - */ - public function testRequestTargetWithDifferentUriForms($requestTarget) : void - { - $mess = (new Request)->withRequestTarget($requestTarget); - - $this->assertSame($requestTarget, $mess->getRequestTarget()); - } - - /** - * @return void - */ - public function testInvalidRequestTarget($requestTarget) : void - { - $this->expectException(\InvalidArgumentException::class); - - (new Request)->withRequestTarget($requestTarget); - } - - /** - * @return void - */ - public function testGetRequestTargetHavingUriWithoutPath() : void - { - $uri = (new UriFactory)->createUri('http://localhost'); - $mess = (new Request)->withUri($uri); - - $this->assertSame('/', $mess->getRequestTarget()); - } - - /** - * @return void - */ - public function testGetRequestTargetHavingUriWithNotAbsolutePath() : void - { - $uri = (new UriFactory)->createUri('not/absolute/path?query'); - $mess = (new Request)->withUri($uri); - - $this->assertSame('/', $mess->getRequestTarget()); - } - - /** - * @return void - */ - public function testGetRequestTargetHavingUriWithAbsolutePath() : void - { - $uri = (new UriFactory)->createUri('/path'); - $mess = (new Request)->withUri($uri); - - $this->assertSame('/path', $mess->getRequestTarget()); - } - - /** - * @return void - */ - public function testGetRequestTargetHavingUriWithAbsolutePathAndQuery() : void - { - $uri = (new UriFactory)->createUri('/path?query'); - $mess = (new Request)->withUri($uri); - - $this->assertSame('/path?query', $mess->getRequestTarget()); - } - - /** - * @return void - */ - public function testGetRequestTargetIgnoringNewUri() : void - { - $uri = (new UriFactory)->createUri('/new'); - $mess = (new Request)->withRequestTarget('/primary')->withUri($uri); - - $this->assertSame('/primary', $mess->getRequestTarget()); - } - - /** - * @return void - */ - public function testUri() : void - { - $uri = (new UriFactory)->createUri('/'); - $mess = new Request(); - $copy = $mess->withUri($uri); - - $this->assertInstanceOf(Message::class, $copy); - $this->assertInstanceOf(RequestInterface::class, $copy); - $this->assertNotEquals($mess, $copy); - - $this->assertNotSame($uri, $mess->getUri()); - - $this->assertSame($uri, $copy->getUri()); - } - - /** - * @return void - */ - public function testUriWithAssigningHostHeaderFromUriHost() : void - { - $uri = (new UriFactory)->createUri('http://localhost'); - $mess = (new Request)->withUri($uri); - - $this->assertSame($uri->getHost(), $mess->getHeaderLine('host')); - } - - /** - * @return void - */ - public function testUriWithAssigningHostHeaderFromUriHostAndPort() : void - { - $uri = (new UriFactory)->createUri('http://localhost:3000'); - $mess = (new Request)->withUri($uri); - - $this->assertSame($uri->getHost() . ':' . $uri->getPort(), $mess->getHeaderLine('host')); - } - - /** - * @return void - */ - public function testUriWithReplacingHostHeaderFromUri() : void - { - $uri = (new UriFactory)->createUri('http://localhost'); - $mess = (new Request)->withHeader('host', 'example.com')->withUri($uri); - - $this->assertSame($uri->getHost(), $mess->getHeaderLine('host')); - } - - /** - * @return void - */ - public function testUriWithPreservingHostHeader() : void - { - $uri = (new UriFactory)->createUri('http://localhost'); - $mess = (new Request)->withHeader('host', 'example.com')->withUri($uri, true); - - $this->assertSame('example.com', $mess->getHeaderLine('host')); - } - - /** - * @return void - */ - public function testUriWithPreservingHostHeaderIfItIsEmpty() : void - { - $uri = (new UriFactory)->createUri('http://localhost'); - $mess = (new Request)->withUri($uri, true); - - $this->assertSame($uri->getHost(), $mess->getHeaderLine('host')); - } - - /** - * @return array - */ - public function figMethodProvider() : array - { - return [ - ['HEAD'], - ['GET'], - ['POST'], - ['PUT'], - ['PATCH'], - ['DELETE'], - ['PURGE'], - ['OPTIONS'], - ['TRACE'], - ['CONNECT'], - ]; - } - - /** - * @return array - */ - public function invalidMethodProvider() : array - { - return [ - [''], - ["BAR\0BAZ"], - ["BAR\tBAZ"], - ["BAR\nBAZ"], - ["BAR\rBAZ"], - ["BAR BAZ"], - ["BAR,BAZ"], - - [true], - [false], - [1], - [1.1], - [[]], - [new \stdClass], - [\STDOUT], - [null], - [function () { - }], - ]; - } - - /** - * @return array - */ - public function invalidRequestTargetProvider() : array - { - return [ - [''], - ["/path\0/"], - ["/path\t/"], - ["/path\n/"], - ["/path\r/"], - ["/path /"], - - [true], - [false], - [1], - [1.1], - [[]], - [new \stdClass], - [\STDOUT], - [null], - [function () { - }], - ]; - } - - /** - * @return array - */ - public function uriFormProvider() : array - { - return [ - - ['/path?query'], - - ['http://localhost/path?query'], - - ['localhost:3000'], - - ['*'], - ]; - } -} diff --git a/vendor/sunrise/http-message/tests/ResponseFactoryTest.php b/vendor/sunrise/http-message/tests/ResponseFactoryTest.php deleted file mode 100644 index da645859..00000000 --- a/vendor/sunrise/http-message/tests/ResponseFactoryTest.php +++ /dev/null @@ -1,91 +0,0 @@ -assertInstanceOf(ResponseFactoryInterface::class, $factory); - } - - /** - * @return void - */ - public function testCreateResponse() : void - { - $statusCode = 204; - $reasonPhrase = 'No Content'; - - $response = (new ResponseFactory) - ->createResponse($statusCode, $reasonPhrase); - - $this->assertInstanceOf(ResponseInterface::class, $response); - $this->assertSame($statusCode, $response->getStatusCode()); - $this->assertSame($reasonPhrase, $response->getReasonPhrase()); - - $this->assertInstanceOf(StreamInterface::class, $response->getBody()); - $this->assertTrue($response->getBody()->isSeekable()); - $this->assertTrue($response->getBody()->isWritable()); - $this->assertTrue($response->getBody()->isReadable()); - $this->assertSame('php://temp', $response->getBody()->getMetadata('uri')); - } - - /** - * @return void - */ - public function testCreateHtmlResponse() : void - { - $content = '
foo bar
'; - - $response = (new ResponseFactory) - ->createHtmlResponse(400, $content); - - $this->assertInstanceOf(ResponseInterface::class, $response); - $this->assertSame(400, $response->getStatusCode()); - $this->assertSame('text/html; charset=UTF-8', $response->getHeaderLine('Content-Type')); - $this->assertSame($content, (string) $response->getBody()); - } - - /** - * @return void - */ - public function testCreateJsonResponse() : void - { - $payload = ['foo' => '']; - $options = \JSON_HEX_TAG; - - $response = (new ResponseFactory) - ->createJsonResponse(400, $payload, $options); - - $this->assertInstanceOf(ResponseInterface::class, $response); - $this->assertSame(400, $response->getStatusCode()); - $this->assertSame('application/json; charset=UTF-8', $response->getHeaderLine('Content-Type')); - $this->assertSame(\json_encode($payload, $options), (string) $response->getBody()); - } - - /** - * @return void - */ - public function testCreateResponseWithInvalidJson() : void - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Maximum stack depth exceeded'); - - $response = (new ResponseFactory) - ->createJsonResponse(200, [[]], 0, 1); - } -} diff --git a/vendor/sunrise/http-message/tests/ResponseTest.php b/vendor/sunrise/http-message/tests/ResponseTest.php deleted file mode 100644 index 3e88163e..00000000 --- a/vendor/sunrise/http-message/tests/ResponseTest.php +++ /dev/null @@ -1,152 +0,0 @@ -assertInstanceOf(Message::class, $mess); - $this->assertInstanceOf(ResponseInterface::class, $mess); - } - - /** - * @return void - */ - public function testStatus() : void - { - $mess = new Response(); - $copy = $mess->withStatus(204); - - $this->assertInstanceOf(Message::class, $copy); - $this->assertInstanceOf(ResponseInterface::class, $copy); - $this->assertNotEquals($mess, $copy); - - $this->assertSame(200, $mess->getStatusCode()); - $this->assertSame(REASON_PHRASES[200], $mess->getReasonPhrase()); - - $this->assertSame(204, $copy->getStatusCode()); - $this->assertSame(REASON_PHRASES[204], $copy->getReasonPhrase()); - } - - /** - * @return void - */ - public function testFigStatus($statusCode, $reasonPhrase) : void - { - $mess = (new Response)->withStatus($statusCode); - - $this->assertSame($statusCode, $mess->getStatusCode()); - $this->assertSame($reasonPhrase, $mess->getReasonPhrase()); - } - - /** - * @return void - */ - public function testInvalidStatusCode($statusCode) : void - { - $this->expectException(\InvalidArgumentException::class); - - (new Response)->withStatus($statusCode); - } - - /** - * @return void - */ - public function testUnknownStatusCode() : void - { - $mess = (new Response)->withStatus(599); - - $this->assertSame('Unknown Status Code', $mess->getReasonPhrase()); - } - - /** - * @return void - */ - public function testInvalidReasonPhrase($reasonPhrase) : void - { - $this->expectException(\InvalidArgumentException::class); - - (new Response)->withStatus(200, $reasonPhrase); - } - - /** - * @return void - */ - public function testCustomReasonPhrase() : void - { - $mess = (new Response)->withStatus(200, 'test'); - - $this->assertSame('test', $mess->getReasonPhrase()); - } - - /** - * @return array - */ - public function figStatusProvider() : array - { - return [ - [200, REASON_PHRASES[200] ?? ''], - ]; - } - - /** - * @return array - */ - public function invalidStatusCodeProvider() : array - { - return [ - [0], - [99], - [600], - - [true], - [false], - ['100'], - [100.0], - [[]], - [new \stdClass], - [\STDOUT], - [null], - [function () { - }], - ]; - } - - /** - * @return array - */ - public function invalidReasonPhraseProvider() : array - { - return [ - ["bar\0baz"], - ["bar\nbaz"], - ["bar\rbaz"], - - [true], - [false], - [1], - [1.1], - [[]], - [new \stdClass], - [\STDOUT], - [null], - [function () { - }], - ]; - } -} diff --git a/vendor/sunrise/http-server-request/.gitignore b/vendor/sunrise/http-server-request/.gitignore deleted file mode 100644 index a6bde413..00000000 --- a/vendor/sunrise/http-server-request/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -/.php_cs.cache -/.phpunit.result.cache -/composer.lock -/coverage.xml -/phpbench.json -/phpcs.xml -/phpunit.xml -/psalm.xml -/vendor/ diff --git a/vendor/sunrise/http-server-request/composer.json b/vendor/sunrise/http-server-request/composer.json index db43ce11..412ebaac 100644 --- a/vendor/sunrise/http-server-request/composer.json +++ b/vendor/sunrise/http-server-request/composer.json @@ -21,7 +21,7 @@ "homepage": "https://github.com/fenric" }, { - "name": "李昀陞 (Peter)", + "name": "\u674e\u6600\u965e (Peter)", "email": "peter279k@gmail.com", "homepage": "https://github.com/peter279k" } @@ -71,5 +71,6 @@ "XDEBUG_MODE=coverage phpunit --coverage-html coverage/" ] }, - "abandoned": "sunrise/http-message" + "abandoned": "sunrise/http-message", + "version": "v2.2.2" } diff --git a/vendor/sunrise/http-server-request/tests/AbstractTestCase.php b/vendor/sunrise/http-server-request/tests/AbstractTestCase.php deleted file mode 100644 index e8459b05..00000000 --- a/vendor/sunrise/http-server-request/tests/AbstractTestCase.php +++ /dev/null @@ -1,21 +0,0 @@ -createStreamFromTemporaryFile($contents); - } -} diff --git a/vendor/sunrise/http-server-request/tests/ServerRequestFactoryTest.php b/vendor/sunrise/http-server-request/tests/ServerRequestFactoryTest.php deleted file mode 100644 index 1a885fb9..00000000 --- a/vendor/sunrise/http-server-request/tests/ServerRequestFactoryTest.php +++ /dev/null @@ -1,338 +0,0 @@ -assertInstanceOf(ServerRequestFactoryInterface::class, $factory); - } - - /** - * @return void - */ - public function testCreateServerRequest() : void - { - $verb = 'GET'; - $uri = 'http://localhost:8000/'; - - $serverParams = []; - $serverParams['HTTP_X_FOO'] = 'bar'; - $serverParams['SERVER_PROTOCOL'] = 'HTTP/1.0'; - - $expectedHeaders = ['X-Foo' => ['bar'], 'Host' => ['localhost:8000']]; - $expectedProtocolVersion = '1.0'; - - $request = (new ServerRequestFactory)->createServerRequest($verb, $uri, $serverParams); - - $this->assertInstanceOf(ServerRequestInterface::class, $request); - $this->assertSame($verb, $request->getMethod()); - $this->assertSame($uri, (string) $request->getUri()); - $this->assertSame($serverParams, $request->getServerParams()); - $this->assertSame($expectedHeaders, $request->getHeaders()); - $this->assertSame($expectedProtocolVersion, $request->getProtocolVersion()); - $this->assertInstanceOf(StreamInterface::class, $request->getBody()); - $this->assertTrue($request->getBody()->isSeekable()); - $this->assertTrue($request->getBody()->isWritable()); - $this->assertTrue($request->getBody()->isReadable()); - $this->assertSame('php://temp', $request->getBody()->getMetadata('uri')); - } - - /** - * @return void - */ - public function testCreateServerRequestFromGlobals() : void - { - $_SERVER = ['foo' => 'bar']; - $_GET = ['bar' => 'baz']; - $_POST = ['baz' => 'bat']; - $_COOKIE = ['bat' => 'qux']; - - $_FILES['foo']['tmp_name'] = \sys_get_temp_dir() . '/c3036cb9-3806-47e2-b193-2a1ca505b7dd'; - $_FILES['foo']['size'] = 100; - $_FILES['foo']['error'] = \UPLOAD_ERR_OK; - $_FILES['foo']['name'] = '8832d847-fe04-4e86-b933-9e74d109cd9b'; - $_FILES['foo']['type'] = '3a7b7995-2900-4834-b165-1de8ede90587'; - - $_FILES['bar']['tmp_name'][0] = \sys_get_temp_dir() . '/bed3c541-b32b-44c7-9abe-1c72d182060e'; - $_FILES['bar']['size'][0] = 200; - $_FILES['bar']['error'][0] = \UPLOAD_ERR_OK; - $_FILES['bar']['name'][0] = '4e7d2e48-90f4-477c-8859-5f69d29835c4'; - $_FILES['bar']['type'][0] = 'c53d3703-63d7-409a-822c-6ee1424023b2'; - - try { - \fclose(\fopen($_FILES['foo']['tmp_name'], 'w+')); - \fclose(\fopen($_FILES['bar']['tmp_name'][0], 'w+')); - - $request = ServerRequestFactory::fromGlobals(); - $this->assertInstanceOf(ServerRequestInterface::class, $request); - - $this->assertSame($_SERVER, $request->getServerParams()); - $this->assertSame($_GET, $request->getQueryParams()); - $this->assertSame($_POST, $request->getParsedBody()); - $this->assertSame($_COOKIE, $request->getCookieParams()); - - $uploadedFiles = $request->getUploadedFiles(); - - $this->assertSame($_FILES['foo']['tmp_name'], $uploadedFiles['foo']->getStream()->getMetadata('uri')); - $this->assertSame($_FILES['foo']['size'], $uploadedFiles['foo']->getSize()); - $this->assertSame($_FILES['foo']['error'], $uploadedFiles['foo']->getError()); - $this->assertSame($_FILES['foo']['name'], $uploadedFiles['foo']->getClientFilename()); - $this->assertSame($_FILES['foo']['type'], $uploadedFiles['foo']->getClientMediaType()); - - $this->assertSame($_FILES['bar']['tmp_name'][0], $uploadedFiles['bar'][0]->getStream()->getMetadata('uri')); - $this->assertSame($_FILES['bar']['size'][0], $uploadedFiles['bar'][0]->getSize()); - $this->assertSame($_FILES['bar']['error'][0], $uploadedFiles['bar'][0]->getError()); - $this->assertSame($_FILES['bar']['name'][0], $uploadedFiles['bar'][0]->getClientFilename()); - $this->assertSame($_FILES['bar']['type'][0], $uploadedFiles['bar'][0]->getClientMediaType()); - } finally { - \file_exists($_FILES['foo']['tmp_name']) and \unlink($_FILES['foo']['tmp_name']); - \file_exists($_FILES['bar']['tmp_name'][0]) and \unlink($_FILES['bar']['tmp_name'][0]); - } - } - - /** - * @return void - */ - public function testCreateServerRequestFromGlobalsWithServerParams() : void - { - $serverParams = ['foo' => 'bar']; - $request = ServerRequestFactory::fromGlobals($serverParams, [], [], [], []); - $this->assertSame($serverParams, $request->getServerParams()); - } - - /** - * @return void - */ - public function testCreateServerRequestFromGlobalsWithQueryParams() : void - { - $queryParams = ['foo' => 'bar']; - $request = ServerRequestFactory::fromGlobals([], $queryParams, [], [], []); - $this->assertSame($queryParams, $request->getQueryParams()); - } - - /** - * @return void - */ - public function testCreateServerRequestFromGlobalsWithCookieParams() : void - { - $cookieParams = ['foo' => 'bar']; - $request = ServerRequestFactory::fromGlobals([], [], $cookieParams, [], []); - $this->assertSame($cookieParams, $request->getCookieParams()); - } - - /** - * @return void - */ - public function testCreateServerRequestFromGlobalsWithParsedBody() : void - { - $parsedBody = ['foo' => 'bar']; - $request = ServerRequestFactory::fromGlobals([], [], [], [], $parsedBody); - $this->assertSame($parsedBody, $request->getParsedBody()); - } - - /** - * @return void - */ - public function testCreateServerRequestFromGlobalsWithUploadErrorNoFile() : void - { - $files = [ - 'foo' => [ - 'error' => \UPLOAD_ERR_NO_FILE, - 'size' => 0, - 'tmp_name' => '/d4496a36-6b57-4956-a627-04f1603b57d7', - 'name' => '12e3ee6c-7ba7-432a-88d7-8d15405cfeb8', - 'type' => 'f01cbcd9-9112-4267-8309-b41daf6da57f', - ], - ]; - - $request = ServerRequestFactory::fromGlobals([], [], [], [], $files); - - $this->assertCount(0, $request->getUploadedFiles()); - } - - /** - * @param mixed $expectedValue - * @param string|null $key - * @return void - */ - public function testHeadersFromGlobals($serverParams, $expectedValue, $key = null) : void - { - $request = ServerRequestFactory::fromGlobals($serverParams); - $this->assertSame($expectedValue, $request->getHeader($key ?? 'foo')); - } - - /** - * @param mixed $expectedValue - * @return void - */ - public function testProtocolVersionFromGlobals($serverParams, $expectedValue) : void - { - $request = ServerRequestFactory::fromGlobals($serverParams); - $this->assertSame($expectedValue, $request->getProtocolVersion()); - } - - /** - * @param mixed $expectedValue - * @return void - */ - public function testMethodFromGlobals($serverParams, $expectedValue) : void - { - $request = ServerRequestFactory::fromGlobals($serverParams); - $this->assertSame($expectedValue, $request->getMethod()); - } - - /** - * @param mixed $expectedValue - * @return void - */ - public function testUriFromGlobals($serverParams, $expectedValue) : void - { - $request = ServerRequestFactory::fromGlobals($serverParams); - $this->assertSame($expectedValue, (string) $request->getUri()); - } - - /** - * @return array - */ - public function headersFromGlobalsProvider() : array - { - return [ - [ - ['FOO' => 'bar'], - [], - ], - [ - ['HTTP_FOO' => 'bar'], - ['bar'], - ], - [ - ['CONTENT_LENGTH' => '100'], - ['100'], - 'Content-Length', - ], - [ - ['CONTENT_TYPE' => 'application/json'], - ['application/json'], - 'Content-Type', - ], - ]; - } - - /** - * @return array - */ - public function protocolVersionFromGlobalsProvider() : array - { - return [ - [ - ['SERVER_PROTOCOL' => 'HTTP/1.0'], - '1.0', - ], - [ - ['SERVER_PROTOCOL' => 'HTTP/1.1'], - '1.1', - ], - [ - ['SERVER_PROTOCOL' => 'HTTP/2'], - '2', - ], - [ - ['SERVER_PROTOCOL' => 'oO'], - '1.1', - ], - ]; - } - - /** - * @return array - */ - public function methodFromGlobalsProvider() : array - { - return [ - [ - ['REQUEST_METHOD' => 'POST'], - 'POST', - ], - [ - ['REQUEST_METHOD' => 'UNKNOWN'], - 'UNKNOWN', - ], - ]; - } - - /** - * @return array - */ - public function uriFromGlobalsProvider() : array - { - return [ - [ - [], - 'http://localhost/', - ], - [ - ['HTTPS' => 'off'], - 'http://localhost/', - ], - [ - ['HTTPS' => 'on'], - 'https://localhost/', - ], - [ - ['HTTP_HOST' => 'example.com'], - 'http://example.com/', - ], - [ - ['HTTP_HOST' => 'example.com:3000'], - 'http://example.com:3000/', - ], - [ - ['SERVER_NAME' => 'example.com'], - 'http://example.com/', - ], - [ - ['SERVER_NAME' => 'example.com', 'SERVER_PORT' => 3000], - 'http://example.com:3000/', - ], - [ - ['SERVER_PORT' => 3000], - 'http://localhost/', - ], - [ - ['REQUEST_URI' => '/path'], - 'http://localhost/path', - ], - [ - ['REQUEST_URI' => '/path?query'], - 'http://localhost/path?query', - ], - [ - ['PHP_SELF' => '/path'], - 'http://localhost/path', - ], - [ - ['PHP_SELF' => '/path', 'QUERY_STRING' => 'query'], - 'http://localhost/path?query', - ], - [ - ['QUERY_STRING' => 'query'], - 'http://localhost/', - ], - ]; - } -} diff --git a/vendor/sunrise/http-server-request/tests/ServerRequestTest.php b/vendor/sunrise/http-server-request/tests/ServerRequestTest.php deleted file mode 100644 index a32acc39..00000000 --- a/vendor/sunrise/http-server-request/tests/ServerRequestTest.php +++ /dev/null @@ -1,230 +0,0 @@ -assertInstanceOf(Request::class, $request); - $this->assertInstanceOf(ServerRequestInterface::class, $request); - } - - /** - * @return void - */ - public function testConstructor() : void - { - $stream = $this->createStream(); - $uploadedFile = new UploadedFile($stream); - - $dataset = [ - - 'POST', - - 'http://localhost:8000/foo?bar', - - ['X-Foo' => 'bar'], - - $stream, - - '/bar?baz', - - '2.0', - - ['foo' => 'bar'], - - ['bar' => 'baz'], - - ['baz' => 'bat'], - - ['bat' => $uploadedFile], - - ['qux' => 'quux'], - - ['quux' => 'quuux'], - ]; - - $request = new ServerRequest(...$dataset); - - $this->assertSame($dataset[0], $request->getMethod()); - $this->assertSame($dataset[1], (string) $request->getUri()); - $this->assertSame($dataset[2]['X-Foo'], $request->getHeaderLine('X-Foo')); - $this->assertSame($dataset[3], $request->getBody()); - $this->assertSame($dataset[4], $request->getRequestTarget()); - $this->assertSame($dataset[5], $request->getProtocolVersion()); - $this->assertSame($dataset[6], $request->getServerParams()); - $this->assertSame($dataset[7], $request->getQueryParams()); - $this->assertSame($dataset[8], $request->getCookieParams()); - $this->assertSame($dataset[9], $request->getUploadedFiles()); - $this->assertSame($dataset[10], $request->getParsedBody()); - $this->assertSame($dataset[11], $request->getAttributes()); - } - - /** - * @return void - */ - public function testConstructorWithInvalidUploadedFiles() : void - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid uploaded files'); - - new ServerRequest(null, null, null, null, null, null, [], [], [], ['foo' => 'bar']); - } - - /** - * @return void - */ - public function testConstructorWithInvalidParsedBody() : void - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid parsed body'); - - new ServerRequest(null, null, null, null, null, null, [], [], [], [], \STDOUT); - } - - /** - * @return void - */ - public function testSetQueryParams() : void - { - $queryParams = ['foo' => 'bar']; - - $request = new ServerRequest(); - $this->assertSame([], $request->getQueryParams()); - - $clone = $request->withQueryParams($queryParams); - $this->assertInstanceOf(ServerRequestInterface::class, $clone); - $this->assertNotSame($request, $clone); - $this->assertSame([], $request->getQueryParams()); - $this->assertSame($queryParams, $clone->getQueryParams()); - } - - /** - * @return void - */ - public function testSetCookieParams() : void - { - $cookieParams = ['foo' => 'bar']; - - $request = new ServerRequest(); - $this->assertSame([], $request->getCookieParams()); - - $clone = $request->withCookieParams($cookieParams); - $this->assertInstanceOf(ServerRequestInterface::class, $clone); - $this->assertNotSame($request, $clone); - $this->assertSame([], $request->getCookieParams()); - $this->assertSame($cookieParams, $clone->getCookieParams()); - } - - /** - * @return void - */ - public function testSetUploadedFiles() : void - { - $uploadedFiles = []; - - $stream = $this->createStream(); - $uploadedFile = new UploadedFile($stream); - $uploadedFiles['foo'] = $uploadedFile; - - $request = new ServerRequest(); - $this->assertSame([], $request->getUploadedFiles()); - - $clone = $request->withUploadedFiles($uploadedFiles); - $this->assertInstanceOf(ServerRequestInterface::class, $clone); - $this->assertNotSame($request, $clone); - $this->assertSame([], $request->getUploadedFiles()); - $this->assertSame($uploadedFiles, $clone->getUploadedFiles()); - } - - /** - * @return void - */ - public function testSetInvalidUploadedFiles() : void - { - $request = new ServerRequest(); - - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid uploaded files'); - - $request->withUploadedFiles(['foo' => 'bar']); - } - - /** - * @return void - */ - public function testSetParsedBody() : void - { - $parsedBody = ['foo' => 'bar']; - - $request = new ServerRequest(); - $this->assertNull($request->getParsedBody()); - - $clone = $request->withParsedBody($parsedBody); - $this->assertInstanceOf(ServerRequestInterface::class, $clone); - $this->assertNotSame($request, $clone); - $this->assertNull($request->getParsedBody()); - $this->assertSame($parsedBody, $clone->getParsedBody()); - } - - /** - * @return void - */ - public function testSetInvalidParsedBody() : void - { - $request = new ServerRequest(); - - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid parsed body'); - - $request->withParsedBody(\STDOUT); - } - - /** - * @return void - */ - public function testSetAttributes() : void - { - $request = new ServerRequest(); - $this->assertSame([], $request->getAttributes()); - $this->assertNull($request->getAttribute('foo')); - $this->assertFalse($request->getAttribute('foo', false)); - - $clone = $request->withAttribute('foo', 'bar'); - $this->assertInstanceOf(ServerRequestInterface::class, $clone); - $this->assertNotSame($request, $clone); - $this->assertSame([], $request->getAttributes()); - $this->assertNull($request->getAttribute('foo')); - $this->assertSame(['foo' => 'bar'], $clone->getAttributes()); - $this->assertSame('bar', $clone->getAttribute('foo')); - } - - /** - * @return void - */ - public function testRemoveAttributes() : void - { - $request = (new ServerRequest)->withAttribute('foo', 'bar'); - - $clone = $request->withoutAttribute('foo'); - $this->assertInstanceOf(ServerRequestInterface::class, $clone); - $this->assertNotSame($request, $clone); - $this->assertSame(['foo' => 'bar'], $request->getAttributes()); - $this->assertSame('bar', $request->getAttribute('foo')); - $this->assertSame([], $clone->getAttributes()); - $this->assertNull($clone->getAttribute('foo')); - } -} diff --git a/vendor/sunrise/http-server-request/tests/UploadedFileFactoryTest.php b/vendor/sunrise/http-server-request/tests/UploadedFileFactoryTest.php deleted file mode 100644 index 03196350..00000000 --- a/vendor/sunrise/http-server-request/tests/UploadedFileFactoryTest.php +++ /dev/null @@ -1,64 +0,0 @@ -assertInstanceOf(UploadedFileFactoryInterface::class, $factory); - } - - /** - * @return void - */ - public function testCreateUploadedFile() : void - { - $stream = $this->createStream(); - $uploadedFile = (new UploadedFileFactory)->createUploadedFile($stream); - - $this->assertInstanceOf(UploadedFileInterface::class, $uploadedFile); - $this->assertSame($stream, $uploadedFile->getStream()); - $this->assertNull($uploadedFile->getSize()); - $this->assertSame(\UPLOAD_ERR_OK, $uploadedFile->getError()); - $this->assertNull($uploadedFile->getClientFilename()); - $this->assertNull($uploadedFile->getClientMediaType()); - } - - /** - * @return void - */ - public function testCreateUploadedFileWithOptionalParameters() : void - { - $stream = $this->createStream(); - $size = 42; - $error = \UPLOAD_ERR_OK; - $filename = '47ce46d2-9b62-431e-81e0-de9064f59ce6'; - $mediatype = 'f769a887-2d5a-4d02-8afd-0e140d9a6b88'; - - $uploadedFile = (new UploadedFileFactory)->createUploadedFile( - $stream, - $size, - $error, - $filename, - $mediatype - ); - - $this->assertSame($stream, $uploadedFile->getStream()); - $this->assertSame($size, $uploadedFile->getSize()); - $this->assertSame($error, $uploadedFile->getError()); - $this->assertSame($filename, $uploadedFile->getClientFilename()); - $this->assertSame($mediatype, $uploadedFile->getClientMediaType()); - } -} diff --git a/vendor/sunrise/http-server-request/tests/UploadedFileTest.php b/vendor/sunrise/http-server-request/tests/UploadedFileTest.php deleted file mode 100644 index a0693cb2..00000000 --- a/vendor/sunrise/http-server-request/tests/UploadedFileTest.php +++ /dev/null @@ -1,183 +0,0 @@ -createStream(); - $uploadedFile = new UploadedFile($stream); - - $this->assertInstanceOf(UploadedFileInterface::class, $uploadedFile); - $this->assertSame($stream, $uploadedFile->getStream()); - $this->assertNull($uploadedFile->getSize()); - $this->assertSame(\UPLOAD_ERR_OK, $uploadedFile->getError()); - $this->assertNull($uploadedFile->getClientFilename()); - $this->assertNull($uploadedFile->getClientMediaType()); - } - - /** - * @return void - */ - public function testConstructorWithOptionalParameters() : void - { - $stream = $this->createStream(); - $uploadedFile = new UploadedFile($stream, 42, \UPLOAD_ERR_OK, 'foo', 'bar'); - - $this->assertInstanceOf(UploadedFileInterface::class, $uploadedFile); - $this->assertSame($stream, $uploadedFile->getStream()); - $this->assertSame(42, $uploadedFile->getSize()); - $this->assertSame(\UPLOAD_ERR_OK, $uploadedFile->getError()); - $this->assertSame('foo', $uploadedFile->getClientFilename()); - $this->assertSame('bar', $uploadedFile->getClientMediaType()); - } - - /** - * @return void - */ - public function testConstructorWithInvalidFile() : void - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid uploaded file'); - - new UploadedFile(null); - } - - /** - * @return void - */ - public function testMove() : void - { - $stream = $this->createStream('foo'); - $uploadedFile = new UploadedFile($stream); - $targetPath = $this->createStream()->getMetadata('uri'); - $uploadedFile->moveTo($targetPath); - - $this->assertStringEqualsFile($targetPath, 'foo'); - } - - /** - * @return void - */ - public function testReWrite() : void - { - $stream = $this->createStream('foo'); - $uploadedFile = new UploadedFile($stream); - $targetPath = $this->createStream('bar')->getMetadata('uri'); - $uploadedFile->moveTo($targetPath); - - $this->assertStringEqualsFile($targetPath, 'foo'); - } - - /** - * @return void - */ - public function testMoveWithError($error) : void - { - $stream = $this->createStream(); - $uploadedFile = new UploadedFile($stream, null, $error); - - $this->expectException(\RuntimeException::class); - $this->expectExceptionMessage(\sprintf( - 'The uploaded file cannot be moved due to the error #%d (%s)', - $error, - UPLOAD_ERRORS[$error] ?? 'Unknown error' - )); - - $uploadedFile->moveTo('/'); - } - - /** - * @return void - */ - public function testReMove() : void - { - $stream = $this->createStream(); - $uploadedFile = new UploadedFile($stream); - $targetPath = $this->createStream()->getMetadata('uri'); - $uploadedFile->moveTo($targetPath); - - $this->expectException(\RuntimeException::class); - $this->expectExceptionMessage('The uploaded file already moved'); - - $uploadedFile->moveTo('/'); - } - - /** - * @return void - */ - public function testMoveToNowhere() : void - { - $stream = $this->createStream(); - $uploadedFile = new UploadedFile($stream); - - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('The uploaded file cannot be moved because the directory "/" is not available'); - - $uploadedFile->moveTo('/'); - } - - /** - * @return void - */ - public function testGetMovedStream() : void - { - $stream = $this->createStream(); - $uploadedFile = new UploadedFile($stream); - - $targetPath = $this->createStream()->getMetadata('uri'); - $uploadedFile->moveTo($targetPath); - - $this->expectException(\RuntimeException::class); - $this->expectExceptionMessage('The uploaded file already moved'); - - $uploadedFile->getStream(); - } - - /** - * @return void - */ - public function testGetStreamWithError($error) : void - { - $stream = $this->createStream(); - $uploadedFile = new UploadedFile($stream, null, $error); - - $this->expectException(\RuntimeException::class); - $this->expectExceptionMessage(\sprintf( - 'The uploaded file has no a stream due to the error #%d (%s)', - $error, - UPLOAD_ERRORS[$error] ?? 'Unknown error' - )); - - $uploadedFile->getStream(); - } - - /** - * @return array - */ - public function errorCodeProvider() : array - { - return [ - [\UPLOAD_ERR_INI_SIZE], - [\UPLOAD_ERR_FORM_SIZE], - [\UPLOAD_ERR_PARTIAL], - [\UPLOAD_ERR_NO_FILE], - [\UPLOAD_ERR_NO_TMP_DIR], - [\UPLOAD_ERR_CANT_WRITE], - [\UPLOAD_ERR_EXTENSION], - ]; - } -} diff --git a/vendor/sunrise/stream/.gitignore b/vendor/sunrise/stream/.gitignore deleted file mode 100644 index a6bde413..00000000 --- a/vendor/sunrise/stream/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -/.php_cs.cache -/.phpunit.result.cache -/composer.lock -/coverage.xml -/phpbench.json -/phpcs.xml -/phpunit.xml -/psalm.xml -/vendor/ diff --git a/vendor/sunrise/stream/composer.json b/vendor/sunrise/stream/composer.json index 9f9e51fc..70b53bbd 100644 --- a/vendor/sunrise/stream/composer.json +++ b/vendor/sunrise/stream/composer.json @@ -20,7 +20,7 @@ "homepage": "https://github.com/fenric" }, { - "name": "李昀陞 (Peter)", + "name": "\u674e\u6600\u965e (Peter)", "email": "peter279k@gmail.com", "homepage": "https://github.com/peter279k" } @@ -53,5 +53,6 @@ "XDEBUG_MODE=coverage phpunit --coverage-html coverage/" ] }, - "abandoned": "sunrise/http-message" + "abandoned": "sunrise/http-message", + "version": "v1.3.4" } diff --git a/vendor/sunrise/stream/tests/StreamFactoryTest.php b/vendor/sunrise/stream/tests/StreamFactoryTest.php deleted file mode 100644 index 15ca1880..00000000 --- a/vendor/sunrise/stream/tests/StreamFactoryTest.php +++ /dev/null @@ -1,59 +0,0 @@ -assertInstanceOf(StreamFactoryInterface::class, $factory); - } - - public function testCreateStream() - { - $stream = (new StreamFactory)->createStream('065036e5-ea69-460a-9491-01f85289ab92'); - $this->assertInstanceOf(StreamInterface::class, $stream); - $this->assertTrue($stream->isReadable()); - $this->assertTrue($stream->isWritable()); - $this->assertEquals('php://temp', $stream->getMetadata('uri')); - $this->assertEquals(0, $stream->tell()); - $this->assertEquals('065036e5-ea69-460a-9491-01f85289ab92', (string) $stream); - $stream->close(); - } - - public function testCreateStreamFromFile() - { - $stream = (new StreamFactory)->createStreamFromFile('php://memory', 'r+b'); - $this->assertInstanceOf(StreamInterface::class, $stream); - $stream->close(); - } - - public function testCreateStreamFromResource() - { - $stream = (new StreamFactory)->createStreamFromResource(\fopen('php://memory', 'r+b')); - $this->assertInstanceOf(StreamInterface::class, $stream); - $stream->close(); - } - - public function testCreateStreamFromUnopenableFile() - { - $this->expectException(UnopenableStreamException::class); - $this->expectExceptionMessage('Unable to open file "/a1fd94f5-9390-41b8-a3e3-8039b6015db6" in mode "r"'); - - (new StreamFactory)->createStreamFromFile('/a1fd94f5-9390-41b8-a3e3-8039b6015db6', 'r'); - } - - public function testCreateStreamWithTemporaryFile() - { - $stream = (new StreamFactory)->createStreamFromTemporaryFile('c4ab0f0b-3ca6-43df-a58b-51e7eec44090'); - $this->assertStringEqualsFile($stream->getMetadata('uri'), 'c4ab0f0b-3ca6-43df-a58b-51e7eec44090'); - } -} diff --git a/vendor/sunrise/stream/tests/StreamTest.php b/vendor/sunrise/stream/tests/StreamTest.php deleted file mode 100644 index 7ee60399..00000000 --- a/vendor/sunrise/stream/tests/StreamTest.php +++ /dev/null @@ -1,375 +0,0 @@ -handle = \fopen('php://memory', 'r+b'); - } - - protected function tearDown() : void - { - if (\is_resource($this->handle)) { - \fclose($this->handle); - } - } - - public function testConstructor() - { - $stream = new Stream($this->handle); - - $this->assertInstanceOf(StreamInterface::class, $stream); - $this->assertStreamResourceEquals($stream, $this->handle); - } - - public function testConstructorWithInvalidResource() - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid stream resource'); - - new Stream(''); - } - - public function testDetach() - { - $stream = new Stream($this->handle); - - $this->assertSame($this->handle, $stream->detach()); - $this->assertStreamResourceEquals($stream, null); - $this->assertNull($stream->detach()); - } - - public function testClose() - { - $stream = new Stream($this->handle); - - $stream->close(); - $this->assertStreamResourceEquals($stream, null); - $this->assertFalse(\is_resource($this->handle)); - } - - public function testEof() - { - $stream = new Stream($this->handle); - - while (! \feof($this->handle)) { - \fread($this->handle, 1024); - } - - $this->assertTrue($stream->eof()); - \rewind($this->handle); - $this->assertFalse($stream->eof()); - } - - public function testTell() - { - $string = 'Hello, world!'; - $length = \strlen($string); - - $stream = new Stream($this->handle); - - \rewind($this->handle); - $this->assertSame(0, $stream->tell()); - - \fwrite($this->handle, $string, $length); - $this->assertSame($length, $stream->tell()); - - \rewind($this->handle); - $this->assertSame(0, $stream->tell()); - } - - public function testTellUnresourceable() - { - $this->expectException(UntellableStreamException::class); - $this->expectExceptionMessage('Stream is not resourceable'); - - $stream = new Stream($this->handle); - - $stream->close(); - $stream->tell(); - } - - public function testIsSeekable() - { - $stream = new Stream($this->handle); - - $this->assertTrue($stream->isSeekable()); - - $stream->detach(); - $this->assertFalse($stream->isSeekable()); - } - - public function testRewind() - { - $string = 'Hello, world!'; - $length = \strlen($string); - - $stream = new Stream($this->handle); - - \fwrite($this->handle, $string, $length); - $stream->rewind(); - $this->assertSame(0, \ftell($this->handle)); - } - - public function testRewindUnresourceable() - { - $this->expectException(UnseekableStreamException::class); - $this->expectExceptionMessage('Stream is not resourceable'); - - $stream = new Stream($this->handle); - - $stream->close(); - $stream->rewind(); - } - - public function testSeek() - { - $string = 'Hello, world!'; - $length = \strlen($string); - - $stream = new Stream($this->handle); - - \fwrite($this->handle, $string, $length); - \rewind($this->handle); - $stream->seek($length, \SEEK_SET); - $this->assertSame($length, \ftell($this->handle)); - } - - public function testSeekUnresourceable() - { - $this->expectException(UnseekableStreamException::class); - $this->expectExceptionMessage('Stream is not resourceable'); - - $stream = new Stream($this->handle); - - $stream->close(); - $stream->seek(0, \SEEK_SET); - } - - public function testIsWritable() - { - $stream = new Stream(\STDOUT); - $this->assertTrue($stream->isWritable()); - - $stream = new Stream(\STDIN); - $this->assertFalse($stream->isWritable()); - } - - public function testWrite() - { - $string = 'Hello, world!'; - $length = \strlen($string); - - $stream = new Stream($this->handle); - - $this->assertSame($length, $stream->write($string)); - - \rewind($this->handle); - $this->assertSame($string, \fread($this->handle, $length)); - } - - public function testWriteUnresourceable() - { - $this->expectException(UnwritableStreamException::class); - $this->expectExceptionMessage('Stream is not resourceable'); - - $stream = new Stream($this->handle); - - $stream->close(); - $stream->write('0', 1); - } - - public function testWriteUnwritable() - { - $this->expectException(UnwritableStreamException::class); - $this->expectExceptionMessage('Stream is not writable'); - - $stream = new Stream(\STDIN); - $stream->write('0', 1); - } - - public function testIsReadable() - { - $stream = new Stream(\STDIN); - $this->assertTrue($stream->isReadable()); - - $stream = new Stream(\STDOUT); - $this->assertFalse($stream->isReadable()); - } - - public function testRead() - { - $string = 'Hello, world!'; - $length = \strlen($string); - - $stream = new Stream($this->handle); - - \fwrite($this->handle, $string); - \rewind($this->handle); - $this->assertSame($string, $stream->read($length)); - } - - public function testReadUnresourceable() - { - $this->expectException(UnreadableStreamException::class); - $this->expectExceptionMessage('Stream is not resourceable'); - - $stream = new Stream($this->handle); - - $stream->close(); - $stream->read(1); - } - - public function testReadUnreadable() - { - $this->expectException(UnreadableStreamException::class); - $this->expectExceptionMessage('Stream is not readable'); - - $stream = new Stream(\STDOUT); - $stream->read(1); - } - - public function testGetContents() - { - $string = 'Hello, world!'; - $length = \strlen($string); - - $stream = new Stream($this->handle); - - \fwrite($this->handle, $string); - \rewind($this->handle); - $this->assertSame($string, $stream->getContents()); - } - - public function testGetContentsUnresourceable() - { - $this->expectException(UnreadableStreamException::class); - $this->expectExceptionMessage('Stream is not resourceable'); - - $stream = new Stream($this->handle); - - $stream->close(); - $stream->getContents(); - } - - public function testGetContentsUnreadable() - { - $this->expectException(UnreadableStreamException::class); - $this->expectExceptionMessage('Stream is not readable'); - - $stream = new Stream(\STDOUT); - $stream->getContents(); - } - - public function testGetMetadata() - { - $stream = new Stream($this->handle); - - $this->assertSame( - \stream_get_meta_data($this->handle), - $stream->getMetadata() - ); - } - - public function testGetMetadataWithKey() - { - $stream = new Stream($this->handle); - - $this->assertSame( - 'php://memory', - $stream->getMetadata('uri') - ); - - $this->assertSame( - null, - $stream->getMetadata('undefined') - ); - } - - public function testGetMetadataUnresourceable() - { - $stream = new Stream($this->handle); - - $stream->close(); - $this->assertNull($stream->getMetadata()); - } - - public function testGetSize() - { - $string = 'Hello, world!'; - $length = \strlen($string); - - $stream = new Stream($this->handle); - - \fwrite($this->handle, $string); - $this->assertSame($length, $stream->getSize()); - - \ftruncate($this->handle, 0); - $this->assertSame(0, $stream->getSize()); - } - - public function testGetSizeUnresourceable() - { - $stream = new Stream($this->handle); - - $stream->close(); - $this->assertNull($stream->getSize()); - } - - public function testToString() - { - $string = 'Hello, world!'; - $length = \strlen($string); - - $stream = new Stream($this->handle); - - \fwrite($this->handle, $string); - $this->assertSame($string, (string) $stream); - } - - public function testToStringUnresourceable() - { - $stream = new Stream($this->handle); - - $stream->close(); - $this->assertSame('', (string) $stream); - } - - public function testToStringUnreadable() - { - $stream = new Stream(\STDOUT); - - $this->assertSame('', (string) $stream); - } - - public function testExceptions() - { - $this->assertInstanceOf(\RuntimeException::class, new UnopenableStreamException('')); - $this->assertInstanceOf(\RuntimeException::class, new UnreadableStreamException('')); - $this->assertInstanceOf(\RuntimeException::class, new UnseekableStreamException('')); - $this->assertInstanceOf(\RuntimeException::class, new UntellableStreamException('')); - $this->assertInstanceOf(\RuntimeException::class, new UnwritableStreamException('')); - } - - private function assertStreamResourceEquals(StreamInterface $stream, $expected) - { - $property = new \ReflectionProperty($stream, 'resource'); - - $property->setAccessible(true); - - return $this->assertSame($property->getValue($stream), $expected); - } -} diff --git a/vendor/sunrise/uri/.gitignore b/vendor/sunrise/uri/.gitignore deleted file mode 100644 index a6bde413..00000000 --- a/vendor/sunrise/uri/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -/.php_cs.cache -/.phpunit.result.cache -/composer.lock -/coverage.xml -/phpbench.json -/phpcs.xml -/phpunit.xml -/psalm.xml -/vendor/ diff --git a/vendor/sunrise/uri/composer.json b/vendor/sunrise/uri/composer.json index 7bb54743..77146e6e 100644 --- a/vendor/sunrise/uri/composer.json +++ b/vendor/sunrise/uri/composer.json @@ -22,7 +22,7 @@ "homepage": "https://github.com/fenric" }, { - "name": "李昀陞 (Peter)", + "name": "\u674e\u6600\u965e (Peter)", "email": "peter279k@gmail.com", "homepage": "https://github.com/peter279k" } @@ -55,5 +55,6 @@ "XDEBUG_MODE=coverage phpunit --coverage-html coverage/" ] }, - "abandoned": "sunrise/http-message" + "abandoned": "sunrise/http-message", + "version": "v1.2.5" } diff --git a/vendor/sunrise/uri/tests/UriFactoryTest.php b/vendor/sunrise/uri/tests/UriFactoryTest.php deleted file mode 100644 index 15a25019..00000000 --- a/vendor/sunrise/uri/tests/UriFactoryTest.php +++ /dev/null @@ -1,45 +0,0 @@ -assertInstanceOf(UriFactoryInterface::class, $factory); - } - - public function testCreateUri() - { - $uri = (new UriFactory)->createUri('/'); - - $this->assertInstanceOf(UriInterface::class, $uri); - - $this->assertSame('/', $uri->getPath()); - } - - public function testCreateUriWithoutUri() - { - $uri = (new UriFactory)->createUri(); - - $this->assertInstanceOf(UriInterface::class, $uri); - - $this->assertSame('', $uri->getPath()); - } - - public function testCreateUriWithEmptyUri() - { - $uri = (new UriFactory)->createUri(''); - - $this->assertInstanceOf(UriInterface::class, $uri); - - $this->assertSame('', $uri->getPath()); - } -} diff --git a/vendor/sunrise/uri/tests/UriParserTest.php b/vendor/sunrise/uri/tests/UriParserTest.php deleted file mode 100644 index cdf560d3..00000000 --- a/vendor/sunrise/uri/tests/UriParserTest.php +++ /dev/null @@ -1,104 +0,0 @@ -assertInstanceOf(UriParser::class, $uri); - } - - public function testConstructorWithInvalidString() - { - $this->expectException(InvalidUriException::class); - $this->expectExceptionMessage('URI must be a string'); - - $uri = new UriParser(null); - } - - public function testGetScheme() - { - $uri = new UriParser(self::TEST_URI); - - $this->assertSame('scheme', $uri->getScheme()->present()); - } - - public function testGetUser() - { - $uri = new UriParser(self::TEST_URI); - - $this->assertSame('user', $uri->getUser()->present()); - } - - public function testGetEmptyUser() - { - $uri = new UriParser('//:password@localhost'); - - $this->assertSame('', $uri->getUser()->present()); - } - - public function testGetPass() - { - $uri = new UriParser(self::TEST_URI); - - $this->assertSame('pass', $uri->getPass()->present()); - } - - public function testGetEmptyPass() - { - $uri = new UriParser('//username:@localhost'); - - $this->assertSame('', $uri->getPass()->present()); - } - - public function testGetHost() - { - $uri = new UriParser(self::TEST_URI); - - $this->assertSame('host', $uri->getHost()->present()); - } - - public function testGetPort() - { - $uri = new UriParser(self::TEST_URI); - - $this->assertSame(3000, $uri->getPort()->present()); - } - - public function testGetPath() - { - $uri = new UriParser(self::TEST_URI); - - $this->assertSame('/path', $uri->getPath()->present()); - } - - public function testGetQuery() - { - $uri = new UriParser(self::TEST_URI); - - $this->assertSame('query', $uri->getQuery()->present()); - } - - public function testGetFragment() - { - $uri = new UriParser(self::TEST_URI); - - $this->assertSame('fragment', $uri->getFragment()->present()); - } - - public function testGetUserInfo() - { - $uri = new UriParser(self::TEST_URI); - - $this->assertSame('user:pass', $uri->getUserInfo()->present()); - } -} diff --git a/vendor/sunrise/uri/tests/UriTest.php b/vendor/sunrise/uri/tests/UriTest.php deleted file mode 100644 index 555ab02a..00000000 --- a/vendor/sunrise/uri/tests/UriTest.php +++ /dev/null @@ -1,624 +0,0 @@ -assertInstanceOf(UriInterface::class, $uri); - } - - public function testConstructorWithoutUri() - { - $uri = new Uri(); - - $this->assertInstanceOf(UriInterface::class, $uri); - } - - public function testConstructorWithEmptyUri() - { - $uri = new Uri(''); - - $this->assertInstanceOf(UriInterface::class, $uri); - } - - public function testConstructorWithInvalidUri() - { - $this->expectException(InvalidUriException::class); - $this->expectExceptionMessage('Unable to parse URI'); - - new Uri(':'); - } - - public function testGetScheme() - { - $uri = new Uri(self::TEST_URI); - - $this->assertSame('scheme', $uri->getScheme()); - } - - public function testGetUserInfo() - { - $uri = new Uri(self::TEST_URI); - - $this->assertSame('user:pass', $uri->getUserInfo()); - } - - public function testGetHost() - { - $uri = new Uri(self::TEST_URI); - - $this->assertSame('host', $uri->getHost()); - } - - public function testGetPort() - { - $uri = new Uri(self::TEST_URI); - - $this->assertSame(3000, $uri->getPort()); - } - - public function testGetPath() - { - $uri = new Uri(self::TEST_URI); - - $this->assertSame('/path', $uri->getPath()); - } - - public function testGetQuery() - { - $uri = new Uri(self::TEST_URI); - - $this->assertSame('query', $uri->getQuery()); - } - - public function testGetFragment() - { - $uri = new Uri(self::TEST_URI); - - $this->assertSame('fragment', $uri->getFragment()); - } - - public function testGetStandardPort() : void - { - $uri = new Uri('http://host:3000'); - $this->assertSame(80, $uri->getStandardPort()); - - $uri = new Uri('https://host:3000'); - $this->assertSame(443, $uri->getStandardPort()); - - $uri = new Uri('ftp://host:3000'); - $this->assertSame(21, $uri->getStandardPort()); - } - - public function testWithScheme() - { - $uri = new Uri(self::TEST_URI); - $copy = $uri->withScheme('new-scheme'); - - $this->assertInstanceOf(UriInterface::class, $copy); - $this->assertNotEquals($uri, $copy); - - $this->assertSame('scheme', $uri->getScheme()); - $this->assertSame('new-scheme', $copy->getScheme()); - } - - public function testWithUserInfo() - { - $uri = new Uri(self::TEST_URI); - $copy = $uri->withUserInfo('new-user', 'new-pass'); - - $this->assertInstanceOf(UriInterface::class, $copy); - $this->assertNotEquals($uri, $copy); - - $this->assertSame('user:pass', $uri->getUserInfo()); - $this->assertSame('new-user:new-pass', $copy->getUserInfo()); - } - - public function testWithUserInfoWithoutPass() - { - $uri = new Uri(self::TEST_URI); - $copy = $uri->withUserInfo('new-user'); - - $this->assertInstanceOf(UriInterface::class, $copy); - $this->assertNotEquals($uri, $copy); - - $this->assertSame('user:pass', $uri->getUserInfo()); - $this->assertSame('new-user', $copy->getUserInfo()); - } - - public function testWithHost() - { - $uri = new Uri(self::TEST_URI); - $copy = $uri->withHost('new-host'); - - $this->assertInstanceOf(UriInterface::class, $copy); - $this->assertNotEquals($uri, $copy); - - $this->assertSame('host', $uri->getHost()); - $this->assertSame('new-host', $copy->getHost()); - } - - public function testWithPort() - { - $uri = new Uri(self::TEST_URI); - $copy = $uri->withPort(80); - - $this->assertInstanceOf(UriInterface::class, $copy); - $this->assertNotEquals($uri, $copy); - - $this->assertSame(3000, $uri->getPort()); - $this->assertSame(80, $copy->getPort()); - } - - public function testWithPath() - { - $uri = new Uri(self::TEST_URI); - $copy = $uri->withPath('/new-path'); - - $this->assertInstanceOf(UriInterface::class, $copy); - $this->assertNotEquals($uri, $copy); - - $this->assertSame('/path', $uri->getPath()); - $this->assertSame('/new-path', $copy->getPath()); - } - - public function testWithQuery() - { - $uri = new Uri(self::TEST_URI); - $copy = $uri->withQuery('new-query'); - - $this->assertInstanceOf(UriInterface::class, $copy); - $this->assertNotEquals($uri, $copy); - - $this->assertSame('query', $uri->getQuery()); - $this->assertSame('new-query', $copy->getQuery()); - } - - public function testWithFragment() - { - $uri = new Uri(self::TEST_URI); - $copy = $uri->withFragment('new-fragment'); - - $this->assertInstanceOf(UriInterface::class, $copy); - $this->assertNotEquals($uri, $copy); - - $this->assertSame('fragment', $uri->getFragment()); - $this->assertSame('new-fragment', $copy->getFragment()); - } - - public function testWithEmptyScheme() - { - $uri = (new Uri(self::TEST_URI))->withScheme(''); - - $this->assertSame('', $uri->getScheme()); - } - - public function testWithEmptyUserInfo() - { - $uri = (new Uri(self::TEST_URI))->withUserInfo(''); - - $this->assertSame('', $uri->getUserInfo()); - } - - public function testWithEmptyHost() - { - $uri = (new Uri(self::TEST_URI))->withHost(''); - - $this->assertSame('', $uri->getHost()); - } - - public function testWithEmptyPort() - { - $uri = (new Uri(self::TEST_URI))->withPort(null); - - $this->assertNull($uri->getPort()); - } - - public function testWithEmptyPath() - { - $uri = (new Uri(self::TEST_URI))->withPath(''); - - $this->assertSame('', $uri->getPath()); - } - - public function testWithEmptyQuery() - { - $uri = (new Uri(self::TEST_URI))->withQuery(''); - - $this->assertSame('', $uri->getQuery()); - } - - public function testWithEmptyFragment() - { - $uri = (new Uri(self::TEST_URI))->withFragment(''); - - $this->assertSame('', $uri->getFragment()); - } - - public function testWithInvalidScheme() - { - $this->expectException(InvalidUriComponentException::class); - $this->expectExceptionMessage('Invalid URI component "scheme"'); - - (new Uri(self::TEST_URI))->withScheme('scheme:'); - } - - public function testWithInvalidUserInfo() - { - $uri = (new Uri(self::TEST_URI))->withUserInfo('user:pass', 'user:pass'); - - $this->assertSame('user%3Apass:user%3Apass', $uri->getUserInfo(), '', 0.0, 10, false, true); - } - - public function testWithInvalidHost() - { - $uri = (new Uri(self::TEST_URI))->withHost('host:80'); - - $expected = \strtolower('host%3A80'); - - $this->assertSame($expected, $uri->getHost(), '', 0.0, 10, false, true); - } - - public function testWithInvalidPortIsLessThanZero() - { - $this->expectException(InvalidUriComponentException::class); - $this->expectExceptionMessage('Invalid URI component "port"'); - - (new Uri(self::TEST_URI))->withPort(-1); - } - - public function testWithInvalidPortIsZero() - { - $this->expectException(InvalidUriComponentException::class); - $this->expectExceptionMessage('Invalid URI component "port"'); - - (new Uri(self::TEST_URI))->withPort(0); - } - - public function testWithInvalidPortIsTooLarge() - { - $this->expectException(InvalidUriComponentException::class); - $this->expectExceptionMessage('Invalid URI component "port"'); - - (new Uri(self::TEST_URI))->withPort((2 ** 16) + 1); - } - - public function testWithInvalidPath() - { - $uri = (new Uri(self::TEST_URI))->withPath('/path?query'); - - $this->assertSame('/path%3Fquery', $uri->getPath(), '', 0.0, 10, false, true); - } - - public function testWithInvalidQuery() - { - $uri = (new Uri(self::TEST_URI))->withQuery('query#fragment'); - - $this->assertSame('query%23fragment', $uri->getQuery(), '', 0.0, 10, false, true); - } - - public function testWithInvalidFragment() - { - $uri = (new Uri(self::TEST_URI))->withFragment('fragment#fragment'); - - $this->assertSame('fragment%23fragment', $uri->getFragment(), '', 0.0, 10, false, true); - } - - public function testWithInvalidDataTypeForScheme($value) - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('URI component "scheme" must be a string'); - - (new Uri)->withScheme($value); - } - - public function invalidDataTypeProviderForScheme() - { - return [ - [true], - [false], - [0], - [0.0], - [[]], - [new \stdClass], - [\STDOUT], - [null], - [function () { - }], - ]; - } - - public function testWithInvalidDataTypeForUser($value) - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('URI component "user" must be a string'); - - (new Uri)->withUserInfo($value); - } - - public function invalidDataTypeProviderForUser() - { - return [ - [true], - [false], - [0], - [0.0], - [[]], - [new \stdClass], - [\STDOUT], - [null], - [function () { - }], - ]; - } - - public function testWithInvalidDataTypeForPass($value) - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('URI component "pass" must be a string'); - - (new Uri)->withUserInfo('user', $value); - } - - public function invalidDataTypeProviderForPass() - { - return [ - [true], - [false], - [0], - [0.0], - [[]], - [new \stdClass], - [\STDOUT], - [function () { - }], - ]; - } - - public function testWithInvalidDataTypeForHost($value) - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('URI component "host" must be a string'); - - (new Uri)->withHost($value); - } - - public function invalidDataTypeProviderForHost() - { - return [ - [true], - [false], - [0], - [0.0], - [[]], - [new \stdClass], - [\STDOUT], - [null], - [function () { - }], - ]; - } - - public function testWithInvalidDataTypeForPort($value) - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('URI component "port" must be an integer'); - - (new Uri)->withPort($value); - } - - public function invalidDataTypeProviderForPort() - { - return [ - [true], - [false], - ['a'], - [0.0], - [[]], - [new \stdClass], - [\STDOUT], - [function () { - }], - ]; - } - - public function testWithInvalidDataTypeForPath($value) - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('URI component "path" must be a string'); - - (new Uri)->withPath($value); - } - - public function invalidDataTypeProviderForPath() - { - return [ - [true], - [false], - [0], - [0.0], - [[]], - [new \stdClass], - [\STDOUT], - [null], - [function () { - }], - ]; - } - - public function testWithInvalidDataTypeForQuery($value) - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('URI component "query" must be a string'); - - (new Uri)->withQuery($value); - } - - public function invalidDataTypeProviderForQuery() - { - return [ - [true], - [false], - [0], - [0.0], - [[]], - [new \stdClass], - [\STDOUT], - [null], - [function () { - }], - ]; - } - - public function testWithInvalidDataTypeForFragment($value) - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('URI component "fragment" must be a string'); - - (new Uri)->withFragment($value); - } - - public function invalidDataTypeProviderForFragment() - { - return [ - [true], - [false], - [0], - [0.0], - [[]], - [new \stdClass], - [\STDOUT], - [null], - [function () { - }], - ]; - } - - public function testGetAuthority() - { - $uri = new Uri(self::TEST_URI); - - $this->assertSame('user:pass@host:3000', $uri->getAuthority()); - - $this->assertSame('', $uri->withHost('')->getAuthority()); - - $this->assertSame('host:3000', $uri->withUserInfo('')->getAuthority()); - - $this->assertSame('user@host:3000', $uri->withUserInfo('user')->getAuthority()); - - $this->assertSame('user:pass@host', $uri->withPort(null)->getAuthority()); - } - - public function testToString() - { - $uri = new Uri(self::TEST_URI); - - $this->assertSame(self::TEST_URI, (string) $uri); - } - - public function testToStringIssue31() - { - $uri = new Uri('//username@hostname'); - $uri = $uri->withPath('pathname'); - $this->assertSame('//username@hostname/pathname', $uri->__toString()); - - $uri = new Uri('scheme:'); - $uri = $uri->withPath('//pathname'); - $this->assertSame('scheme:/pathname', $uri->__toString()); - - $uri = new Uri('scheme:'); - $uri = $uri->withPath('///pathname'); - $this->assertSame('scheme:/pathname', $uri->__toString()); - } - - public function testNormalizeScheme() - { - $uri = new Uri(self::TEST_URI); - - $uri = $uri->withScheme('UPPERCASED-SCHEME'); - - $this->assertSame('uppercased-scheme', $uri->getScheme()); - } - - public function testNormalizeHost() - { - $uri = new Uri(self::TEST_URI); - - $uri = $uri->withHost('UPPERCASED-HOST'); - - $this->assertSame('uppercased-host', $uri->getHost()); - } - - public function testExceptions() - { - $this->assertInstanceOf(\InvalidArgumentException::class, new InvalidUriComponentException('')); - $this->assertInstanceOf(\InvalidArgumentException::class, new InvalidUriException('')); - } - - public function testIgnoringStandardPorts() - { - $uri = new Uri('http://example.com:80/'); - $this->assertNull($uri->getPort()); - $this->assertSame('example.com', $uri->getAuthority()); - $this->assertSame('http://example.com/', (string) $uri); - - $uri = new Uri('https://example.com:443/'); - $this->assertNull($uri->getPort()); - $this->assertSame('example.com', $uri->getAuthority()); - $this->assertSame('https://example.com/', (string) $uri); - - $uri = new Uri('http://example.com:443/'); - $this->assertSame(443, $uri->getPort()); - $this->assertSame('example.com:443', $uri->getAuthority()); - $this->assertSame('http://example.com:443/', (string) $uri); - - $uri = new Uri('https://example.com:80/'); - $this->assertSame(80, $uri->getPort()); - $this->assertSame('example.com:80', $uri->getAuthority()); - $this->assertSame('https://example.com:80/', (string) $uri); - } - - public function testMailtoScheme() - { - $uri = new Uri('mailto:test@example.com'); - - $this->assertSame('mailto', $uri->getScheme()); - $this->assertSame('test@example.com', $uri->getPath()); - } - - public function testMapsScheme() - { - $uri = new Uri('maps:?q=112+E+Chapman+Ave+Orange,+CA+92866'); - - $this->assertSame('maps', $uri->getScheme()); - $this->assertSame('q=112+E+Chapman+Ave+Orange,+CA+92866', $uri->getQuery()); - } - - public function testTelScheme() - { - $uri = new Uri('tel:+1-816-555-1212'); - - $this->assertSame('tel', $uri->getScheme()); - $this->assertSame('+1-816-555-1212', $uri->getPath()); - } - - public function testUrnScheme() - { - $uri = new Uri('urn:oasis:names:specification:docbook:dtd:xml:4.1.2'); - - $this->assertSame('urn', $uri->getScheme()); - $this->assertSame('oasis:names:specification:docbook:dtd:xml:4.1.2', $uri->getPath()); - } -} diff --git a/vendor/symfony/yaml/Command/LintCommand.php b/vendor/symfony/yaml/Command/LintCommand.php deleted file mode 100644 index c5df6b01..00000000 --- a/vendor/symfony/yaml/Command/LintCommand.php +++ /dev/null @@ -1,198 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace ComfinoExternal\Symfony\Component\Yaml\Command; - -use ComfinoExternal\Symfony\Component\Console\Command\Command; -use ComfinoExternal\Symfony\Component\Console\Exception\InvalidArgumentException; -use ComfinoExternal\Symfony\Component\Console\Exception\RuntimeException; -use ComfinoExternal\Symfony\Component\Console\Input\InputArgument; -use ComfinoExternal\Symfony\Component\Console\Input\InputInterface; -use ComfinoExternal\Symfony\Component\Console\Input\InputOption; -use ComfinoExternal\Symfony\Component\Console\Output\OutputInterface; -use ComfinoExternal\Symfony\Component\Console\Style\SymfonyStyle; -use ComfinoExternal\Symfony\Component\Yaml\Exception\ParseException; -use ComfinoExternal\Symfony\Component\Yaml\Parser; -use ComfinoExternal\Symfony\Component\Yaml\Yaml; - -class LintCommand extends Command -{ - protected static $defaultName = 'lint:yaml'; - private $parser; - private $format; - private $displayCorrectFiles; - private $directoryIteratorProvider; - private $isReadableProvider; - public function __construct(string $name = null, callable $directoryIteratorProvider = null, callable $isReadableProvider = null) - { - parent::__construct($name); - $this->directoryIteratorProvider = $directoryIteratorProvider; - $this->isReadableProvider = $isReadableProvider; - } - - protected function configure() - { - $this->setDescription('Lint a file and outputs encountered errors')->addArgument('filename', InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN')->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format', 'txt')->addOption('parse-tags', null, InputOption::VALUE_NONE, 'Parse custom tags')->setHelp(<<%command.name% command lints a YAML file and outputs to STDOUT -the first encountered syntax error. - -You can validates YAML contents passed from STDIN: - - cat filename | php %command.full_name% - - -You can also validate the syntax of a file: - - php %command.full_name% filename - -Or of a whole directory: - - php %command.full_name% dirname - php %command.full_name% dirname --format=json - -EOF -); - } - protected function execute(InputInterface $input, OutputInterface $output) - { - $io = new SymfonyStyle($input, $output); - $filenames = (array) $input->getArgument('filename'); - $this->format = $input->getOption('format'); - $this->displayCorrectFiles = $output->isVerbose(); - $flags = $input->getOption('parse-tags') ? Yaml::PARSE_CUSTOM_TAGS : 0; - if (['-'] === $filenames) { - return $this->display($io, [$this->validate(file_get_contents('php://stdin'), $flags)]); - } - - if (!$filenames) { - if (0 === ftell(\STDIN)) { - @trigger_error('Piping content from STDIN to the "lint:yaml" command without passing the dash symbol "-" as argument is deprecated since Symfony 4.4.', \E_USER_DEPRECATED); - return $this->display($io, [$this->validate(file_get_contents('php://stdin'), $flags)]); - } - throw new RuntimeException('Please provide a filename or pipe file content to STDIN.'); - } - $filesInfo = []; - foreach ($filenames as $filename) { - if (!$this->isReadable($filename)) { - throw new RuntimeException(sprintf('File or directory "%s" is not readable.', $filename)); - } - foreach ($this->getFiles($filename) as $file) { - $filesInfo[] = $this->validate(file_get_contents($file), $flags, $file); - } - } - return $this->display($io, $filesInfo); - } - private function validate(string $content, int $flags, string $file = null) - { - $prevErrorHandler = set_error_handler(function ($level, $message, $file, $line) use (&$prevErrorHandler) { - if (\E_USER_DEPRECATED === $level) { - throw new ParseException($message, $this->getParser()->getRealCurrentLineNb() + 1); - } - return $prevErrorHandler ? $prevErrorHandler($level, $message, $file, $line) : \false; - }); - try { - $this->getParser()->parse($content, Yaml::PARSE_CONSTANT | $flags); - } catch (ParseException $e) { - return ['file' => $file, 'line' => $e->getParsedLine(), 'valid' => \false, 'message' => $e->getMessage()]; - } finally { - restore_error_handler(); - } - return ['file' => $file, 'valid' => \true]; - } - private function display(SymfonyStyle $io, array $files): int - { - switch ($this->format) { - case 'txt': - return $this->displayTxt($io, $files); - case 'json': - return $this->displayJson($io, $files); - default: - throw new InvalidArgumentException(sprintf('The format "%s" is not supported.', $this->format)); - } - } - private function displayTxt(SymfonyStyle $io, array $filesInfo): int - { - $countFiles = \count($filesInfo); - $erroredFiles = 0; - $suggestTagOption = \false; - foreach ($filesInfo as $info) { - if ($info['valid'] && $this->displayCorrectFiles) { - $io->comment('OK' . ($info['file'] ? sprintf(' in %s', $info['file']) : '')); - } elseif (!$info['valid']) { - ++$erroredFiles; - $io->text(' ERROR ' . ($info['file'] ? sprintf(' in %s', $info['file']) : '')); - $io->text(sprintf(' >> %s', $info['message'])); - if (\false !== strpos($info['message'], 'PARSE_CUSTOM_TAGS')) { - $suggestTagOption = \true; - } - } - } - if (0 === $erroredFiles) { - $io->success(sprintf('All %d YAML files contain valid syntax.', $countFiles)); - } else { - $io->warning(sprintf('%d YAML files have valid syntax and %d contain errors.%s', $countFiles - $erroredFiles, $erroredFiles, $suggestTagOption ? ' Use the --parse-tags option if you want parse custom tags.' : '')); - } - return min($erroredFiles, 1); - } - private function displayJson(SymfonyStyle $io, array $filesInfo): int - { - $errors = 0; - array_walk($filesInfo, function (&$v) use (&$errors) { - $v['file'] = (string) $v['file']; - if (!$v['valid']) { - ++$errors; - } - if (isset($v['message']) && \false !== strpos($v['message'], 'PARSE_CUSTOM_TAGS')) { - $v['message'] .= ' Use the --parse-tags option if you want parse custom tags.'; - } - }); - $io->writeln(json_encode($filesInfo, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES)); - return min($errors, 1); - } - private function getFiles(string $fileOrDirectory): iterable - { - if (is_file($fileOrDirectory)) { - yield new \SplFileInfo($fileOrDirectory); - return; - } - foreach ($this->getDirectoryIterator($fileOrDirectory) as $file) { - if (!\in_array($file->getExtension(), ['yml', 'yaml'])) { - continue; - } - yield $file; - } - } - private function getParser(): Parser - { - if (!$this->parser) { - $this->parser = new Parser(); - } - return $this->parser; - } - private function getDirectoryIterator(string $directory): iterable - { - $default = function ($directory) { - return new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS), \RecursiveIteratorIterator::LEAVES_ONLY); - }; - if (null !== $this->directoryIteratorProvider) { - return ($this->directoryIteratorProvider)($directory, $default); - } - return $default($directory); - } - private function isReadable(string $fileOrDirectory): bool - { - $default = function ($fileOrDirectory) { - return is_readable($fileOrDirectory); - }; - if (null !== $this->isReadableProvider) { - return ($this->isReadableProvider)($fileOrDirectory, $default); - } - return $default($fileOrDirectory); - } -} diff --git a/views/front/api-error.php b/views/front/api-error.php deleted file mode 100644 index b581d0f2..00000000 --- a/views/front/api-error.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - <?php echo esc_html($title); ?> - - - - -
- - - - diff --git a/views/front/paywall-disabled.php b/views/front/paywall-disabled.php deleted file mode 100644 index 360074b7..00000000 --- a/views/front/paywall-disabled.php +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - <?php echo esc_html($title); ?> - - - - -
- - - diff --git a/views/front/paywall.php b/views/front/paywall.php deleted file mode 100644 index 50ced7d3..00000000 --- a/views/front/paywall.php +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - <?php echo esc_html__('Comfino - installment and deferred on-line payments', 'comfino-payment-gateway'); ?> - - - - -
- - - - From 2fd317da0a6d7b9801713c4a36509bc1dc30f3e2 Mon Sep 17 00:00:00 2001 From: Artur Kozubski Date: Tue, 12 May 2026 19:04:46 +0200 Subject: [PATCH 02/67] FN-14460 Updated dependencies, removed unused test methods, and introduced nullable type hints in YAML parser. --- comfino-payment-gateway.php | 18 +- composer.json | 5 +- composer.lock | 228 +++--- languages/comfino-payment-gateway-pl_PL.mo | Bin 20761 -> 23855 bytes languages/comfino-payment-gateway-pl_PL.po | 647 ++++++++++-------- languages/comfino-payment-gateway.pot | 299 +++++--- tests/Api/ApiServiceTest.php | 158 +---- vendor/autoload.php | 2 +- vendor/composer/autoload_classmap.php | 6 +- vendor/composer/autoload_real.php | 11 +- vendor/composer/autoload_static.php | 14 +- vendor/composer/installed.json | 212 +++--- vendor/composer/installed.php | 20 +- vendor/league/flysystem/src/Handler.php | 2 +- .../Resources/stubs/Attribute.php | 2 +- .../Resources/stubs/PhpToken.php | 2 + .../Resources/stubs/Stringable.php | 14 +- .../Resources/stubs/UnhandledMatchError.php | 10 +- .../Resources/stubs/ValueError.php | 10 +- .../symfony/yaml/Exception/ParseException.php | 2 +- vendor/symfony/yaml/Inline.php | 8 +- vendor/symfony/yaml/Parser.php | 4 +- views/admin/_configure/installation-logs.php | 20 +- views/admin/configuration.php | 46 +- 24 files changed, 863 insertions(+), 877 deletions(-) diff --git a/comfino-payment-gateway.php b/comfino-payment-gateway.php index 05c02aa3..0b3bcb29 100644 --- a/comfino-payment-gateway.php +++ b/comfino-payment-gateway.php @@ -3,7 +3,7 @@ * Plugin Name: Comfino Payment Gateway * Plugin URI: https://github.com/comfino/WooCommerce.git * Description: Comfino Payment Gateway for WooCommerce. - * Version: 4.2.8 + * Version: 4.3.0 * Author: Comfino * Author URI: https://github.com/comfino * Domain Path: /languages @@ -23,9 +23,8 @@ } /** - * Guard clause to prevent plugin execution in incompatible environments. - * This MUST be placed before any code which uses PHP 7.1+ syntax and before any use statements. - * Uses PHP 5.6+ compatible syntax. + * Guard clause to prevent plugin execution in incompatible environments. This MUST be placed before any code that uses + * PHP 7.1+ syntax and before any use statements. Uses PHP 5.6+ compatible syntax. */ if (PHP_VERSION_ID < 70100) { // Display admin notice about PHP version incompatibility. @@ -253,6 +252,17 @@ public function activation_check(): void wp_die(wp_kses_post($environmentWarning)); } + if (!in_array('sha3-256', hash_algos(), true)) { + add_action('admin_notices', static function () { + echo '

' + . esc_html__( + 'Comfino requires OpenSSL >= 1.1.0 (SHA-3 support) for the V3 paywall.', + 'comfino-payment-gateway' + ) + . '

'; + }); + } + Main::install(); } diff --git a/composer.json b/composer.json index 424de447..1da93b0f 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,6 @@ "platform": { "php": "7.1.3" }, - "classmap-authoritative": true, "optimize-autoloader": true, "prepend-autoloader": false, "allow-plugins": { @@ -95,6 +94,10 @@ "webmozart/assert": "<1.10" }, "repositories": [ + { + "type": "artifact", + "url": "/home/akozubski/Devel/comfino/lib/shop-plugins-lib-builder/packages/sunrise" + }, { "type": "vcs", "url": "git@github.com:comfino/shop-plugins-shared.git" diff --git a/composer.lock b/composer.lock index 67f5ae45..e33485a5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f7c11ec0518961d431ec47935214504c", + "content-hash": "c881c954c3f7c2bbd7196d2eee3dca74", "packages": [ { "name": "cache/adapter-common", @@ -344,12 +344,12 @@ "source": { "type": "git", "url": "git@github.com:comfino/shop-plugins-shared.git", - "reference": "9d0680060b63f2514519f8268115c841ddcc466e" + "reference": "04ac87168a8ac50bc0932ed584f683c4e15a3bc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/comfino/shop-plugins-shared/zipball/9d0680060b63f2514519f8268115c841ddcc466e", - "reference": "9d0680060b63f2514519f8268115c841ddcc466e", + "url": "https://api.github.com/repos/comfino/shop-plugins-shared/zipball/04ac87168a8ac50bc0932ed584f683c4e15a3bc4", + "reference": "04ac87168a8ac50bc0932ed584f683c4e15a3bc4", "shasum": "" }, "require": { @@ -399,7 +399,7 @@ "source": "https://github.com/comfino/shop-plugins-shared/tree/master", "issues": "https://github.com/comfino/shop-plugins-shared/issues" }, - "time": "2026-02-16T12:48:10+00:00" + "time": "2026-05-12T13:26:11+00:00" }, { "name": "fig/http-message-util", @@ -950,16 +950,10 @@ { "name": "sunrise/http-client-curl", "version": "v1.4.6", - "source": { - "type": "git", - "url": "https://github.com/sunrise-php/http-client-curl.git", - "reference": "df3fa3f7f9bf9f88fb6afc6ce79866bc51e789f8" - }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sunrise-php/http-client-curl/zipball/df3fa3f7f9bf9f88fb6afc6ce79866bc51e789f8", - "reference": "df3fa3f7f9bf9f88fb6afc6ce79866bc51e789f8", - "shasum": "" + "url": "/home/akozubski/Devel/comfino/lib/shop-plugins-lib-builder/packages/sunrise/sunrise-http-client-curl-v1.4.6.zip", + "shasum": "54d02c18a2df79ad6c8bcb79cf096af21a4d39b6" }, "require": { "ext-curl": "*", @@ -983,7 +977,17 @@ "Sunrise\\Http\\Client\\Curl\\": "src/" } }, - "notification-url": "https://packagist.org/downloads/", + "scripts": { + "test": [ + "phpcs", + "psalm", + "XDEBUG_MODE=coverage phpunit --coverage-text --colors=always" + ], + "build": [ + "phpdoc -d src/ -t phpdoc/", + "XDEBUG_MODE=coverage phpunit --coverage-html coverage/" + ] + }, "license": [ "MIT" ], @@ -1002,7 +1006,6 @@ "description": "Simple HTTP cURL client for PHP 7.1+ based on PSR-18", "homepage": "https://github.com/sunrise-php/http-client-curl", "keywords": [ - "PSR-2", "client", "curl", "fenric", @@ -1011,28 +1014,18 @@ "php-8", "psr-17", "psr-18", + "psr-2", "psr-7", "sunrise" - ], - "support": { - "issues": "https://github.com/sunrise-php/http-client-curl/issues", - "source": "https://github.com/sunrise-php/http-client-curl/tree/v1.4.6" - }, - "time": "2022-04-19T19:08:14+00:00" + ] }, { "name": "sunrise/http-factory", "version": "v2.0.3", - "source": { - "type": "git", - "url": "https://github.com/sunrise-php/http-factory.git", - "reference": "c923fcd8ac770f68e5070f06324d50713c6fe681" - }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sunrise-php/http-factory/zipball/c923fcd8ac770f68e5070f06324d50713c6fe681", - "reference": "c923fcd8ac770f68e5070f06324d50713c6fe681", - "shasum": "" + "url": "/home/akozubski/Devel/comfino/lib/shop-plugins-lib-builder/packages/sunrise/sunrise-http-factory-v2.0.3.zip", + "shasum": "5e2ab5ba5683e55ca0dea30fd4d6575966c235f0" }, "require": { "php": "^7.1|^8.0", @@ -1054,7 +1047,17 @@ "Sunrise\\Http\\Factory\\": "src/" } }, - "notification-url": "https://packagist.org/downloads/", + "scripts": { + "test": [ + "phpcs", + "psalm", + "XDEBUG_MODE=coverage phpunit --coverage-text --colors=always" + ], + "build": [ + "phpdoc -d src/ -t phpdoc/", + "XDEBUG_MODE=coverage phpunit --coverage-html coverage/" + ] + }, "license": [ "MIT" ], @@ -1068,35 +1071,24 @@ "description": "HTTP factory for PHP 7.1+ based on PSR-17", "homepage": "https://github.com/sunrise-php/http-factory", "keywords": [ - "PHP7", "factory", "fenric", "http", + "php7", "php8", "psr-17", "psr-7", "sunrise" ], - "support": { - "issues": "https://github.com/sunrise-php/http-factory/issues", - "source": "https://github.com/sunrise-php/http-factory/tree/v2.0.3" - }, - "abandoned": "sunrise/http-message", - "time": "2022-12-31T01:52:59+00:00" + "abandoned": "sunrise/http-message" }, { "name": "sunrise/http-header", "version": "v2.0.2", - "source": { - "type": "git", - "url": "https://github.com/sunrise-php/http-header.git", - "reference": "b291196b4f0b041e6f546d1eed91cbcdb1e773b8" - }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sunrise-php/http-header/zipball/b291196b4f0b041e6f546d1eed91cbcdb1e773b8", - "reference": "b291196b4f0b041e6f546d1eed91cbcdb1e773b8", - "shasum": "" + "url": "/home/akozubski/Devel/comfino/lib/shop-plugins-lib-builder/packages/sunrise/sunrise-http-header-v2.0.2.zip", + "shasum": "4343d56e96337f12a98a6e71a848dab8cc455667" }, "require": { "php": "^7.1|^8.0" @@ -1110,7 +1102,12 @@ "Sunrise\\Http\\Header\\": "src/" } }, - "notification-url": "https://packagist.org/downloads/", + "scripts": { + "test": [ + "phpcs", + "psalm" + ] + }, "license": [ "MIT" ], @@ -1128,27 +1125,15 @@ "header", "http", "sunrise" - ], - "support": { - "issues": "https://github.com/sunrise-php/http-header/issues", - "source": "https://github.com/sunrise-php/http-header/tree/v2.0.2" - }, - "abandoned": "sunrise/http-message", - "time": "2022-04-18T23:18:22+00:00" + ] }, { "name": "sunrise/http-message", "version": "v2.1.3", - "source": { - "type": "git", - "url": "https://github.com/sunrise-php/http-message.git", - "reference": "cd6ebddf984ff2169c30c315a5d87ae88aa930da" - }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sunrise-php/http-message/zipball/cd6ebddf984ff2169c30c315a5d87ae88aa930da", - "reference": "cd6ebddf984ff2169c30c315a5d87ae88aa930da", - "shasum": "" + "url": "/home/akozubski/Devel/comfino/lib/shop-plugins-lib-builder/packages/sunrise/sunrise-http-message-v2.1.3.zip", + "shasum": "32618f35ca82ef6d32218a904840682a7cfc6ea5" }, "require": { "fig/http-message-util": "^1.1", @@ -1175,7 +1160,17 @@ "Sunrise\\Http\\Message\\": "src/" } }, - "notification-url": "https://packagist.org/downloads/", + "scripts": { + "test": [ + "phpcs", + "psalm", + "XDEBUG_MODE=coverage phpunit --coverage-text --colors=always" + ], + "build": [ + "phpdoc -d src/ -t phpdoc/", + "XDEBUG_MODE=coverage phpunit --coverage-html coverage/" + ] + }, "license": [ "MIT" ], @@ -1200,26 +1195,15 @@ "response", "rfc-7230", "sunrise" - ], - "support": { - "issues": "https://github.com/sunrise-php/http-message/issues", - "source": "https://github.com/sunrise-php/http-message/tree/v2.1.3" - }, - "time": "2022-04-19T19:10:25+00:00" + ] }, { "name": "sunrise/http-server-request", "version": "v2.2.2", - "source": { - "type": "git", - "url": "https://github.com/sunrise-php/http-server-request.git", - "reference": "431ed2d5b27def62b23196987cd9db654dcda7ce" - }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sunrise-php/http-server-request/zipball/431ed2d5b27def62b23196987cd9db654dcda7ce", - "reference": "431ed2d5b27def62b23196987cd9db654dcda7ce", - "shasum": "" + "url": "/home/akozubski/Devel/comfino/lib/shop-plugins-lib-builder/packages/sunrise/sunrise-http-server-request-v2.2.2.zip", + "shasum": "095a5ac2b86635b0b2036cdff99934f05744244c" }, "require": { "php": "^7.1|^8.0", @@ -1238,6 +1222,9 @@ }, "type": "library", "autoload": { + "psr-4": { + "Sunrise\\Http\\ServerRequest\\": "src/" + }, "files": [ "constants/UPLOAD_ERRORS.php", "functions/request_body.php", @@ -1246,12 +1233,24 @@ "functions/request_method.php", "functions/request_protocol.php", "functions/request_uri.php" - ], + ] + }, + "autoload-dev": { "psr-4": { - "Sunrise\\Http\\ServerRequest\\": "src/" + "Sunrise\\Http\\ServerRequest\\Tests\\": "tests/" } }, - "notification-url": "https://packagist.org/downloads/", + "scripts": { + "test": [ + "phpcs", + "psalm", + "XDEBUG_MODE=coverage phpunit --coverage-text --colors=always" + ], + "build": [ + "phpdoc -d src/ -t phpdoc/", + "XDEBUG_MODE=coverage phpunit --coverage-html coverage/" + ] + }, "license": [ "MIT" ], @@ -1270,9 +1269,9 @@ "description": "HTTP server request wrapper for PHP 7.1+ based on PSR-7 and PSR-17", "homepage": "https://github.com/sunrise-php/http-server-request", "keywords": [ - "PHP7", "fenric", "http", + "php7", "php8", "psr-17", "psr-7", @@ -1280,26 +1279,15 @@ "server", "sunrise" ], - "support": { - "issues": "https://github.com/sunrise-php/http-server-request/issues", - "source": "https://github.com/sunrise-php/http-server-request/tree/v2.2.2" - }, - "abandoned": "sunrise/http-message", - "time": "2022-12-31T01:57:49+00:00" + "abandoned": "sunrise/http-message" }, { "name": "sunrise/stream", "version": "v1.3.4", - "source": { - "type": "git", - "url": "https://github.com/sunrise-php/stream.git", - "reference": "d1a4764f51b9b6710c0c216820accba3d43e5644" - }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sunrise-php/stream/zipball/d1a4764f51b9b6710c0c216820accba3d43e5644", - "reference": "d1a4764f51b9b6710c0c216820accba3d43e5644", - "shasum": "" + "url": "/home/akozubski/Devel/comfino/lib/shop-plugins-lib-builder/packages/sunrise/sunrise-stream-v1.3.4.zip", + "shasum": "8b5770353124ea9ad64c14caeaaf5d83ae8ac64f" }, "require": { "php": "^7.1|^8.0", @@ -1319,7 +1307,17 @@ "Sunrise\\Stream\\": "src/" } }, - "notification-url": "https://packagist.org/downloads/", + "scripts": { + "test": [ + "phpcs", + "psalm", + "XDEBUG_MODE=coverage phpunit --coverage-text --colors=always" + ], + "build": [ + "phpdoc -d src/ -t phpdoc/", + "XDEBUG_MODE=coverage phpunit --coverage-html coverage/" + ] + }, "license": [ "MIT" ], @@ -1338,35 +1336,24 @@ "description": "Stream wrapper for PHP 7.1+ based on PSR-7 and PSR-17", "homepage": "https://github.com/sunrise-php/stream", "keywords": [ - "PHP7", "fenric", "http", + "php7", "php8", "psr-17", "psr-7", "stream", "sunrise" ], - "support": { - "issues": "https://github.com/sunrise-php/stream/issues", - "source": "https://github.com/sunrise-php/stream/tree/v1.3.4" - }, - "abandoned": "sunrise/http-message", - "time": "2022-12-31T02:00:59+00:00" + "abandoned": "sunrise/http-message" }, { "name": "sunrise/uri", "version": "v1.2.5", - "source": { - "type": "git", - "url": "https://github.com/sunrise-php/uri.git", - "reference": "cf636bb78bec0888ad0e0645588a1ee2d783adae" - }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sunrise-php/uri/zipball/cf636bb78bec0888ad0e0645588a1ee2d783adae", - "reference": "cf636bb78bec0888ad0e0645588a1ee2d783adae", - "shasum": "" + "url": "/home/akozubski/Devel/comfino/lib/shop-plugins-lib-builder/packages/sunrise/sunrise-uri-v1.2.5.zip", + "shasum": "77486809276d7ac592ad5a3ba14d779ec4df69b3" }, "require": { "php": "^7.1|^8.0", @@ -1386,7 +1373,17 @@ "Sunrise\\Uri\\": "src/" } }, - "notification-url": "https://packagist.org/downloads/", + "scripts": { + "test": [ + "phpcs", + "psalm", + "XDEBUG_MODE=coverage phpunit --coverage-text --colors=always" + ], + "build": [ + "phpdoc -d src/ -t phpdoc/", + "XDEBUG_MODE=coverage phpunit --coverage-html coverage/" + ] + }, "license": [ "MIT" ], @@ -1405,10 +1402,10 @@ "description": "URI wrapper for PHP 7.1+ based on RFC-3986, PSR-7 and PSR-17", "homepage": "https://github.com/sunrise-php/uri", "keywords": [ - "PHP7", "fenric", "http", "parser", + "php7", "php8", "psr-17", "psr-7", @@ -1416,12 +1413,7 @@ "sunrise", "uri" ], - "support": { - "issues": "https://github.com/sunrise-php/uri/issues", - "source": "https://github.com/sunrise-php/uri/tree/v1.2.5" - }, - "abandoned": "sunrise/http-message", - "time": "2022-12-31T02:03:56+00:00" + "abandoned": "sunrise/http-message" }, { "name": "symfony/deprecation-contracts", diff --git a/languages/comfino-payment-gateway-pl_PL.mo b/languages/comfino-payment-gateway-pl_PL.mo index 4d4141d6b6b5afaff955913bc8f663bd91a96545..b8b8b036ee0df1aba71d4de9c595523973f028d6 100644 GIT binary patch delta 6362 zcmaKu3v?9K8GvuX%SQ!yLj}1;4Ip931Hvov3W{&gpeW*FvOAkhc6MgnnPu74x{9E! zTB|NT5Tz=j)gHCF)z(*QHPNa^kJYx;wzl+bJsj<^Dy^-x-#;@OLe#UUf~P>7R*yrm^kvu#e-FjLvA8Ac>mjzO<&fa1wNMPVAn5l6_(+gdZirr0$dO0O%1!^L8$TILwFe+M{BI)`7LOd;(G@Uf&YO$a4_MK=PvAk zKZHcOq((P{xvYnxs2QSL-2s#Ed5H5W#wjA*aB9RPJc;>*@M`#D_%u8{7KVDo99XfCXd>G0`&p@0~Z^3nNKMKI( zJrn+n`I{|DJpmt_tCc})sfE8loKO?6;$pZ0 zUJIXtvTn^hrS67lh|_A!e5KH(mO&at<>5rQ1&)UgK%%XlgA%d#p`4V97Z88hU!HMuKI1CT>z&P_y7lt{Gw}oAhhnI5yQ8*mVJ34e^1w4iM21pRp^AO+E zCs4X!_9Eg>fvS#0p#ga)9^MS4-5!8awQs;Z@NFm_?pmzWX7~w|YQAhq*cG=ziQLmr z-g^&9ElEp>BlS?$FM-S8SxbrkI0mAQASG(Xra2Ttnz_Cyi%z;vj2`IHw zfa2+9I2`^Ij)Z@Jvd@R`P&kQ#S`HUN(Q`?Of#l>yD7pFr995&#zo2+9{Ft!#ra z1xG{a=auj*7>819Peu3NhZ3QooX=7-W1u`=0%hMEl*n8MX$-XsO81Q6!-B&lwU~i~ zat)N+*zj<;8H$DX!ZHzg0yZ#Td14s4i{J^&uZI%yw_q*nc0=*_J;Eycd<;2g)S)Mb z^Cl>IPKVQ_{~ZSNxp6b3rPXUtJRXeM650uHC!7bn;BTM{k6jrW@F={SdCe-Ny5YBA z297*6JV`gg!!Ya>ScHE&jYEv*snr;Ue)SZCq3~6>1-=10pnZDyae5k#WIpkXFy}L1 znRy$W0bhle!hgdUym(C*`ukxW^A{lHq;|vWVdI(Mzj)8W(o}BjAhDw0B{&hj1rLII zpcK`RwP6U4fCn<43m?XlcG$}NqqCJFXlmxVFclZVFEhUqO0IXpbK$Fy*Mf^6imp;{ zf-Pk7H3S2LqfrV+iiL9`{3yXokQ^e{f)MITSct~bMYYHnWEvtNz8$$0k!uMeEk`he zYXiS4CI6iarib@}U$ImQOL8dQ--cX^5Z&M!6p=z!HzVgE`y+FZCS*NAiq)OSFobdl zqHr<12DuKo1(7Q+`M&_UOlDk?SGm4|q=QlTBYC|7*@#R+E<{EnjmT_-ulGLJwgEG# z4JlYjm0YtBFBlR3xzV7CWekQRoEt$-hrn@&fk>^KjYyS`K&sa{45T%sHsq4_yF3_$ zbs)oHG@lnS1@Dmj|L-NeD&4RdSsFb&7)mcsM*Qer2V9IyiRL3=S2Pw3Mkw%ot{a(g zj0FAP2JaI6(h_p*7a}<2%xK&UrNyp7jz#3`u3q&FzKUFp>_E07-#`+`*OBqaVMse7 z-6Ypqq%IhRKS}Z5LAD@^5DSq@BXLBY54^SxnDj6{5t)yC6S)Do3CSYoBP$R(F8Dw4 zNVo|Jt~Srlx=z=kb~jzIzjXHC5x$Y_GX10L&g--dCskLzw|Qk{?8uV_wPnoU1)fC3;!y z7}>0w_au~QopAF`OjQ>t-UwEg(-RjA3EZvhm{_S95r$iI`p)M=&K&Q342Ix0|!&9c|iHm(^*L%AmF+OHmoP z8OdHuAD`3)iIEaBvr|2G&H9o!pR{>l8v6H5W~sxRBSst-7pwM~(11&W}~vCr_=_`__S;7I)KWW2R?jj4WOzrdO;fzZ}|BHB`5Ebf5~i zET@NfUobHs; zp@=9%F*;#+8QUnBiI`r^3vMj}MwNv#D7(&0o;i zIHR$-e89||HS;UqnfdW&4yVd}&Horws;bEs(ngn|JE;@P_05#ke^TXj-pqPE7WF_^ z^`srk?5UnzMeTNaeH(LKy_>aR(NmZr`@J zrO&8osodVWw5Gg$?u21c4l2K$JGA!j)!9NP)l$r`kSL+Fi_8$W!x1Mq z83}@%Bq=`^(`&q9!SnHI@A|-$qGb@M9s=995sQjW$>PB5G5faJmPWUcr*qNEg1R*Y zuZRm>&sJXBBB(zBJkT3yIgr@8QeA>4$s{QV_!OVuQjNlCir_ioKZ z6_#=LhDMS?^x3Yul?;Q^ip}I{-b_d}>r`X{g%c)WlHXP7DF@1v6L&+kclu=5jY;5ukNf8PSjEsthxb!P3O2Os}bVg97{k}Fxg+?Ey zRCI(%T!Q-U?A@9uN|8ndCH5xbMZ?3LWzc;j$v8_~2j`(V*bQ-s${|HJxD*u8+CT#HFq-Ue>8*Y#+ zx0rW>&80;K2Es-WmhvwD^c3{!yxSv5@=~^$$;H&t1Z7;_e!`?m@`TnwbiK}pLBy%t zfILX8vF$dz^(l-XQ5myuqr=&NJ6(3~=7f<=89~VSm!McR&P>Pj+Wt71w3O$goo<&C zA~cMBX(|5SJ1?w1{)y?Y(=?|}l<6=c^yI*kv9Qm%=}L_L&nbAz$-k@}?qojab8^*x E0crQ1g#Z8m delta 3395 zcmX}uc~Dhl7{~GFUT_ywR8YFgrN9kAE<~WB0tSjGxTdDLM2e+CDME{SElM*j$zzL4 z&WOv5PNS2@tSFmuqRFY5$`*CTwAGo$Y11)h{GjlX-&(26<3uY@qisv%+Yk;$b!;vU#bu}mZ^tzJ7*p{o zs)4w^X18HFYVwLP1uL*CF2}RjfCI3cQ7xx^tD!<4>?_Q{E2xh2=c&4I7;=wILJcE)4etbx3ZTKkJgU+fBMDg3O{oCY-`FRB`^x^k}Z64q}iT z=b_Gz#u*siLPaxh8MQXoP!0Tp+-oZbn=M5LX~S+I32y_KUzvlGaRP3|9mt?9l`W&0 zD?(P$Dp51>ATnuIk8J0#ZKtA!TW~u)KZ^Mr7qdX)@iEi`PNAmoJkH0M;byD3ei44d z@z=a%-o+zXyo_+^i0Jkl$U3S+MK}`|qISUv?5q9%85REQM?SdMdb2?5u>_m(L)7-0 zPUgIV%TRALy$tSzEF_<-8kO}MPz~%t`fA5fGjs{{g390~-Jgp=+PB42G{UD)H@t>= z&>8H+2!FzAj<4oL*RtxaXf{`4Jm*_b19$@~@kiuR3+0_sK%Db#>|z%a{Y zH>vc*U;%Xup++=xBzqdmP)Yh3YKDG6UEgO^G)L00KgSiQ>y}_5uJ?Qi)!^$$TG?q- zZu~lm`6uD+CMWdZq|wo&D#LCZ&qIx<2IKK0_QE#Qh|b~N_&2J7(S^~eo`y*r??rX& zBnI#cRC~Xn?vES8{FhJ}J|>zhb*L>p`YB@iW<;1MydOEp|<<`-f{R#Dq6D}$j-C)@n$Tq6<}{%g(Kcb=} z`4;2wPaKH(ULg@wi5S+E#z?9_11nG&Qv0&z+i(H4BA43(gp#zqXqHv9 ztZQjM@;cOs>BI)2k;o^Sh*^Y|r-29&>xdwsq-4|By~J$dc|xv822$Lcffs!4%LC8&oN#cE`&(+d-_1?C(9vzoxa@b6M(p;xr$a@) zxSY&TPB4@=Dmy15JLL4pJ?JZN-^{%g>r^FFy4^<}iE#_YjPtp#j*ay@9~A9#4-`-H zIf3z)oe`z^Ze!_rpIbfQhR@kpp66CoH2K}w%HKP>n`RZpxcldx_dBOUWzHA#7ybuK C{DWHn diff --git a/languages/comfino-payment-gateway-pl_PL.po b/languages/comfino-payment-gateway-pl_PL.po index ab116ddb..3ddb3cd6 100644 --- a/languages/comfino-payment-gateway-pl_PL.po +++ b/languages/comfino-payment-gateway-pl_PL.po @@ -3,17 +3,16 @@ msgid "" msgstr "" "Project-Id-Version: Comfino payment gateway 4.2.7\n" -"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/comfino-payment-" -"gateway\n" -"POT-Creation-Date: 2026-02-12T14:01:18+00:00\n" -"PO-Revision-Date: 2026-02-12 15:02+0100\n" +"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/comfino-payment-gateway\n" +"POT-Creation-Date: 2026-05-12T08:13:49+00:00\n" +"PO-Revision-Date: 2026-05-12 19:00+0200\n" "Last-Translator: \n" "Language-Team: \n" "Language: pl_PL\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 3.8\n" +"X-Generator: Poedit 3.9\n" "X-Domain: comfino-payment-gateway\n" #. Plugin Name of the plugin @@ -41,139 +40,136 @@ msgstr "Comfino" msgid "https://github.com/comfino" msgstr "https://github.com/comfino" +#: comfino-payment-gateway.php:259 +msgid "Comfino requires OpenSSL >= 1.1.0 (SHA-3 support) for the V3 paywall." +msgstr "" +"Comfino wymaga biblioteki OpenSSL w wersji co najmniej 1.1.0 (z obsługą algorytmu SHA-3) do " +"obsługi mechanizmu płatności V3." + #. translators: 1: Previous plugin version 2: Current plugin version -#: comfino-payment-gateway.php:324 +#: comfino-payment-gateway.php:332 msgid "Comfino plugin updated from version %1$s to %2$s." msgstr "Wtyczka Comfino została zaktualizowana z wersji %1$s do %2$s." -#: comfino-payment-gateway.php:337 +#: comfino-payment-gateway.php:345 msgid "Plugin reset completed with some errors." msgstr "Resetowanie wtyczki zakończone z pewnymi błędami." -#: comfino-payment-gateway.php:338 +#: comfino-payment-gateway.php:346 msgid "Plugin reset completed successfully." msgstr "Resetowanie wtyczki zakończony pomyślnie." #. translators: 1: Number of configuration options repaired 2: Number of configuration options failed -#: comfino-payment-gateway.php:341 +#: comfino-payment-gateway.php:349 msgid "Configuration: %1$d repaired, %2$d failed" msgstr "Konfiguracja: %1$d naprawionych, %2$d nieudanych" -#: comfino-payment-gateway.php:356 +#: comfino-payment-gateway.php:364 msgid "Error log cleared successfully." msgstr "Log błędów wyczyszczony pomyślnie." -#: comfino-payment-gateway.php:367 +#: comfino-payment-gateway.php:375 msgid "Debug log cleared successfully." msgstr "Log debugowania wyczyszczony pomyślnie." #. translators: 1: Current version 2: Available version 3: GitHub releases URL -#: comfino-payment-gateway.php:416 +#: comfino-payment-gateway.php:424 msgid "" -"Comfino Payment Gateway: A new version (%2$s) is available " -"on GitHub. You are currently using version %1$s. Visit GitHub Releases for more information." +"Comfino Payment Gateway: A new version (%2$s) is available on GitHub. You are " +"currently using version %1$s. Visit GitHub Releases for " +"more information." msgstr "" -"Bramka płatności Comfino: Nowa wersja (%2$s) jest dostępna " -"na GitHub. Obecnie używasz wersji %1$s. Odwiedź GitHub Releases, aby uzyskać więcej informacji." +"Bramka płatności Comfino: Nowa wersja (%2$s) jest dostępna na GitHub. Obecnie " +"używasz wersji %1$s. Odwiedź GitHub Releases, aby " +"uzyskać więcej informacji." -#: comfino-payment-gateway.php:480 +#: comfino-payment-gateway.php:488 msgid "Invalid nonce." msgstr "Nieprawidłowy nonce." -#: comfino-payment-gateway.php:486 +#: comfino-payment-gateway.php:494 msgid "Insufficient permissions." msgstr "Niewystarczające uprawnienia." -#: comfino-payment-gateway.php:493 +#: comfino-payment-gateway.php:501 msgid "Notice dismissed." msgstr "Powiadomienie zostało odrzucone." -#: src/Api/ApiClient.php:79 src/View/FrontendManager.php:566 -msgid "" -"There was a technical problem. Please try again in a moment and it should " -"work!" -msgstr "" -"Wystąpił problem techniczny. Spróbuj ponownie za chwilę i powinno się udać!" +#: src/Api/ApiClient.php:79 src/View/FrontendManager.php:581 +msgid "There was a technical problem. Please try again in a moment and it should work!" +msgstr "Wystąpił problem techniczny. Spróbuj ponownie za chwilę i powinno się udać!" #: src/Api/ApiClient.php:116 -msgid "" -"We have a configuration problem. The store is already working on a solution!" +msgid "We have a configuration problem. The store is already working on a solution!" msgstr "Mamy problem z konfiguracją. Sklep już pracuje nad rozwiązaniem!" #: src/Api/ApiClient.php:121 msgid "It looks like we have an outage. We'll fix it as soon as possible!" -msgstr "" -"Wygląda na to, że mamy awarię. Naprawimy ją tak szybko, jak to możliwe!" +msgstr "Wygląda na to, że mamy awarię. Naprawimy ją tak szybko, jak to możliwe!" #: src/Main.php:138 msgid "Settings" msgstr "Ustawienia" #. translators: 1: Minimum required PHP version 2: Current PHP version -#: src/Main.php:383 +#: src/Main.php:435 msgid "" -"The plugin could not be activated. The minimum PHP version required for " -"Comfino is %1$s. You are running %2$s." +"The plugin could not be activated. The minimum PHP version required for Comfino is %1$s. You " +"are running %2$s." msgstr "" -"Wtyczka nie mogła zostać włączona. Minimalna wersja PHP wymagana dla Comfino " -"to %1$s. Używasz %2$s." +"Wtyczka nie mogła zostać włączona. Minimalna wersja PHP wymagana dla Comfino to %1$s. Używasz " +"%2$s." #. translators: 1: Minimum required PHP version 2: Current PHP version -#: src/Main.php:389 +#: src/Main.php:441 msgid "" -"The Comfino plugin has been deactivated. The minimum PHP version required " -"for Comfino is %1$s. You are running %2$s." +"The Comfino plugin has been deactivated. The minimum PHP version required for Comfino is %1$s. " +"You are running %2$s." msgstr "" -"Wtyczka Comfino została wyłączona. Minimalna wersja PHP wymagana dla Comfino " -"to %1$s. Używasz %2$s." +"Wtyczka Comfino została wyłączona. Minimalna wersja PHP wymagana dla Comfino to %1$s. Używasz " +"%2$s." -#: src/Main.php:397 +#: src/Main.php:449 msgid "The plugin could not be activated. WooCommerce needs to be activated." msgstr "Wtyczka nie mogła zostać włączona. WooCommerce musi zostać aktywowany." -#: src/Main.php:398 -msgid "" -"The Comfino plugin has been deactivated. WooCommerce needs to be activated." +#: src/Main.php:450 +msgid "The Comfino plugin has been deactivated. WooCommerce needs to be activated." msgstr "Wtyczka Comfino została wyłączona. WooCommerce musi zostać aktywowany." #. translators: 1: Minimum required WooCommerce version 2: Current WooCommerce version -#: src/Main.php:405 +#: src/Main.php:457 msgid "" -"The plugin could not be activated. The minimum WooCommerce version required " -"for Comfino is %1$s. You are running %2$s." +"The plugin could not be activated. The minimum WooCommerce version required for Comfino is " +"%1$s. You are running %2$s." msgstr "" -"Wtyczka nie mogła zostać włączona. Minimalna wersja WooCommerce wymagana dla " -"Comfino to %1$s. Używasz %2$s." +"Wtyczka nie mogła zostać włączona. Minimalna wersja WooCommerce wymagana dla Comfino to %1$s. " +"Używasz %2$s." #. translators: 1: Minimum required WooCommerce version 2: Current WooCommerce version -#: src/Main.php:411 +#: src/Main.php:463 msgid "" -"The Comfino plugin has been deactivated. The minimum WooCommerce version " -"required for Comfino is %1$s. You are running %2$s." +"The Comfino plugin has been deactivated. The minimum WooCommerce version required for Comfino " +"is %1$s. You are running %2$s." msgstr "" -"Wtyczka Comfino została wyłączona. Minimalna wersja WooCommerce wymagana dla " -"Comfino to %1$s. Używasz %2$s." +"Wtyczka Comfino została wyłączona. Minimalna wersja WooCommerce wymagana dla Comfino to %1$s. " +"Używasz %2$s." -#: src/Main.php:419 +#: src/Main.php:471 msgid "" -"The plugin could not be activated. It requires PHP cURL extension which is " -"not installed. More details: https://www.php.net/manual/en/book.curl.php" +"The plugin could not be activated. It requires PHP cURL extension which is not installed. More " +"details: https://www.php.net/manual/en/book.curl.php" msgstr "" -"Wtyczka nie mogła zostać włączona. Wymaga rozszerzenia PHP cURL, które nie " -"jest zainstalowane. Więcej szczegółów: https://www.php.net/manual/en/" -"book.curl.php" +"Wtyczka nie mogła zostać włączona. Wymaga rozszerzenia PHP cURL, które nie jest zainstalowane. " +"Więcej szczegółów: https://www.php.net/manual/en/book.curl.php" -#: src/Main.php:420 +#: src/Main.php:472 msgid "" -"The Comfino plugin has been deactivated. It requires PHP cURL extension " -"which is not installed. More details: https://www.php.net/manual/en/" -"book.curl.php" +"The Comfino plugin has been deactivated. It requires PHP cURL extension which is not " +"installed. More details: https://www.php.net/manual/en/book.curl.php" msgstr "" -"Wtyczka Comfino została wyłączona. Wymaga rozszerzenia PHP cURL, które nie " -"jest zainstalowane. Więcej szczegółów: https://www.php.net/manual/en/" -"book.curl.php" +"Wtyczka Comfino została wyłączona. Wymaga rozszerzenia PHP cURL, które nie jest zainstalowane. " +"Więcej szczegółów: https://www.php.net/manual/en/book.curl.php" #: src/Order/ShopStatusManager.php:72 msgid "Order cancellation sent to Comfino." @@ -187,112 +183,99 @@ msgstr "Przypomnienie o zamówieniu" msgid "Comfino status" msgstr "Status Comfino" -#: src/PaymentGateway.php:43 +#: src/PaymentGateway.php:44 msgid "Comfino payments" msgstr "Płatności Comfino" -#: src/PaymentGateway.php:44 +#: src/PaymentGateway.php:45 msgid "" -"Comfino is an innovative payment method for customers of e-commerce stores! " -"These are installment payments, deferred (buy now, pay later) and corporate " -"payments available on one platform with the help of quick integration. Grow " -"your business with Comfino!" +"Comfino is an innovative payment method for customers of e-commerce stores! These are " +"installment payments, deferred (buy now, pay later) and corporate payments available on one " +"platform with the help of quick integration. Grow your business with Comfino!" msgstr "" -"Comfino to nowatorska metoda płatności dla klientów sklepów e-commerce! To " -"płatności ratalne, odroczone (kup teraz, zapłać później) oraz płatności dla " -"firm dostępne na jednej platformie za pomocą szybkiej integracji. Rozwijaj " -"swój biznes z Comfino!" +"Comfino to nowatorska metoda płatności dla klientów sklepów e-commerce! To płatności ratalne, " +"odroczone (kup teraz, zapłać później) oraz płatności dla firm dostępne na jednej platformie za " +"pomocą szybkiej integracji. Rozwijaj swój biznes z Comfino!" -#: src/PaymentGateway.php:48 +#: src/PaymentGateway.php:49 msgid "" -"The wide range of Comfino installment payments means fast and safe shopping " -"without burdening your budget here and now. Unexpected expenses, larger " -"purchases, or maybe you just prefer to pay later? With Comfino you have a " -"choice! 0% installments, Convenient Installments and deferred payments \"Buy " -"now, pay later\". All so that you can enjoy shopping without worrying about " -"your finances." -msgstr "" -"Szeroki wybór płatności ratalnych Comfino to szybkie i bezpieczne zakupy bez " -"obciążania budżetu tu i teraz. Niespodziewane wydatki, większe zakupy, a " -"może po prostu wolisz zapłacić później? Z Comfino masz wybór! Raty 0%, " -"Niskie Raty oraz płatności odroczone \"Kup teraz, zapłać później\". Wszystko " -"po to, abyś mógł cieszyć się zakupami bez obawy o finanse." - -#: src/PaymentGateway.php:170 -msgid "Preselected financial offer data incomplete. Please try again." +"The wide range of Comfino installment payments means fast and safe shopping without burdening " +"your budget here and now. Unexpected expenses, larger purchases, or maybe you just prefer to " +"pay later? With Comfino you have a choice! 0% installments, Convenient Installments and " +"deferred payments \"Buy now, pay later\". All so that you can enjoy shopping without worrying " +"about your finances." msgstr "" -"Dane wstępnie wybranej oferty finansowej są niekompletne. Spróbuj ponownie." +"Szeroki wybór płatności ratalnych Comfino to szybkie i bezpieczne zakupy bez obciążania " +"budżetu tu i teraz. Niespodziewane wydatki, większe zakupy, a może po prostu wolisz zapłacić " +"później? Z Comfino masz wybór! Raty 0%, Niskie Raty oraz płatności odroczone \"Kup teraz, " +"zapłać później\". Wszystko po to, abyś mógł cieszyć się zakupami bez obawy o finanse." -#: src/PaymentGateway.php:227 +#: src/PaymentGateway.php:169 +msgid "Preselected financial offer data incomplete. Please try again." +msgstr "Dane wstępnie wybranej oferty finansowej są niekompletne. Spróbuj ponownie." + +#: src/PaymentGateway.php:224 msgid "Comfino create order" msgstr "Wniosek Comfino stworzony" #. translators: 1: WordPress version 2: WooCommerce version 3: Comfino plugin version -#: src/PaymentGateway.php:285 +#: src/PaymentGateway.php:282 msgid "WordPress %1$s WooCommerce %2$s Comfino %3$s - question" msgstr "WordPress %1$s WooCommerce %2$s Comfino %3$s - pytanie" -#: src/PaymentGateway.php:297 +#: src/PaymentGateway.php:294 msgid "Do you want to ask about something? Write to us at" msgstr "Chcesz o coś zapytać? Napisz do nas na adres" #. translators: s%: Comfino support telephone -#: src/PaymentGateway.php:300 +#: src/PaymentGateway.php:297 msgid "" -"or contact us by phone. We are waiting on the number: %s. We will answer all " -"your questions!" +"or contact us by phone. We are waiting on the number: %s. We will answer all your questions!" msgstr "" -"lub skontaktuj się telefonicznie. Czekamy pod numerem: %s. Odpowiemy na " -"każde Twoje pytanie!" +"lub skontaktuj się telefonicznie. Czekamy pod numerem: %s. Odpowiemy na każde Twoje pytanie!" -#: src/PaymentGateway.php:527 -msgid "" -"Invalid customer e-mail address. Please check your account contact data." +#: src/PaymentGateway.php:529 +msgid "Invalid customer e-mail address. Please check your account contact data." msgstr "Nieprawidłowy adres e-mail klienta. Sprawdź dane kontaktowe konta." -#: src/PaymentGateway.php:534 -msgid "" -"Phone number is required. Please add a phone number to your billing or " -"delivery address." +#: src/PaymentGateway.php:536 +msgid "Phone number is required. Please add a phone number to your billing or delivery address." msgstr "" -"Numer telefonu jest wymagany. Dodaj numer telefonu do adresu rozliczeniowego " -"lub dostawy." +"Numer telefonu jest wymagany. Dodaj numer telefonu do adresu rozliczeniowego lub dostawy." -#: src/PaymentGateway.php:542 +#: src/PaymentGateway.php:544 msgid "First name is required." msgstr "Imię jest wymagane." -#: src/PaymentGateway.php:546 +#: src/PaymentGateway.php:548 msgid "Last name is required." msgstr "Nazwisko jest wymagane." -#: src/PaymentGateway.php:553 +#: src/PaymentGateway.php:555 msgid "Delivery address is required." msgstr "Adres dostawy jest wymagany." -#: src/PaymentGateway.php:556 +#: src/PaymentGateway.php:558 msgid "City/Town is required." msgstr "Miejscowość jest wymagana." -#: src/PaymentGateway.php:560 +#: src/PaymentGateway.php:562 msgid "Postal code is required." msgstr "Kod pocztowy jest wymagany." -#: src/PaymentGateway.php:568 +#: src/PaymentGateway.php:570 msgid "Cart is empty. Please add products to your cart." msgstr "Koszyk jest pusty. Dodaj produkty do koszyka." -#: src/PaymentGateway.php:573 +#: src/PaymentGateway.php:575 msgid "Cart total amount must be greater than zero." msgstr "Łączna kwota koszyka musi być większa niż zero." -#: src/PaymentGateway.php:578 +#: src/PaymentGateway.php:580 msgid "" -"Comfino payment is not available for this cart. Please check cart amount and " -"product types." +"Comfino payment is not available for this cart. Please check cart amount and product types." msgstr "" -"Płatność Comfino nie jest dostępna dla tego koszyka. Sprawdź kwotę koszyka i " -"typy produktów." +"Płatność Comfino nie jest dostępna dla tego koszyka. Sprawdź kwotę koszyka i typy produktów." #. translators: s%: Validated form field name #: src/View/SettingsForm.php:49 @@ -304,7 +287,7 @@ msgstr "Pole '%s' nie może być puste." msgid "Field '%s' has wrong numeric format." msgstr "Pole '%s' ma nieprawidłowy format numeryczny." -#: src/View/SettingsForm.php:63 src/View/SettingsForm.php:467 +#: src/View/SettingsForm.php:63 src/View/SettingsForm.php:536 msgid "Production environment API key" msgstr "Klucz API środowiska produkcyjnego" @@ -312,311 +295,345 @@ msgstr "Klucz API środowiska produkcyjnego" msgid "Payment text" msgstr "Tekst płatności" -#: src/View/SettingsForm.php:69 src/View/SettingsForm.php:71 -#: src/View/SettingsForm.php:477 +#: src/View/SettingsForm.php:69 src/View/SettingsForm.php:71 src/View/SettingsForm.php:546 msgid "Minimal amount in cart" msgstr "Minimalna kwota w koszyku" -#. translators: s%: Comfino API key -#: src/View/SettingsForm.php:116 src/View/SettingsForm.php:226 -msgid "API key %s is not valid." -msgstr "Klucz API %s jest nieprawidłowy." - -#: src/View/SettingsForm.php:176 src/View/SettingsForm.php:597 -msgid "Price change detection - container hierarchy level" -msgstr "Wykrywanie zmian ceny - poziom hierarchii kontenera" - #. translators: s%: Custom CSS URL -#: src/View/SettingsForm.php:189 +#: src/View/SettingsForm.php:77 src/View/SettingsForm.php:237 msgid "Custom CSS URL \"%s\" is not valid." msgstr "Niestandardowy adres URL CSS \"%s\" jest nieprawidłowy." #. translators: s%: Custom CSS URL -#: src/View/SettingsForm.php:192 +#: src/View/SettingsForm.php:80 src/View/SettingsForm.php:240 msgid "Custom CSS URL \"%s\" is not absolute." msgstr "Niestandardowy adres URL CSS \"%s\" nie jest absolutny." #. translators: 1: Custom CSS URL 2: Shop domain -#: src/View/SettingsForm.php:196 +#: src/View/SettingsForm.php:84 src/View/SettingsForm.php:244 msgid "Custom CSS URL \"%1$s\" is not in shop domain \"%2$s\"." -msgstr "" -"Niestandardowy adres URL CSS \"%1$s\" nie znajduje się w domenie sklepu " -"\"%2$s\"." +msgstr "Niestandardowy adres URL CSS \"%1$s\" nie znajduje się w domenie sklepu \"%2$s\"." + +#. translators: s%: Comfino API key +#: src/View/SettingsForm.php:133 src/View/SettingsForm.php:274 +msgid "API key %s is not valid." +msgstr "Klucz API %s jest nieprawidłowy." + +#: src/View/SettingsForm.php:224 src/View/SettingsForm.php:693 +msgid "Price change detection - container hierarchy level" +msgstr "Wykrywanie zmian ceny - poziom hierarchii kontenera" -#: src/View/SettingsForm.php:460 src/View/SettingsForm.php:648 +#: src/View/SettingsForm.php:402 src/View/SettingsForm.php:633 +msgid "Installment term limits" +msgstr "Ograniczenia dotyczące okresu spłaty" + +#: src/View/SettingsForm.php:529 src/View/SettingsForm.php:744 msgid "Enable/Disable" msgstr "Włączony/Wyłączony" -#: src/View/SettingsForm.php:462 +#: src/View/SettingsForm.php:531 msgid "Enable Comfino payment module" msgstr "Włączony moduł płatności Comfino" -#: src/View/SettingsForm.php:464 +#: src/View/SettingsForm.php:533 msgid "Shows Comfino payment option at the payment list." msgstr "Pokaż opcję płatności Comfino na liście płatności." -#: src/View/SettingsForm.php:469 +#: src/View/SettingsForm.php:538 msgid "Please enter the key provided during registration" msgstr "Proszę wprowadzić klucz podany podczas rejestracji" -#: src/View/SettingsForm.php:472 +#: src/View/SettingsForm.php:541 msgid "Title" msgstr "Tytuł" -#: src/View/SettingsForm.php:482 +#: src/View/SettingsForm.php:551 msgid "Show logo" msgstr "Wyświetlanie logo" -#: src/View/SettingsForm.php:484 +#: src/View/SettingsForm.php:553 msgid "Show logo on payment method" msgstr "Pokaż logo na metodzie płatności" -#: src/View/SettingsForm.php:488 +#: src/View/SettingsForm.php:557 msgid "Order number" msgstr "Numer zamówienia" -#: src/View/SettingsForm.php:490 +#: src/View/SettingsForm.php:559 msgid "Use order reference as external ID" msgstr "Użyj numeru zamówienia jako zewnętrznego ID" -#: src/View/SettingsForm.php:492 +#: src/View/SettingsForm.php:561 +msgid "" +"Use customer-visible order reference instead of numeric order ID for Comfino API integration. " +"New orders only." +msgstr "" +"Używaj numeru zamówienia widocznego dla klienta zamiast numerycznego ID zamówienia w " +"komunikacji z API Comfino. Dotyczy tylko nowych zamówień." + +#: src/View/SettingsForm.php:567 +msgid "Paywall settings" +msgstr "Ustawienia paywalla" + +#: src/View/SettingsForm.php:571 +msgid "Direct redirect mode" +msgstr "Tryb bezpośredniego przekierowania" + +#: src/View/SettingsForm.php:573 +msgid "Enable direct redirect to Comfino payment gateway" +msgstr "Włącz bezpośrednie przekierowanie do bramki płatniczej Comfino" + +#: src/View/SettingsForm.php:575 msgid "" -"Use customer-visible order reference instead of numeric order ID for Comfino " -"API integration. New orders only." +"When enabled, the full paywall offer browser is not displayed. The order is submitted with the " +"default financial product and the customer is redirected directly to the Comfino payment " +"gateway." msgstr "" -"Używaj numeru zamówienia widocznego dla klienta zamiast numerycznego ID " -"zamówienia w komunikacji z API Comfino. Dotyczy tylko nowych zamówień." +"Po włączeniu tej opcji nie wyświetla się pełna przeglądarka oferty z paywallem. Zamówienie " +"jest składane z domyślnym produktem finansowym, a klient zostaje przekierowany bezpośrednio do " +"bramki płatniczej Comfino." + +#: src/View/SettingsForm.php:581 +msgid "Custom paywall CSS style" +msgstr "Niestandardowy styl CSS paywalla" -#: src/View/SettingsForm.php:498 +#: src/View/SettingsForm.php:584 +msgid "" +"URL for a custom CSS file injected into the paywall iframe. Only links from your store domain " +"are allowed." +msgstr "" +"Adres URL niestandardowego pliku CSS, który ma zostać wstawiony do ramki iframe paywalla. " +"Dozwolone są wyłącznie linki z domeny Twojego sklepu." + +#: src/View/SettingsForm.php:590 msgid "Test environment" msgstr "Środowisko testowe" -#: src/View/SettingsForm.php:500 +#: src/View/SettingsForm.php:592 msgid "Use test environment" msgstr "Użyj środowiska testowego" -#: src/View/SettingsForm.php:502 +#: src/View/SettingsForm.php:594 msgid "" -"The test environment allows the store owner to get acquainted with the " -"functionality of the Comfino module. This is a Comfino simulator, thanks to " -"which you can get to know all the advantages of this payment method. The use " -"of the test mode is free (there are also no charges for orders)." +"The test environment allows the store owner to get acquainted with the functionality of the " +"Comfino module. This is a Comfino simulator, thanks to which you can get to know all the " +"advantages of this payment method. The use of the test mode is free (there are also no charges " +"for orders)." msgstr "" -"Środowisko testowe pozwala właścicielowi sklepu zapoznać się z " -"funkcjonalnością modułu Comfino. To symulator Comfino, dzięki któremu można " -"poznać wszystkie zalety tej metody płatności. Użycie trybu testowego jest " -"darmowe (nie są również pobierane opłaty za zamówienia)." +"Środowisko testowe pozwala właścicielowi sklepu zapoznać się z funkcjonalnością modułu " +"Comfino. To symulator Comfino, dzięki któremu można poznać wszystkie zalety tej metody " +"płatności. Użycie trybu testowego jest darmowe (nie są również pobierane opłaty za zamówienia)." -#: src/View/SettingsForm.php:508 +#: src/View/SettingsForm.php:600 msgid "Test environment API key" msgstr "Klucz API środowiska testowego" -#: src/View/SettingsForm.php:510 +#: src/View/SettingsForm.php:602 msgid "" -"Ask the supervisor for access to the test environment (key, login, password, " -"link). Remember, the test key is different from the production key." +"Ask the supervisor for access to the test environment (key, login, password, link). Remember, " +"the test key is different from the production key." msgstr "" -"Poproś opiekuna o dostęp do środowiska testowego (klucz, login, hasło, " -"link). Pamiętaj, klucz testowy różni się od klucza produkcyjnego." +"Poproś opiekuna o dostęp do środowiska testowego (klucz, login, hasło, link). Pamiętaj, klucz " +"testowy różni się od klucza produkcyjnego." -#: src/View/SettingsForm.php:513 +#: src/View/SettingsForm.php:605 msgid "Debug mode" msgstr "Tryb debugowania" -#: src/View/SettingsForm.php:515 +#: src/View/SettingsForm.php:607 msgid "Enable debug mode" msgstr "Włącz tryb debugowania" -#: src/View/SettingsForm.php:517 +#: src/View/SettingsForm.php:609 msgid "" -"Debug mode is useful in case of problems with Comfino payment availability. " -"In this mode module logs details of internal process responsible for " -"displaying of Comfino payment option at the payment methods list." +"Debug mode is useful in case of problems with Comfino payment availability. In this mode " +"module logs details of internal process responsible for displaying of Comfino payment option " +"at the payment methods list." msgstr "" -"Tryb debugowania przydaje się w przypadku problemów z dostępnością płatności " -"Comfino. W tym trybie moduł rejestruje szczegóły wewnętrznego procesu " -"odpowiedzialnego za wyświetlenie opcji płatności Comfino na liście metod " -"płatności." +"Tryb debugowania przydaje się w przypadku problemów z dostępnością płatności Comfino. W tym " +"trybie moduł rejestruje szczegóły wewnętrznego procesu odpowiedzialnego za wyświetlenie opcji " +"płatności Comfino na liście metod płatności." -#: src/View/SettingsForm.php:523 +#: src/View/SettingsForm.php:615 msgid "Service mode" msgstr "Tryb serwisowy" -#: src/View/SettingsForm.php:525 +#: src/View/SettingsForm.php:617 msgid "Enable service mode" msgstr "Włącz tryb serwisowy" -#: src/View/SettingsForm.php:527 +#: src/View/SettingsForm.php:619 msgid "" -"Service mode is useful in testing Comfino payment gateway without sharing it " -"with customers. In this mode Comfino payment method is visible only for " -"selected sessions and debug logs are collected only for these sessions." +"Service mode is useful in testing Comfino payment gateway without sharing it with customers. " +"In this mode Comfino payment method is visible only for selected sessions and debug logs are " +"collected only for these sessions." msgstr "" -"Tryb serwisowy jest przydatny do testowania bramki płatniczej Comfino bez " -"konieczności udostępniania jej klientom. W tym trybie metoda płatności " -"Comfino widoczna jest tylko dla wybranych sesji, a logi debugowania są " -"zbierane wyłącznie dla tych sesji." +"Tryb serwisowy jest przydatny do testowania bramki płatniczej Comfino bez konieczności " +"udostępniania jej klientom. W tym trybie metoda płatności Comfino widoczna jest tylko dla " +"wybranych sesji, a logi debugowania są zbierane wyłącznie dla tych sesji." -#: src/View/SettingsForm.php:537 +#: src/View/SettingsForm.php:629 msgid "Rules for the availability of financial products" msgstr "Reguły dostępności produktów finansowych" -#: src/View/SettingsForm.php:541 +#: src/View/SettingsForm.php:372 src/View/SettingsForm.php:642 +msgid "Product categories" +msgstr "Kategorie produktów" + +#: src/View/SettingsForm.php:375 +msgid "" +"Restrict the availability of each financial product type by product category. For each " +"financial product listed below, select the categories whose products should be eligible for " +"that payment option. If a customer's cart contains only products from unselected categories, " +"that financial product will not be offered at checkout." +msgstr "" +"Ograniczanie dostępności poszczególnych typów produktów finansowych według kategorii " +"produktów. Dla każdego wymienionego poniżej produktu finansowego wybierz kategorie, których " +"produkty powinny kwalifikować się do tej opcji płatności. Jeśli koszyk klienta zawiera " +"wyłącznie produkty z niewybranych kategorii, dany produkt finansowy nie będzie oferowany " +"podczas finalizacji zamówienia." + +#: src/View/SettingsForm.php:637 msgid "Basic settings" msgstr "Ustawienia podstawowe" -#: src/View/SettingsForm.php:545 +#: src/View/SettingsForm.php:641 msgid "Widget enable" msgstr "Widget włączony" -#: src/View/SettingsForm.php:547 +#: src/View/SettingsForm.php:643 msgid "Enable Comfino widget" msgstr "Włączony widget Comfino" -#: src/View/SettingsForm.php:549 +#: src/View/SettingsForm.php:645 msgid "Show Comfino widget in the product." msgstr "Pokazuj widget Comfino w produkcie." -#: src/View/SettingsForm.php:552 +#: src/View/SettingsForm.php:648 msgid "Widget key" msgstr "Klucz widgetu" -#: src/View/SettingsForm.php:556 +#: src/View/SettingsForm.php:652 msgid "Widget type" msgstr "Typ widgetu" -#: src/View/SettingsForm.php:561 +#: src/View/SettingsForm.php:657 msgid "Offer types" msgstr "Typy ofert" -#: src/View/SettingsForm.php:565 +#: src/View/SettingsForm.php:661 msgid "" -"Other payment methods (Installments 0%, Buy now, pay later, Installments for " -"companies, Leasing) available after consulting a Comfino advisor " -"(kontakt@comfino.pl)." +"Other payment methods (Installments 0%, Buy now, pay later, Installments for companies, " +"Leasing) available after consulting a Comfino advisor (kontakt@comfino.pl)." msgstr "" -"Inne sposoby płatności (Raty 0%, Kup teraz, zapłać później, Raty dla firm, " -"Leasing) dostępne po konsultacji z doradcą Comfino (kontakt@comfino.pl)." +"Inne sposoby płatności (Raty 0%, Kup teraz, zapłać później, Raty dla firm, Leasing) dostępne " +"po konsultacji z doradcą Comfino (kontakt@comfino.pl)." -#: src/View/SettingsForm.php:568 +#: src/View/SettingsForm.php:664 msgid "Show logos" msgstr "Wyświetlanie logotypów" -#: src/View/SettingsForm.php:570 +#: src/View/SettingsForm.php:666 msgid "Show logos of financial services providers" msgstr "Pokaż loga dostawców usług finansowych" -#: src/View/SettingsForm.php:574 +#: src/View/SettingsForm.php:670 msgid "Advanced settings" msgstr "Ustawienia zaawansowane" -#: src/View/SettingsForm.php:578 +#: src/View/SettingsForm.php:674 msgid "Widget price element selector" msgstr "Selektor elementu ceny widgetu" -#: src/View/SettingsForm.php:583 +#: src/View/SettingsForm.php:679 msgid "Widget anchor element selector" msgstr "Selektor elementu zakotwiczenia widgetu" -#: src/View/SettingsForm.php:588 +#: src/View/SettingsForm.php:684 msgid "Price change detection - container selector" msgstr "Wykrywanie zmian ceny - selektor kontenera" -#: src/View/SettingsForm.php:591 +#: src/View/SettingsForm.php:687 msgid "Selector of observed parent element which contains price element." -msgstr "" -"Selektor obserwowanego elementu nadrzędnego, który zawiera element ceny." +msgstr "Selektor obserwowanego elementu nadrzędnego, który zawiera element ceny." -#: src/View/SettingsForm.php:600 -msgid "" -"Hierarchy level of observed parent element relative to the price element." -msgstr "" -"Poziom hierarchii obserwowanego elementu nadrzędnego względem elementu ceny." +#: src/View/SettingsForm.php:696 +msgid "Hierarchy level of observed parent element relative to the price element." +msgstr "Poziom hierarchii obserwowanego elementu nadrzędnego względem elementu ceny." -#: src/View/SettingsForm.php:606 +#: src/View/SettingsForm.php:702 msgid "Embedding method" msgstr "Metoda osadzania" -#: src/View/SettingsForm.php:616 +#: src/View/SettingsForm.php:712 msgid "Custom banner CSS style" msgstr "Niestandardowy styl CSS banera" -#: src/View/SettingsForm.php:619 -msgid "" -"URL for the custom banner style. Only links from your store domain are " -"allowed." -msgstr "" -"Adres URL niestandardowego stylu banera. Dozwolone są tylko linki z domeny " -"sklepu." +#: src/View/SettingsForm.php:715 +msgid "URL for the custom banner style. Only links from your store domain are allowed." +msgstr "Adres URL niestandardowego stylu banera. Dozwolone są tylko linki z domeny sklepu." -#: src/View/SettingsForm.php:625 +#: src/View/SettingsForm.php:721 msgid "Custom calculator CSS style" msgstr "Niestandardowy styl CSS kalkulatora" -#: src/View/SettingsForm.php:628 -msgid "" -"URL for the custom calculator style. Only links from your store domain are " -"allowed." -msgstr "" -"Adres URL niestandardowego stylu kalkulatora. Dozwolone są tylko linki z " -"domeny sklepu." +#: src/View/SettingsForm.php:724 +msgid "URL for the custom calculator style. Only links from your store domain are allowed." +msgstr "Adres URL niestandardowego stylu kalkulatora. Dozwolone są tylko linki z domeny sklepu." -#: src/View/SettingsForm.php:634 +#: src/View/SettingsForm.php:730 msgid "Widget initialization code" msgstr "Kod inicjalizacji widgetu" -#: src/View/SettingsForm.php:650 +#: src/View/SettingsForm.php:746 msgid "" -"By enabling \"Saving shopping cart\", you agree and accept Regulations" msgstr "" -"Włączając \"Ratowanie koszyków\" zgadzasz się i akceptujesz Regulamin" +"Włączając \"Ratowanie koszyków\" zgadzasz się i akceptujesz Regulamin" -#: src/View/SettingsForm.php:652 +#: src/View/SettingsForm.php:748 msgid "" -"With the \"Cart Rescue\" feature, you will effectively minimize the problem " -"of abandoned carts that all sellers face. When a customer adds products to " -"the cart but abandons it, also due to an unsuccessful payment, they will " -"automatically receive a reminder e-mail with a direct link leading to " -"payment. This service allows you to effectively recover potential " -"transactions and increase order conversions." -msgstr "" -"Dzięki funkcji \"Ratowanie koszyków\" efektywnie zminimalizujesz problem " -"porzuconych koszyków, z którym borykają się wszyscy sprzedawcy. Gdy klient " -"dodaje produkty do koszyka, ale porzuca go, także z powodu nieudanej " -"płatności, automatycznie otrzyma przypominający e-mail z bezpośrednim " -"linkiem prowadzącym do płatności. Ta usługa pozwala skutecznie odzyskiwać " +"With the \"Cart Rescue\" feature, you will effectively minimize the problem of abandoned carts " +"that all sellers face. When a customer adds products to the cart but abandons it, also due to " +"an unsuccessful payment, they will automatically receive a reminder e-mail with a direct link " +"leading to payment. This service allows you to effectively recover potential transactions and " +"increase order conversions." +msgstr "" +"Dzięki funkcji \"Ratowanie koszyków\" efektywnie zminimalizujesz problem porzuconych koszyków, " +"z którym borykają się wszyscy sprzedawcy. Gdy klient dodaje produkty do koszyka, ale porzuca " +"go, także z powodu nieudanej płatności, automatycznie otrzyma przypominający e-mail z " +"bezpośrednim linkiem prowadzącym do płatności. Ta usługa pozwala skutecznie odzyskiwać " "potencjalne transakcje i zwiększać konwersję zamówień." -#: src/View/SettingsForm.php:655 +#: src/View/SettingsForm.php:751 msgid "View in payment list" msgstr "Wyświetlaj na liście płatności" -#: src/View/SettingsForm.php:658 +#: src/View/SettingsForm.php:754 msgid "Only Comfino" msgstr "Tylko Comfino" -#: src/View/SettingsForm.php:659 +#: src/View/SettingsForm.php:755 msgid "All payments" msgstr "Wszystkie płatności" -#: src/View/SettingsForm.php:666 +#: src/View/SettingsForm.php:762 msgid "Environment variables" msgstr "Zmienne środowiskowe" -#: src/View/SettingsForm.php:668 +#: src/View/SettingsForm.php:764 msgid "Use development environment variables" msgstr "Użyj zmiennych środowiska deweloperskiego" -#: src/View/SettingsForm.php:670 +#: src/View/SettingsForm.php:766 msgid "" -"Use of development environment variables with custom hosts which overwrite " -"hosts stored in the plugin." +"Use of development environment variables with custom hosts which overwrite hosts stored in the " +"plugin." msgstr "" -"Wykorzystanie zmiennych środowiska deweloperskiego z niestandardowymi " -"hostami, które nadpisują hosty przechowywane we wtyczce." +"Wykorzystanie zmiennych środowiska deweloperskiego z niestandardowymi hostami, które nadpisują " +"hosty przechowywane we wtyczce." #: views/admin/configuration.php:71 msgid "Payment settings" @@ -648,38 +665,69 @@ msgstr "Tryb debugowania Comfino aktywny" #: views/admin/debug-mode-notice.php:19 msgid "" -"Detailed logging is enabled. This may impact performance and should not be " -"used in production environments." +"Detailed logging is enabled. This may impact performance and should not be used in production " +"environments." msgstr "" -"Szczegółowe logowanie jest włączone. Może to wpływać na wydajność i nie " -"powinno być używane w środowiskach produkcyjnych." +"Szczegółowe logowanie jest włączone. Może to wpływać na wydajność i nie powinno być używane w " +"środowiskach produkcyjnych." #. translators: %s: Link to plugin settings #: views/admin/debug-mode-notice.php:24 msgid "You can disable debug mode in the plugin settings." -msgstr "" -"Możesz wyłączyć tryb debugowania w ustawieniach wtyczki." +msgstr "Możesz wyłączyć tryb debugowania w ustawieniach wtyczki." #. translators: 1: Plugin version 2: Required PHP version 3: Current PHP version 4: Link to compatible version #: views/admin/php-compatibility-notice.php:24 msgid "" -"Comfino Payment Gateway: Plugin version %1$s requires PHP " -"%2$s or higher. You are running PHP %3$s. Please upgrade your PHP version or " -"downgrade to %4$s (compatible with PHP 7.0+)." +"Comfino Payment Gateway: Plugin version %1$s requires PHP %2$s or higher. You " +"are running PHP %3$s. Please upgrade your PHP version or downgrade to %4$s (compatible with " +"PHP 7.0+)." msgstr "" -"Bramka płatności Comfino: Wtyczka w wersji %1$s wymaga PHP " -"%2$s lub wyższej. Używasz PHP %3$s. Zaktualizuj wersję PHP lub zainstaluj " -"%4$s (kompatybilną z PHP 7.0+)." +"Bramka płatności Comfino: Wtyczka w wersji %1$s wymaga PHP %2$s lub wyższej. " +"Używasz PHP %3$s. Zaktualizuj wersję PHP lub zainstaluj %4$s (kompatybilną z PHP 7.0+)." #: views/admin/php-compatibility-notice.php:40 msgid "" -"Comfino Payment Gateway: The plugin has been automatically " -"deactivated to prevent fatal errors. Please resolve the PHP version issue " -"before reactivating." +"Comfino Payment Gateway: The plugin has been automatically deactivated to " +"prevent fatal errors. Please resolve the PHP version issue before reactivating." +msgstr "" +"Bramka płatności Comfino: Wtyczka została automatycznie wyłączona, aby " +"zapobiec błędom krytycznym. Rozwiąż problem z wersją PHP przed ponownym włączeniem." + +#: views/admin/_configure/allowed-products-config.php:14 +msgid "Product type" +msgstr "Typ produktu finansowego" + +#: views/admin/_configure/allowed-products-config.php:15 +msgid "Min term" +msgstr "Minimalny okres" + +#: views/admin/_configure/allowed-products-config.php:16 +msgid "Max term" +msgstr "Maksymalny okres" + +#: views/admin/_configure/allowed-products-config.php:17 +msgid "Specific terms (comma-separated)" +msgstr "Wyszczególnione okresy (rozdzielone przecinkami)" + +#: views/admin/_configure/allowed-products-config.php:34 +#: views/admin/_configure/allowed-products-config.php:41 +msgid "No limit" +msgstr "Brak ograniczeń" + +#: views/admin/_configure/allowed-products-config.php:48 +msgid "e.g. 6,12,24,36" +msgstr "np. 6,12,24,36" + +#: views/admin/_configure/allowed-products-config.php:65 +msgid "" +"Leave fields empty to apply no restriction for that product type. All constraints are " +"cumulative: when \"Specific terms\" is set, only those exact terms are offered; \"Min/Max " +"term\" further narrows them down." msgstr "" -"Bramka płatności Comfino: Wtyczka została automatycznie " -"wyłączona, aby zapobiec błędom krytycznym. Rozwiąż problem z wersją PHP " -"przed ponownym włączeniem." +"Pozostaw pola puste, aby nie stosować żadnych ograniczeń dla danego typu produktu. Wszystkie " +"ograniczenia działają łącznie: jeśli ustawione są \"Wyszczególnione okresy\", oferowane są " +"tylko te konkretne okresy; wartości \"Min./Maks. okres\" dodatkowo je zawężają." #: views/admin/_configure/debug-log.php:16 msgid "Debug log" @@ -733,8 +781,7 @@ msgstr "Log dezinstalacji" msgid "No uninstallation log available." msgstr "Log dezinstalacji niedostępny." -#: views/admin/_configure/module-reset.php:12 -#: views/admin/_configure/module-reset.php:16 +#: views/admin/_configure/module-reset.php:12 views/admin/_configure/module-reset.php:16 msgid "Plugin reset" msgstr "Reset wtyczki" @@ -744,26 +791,23 @@ msgstr "Ta operacja wykona" #: views/admin/_configure/module-reset.php:19 msgid "Add missing configuration options (preserves existing values)." -msgstr "" -"Dodanie brakujących opcji konfiguracyjnych (z zachowaniem istniejących " -"wartości)." +msgstr "Dodanie brakujących opcji konfiguracyjnych (z zachowaniem istniejących wartości)." #: views/admin/_configure/module-reset.php:20 msgid "Clear module cache." msgstr "Wyczyszczenie pamięci podręcznej modułu." #: views/admin/_configure/module-reset.php:22 -msgid "" -"Note: This operation does NOT delete any existing configuration or data." +msgid "Note: This operation does NOT delete any existing configuration or data." msgstr "Uwaga: Ta operacja NIE usuwa istniejącej konfiguracji ani danych." #: views/admin/_configure/module-reset.php:25 msgid "" -"Are you sure you want to reset the plugin? This will repair missing options " -"and clear all caches." +"Are you sure you want to reset the plugin? This will repair missing options and clear all " +"caches." msgstr "" -"Czy na pewno chcesz zresetować wtyczkę? Spowoduje to naprawienie brakujących " -"opcji i wyczyści całą pamięć podręczną." +"Czy na pewno chcesz zresetować wtyczkę? Spowoduje to naprawienie brakujących opcji i wyczyści " +"całą pamięć podręczną." #: views/admin/_configure/module-reset.php:26 msgid "Reset plugin" @@ -777,17 +821,16 @@ msgstr "Cześć %s," #. translators: %s: Order number #: views/emails/failed-order.php:19 msgid "" -"We have noticed that your order number [%s] has still not been paid. The " -"products you have selected are still waiting in your shopping cart." +"We have noticed that your order number [%s] has still not been paid. The products you have " +"selected are still waiting in your shopping cart." msgstr "" -"Zauważyliśmy, że Twoje zamówienia numer [%s] nadal nie zostało opłacone. " -"Wybrane przez Ciebie produkty wciąż czekają w koszyku zakupowym." +"Zauważyliśmy, że Twoje zamówienia numer [%s] nadal nie zostało opłacone. Wybrane przez Ciebie " +"produkty wciąż czekają w koszyku zakupowym." #. translators: %s: Payment link #: views/emails/failed-order.php:20 msgid "Click on the link below and use the payments offered in the store. %s" -msgstr "" -"Kliknij w link poniżej i skorzystaj z oferowanych w sklepie płatności. %s" +msgstr "Kliknij w link poniżej i skorzystaj z oferowanych w sklepie płatności. %s" #. translators: %s: Payment link #: views/emails/failed-order.php:20 diff --git a/languages/comfino-payment-gateway.pot b/languages/comfino-payment-gateway.pot index 421dc8dc..ec54eb44 100644 --- a/languages/comfino-payment-gateway.pot +++ b/languages/comfino-payment-gateway.pot @@ -2,14 +2,14 @@ # This file is distributed under the GPLv3. msgid "" msgstr "" -"Project-Id-Version: Comfino Payment Gateway 4.2.8\n" +"Project-Id-Version: Comfino Payment Gateway 4.3.0\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/comfino-payment-gateway\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2026-02-12T14:01:18+00:00\n" +"POT-Creation-Date: 2026-05-12T08:13:49+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.10.0\n" "X-Domain: comfino-payment-gateway\n" @@ -39,51 +39,55 @@ msgstr "" msgid "https://github.com/comfino" msgstr "" +#: comfino-payment-gateway.php:259 +msgid "Comfino requires OpenSSL >= 1.1.0 (SHA-3 support) for the V3 paywall." +msgstr "" + #. translators: 1: Previous plugin version 2: Current plugin version -#: comfino-payment-gateway.php:324 +#: comfino-payment-gateway.php:332 msgid "Comfino plugin updated from version %1$s to %2$s." msgstr "" -#: comfino-payment-gateway.php:337 +#: comfino-payment-gateway.php:345 msgid "Plugin reset completed with some errors." msgstr "" -#: comfino-payment-gateway.php:338 +#: comfino-payment-gateway.php:346 msgid "Plugin reset completed successfully." msgstr "" #. translators: 1: Number of configuration options repaired 2: Number of configuration options failed -#: comfino-payment-gateway.php:341 +#: comfino-payment-gateway.php:349 msgid "Configuration: %1$d repaired, %2$d failed" msgstr "" -#: comfino-payment-gateway.php:356 +#: comfino-payment-gateway.php:364 msgid "Error log cleared successfully." msgstr "" -#: comfino-payment-gateway.php:367 +#: comfino-payment-gateway.php:375 msgid "Debug log cleared successfully." msgstr "" #. translators: 1: Current version 2: Available version 3: GitHub releases URL -#: comfino-payment-gateway.php:416 +#: comfino-payment-gateway.php:424 msgid "Comfino Payment Gateway: A new version (%2$s) is available on GitHub. You are currently using version %1$s. Visit GitHub Releases for more information." msgstr "" -#: comfino-payment-gateway.php:480 +#: comfino-payment-gateway.php:488 msgid "Invalid nonce." msgstr "" -#: comfino-payment-gateway.php:486 +#: comfino-payment-gateway.php:494 msgid "Insufficient permissions." msgstr "" -#: comfino-payment-gateway.php:493 +#: comfino-payment-gateway.php:501 msgid "Notice dismissed." msgstr "" #: src/Api/ApiClient.php:79 -#: src/View/FrontendManager.php:566 +#: src/View/FrontendManager.php:581 msgid "There was a technical problem. Please try again in a moment and it should work!" msgstr "" @@ -100,38 +104,38 @@ msgid "Settings" msgstr "" #. translators: 1: Minimum required PHP version 2: Current PHP version -#: src/Main.php:383 +#: src/Main.php:435 msgid "The plugin could not be activated. The minimum PHP version required for Comfino is %1$s. You are running %2$s." msgstr "" #. translators: 1: Minimum required PHP version 2: Current PHP version -#: src/Main.php:389 +#: src/Main.php:441 msgid "The Comfino plugin has been deactivated. The minimum PHP version required for Comfino is %1$s. You are running %2$s." msgstr "" -#: src/Main.php:397 +#: src/Main.php:449 msgid "The plugin could not be activated. WooCommerce needs to be activated." msgstr "" -#: src/Main.php:398 +#: src/Main.php:450 msgid "The Comfino plugin has been deactivated. WooCommerce needs to be activated." msgstr "" #. translators: 1: Minimum required WooCommerce version 2: Current WooCommerce version -#: src/Main.php:405 +#: src/Main.php:457 msgid "The plugin could not be activated. The minimum WooCommerce version required for Comfino is %1$s. You are running %2$s." msgstr "" #. translators: 1: Minimum required WooCommerce version 2: Current WooCommerce version -#: src/Main.php:411 +#: src/Main.php:463 msgid "The Comfino plugin has been deactivated. The minimum WooCommerce version required for Comfino is %1$s. You are running %2$s." msgstr "" -#: src/Main.php:419 +#: src/Main.php:471 msgid "The plugin could not be activated. It requires PHP cURL extension which is not installed. More details: https://www.php.net/manual/en/book.curl.php" msgstr "" -#: src/Main.php:420 +#: src/Main.php:472 msgid "The Comfino plugin has been deactivated. It requires PHP cURL extension which is not installed. More details: https://www.php.net/manual/en/book.curl.php" msgstr "" @@ -147,77 +151,77 @@ msgstr "" msgid "Comfino status" msgstr "" -#: src/PaymentGateway.php:43 +#: src/PaymentGateway.php:44 msgid "Comfino payments" msgstr "" -#: src/PaymentGateway.php:44 +#: src/PaymentGateway.php:45 msgid "Comfino is an innovative payment method for customers of e-commerce stores! These are installment payments, deferred (buy now, pay later) and corporate payments available on one platform with the help of quick integration. Grow your business with Comfino!" msgstr "" -#: src/PaymentGateway.php:48 +#: src/PaymentGateway.php:49 msgid "The wide range of Comfino installment payments means fast and safe shopping without burdening your budget here and now. Unexpected expenses, larger purchases, or maybe you just prefer to pay later? With Comfino you have a choice! 0% installments, Convenient Installments and deferred payments \"Buy now, pay later\". All so that you can enjoy shopping without worrying about your finances." msgstr "" -#: src/PaymentGateway.php:170 +#: src/PaymentGateway.php:169 msgid "Preselected financial offer data incomplete. Please try again." msgstr "" -#: src/PaymentGateway.php:227 +#: src/PaymentGateway.php:224 msgid "Comfino create order" msgstr "" #. translators: 1: WordPress version 2: WooCommerce version 3: Comfino plugin version -#: src/PaymentGateway.php:285 +#: src/PaymentGateway.php:282 msgid "WordPress %1$s WooCommerce %2$s Comfino %3$s - question" msgstr "" -#: src/PaymentGateway.php:297 +#: src/PaymentGateway.php:294 msgid "Do you want to ask about something? Write to us at" msgstr "" #. translators: s%: Comfino support telephone -#: src/PaymentGateway.php:300 +#: src/PaymentGateway.php:297 msgid "or contact us by phone. We are waiting on the number: %s. We will answer all your questions!" msgstr "" -#: src/PaymentGateway.php:527 +#: src/PaymentGateway.php:529 msgid "Invalid customer e-mail address. Please check your account contact data." msgstr "" -#: src/PaymentGateway.php:534 +#: src/PaymentGateway.php:536 msgid "Phone number is required. Please add a phone number to your billing or delivery address." msgstr "" -#: src/PaymentGateway.php:542 +#: src/PaymentGateway.php:544 msgid "First name is required." msgstr "" -#: src/PaymentGateway.php:546 +#: src/PaymentGateway.php:548 msgid "Last name is required." msgstr "" -#: src/PaymentGateway.php:553 +#: src/PaymentGateway.php:555 msgid "Delivery address is required." msgstr "" -#: src/PaymentGateway.php:556 +#: src/PaymentGateway.php:558 msgid "City/Town is required." msgstr "" -#: src/PaymentGateway.php:560 +#: src/PaymentGateway.php:562 msgid "Postal code is required." msgstr "" -#: src/PaymentGateway.php:568 +#: src/PaymentGateway.php:570 msgid "Cart is empty. Please add products to your cart." msgstr "" -#: src/PaymentGateway.php:573 +#: src/PaymentGateway.php:575 msgid "Cart total amount must be greater than zero." msgstr "" -#: src/PaymentGateway.php:578 +#: src/PaymentGateway.php:580 msgid "Comfino payment is not available for this cart. Please check cart amount and product types." msgstr "" @@ -232,7 +236,7 @@ msgid "Field '%s' has wrong numeric format." msgstr "" #: src/View/SettingsForm.php:63 -#: src/View/SettingsForm.php:467 +#: src/View/SettingsForm.php:536 msgid "Production environment API key" msgstr "" @@ -242,242 +246,287 @@ msgstr "" #: src/View/SettingsForm.php:69 #: src/View/SettingsForm.php:71 -#: src/View/SettingsForm.php:477 +#: src/View/SettingsForm.php:546 msgid "Minimal amount in cart" msgstr "" -#. translators: s%: Comfino API key -#: src/View/SettingsForm.php:116 -#: src/View/SettingsForm.php:226 -msgid "API key %s is not valid." -msgstr "" - -#: src/View/SettingsForm.php:176 -#: src/View/SettingsForm.php:597 -msgid "Price change detection - container hierarchy level" -msgstr "" - #. translators: s%: Custom CSS URL -#: src/View/SettingsForm.php:189 +#: src/View/SettingsForm.php:77 +#: src/View/SettingsForm.php:237 msgid "Custom CSS URL \"%s\" is not valid." msgstr "" #. translators: s%: Custom CSS URL -#: src/View/SettingsForm.php:192 +#: src/View/SettingsForm.php:80 +#: src/View/SettingsForm.php:240 msgid "Custom CSS URL \"%s\" is not absolute." msgstr "" #. translators: 1: Custom CSS URL 2: Shop domain -#: src/View/SettingsForm.php:196 +#: src/View/SettingsForm.php:84 +#: src/View/SettingsForm.php:244 msgid "Custom CSS URL \"%1$s\" is not in shop domain \"%2$s\"." msgstr "" -#: src/View/SettingsForm.php:460 -#: src/View/SettingsForm.php:648 +#. translators: s%: Comfino API key +#: src/View/SettingsForm.php:133 +#: src/View/SettingsForm.php:274 +msgid "API key %s is not valid." +msgstr "" + +#: src/View/SettingsForm.php:224 +#: src/View/SettingsForm.php:693 +msgid "Price change detection - container hierarchy level" +msgstr "" + +#: src/View/SettingsForm.php:402 +#: src/View/SettingsForm.php:633 +msgid "Installment term limits" +msgstr "" + +#: src/View/SettingsForm.php:529 +#: src/View/SettingsForm.php:744 msgid "Enable/Disable" msgstr "" -#: src/View/SettingsForm.php:462 +#: src/View/SettingsForm.php:531 msgid "Enable Comfino payment module" msgstr "" -#: src/View/SettingsForm.php:464 +#: src/View/SettingsForm.php:533 msgid "Shows Comfino payment option at the payment list." msgstr "" -#: src/View/SettingsForm.php:469 +#: src/View/SettingsForm.php:538 msgid "Please enter the key provided during registration" msgstr "" -#: src/View/SettingsForm.php:472 +#: src/View/SettingsForm.php:541 msgid "Title" msgstr "" -#: src/View/SettingsForm.php:482 +#: src/View/SettingsForm.php:551 msgid "Show logo" msgstr "" -#: src/View/SettingsForm.php:484 +#: src/View/SettingsForm.php:553 msgid "Show logo on payment method" msgstr "" -#: src/View/SettingsForm.php:488 +#: src/View/SettingsForm.php:557 msgid "Order number" msgstr "" -#: src/View/SettingsForm.php:490 +#: src/View/SettingsForm.php:559 msgid "Use order reference as external ID" msgstr "" -#: src/View/SettingsForm.php:492 +#: src/View/SettingsForm.php:561 msgid "Use customer-visible order reference instead of numeric order ID for Comfino API integration. New orders only." msgstr "" -#: src/View/SettingsForm.php:498 +#: src/View/SettingsForm.php:567 +msgid "Paywall settings" +msgstr "" + +#: src/View/SettingsForm.php:571 +msgid "Direct redirect mode" +msgstr "" + +#: src/View/SettingsForm.php:573 +msgid "Enable direct redirect to Comfino payment gateway" +msgstr "" + +#: src/View/SettingsForm.php:575 +msgid "When enabled, the full paywall offer browser is not displayed. The order is submitted with the default financial product and the customer is redirected directly to the Comfino payment gateway." +msgstr "" + +#: src/View/SettingsForm.php:581 +msgid "Custom paywall CSS style" +msgstr "" + +#: src/View/SettingsForm.php:584 +msgid "URL for a custom CSS file injected into the paywall iframe. Only links from your store domain are allowed." +msgstr "" + +#: src/View/SettingsForm.php:590 msgid "Test environment" msgstr "" -#: src/View/SettingsForm.php:500 +#: src/View/SettingsForm.php:592 msgid "Use test environment" msgstr "" -#: src/View/SettingsForm.php:502 +#: src/View/SettingsForm.php:594 msgid "The test environment allows the store owner to get acquainted with the functionality of the Comfino module. This is a Comfino simulator, thanks to which you can get to know all the advantages of this payment method. The use of the test mode is free (there are also no charges for orders)." msgstr "" -#: src/View/SettingsForm.php:508 +#: src/View/SettingsForm.php:600 msgid "Test environment API key" msgstr "" -#: src/View/SettingsForm.php:510 +#: src/View/SettingsForm.php:602 msgid "Ask the supervisor for access to the test environment (key, login, password, link). Remember, the test key is different from the production key." msgstr "" -#: src/View/SettingsForm.php:513 +#: src/View/SettingsForm.php:605 msgid "Debug mode" msgstr "" -#: src/View/SettingsForm.php:515 +#: src/View/SettingsForm.php:607 msgid "Enable debug mode" msgstr "" -#: src/View/SettingsForm.php:517 +#: src/View/SettingsForm.php:609 msgid "Debug mode is useful in case of problems with Comfino payment availability. In this mode module logs details of internal process responsible for displaying of Comfino payment option at the payment methods list." msgstr "" -#: src/View/SettingsForm.php:523 +#: src/View/SettingsForm.php:615 msgid "Service mode" msgstr "" -#: src/View/SettingsForm.php:525 +#: src/View/SettingsForm.php:617 msgid "Enable service mode" msgstr "" -#: src/View/SettingsForm.php:527 +#: src/View/SettingsForm.php:619 msgid "Service mode is useful in testing Comfino payment gateway without sharing it with customers. In this mode Comfino payment method is visible only for selected sessions and debug logs are collected only for these sessions." msgstr "" -#: src/View/SettingsForm.php:537 +#: src/View/SettingsForm.php:629 msgid "Rules for the availability of financial products" msgstr "" -#: src/View/SettingsForm.php:541 +#: src/View/SettingsForm.php:372 src/View/SettingsForm.php:642 +msgid "Product categories" +msgstr "" + +#: src/View/SettingsForm.php:375 +msgid "" +"Restrict the availability of each financial product type by product " +"category. For each financial product listed below, select the categories " +"whose products should be eligible for that payment option. If a customer's " +"cart contains only products from unselected categories, that financial " +"product will not be offered at checkout." +msgstr "" + +#: src/View/SettingsForm.php:637 msgid "Basic settings" msgstr "" -#: src/View/SettingsForm.php:545 +#: src/View/SettingsForm.php:641 msgid "Widget enable" msgstr "" -#: src/View/SettingsForm.php:547 +#: src/View/SettingsForm.php:643 msgid "Enable Comfino widget" msgstr "" -#: src/View/SettingsForm.php:549 +#: src/View/SettingsForm.php:645 msgid "Show Comfino widget in the product." msgstr "" -#: src/View/SettingsForm.php:552 +#: src/View/SettingsForm.php:648 msgid "Widget key" msgstr "" -#: src/View/SettingsForm.php:556 +#: src/View/SettingsForm.php:652 msgid "Widget type" msgstr "" -#: src/View/SettingsForm.php:561 +#: src/View/SettingsForm.php:657 msgid "Offer types" msgstr "" -#: src/View/SettingsForm.php:565 +#: src/View/SettingsForm.php:661 msgid "Other payment methods (Installments 0%, Buy now, pay later, Installments for companies, Leasing) available after consulting a Comfino advisor (kontakt@comfino.pl)." msgstr "" -#: src/View/SettingsForm.php:568 +#: src/View/SettingsForm.php:664 msgid "Show logos" msgstr "" -#: src/View/SettingsForm.php:570 +#: src/View/SettingsForm.php:666 msgid "Show logos of financial services providers" msgstr "" -#: src/View/SettingsForm.php:574 +#: src/View/SettingsForm.php:670 msgid "Advanced settings" msgstr "" -#: src/View/SettingsForm.php:578 +#: src/View/SettingsForm.php:674 msgid "Widget price element selector" msgstr "" -#: src/View/SettingsForm.php:583 +#: src/View/SettingsForm.php:679 msgid "Widget anchor element selector" msgstr "" -#: src/View/SettingsForm.php:588 +#: src/View/SettingsForm.php:684 msgid "Price change detection - container selector" msgstr "" -#: src/View/SettingsForm.php:591 +#: src/View/SettingsForm.php:687 msgid "Selector of observed parent element which contains price element." msgstr "" -#: src/View/SettingsForm.php:600 +#: src/View/SettingsForm.php:696 msgid "Hierarchy level of observed parent element relative to the price element." msgstr "" -#: src/View/SettingsForm.php:606 +#: src/View/SettingsForm.php:702 msgid "Embedding method" msgstr "" -#: src/View/SettingsForm.php:616 +#: src/View/SettingsForm.php:712 msgid "Custom banner CSS style" msgstr "" -#: src/View/SettingsForm.php:619 +#: src/View/SettingsForm.php:715 msgid "URL for the custom banner style. Only links from your store domain are allowed." msgstr "" -#: src/View/SettingsForm.php:625 +#: src/View/SettingsForm.php:721 msgid "Custom calculator CSS style" msgstr "" -#: src/View/SettingsForm.php:628 +#: src/View/SettingsForm.php:724 msgid "URL for the custom calculator style. Only links from your store domain are allowed." msgstr "" -#: src/View/SettingsForm.php:634 +#: src/View/SettingsForm.php:730 msgid "Widget initialization code" msgstr "" -#: src/View/SettingsForm.php:650 -msgid "By enabling \"Saving shopping cart\", you agree and accept Regulations" +#: src/View/SettingsForm.php:746 +msgid "By enabling \"Saving shopping cart\", you agree and accept Regulations" msgstr "" -#: src/View/SettingsForm.php:652 +#: src/View/SettingsForm.php:748 msgid "With the \"Cart Rescue\" feature, you will effectively minimize the problem of abandoned carts that all sellers face. When a customer adds products to the cart but abandons it, also due to an unsuccessful payment, they will automatically receive a reminder e-mail with a direct link leading to payment. This service allows you to effectively recover potential transactions and increase order conversions." msgstr "" -#: src/View/SettingsForm.php:655 +#: src/View/SettingsForm.php:751 msgid "View in payment list" msgstr "" -#: src/View/SettingsForm.php:658 +#: src/View/SettingsForm.php:754 msgid "Only Comfino" msgstr "" -#: src/View/SettingsForm.php:659 +#: src/View/SettingsForm.php:755 msgid "All payments" msgstr "" -#: src/View/SettingsForm.php:666 +#: src/View/SettingsForm.php:762 msgid "Environment variables" msgstr "" -#: src/View/SettingsForm.php:668 +#: src/View/SettingsForm.php:764 msgid "Use development environment variables" msgstr "" -#: src/View/SettingsForm.php:670 +#: src/View/SettingsForm.php:766 msgid "Use of development environment variables with custom hosts which overwrite hosts stored in the plugin." msgstr "" @@ -527,6 +576,38 @@ msgstr "" msgid "Comfino Payment Gateway: The plugin has been automatically deactivated to prevent fatal errors. Please resolve the PHP version issue before reactivating." msgstr "" +#: views/admin/_configure/allowed-products-config.php:14 +msgid "Product type" +msgstr "" + +#: views/admin/_configure/allowed-products-config.php:15 +msgid "Min term" +msgstr "" + +#: views/admin/_configure/allowed-products-config.php:16 +msgid "Max term" +msgstr "" + +#: views/admin/_configure/allowed-products-config.php:17 +msgid "Specific terms (comma-separated)" +msgstr "" + +#: views/admin/_configure/allowed-products-config.php:34 +#: views/admin/_configure/allowed-products-config.php:41 +msgid "No limit" +msgstr "" + +#: views/admin/_configure/allowed-products-config.php:48 +msgid "e.g. 6,12,24,36" +msgstr "" + +#: views/admin/_configure/allowed-products-config.php:65 +msgid "" +"Leave fields empty to apply no restriction for that product type. All " +"constraints are cumulative: when \"Specific terms\" is set, only those exact " +"terms are offered; \"Min/Max term\" further narrows them down." +msgstr "" + #: views/admin/_configure/debug-log.php:16 msgid "Debug log" msgstr "" diff --git a/tests/Api/ApiServiceTest.php b/tests/Api/ApiServiceTest.php index 7fb7216b..f05374f7 100644 --- a/tests/Api/ApiServiceTest.php +++ b/tests/Api/ApiServiceTest.php @@ -35,9 +35,9 @@ public function testRegisterEndpoints(): void public function testGetEndpointUrl(): void { // Test getting URL for a known endpoint. - $url = ApiService::getEndpointUrl('paywall'); + $url = ApiService::getEndpointUrl('availableOfferTypes'); - $this->assertEquals('https://comfino-wc-store.test/wp-json/comfino/paywall', $url); + $this->assertEquals('https://comfino-wc-store.test/wp-json/comfino/availableoffertypes', $url); // Test getting URL for unknown endpoint. $this->assertEquals('', ApiService::getEndpointUrl('unknown_endpoint')); @@ -45,43 +45,7 @@ public function testGetEndpointUrl(): void public function testGetEndpointPath(): void { - $this->assertEquals('/wp-json/comfino/paywall', ApiService::getEndpointPath('paywall')); - } - - public function testProcessRequestWithPaywallEndpoint(): void - { - // Mock WC()->cart. - global $woocommerce; - - if (!isset($woocommerce)) { - $woocommerce = new \stdClass(); - } - - // WC function is already mocked in global namespace. - - $request = new \WP_REST_Request(); - $request->set_param('priceModifier', '0'); - - // In test environment, endpoint manager is not initialized. - $data = ApiService::processRequest('paywall', $request)->get_data(); - - // Expect either an error string or successful response. - $this->assertTrue(is_string($data) || is_array($data)); - } - - public function testProcessRequestWithPaywallItemDetailsEndpoint(): void - { - // WC function is already mocked in global namespace. - - $request = new \WP_REST_Request(); - $request->set_param('loanTypeSelected', 'INSTALLMENTS_ZERO_PERCENT'); - $request->set_param('priceModifier', '0'); - - $response = ApiService::processRequest('paywallItemDetails', $request); - - // Should return service unavailable when endpoint manager is not initialized. - $this->assertEquals(503, $response->get_status()); - $this->assertEquals('Endpoint manager not initialized.', $response->get_data()); + $this->assertEquals('/wp-json/comfino/availableoffertypes', ApiService::getEndpointPath('availableOfferTypes')); } public function testProcessRequestWithUnknownEndpoint(): void @@ -93,16 +57,6 @@ public function testProcessRequestWithUnknownEndpoint(): void $this->assertEquals('Endpoint manager not initialized.', $response->get_data()); } - public function testProcessRequestWithEmptyLoanTypeSelected(): void - { - // Don't set loanTypeSelected parameter. - $response = ApiService::processRequest('paywallItemDetails', new \WP_REST_Request()); - - // In test environment, endpoint manager is not initialized, so expect error string. - $this->assertEquals(503, $response->get_status()); - $this->assertEquals('Endpoint manager not initialized.', $response->get_data()); - } - public function testStaticMethodsExist(): void { // Verify all expected static methods exist and are callable. @@ -116,7 +70,7 @@ public function testStaticMethodsExist(): void public function testEndpointUrlsAreStrings(): void { // Test several known endpoints. - $endpoints = ['paywall', 'paywallItemDetails', 'configuration', 'transactionStatus']; + $endpoints = ['availableOfferTypes', 'configuration', 'transactionStatus']; foreach ($endpoints as $endpoint) { $this->assertEquals( @@ -141,25 +95,6 @@ public function testProcessRequestReturnsWPRestResponse(): void $this->assertEquals('Endpoint manager not initialized.', $response->get_data()); } - /** - * Enhanced tests for widget functionality after vendor optimizations. - * These tests cover critical paywall and product details endpoints. - */ - - public function testProcessRequestWithProductDetailsEndpoint(): void - { - $request = new \WP_REST_Request(); - $request->set_param('loanTypeSelected', 'INSTALLMENTS_ZERO_PERCENT'); - $request->set_param('priceModifier', '100'); - $request->set_param('productId', '123'); - - $response = ApiService::processRequest('productDetails', $request); - - // Should return service unavailable when endpoint manager is not initialized. - $this->assertEquals(503, $response->get_status()); - $this->assertEquals('Endpoint manager not initialized.', $response->get_data()); - } - public function testProcessRequestWithAvailableOfferTypesEndpoint(): void { $request = new \WP_REST_Request(); @@ -174,13 +109,8 @@ public function testProcessRequestWithAvailableOfferTypesEndpoint(): void public function testGetEndpointUrlForAllKnownEndpoints(): void { - // Test all frontend endpoints. - $frontendEndpoints = [ - 'availableOfferTypes', - 'paywall', - 'paywallItemDetails', - 'productDetails', - ]; + // Test frontend endpoints. + $frontendEndpoints = ['availableOfferTypes']; foreach ($frontendEndpoints as $endpoint) { $url = ApiService::getEndpointUrl($endpoint); @@ -210,9 +140,6 @@ public function testGetEndpointPathForAllKnownEndpoints(): void { $allEndpoints = [ 'availableOfferTypes', - 'paywall', - 'paywallItemDetails', - 'productDetails', 'transactionStatus', 'configuration', 'cacheInvalidate', @@ -228,68 +155,12 @@ public function testGetEndpointPathForAllKnownEndpoints(): void } } - public function testProcessRequestHandlesInvalidLoanType(): void - { - $request = new \WP_REST_Request(); - $request->set_param('loanTypeSelected', 'INVALID_TYPE'); - $request->set_param('priceModifier', '0'); - - $response = ApiService::processRequest('paywallItemDetails', $request); - - // Verify graceful handling. - $this->assertEquals(503, $response->get_status()); - } - - public function testProcessRequestHandlesNegativePriceModifier(): void - { - $request = new \WP_REST_Request(); - $request->set_param('priceModifier', '-100'); - - $response = ApiService::processRequest('paywall', $request); - - // Verify method completes without fatal errors. - $this->assertTrue(is_string($response->get_data())); - } - - public function testProcessRequestHandlesZeroPriceModifier(): void - { - $request = new \WP_REST_Request(); - $request->set_param('priceModifier', '0'); - - ApiService::processRequest('paywall', $request); - - // Verify method completes. - $this->assertTrue(true); - } - - public function testProcessRequestHandlesLargePriceModifier(): void - { - $request = new \WP_REST_Request(); - $request->set_param('priceModifier', '999999999'); - - ApiService::processRequest('paywall', $request); - - // Verify method completes. - $this->assertTrue(true); - } - - public function testProcessRequestHandlesNonNumericPriceModifier(): void - { - $request = new \WP_REST_Request(); - $request->set_param('priceModifier', 'not-a-number'); - - ApiService::processRequest('paywall', $request); - - // Verify invalid input handled gracefully. - $this->assertTrue(true); - } - public function testGetEndpointUrlConsistency(): void { // Test that calling getEndpointUrl multiple times returns same result. - $url1 = ApiService::getEndpointUrl('paywall'); - $url2 = ApiService::getEndpointUrl('paywall'); - $url3 = ApiService::getEndpointUrl('paywall'); + $url1 = ApiService::getEndpointUrl('availableOfferTypes'); + $url2 = ApiService::getEndpointUrl('availableOfferTypes'); + $url3 = ApiService::getEndpointUrl('availableOfferTypes'); $this->assertEquals($url1, $url2); $this->assertEquals($url2, $url3); @@ -298,9 +169,9 @@ public function testGetEndpointUrlConsistency(): void public function testGetEndpointPathConsistency(): void { // Test that calling getEndpointPath multiple times returns same result. - $path1 = ApiService::getEndpointPath('paywall'); - $path2 = ApiService::getEndpointPath('paywall'); - $path3 = ApiService::getEndpointPath('paywall'); + $path1 = ApiService::getEndpointPath('availableOfferTypes'); + $path2 = ApiService::getEndpointPath('availableOfferTypes'); + $path3 = ApiService::getEndpointPath('availableOfferTypes'); $this->assertEquals($path1, $path2); $this->assertEquals($path2, $path3); @@ -324,9 +195,6 @@ public function testEndpointUrlsDoNotContainDoubleSlashes(): void { $allEndpoints = [ 'availableOfferTypes', - 'paywall', - 'paywallItemDetails', - 'productDetails', 'transactionStatus', 'configuration', 'cacheInvalidate', @@ -350,4 +218,4 @@ public function testGetEndpointPathReturnsEmptyForUnknownEndpoint(): void { $this->assertEquals('', ApiService::getEndpointPath('unknown_endpoint_xyz')); } -} +} \ No newline at end of file diff --git a/vendor/autoload.php b/vendor/autoload.php index 4cf4ca0f..bd9b276d 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -20,4 +20,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInitf7c11ec0518961d431ec47935214504c::getLoader(); +return ComposerAutoloaderInitc881c954c3f7c2bbd7196d2eee3dca74::getLoader(); diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 33bb983d..f315fbf3 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -121,9 +121,6 @@ 'ComfinoExternal\\Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php', 'ComfinoExternal\\Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php', 'ComfinoExternal\\Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php', - 'ComfinoExternal\\Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/DummyTest.php', - 'ComfinoExternal\\Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', - 'ComfinoExternal\\Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php', 'ComfinoExternal\\Psr\\SimpleCache\\CacheException' => $vendorDir . '/psr/simple-cache/src/CacheException.php', 'ComfinoExternal\\Psr\\SimpleCache\\CacheInterface' => $vendorDir . '/psr/simple-cache/src/CacheInterface.php', 'ComfinoExternal\\Psr\\SimpleCache\\InvalidArgumentException' => $vendorDir . '/psr/simple-cache/src/InvalidArgumentException.php', @@ -182,7 +179,6 @@ 'ComfinoExternal\\Symfony\\Component\\OptionsResolver\\Exception\\UndefinedOptionsException' => $vendorDir . '/symfony/options-resolver/Exception/UndefinedOptionsException.php', 'ComfinoExternal\\Symfony\\Component\\OptionsResolver\\Options' => $vendorDir . '/symfony/options-resolver/Options.php', 'ComfinoExternal\\Symfony\\Component\\OptionsResolver\\OptionsResolver' => $vendorDir . '/symfony/options-resolver/OptionsResolver.php', - 'ComfinoExternal\\Symfony\\Component\\Yaml\\Command\\LintCommand' => $vendorDir . '/symfony/yaml/Command/LintCommand.php', 'ComfinoExternal\\Symfony\\Component\\Yaml\\Dumper' => $vendorDir . '/symfony/yaml/Dumper.php', 'ComfinoExternal\\Symfony\\Component\\Yaml\\Escaper' => $vendorDir . '/symfony/yaml/Escaper.php', 'ComfinoExternal\\Symfony\\Component\\Yaml\\Exception\\DumpException' => $vendorDir . '/symfony/yaml/Exception/DumpException.php', @@ -208,6 +204,7 @@ 'Comfino\\Api\\Dto\\Order\\Customer' => $vendorDir . '/comfino/shop-plugins-shared/src/Api/Dto/Order/Customer.php', 'Comfino\\Api\\Dto\\Order\\Customer\\Address' => $vendorDir . '/comfino/shop-plugins-shared/src/Api/Dto/Order/Customer/Address.php', 'Comfino\\Api\\Dto\\Order\\LoanParameters' => $vendorDir . '/comfino/shop-plugins-shared/src/Api/Dto/Order/LoanParameters.php', + 'Comfino\\Api\\Dto\\Payment\\AllowedProductConfig' => $vendorDir . '/comfino/shop-plugins-shared/src/Api/Dto/Payment/AllowedProductConfig.php', 'Comfino\\Api\\Dto\\Payment\\FinancialProduct' => $vendorDir . '/comfino/shop-plugins-shared/src/Api/Dto/Payment/FinancialProduct.php', 'Comfino\\Api\\Dto\\Payment\\LoanParameters' => $vendorDir . '/comfino/shop-plugins-shared/src/Api/Dto/Payment/LoanParameters.php', 'Comfino\\Api\\Dto\\Payment\\LoanQueryCriteria' => $vendorDir . '/comfino/shop-plugins-shared/src/Api/Dto/Payment/LoanQueryCriteria.php', @@ -316,6 +313,7 @@ 'Comfino\\Order\\ShopStatusManager' => $baseDir . '/src/Order/ShopStatusManager.php', 'Comfino\\Order\\StatusAdapter' => $baseDir . '/src/Order/StatusAdapter.php', 'Comfino\\PaymentGateway' => $baseDir . '/src/PaymentGateway.php', + 'Comfino\\PaywallAuthTokenGenerator' => $baseDir . '/src/PaywallAuthTokenGenerator.php', 'Comfino\\PluginShared\\CacheManager' => $vendorDir . '/comfino/shop-plugins-shared/src/PluginShared/CacheManager.php', 'Comfino\\Shop\\Order\\Cart' => $vendorDir . '/comfino/shop-plugins-shared/src/Shop/Order/Cart.php', 'Comfino\\Shop\\Order\\CartInterface' => $vendorDir . '/comfino/shop-plugins-shared/src/Shop/Order/CartInterface.php', diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index de54c1b8..3c3285e7 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -1,6 +1,6 @@ setClassMapAuthoritative(true); $loader->register(false); - $filesToLoad = \Composer\Autoload\ComposerStaticInitf7c11ec0518961d431ec47935214504c::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInitc881c954c3f7c2bbd7196d2eee3dca74::$files; $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 687e55bd..46f3e44a 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -2,7 +2,7 @@ namespace Composer\Autoload; -class ComposerStaticInitf7c11ec0518961d431ec47935214504c +class ComposerStaticInitc881c954c3f7c2bbd7196d2eee3dca74 { public static $files = array ( 'e90b514f516f456feec46b4f674e0f58' => __DIR__ . '/..' . '/sunrise/http-message/constants/REASON_PHRASES.php', @@ -419,9 +419,6 @@ class ComposerStaticInitf7c11ec0518961d431ec47935214504c 'ComfinoExternal\\Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php', 'ComfinoExternal\\Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php', 'ComfinoExternal\\Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php', - 'ComfinoExternal\\Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/DummyTest.php', - 'ComfinoExternal\\Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', - 'ComfinoExternal\\Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php', 'ComfinoExternal\\Psr\\SimpleCache\\CacheException' => __DIR__ . '/..' . '/psr/simple-cache/src/CacheException.php', 'ComfinoExternal\\Psr\\SimpleCache\\CacheInterface' => __DIR__ . '/..' . '/psr/simple-cache/src/CacheInterface.php', 'ComfinoExternal\\Psr\\SimpleCache\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/simple-cache/src/InvalidArgumentException.php', @@ -480,7 +477,6 @@ class ComposerStaticInitf7c11ec0518961d431ec47935214504c 'ComfinoExternal\\Symfony\\Component\\OptionsResolver\\Exception\\UndefinedOptionsException' => __DIR__ . '/..' . '/symfony/options-resolver/Exception/UndefinedOptionsException.php', 'ComfinoExternal\\Symfony\\Component\\OptionsResolver\\Options' => __DIR__ . '/..' . '/symfony/options-resolver/Options.php', 'ComfinoExternal\\Symfony\\Component\\OptionsResolver\\OptionsResolver' => __DIR__ . '/..' . '/symfony/options-resolver/OptionsResolver.php', - 'ComfinoExternal\\Symfony\\Component\\Yaml\\Command\\LintCommand' => __DIR__ . '/..' . '/symfony/yaml/Command/LintCommand.php', 'ComfinoExternal\\Symfony\\Component\\Yaml\\Dumper' => __DIR__ . '/..' . '/symfony/yaml/Dumper.php', 'ComfinoExternal\\Symfony\\Component\\Yaml\\Escaper' => __DIR__ . '/..' . '/symfony/yaml/Escaper.php', 'ComfinoExternal\\Symfony\\Component\\Yaml\\Exception\\DumpException' => __DIR__ . '/..' . '/symfony/yaml/Exception/DumpException.php', @@ -506,6 +502,7 @@ class ComposerStaticInitf7c11ec0518961d431ec47935214504c 'Comfino\\Api\\Dto\\Order\\Customer' => __DIR__ . '/..' . '/comfino/shop-plugins-shared/src/Api/Dto/Order/Customer.php', 'Comfino\\Api\\Dto\\Order\\Customer\\Address' => __DIR__ . '/..' . '/comfino/shop-plugins-shared/src/Api/Dto/Order/Customer/Address.php', 'Comfino\\Api\\Dto\\Order\\LoanParameters' => __DIR__ . '/..' . '/comfino/shop-plugins-shared/src/Api/Dto/Order/LoanParameters.php', + 'Comfino\\Api\\Dto\\Payment\\AllowedProductConfig' => __DIR__ . '/..' . '/comfino/shop-plugins-shared/src/Api/Dto/Payment/AllowedProductConfig.php', 'Comfino\\Api\\Dto\\Payment\\FinancialProduct' => __DIR__ . '/..' . '/comfino/shop-plugins-shared/src/Api/Dto/Payment/FinancialProduct.php', 'Comfino\\Api\\Dto\\Payment\\LoanParameters' => __DIR__ . '/..' . '/comfino/shop-plugins-shared/src/Api/Dto/Payment/LoanParameters.php', 'Comfino\\Api\\Dto\\Payment\\LoanQueryCriteria' => __DIR__ . '/..' . '/comfino/shop-plugins-shared/src/Api/Dto/Payment/LoanQueryCriteria.php', @@ -614,6 +611,7 @@ class ComposerStaticInitf7c11ec0518961d431ec47935214504c 'Comfino\\Order\\ShopStatusManager' => __DIR__ . '/../..' . '/src/Order/ShopStatusManager.php', 'Comfino\\Order\\StatusAdapter' => __DIR__ . '/../..' . '/src/Order/StatusAdapter.php', 'Comfino\\PaymentGateway' => __DIR__ . '/../..' . '/src/PaymentGateway.php', + 'Comfino\\PaywallAuthTokenGenerator' => __DIR__ . '/../..' . '/src/PaywallAuthTokenGenerator.php', 'Comfino\\PluginShared\\CacheManager' => __DIR__ . '/..' . '/comfino/shop-plugins-shared/src/PluginShared/CacheManager.php', 'Comfino\\Shop\\Order\\Cart' => __DIR__ . '/..' . '/comfino/shop-plugins-shared/src/Shop/Order/Cart.php', 'Comfino\\Shop\\Order\\CartInterface' => __DIR__ . '/..' . '/comfino/shop-plugins-shared/src/Shop/Order/CartInterface.php', @@ -643,9 +641,9 @@ class ComposerStaticInitf7c11ec0518961d431ec47935214504c public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitf7c11ec0518961d431ec47935214504c::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitf7c11ec0518961d431ec47935214504c::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitf7c11ec0518961d431ec47935214504c::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInitc881c954c3f7c2bbd7196d2eee3dca74::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitc881c954c3f7c2bbd7196d2eee3dca74::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInitc881c954c3f7c2bbd7196d2eee3dca74::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 6f310797..fab2da00 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -354,12 +354,12 @@ "source": { "type": "git", "url": "git@github.com:comfino/shop-plugins-shared.git", - "reference": "9d0680060b63f2514519f8268115c841ddcc466e" + "reference": "04ac87168a8ac50bc0932ed584f683c4e15a3bc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/comfino/shop-plugins-shared/zipball/9d0680060b63f2514519f8268115c841ddcc466e", - "reference": "9d0680060b63f2514519f8268115c841ddcc466e", + "url": "https://api.github.com/repos/comfino/shop-plugins-shared/zipball/04ac87168a8ac50bc0932ed584f683c4e15a3bc4", + "reference": "04ac87168a8ac50bc0932ed584f683c4e15a3bc4", "shasum": "" }, "require": { @@ -381,7 +381,7 @@ "phpspec/prophecy-phpunit": "^1.1", "phpunit/phpunit": "^5.7" }, - "time": "2026-02-16T12:48:10+00:00", + "time": "2026-05-12T13:26:11+00:00", "default-branch": true, "type": "library", "installation-source": "dist", @@ -990,16 +990,10 @@ "name": "sunrise/http-client-curl", "version": "v1.4.6", "version_normalized": "1.4.6.0", - "source": { - "type": "git", - "url": "https://github.com/sunrise-php/http-client-curl.git", - "reference": "df3fa3f7f9bf9f88fb6afc6ce79866bc51e789f8" - }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sunrise-php/http-client-curl/zipball/df3fa3f7f9bf9f88fb6afc6ce79866bc51e789f8", - "reference": "df3fa3f7f9bf9f88fb6afc6ce79866bc51e789f8", - "shasum": "" + "url": "/home/akozubski/Devel/comfino/lib/shop-plugins-lib-builder/packages/sunrise/sunrise-http-client-curl-v1.4.6.zip", + "shasum": "54d02c18a2df79ad6c8bcb79cf096af21a4d39b6" }, "require": { "ext-curl": "*", @@ -1017,7 +1011,6 @@ "sunrise/coding-standard": "1.0.0", "sunrise/http-factory": "2.0.0" }, - "time": "2022-04-19T19:08:14+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1025,7 +1018,17 @@ "Sunrise\\Http\\Client\\Curl\\": "src/" } }, - "notification-url": "https://packagist.org/downloads/", + "scripts": { + "test": [ + "phpcs", + "psalm", + "XDEBUG_MODE=coverage phpunit --coverage-text --colors=always" + ], + "build": [ + "phpdoc -d src/ -t phpdoc/", + "XDEBUG_MODE=coverage phpunit --coverage-html coverage/" + ] + }, "license": [ "MIT" ], @@ -1044,7 +1047,6 @@ "description": "Simple HTTP cURL client for PHP 7.1+ based on PSR-18", "homepage": "https://github.com/sunrise-php/http-client-curl", "keywords": [ - "PSR-2", "client", "curl", "fenric", @@ -1053,29 +1055,20 @@ "php-8", "psr-17", "psr-18", + "psr-2", "psr-7", "sunrise" ], - "support": { - "issues": "https://github.com/sunrise-php/http-client-curl/issues", - "source": "https://github.com/sunrise-php/http-client-curl/tree/v1.4.6" - }, "install-path": "../sunrise/http-client-curl" }, { "name": "sunrise/http-factory", "version": "v2.0.3", "version_normalized": "2.0.3.0", - "source": { - "type": "git", - "url": "https://github.com/sunrise-php/http-factory.git", - "reference": "c923fcd8ac770f68e5070f06324d50713c6fe681" - }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sunrise-php/http-factory/zipball/c923fcd8ac770f68e5070f06324d50713c6fe681", - "reference": "c923fcd8ac770f68e5070f06324d50713c6fe681", - "shasum": "" + "url": "/home/akozubski/Devel/comfino/lib/shop-plugins-lib-builder/packages/sunrise/sunrise-http-factory-v2.0.3.zip", + "shasum": "5e2ab5ba5683e55ca0dea30fd4d6575966c235f0" }, "require": { "php": "^7.1|^8.0", @@ -1091,7 +1084,6 @@ "phpunit/phpunit": "7.5.20|9.5.0", "sunrise/coding-standard": "1.0.0" }, - "time": "2022-12-31T01:52:59+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1099,7 +1091,17 @@ "Sunrise\\Http\\Factory\\": "src/" } }, - "notification-url": "https://packagist.org/downloads/", + "scripts": { + "test": [ + "phpcs", + "psalm", + "XDEBUG_MODE=coverage phpunit --coverage-text --colors=always" + ], + "build": [ + "phpdoc -d src/ -t phpdoc/", + "XDEBUG_MODE=coverage phpunit --coverage-html coverage/" + ] + }, "license": [ "MIT" ], @@ -1113,19 +1115,15 @@ "description": "HTTP factory for PHP 7.1+ based on PSR-17", "homepage": "https://github.com/sunrise-php/http-factory", "keywords": [ - "PHP7", "factory", "fenric", "http", + "php7", "php8", "psr-17", "psr-7", "sunrise" ], - "support": { - "issues": "https://github.com/sunrise-php/http-factory/issues", - "source": "https://github.com/sunrise-php/http-factory/tree/v2.0.3" - }, "abandoned": "sunrise/http-message", "install-path": "../sunrise/http-factory" }, @@ -1133,16 +1131,10 @@ "name": "sunrise/http-header", "version": "v2.0.2", "version_normalized": "2.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/sunrise-php/http-header.git", - "reference": "b291196b4f0b041e6f546d1eed91cbcdb1e773b8" - }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sunrise-php/http-header/zipball/b291196b4f0b041e6f546d1eed91cbcdb1e773b8", - "reference": "b291196b4f0b041e6f546d1eed91cbcdb1e773b8", - "shasum": "" + "url": "/home/akozubski/Devel/comfino/lib/shop-plugins-lib-builder/packages/sunrise/sunrise-http-header-v2.0.2.zip", + "shasum": "4343d56e96337f12a98a6e71a848dab8cc455667" }, "require": { "php": "^7.1|^8.0" @@ -1150,7 +1142,6 @@ "require-dev": { "sunrise/coding-standard": "1.0.0" }, - "time": "2022-04-18T23:18:22+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1158,7 +1149,12 @@ "Sunrise\\Http\\Header\\": "src/" } }, - "notification-url": "https://packagist.org/downloads/", + "scripts": { + "test": [ + "phpcs", + "psalm" + ] + }, "license": [ "MIT" ], @@ -1177,27 +1173,16 @@ "http", "sunrise" ], - "support": { - "issues": "https://github.com/sunrise-php/http-header/issues", - "source": "https://github.com/sunrise-php/http-header/tree/v2.0.2" - }, - "abandoned": "sunrise/http-message", "install-path": "../sunrise/http-header" }, { "name": "sunrise/http-message", "version": "v2.1.3", "version_normalized": "2.1.3.0", - "source": { - "type": "git", - "url": "https://github.com/sunrise-php/http-message.git", - "reference": "cd6ebddf984ff2169c30c315a5d87ae88aa930da" - }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sunrise-php/http-message/zipball/cd6ebddf984ff2169c30c315a5d87ae88aa930da", - "reference": "cd6ebddf984ff2169c30c315a5d87ae88aa930da", - "shasum": "" + "url": "/home/akozubski/Devel/comfino/lib/shop-plugins-lib-builder/packages/sunrise/sunrise-http-message-v2.1.3.zip", + "shasum": "32618f35ca82ef6d32218a904840682a7cfc6ea5" }, "require": { "fig/http-message-util": "^1.1", @@ -1215,7 +1200,6 @@ "phpunit/phpunit": "7.5.20|9.5.0", "sunrise/coding-standard": "1.0.0" }, - "time": "2022-04-19T19:10:25+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1226,7 +1210,17 @@ "Sunrise\\Http\\Message\\": "src/" } }, - "notification-url": "https://packagist.org/downloads/", + "scripts": { + "test": [ + "phpcs", + "psalm", + "XDEBUG_MODE=coverage phpunit --coverage-text --colors=always" + ], + "build": [ + "phpdoc -d src/ -t phpdoc/", + "XDEBUG_MODE=coverage phpunit --coverage-html coverage/" + ] + }, "license": [ "MIT" ], @@ -1252,26 +1246,16 @@ "rfc-7230", "sunrise" ], - "support": { - "issues": "https://github.com/sunrise-php/http-message/issues", - "source": "https://github.com/sunrise-php/http-message/tree/v2.1.3" - }, "install-path": "../sunrise/http-message" }, { "name": "sunrise/http-server-request", "version": "v2.2.2", "version_normalized": "2.2.2.0", - "source": { - "type": "git", - "url": "https://github.com/sunrise-php/http-server-request.git", - "reference": "431ed2d5b27def62b23196987cd9db654dcda7ce" - }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sunrise-php/http-server-request/zipball/431ed2d5b27def62b23196987cd9db654dcda7ce", - "reference": "431ed2d5b27def62b23196987cd9db654dcda7ce", - "shasum": "" + "url": "/home/akozubski/Devel/comfino/lib/shop-plugins-lib-builder/packages/sunrise/sunrise-http-server-request-v2.2.2.zip", + "shasum": "095a5ac2b86635b0b2036cdff99934f05744244c" }, "require": { "php": "^7.1|^8.0", @@ -1288,10 +1272,12 @@ "phpunit/phpunit": "7.5.20|9.5.0", "sunrise/coding-standard": "1.0.0" }, - "time": "2022-12-31T01:57:49+00:00", "type": "library", "installation-source": "dist", "autoload": { + "psr-4": { + "Sunrise\\Http\\ServerRequest\\": "src/" + }, "files": [ "constants/UPLOAD_ERRORS.php", "functions/request_body.php", @@ -1300,12 +1286,24 @@ "functions/request_method.php", "functions/request_protocol.php", "functions/request_uri.php" - ], + ] + }, + "autoload-dev": { "psr-4": { - "Sunrise\\Http\\ServerRequest\\": "src/" + "Sunrise\\Http\\ServerRequest\\Tests\\": "tests/" } }, - "notification-url": "https://packagist.org/downloads/", + "scripts": { + "test": [ + "phpcs", + "psalm", + "XDEBUG_MODE=coverage phpunit --coverage-text --colors=always" + ], + "build": [ + "phpdoc -d src/ -t phpdoc/", + "XDEBUG_MODE=coverage phpunit --coverage-html coverage/" + ] + }, "license": [ "MIT" ], @@ -1324,9 +1322,9 @@ "description": "HTTP server request wrapper for PHP 7.1+ based on PSR-7 and PSR-17", "homepage": "https://github.com/sunrise-php/http-server-request", "keywords": [ - "PHP7", "fenric", "http", + "php7", "php8", "psr-17", "psr-7", @@ -1334,10 +1332,6 @@ "server", "sunrise" ], - "support": { - "issues": "https://github.com/sunrise-php/http-server-request/issues", - "source": "https://github.com/sunrise-php/http-server-request/tree/v2.2.2" - }, "abandoned": "sunrise/http-message", "install-path": "../sunrise/http-server-request" }, @@ -1345,16 +1339,10 @@ "name": "sunrise/stream", "version": "v1.3.4", "version_normalized": "1.3.4.0", - "source": { - "type": "git", - "url": "https://github.com/sunrise-php/stream.git", - "reference": "d1a4764f51b9b6710c0c216820accba3d43e5644" - }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sunrise-php/stream/zipball/d1a4764f51b9b6710c0c216820accba3d43e5644", - "reference": "d1a4764f51b9b6710c0c216820accba3d43e5644", - "shasum": "" + "url": "/home/akozubski/Devel/comfino/lib/shop-plugins-lib-builder/packages/sunrise/sunrise-stream-v1.3.4.zip", + "shasum": "8b5770353124ea9ad64c14caeaaf5d83ae8ac64f" }, "require": { "php": "^7.1|^8.0", @@ -1368,7 +1356,6 @@ "phpunit/phpunit": "7.5.20|9.5.0", "sunrise/coding-standard": "1.0.0" }, - "time": "2022-12-31T02:00:59+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1376,7 +1363,17 @@ "Sunrise\\Stream\\": "src/" } }, - "notification-url": "https://packagist.org/downloads/", + "scripts": { + "test": [ + "phpcs", + "psalm", + "XDEBUG_MODE=coverage phpunit --coverage-text --colors=always" + ], + "build": [ + "phpdoc -d src/ -t phpdoc/", + "XDEBUG_MODE=coverage phpunit --coverage-html coverage/" + ] + }, "license": [ "MIT" ], @@ -1395,19 +1392,15 @@ "description": "Stream wrapper for PHP 7.1+ based on PSR-7 and PSR-17", "homepage": "https://github.com/sunrise-php/stream", "keywords": [ - "PHP7", "fenric", "http", + "php7", "php8", "psr-17", "psr-7", "stream", "sunrise" ], - "support": { - "issues": "https://github.com/sunrise-php/stream/issues", - "source": "https://github.com/sunrise-php/stream/tree/v1.3.4" - }, "abandoned": "sunrise/http-message", "install-path": "../sunrise/stream" }, @@ -1415,16 +1408,10 @@ "name": "sunrise/uri", "version": "v1.2.5", "version_normalized": "1.2.5.0", - "source": { - "type": "git", - "url": "https://github.com/sunrise-php/uri.git", - "reference": "cf636bb78bec0888ad0e0645588a1ee2d783adae" - }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sunrise-php/uri/zipball/cf636bb78bec0888ad0e0645588a1ee2d783adae", - "reference": "cf636bb78bec0888ad0e0645588a1ee2d783adae", - "shasum": "" + "url": "/home/akozubski/Devel/comfino/lib/shop-plugins-lib-builder/packages/sunrise/sunrise-uri-v1.2.5.zip", + "shasum": "77486809276d7ac592ad5a3ba14d779ec4df69b3" }, "require": { "php": "^7.1|^8.0", @@ -1438,7 +1425,6 @@ "phpunit/phpunit": "7.5.20|9.5.0", "sunrise/coding-standard": "1.0.0" }, - "time": "2022-12-31T02:03:56+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1446,7 +1432,17 @@ "Sunrise\\Uri\\": "src/" } }, - "notification-url": "https://packagist.org/downloads/", + "scripts": { + "test": [ + "phpcs", + "psalm", + "XDEBUG_MODE=coverage phpunit --coverage-text --colors=always" + ], + "build": [ + "phpdoc -d src/ -t phpdoc/", + "XDEBUG_MODE=coverage phpunit --coverage-html coverage/" + ] + }, "license": [ "MIT" ], @@ -1465,10 +1461,10 @@ "description": "URI wrapper for PHP 7.1+ based on RFC-3986, PSR-7 and PSR-17", "homepage": "https://github.com/sunrise-php/uri", "keywords": [ - "PHP7", "fenric", "http", "parser", + "php7", "php8", "psr-17", "psr-7", @@ -1476,10 +1472,6 @@ "sunrise", "uri" ], - "support": { - "issues": "https://github.com/sunrise-php/uri/issues", - "source": "https://github.com/sunrise-php/uri/tree/v1.2.5" - }, "abandoned": "sunrise/http-message", "install-path": "../sunrise/uri" }, diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index d6be5ab5..025d40ac 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'comfino/woocommerce', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'c9facab6267414d880eeb084cb85f8315abc29dd', + 'reference' => 'e9d9ee070c6fdbd715728955864c0dee79ef45f7', 'type' => 'woocommerce-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -58,7 +58,7 @@ 'comfino/shop-plugins-shared' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '9d0680060b63f2514519f8268115c841ddcc466e', + 'reference' => '04ac87168a8ac50bc0932ed584f683c4e15a3bc4', 'type' => 'library', 'install_path' => __DIR__ . '/../comfino/shop-plugins-shared', 'aliases' => array( @@ -69,7 +69,7 @@ 'comfino/woocommerce' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'c9facab6267414d880eeb084cb85f8315abc29dd', + 'reference' => 'e9d9ee070c6fdbd715728955864c0dee79ef45f7', 'type' => 'woocommerce-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -201,7 +201,7 @@ 'sunrise/http-client-curl' => array( 'pretty_version' => 'v1.4.6', 'version' => '1.4.6.0', - 'reference' => 'df3fa3f7f9bf9f88fb6afc6ce79866bc51e789f8', + 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../sunrise/http-client-curl', 'aliases' => array(), @@ -210,7 +210,7 @@ 'sunrise/http-factory' => array( 'pretty_version' => 'v2.0.3', 'version' => '2.0.3.0', - 'reference' => 'c923fcd8ac770f68e5070f06324d50713c6fe681', + 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../sunrise/http-factory', 'aliases' => array(), @@ -219,7 +219,7 @@ 'sunrise/http-header' => array( 'pretty_version' => 'v2.0.2', 'version' => '2.0.2.0', - 'reference' => 'b291196b4f0b041e6f546d1eed91cbcdb1e773b8', + 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../sunrise/http-header', 'aliases' => array(), @@ -228,7 +228,7 @@ 'sunrise/http-message' => array( 'pretty_version' => 'v2.1.3', 'version' => '2.1.3.0', - 'reference' => 'cd6ebddf984ff2169c30c315a5d87ae88aa930da', + 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../sunrise/http-message', 'aliases' => array(), @@ -237,7 +237,7 @@ 'sunrise/http-server-request' => array( 'pretty_version' => 'v2.2.2', 'version' => '2.2.2.0', - 'reference' => '431ed2d5b27def62b23196987cd9db654dcda7ce', + 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../sunrise/http-server-request', 'aliases' => array(), @@ -246,7 +246,7 @@ 'sunrise/stream' => array( 'pretty_version' => 'v1.3.4', 'version' => '1.3.4.0', - 'reference' => 'd1a4764f51b9b6710c0c216820accba3d43e5644', + 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../sunrise/stream', 'aliases' => array(), @@ -255,7 +255,7 @@ 'sunrise/uri' => array( 'pretty_version' => 'v1.2.5', 'version' => '1.2.5.0', - 'reference' => 'cf636bb78bec0888ad0e0645588a1ee2d783adae', + 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../sunrise/uri', 'aliases' => array(), diff --git a/vendor/league/flysystem/src/Handler.php b/vendor/league/flysystem/src/Handler.php index ed7335b2..defce2a7 100644 --- a/vendor/league/flysystem/src/Handler.php +++ b/vendor/league/flysystem/src/Handler.php @@ -18,7 +18,7 @@ abstract class Handler * @param FilesystemInterface $filesystem * @param string $path */ - public function __construct(FilesystemInterface $filesystem = null, $path = null) + public function __construct(?FilesystemInterface $filesystem = null, $path = null) { $this->path = $path; $this->filesystem = $filesystem; diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php b/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php index 2a7b5787..04a2dafa 100644 --- a/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php +++ b/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php @@ -29,4 +29,4 @@ public function __construct(int $flags = self::TARGET_ALL) } } -\class_alias('ComfinoExternal\Attribute', 'Attribute', \false); +if (!class_exists('Attribute', false)) { \class_alias('ComfinoExternal\Attribute', 'Attribute', \false); } diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php b/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php index 01d08936..24f7f1f9 100644 --- a/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php +++ b/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php @@ -16,3 +16,5 @@ class PhpToken extends Symfony\Polyfill\Php80\PhpToken } \class_alias('ComfinoExternal\PhpToken', 'PhpToken', \false); } + +if (!class_exists('ComfinoExternal\\PhpToken', false)) { class PhpToken extends \PhpToken {} } diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php b/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php index 0e362cda..4a1c8e35 100644 --- a/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php +++ b/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php @@ -10,13 +10,13 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -if (\PHP_VERSION_ID < 80000) { - interface Stringable - { - /** + +interface Stringable +{ + /** * @return string */ - public function __toString(); - } - \class_alias('ComfinoExternal\Stringable', 'Stringable', \false); + public function __toString(); } +if (!class_exists('Stringable', false) && !interface_exists('Stringable', false)) { \class_alias('ComfinoExternal\Stringable', 'Stringable', \false); } + diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php b/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php index 042c3314..1935b859 100644 --- a/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php +++ b/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php @@ -10,9 +10,9 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -if (\PHP_VERSION_ID < 80000) { - class UnhandledMatchError extends \Error - { - } - \class_alias('ComfinoExternal\UnhandledMatchError', 'UnhandledMatchError', \false); + +class UnhandledMatchError extends \Error +{ } +if (!class_exists('UnhandledMatchError', false) && !interface_exists('UnhandledMatchError', false)) { \class_alias('ComfinoExternal\UnhandledMatchError', 'UnhandledMatchError', \false); } + diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php b/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php index 102d0d6a..020a2fa0 100644 --- a/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php +++ b/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php @@ -10,9 +10,9 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -if (\PHP_VERSION_ID < 80000) { - class ValueError extends \Error - { - } - \class_alias('ComfinoExternal\ValueError', 'ValueError', \false); + +class ValueError extends \Error +{ } +if (!class_exists('ValueError', false) && !interface_exists('ValueError', false)) { \class_alias('ComfinoExternal\ValueError', 'ValueError', \false); } + diff --git a/vendor/symfony/yaml/Exception/ParseException.php b/vendor/symfony/yaml/Exception/ParseException.php index b33bb585..691a2423 100644 --- a/vendor/symfony/yaml/Exception/ParseException.php +++ b/vendor/symfony/yaml/Exception/ParseException.php @@ -22,7 +22,7 @@ class ParseException extends RuntimeException * @param string|null $snippet * @param string|null $parsedFile */ - public function __construct(string $message, int $parsedLine = -1, string $snippet = null, string $parsedFile = null, \Throwable $previous = null) + public function __construct(string $message, int $parsedLine = -1, ?string $snippet = null, ?string $parsedFile = null, ?\Throwable $previous = null) { $this->parsedFile = $parsedFile; $this->parsedLine = $parsedLine; diff --git a/vendor/symfony/yaml/Inline.php b/vendor/symfony/yaml/Inline.php index 4279a06a..33a0013b 100644 --- a/vendor/symfony/yaml/Inline.php +++ b/vendor/symfony/yaml/Inline.php @@ -23,7 +23,7 @@ class Inline private static $objectSupport = \false; private static $objectForMap = \false; private static $constantSupport = \false; - public static function initialize(int $flags, int $parsedLineNumber = null, string $parsedFilename = null) + public static function initialize(int $flags, ?int $parsedLineNumber = null, ?string $parsedFilename = null) { self::$exceptionOnInvalidType = (bool) (Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE & $flags); self::$objectSupport = (bool) (Yaml::PARSE_OBJECT & $flags); @@ -41,7 +41,7 @@ public static function initialize(int $flags, int $parsedLineNumber = null, stri * @return mixed * @throws ParseException */ - public static function parse(string $value = null, int $flags = 0, array &$references = []) + public static function parse(?string $value = null, int $flags = 0, array &$references = []) { self::initialize($flags); $value = trim($value); @@ -210,7 +210,7 @@ private static function dumpNull(int $flags): string * @return mixed * @throws ParseException */ - public static function parseScalar(string $scalar, int $flags = 0, array $delimiters = null, int &$i = 0, bool $evaluate = \true, array &$references = [], bool &$isQuoted = null) + public static function parseScalar(string $scalar, int $flags = 0, ?array $delimiters = null, int &$i = 0, bool $evaluate = \true, array &$references = [], ?bool &$isQuoted = null) { if (\in_array($scalar[$i], ['"', "'"])) { $isQuoted = \true; @@ -440,7 +440,7 @@ private static function parseMapping(string $mapping, int $flags, int &$i = 0, a * @return mixed * @throws ParseException */ - private static function evaluateScalar(string $scalar, int $flags, array &$references = [], bool &$isQuotedString = null) + private static function evaluateScalar(string $scalar, int $flags, array &$references = [], ?bool &$isQuotedString = null) { $isQuotedString = \false; $scalar = trim($scalar); diff --git a/vendor/symfony/yaml/Parser.php b/vendor/symfony/yaml/Parser.php index f0d01e32..650761c6 100644 --- a/vendor/symfony/yaml/Parser.php +++ b/vendor/symfony/yaml/Parser.php @@ -437,7 +437,7 @@ private function getCurrentLineIndentation(): int * @return string * @throws ParseException */ - private function getNextEmbedBlock(int $indentation = null, bool $inSequence = \false): string + private function getNextEmbedBlock(?int $indentation = null, bool $inSequence = \false): string { $oldLineIndentation = $this->getCurrentLineIndentation(); if (!$this->moveToNextLine()) { @@ -814,7 +814,7 @@ private function isStringUnIndentedCollectionItem(): bool /** * @throws ParseException */ - public static function preg_match(string $pattern, string $subject, array &$matches = null, int $flags = 0, int $offset = 0): int + public static function preg_match(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): int { if (\false === $ret = preg_match($pattern, $subject, $matches, $flags, $offset)) { switch (preg_last_error()) { diff --git a/views/admin/_configure/installation-logs.php b/views/admin/_configure/installation-logs.php index 57d64469..cb233a16 100644 --- a/views/admin/_configure/installation-logs.php +++ b/views/admin/_configure/installation-logs.php @@ -18,36 +18,36 @@ ?> - +
- +
- + -

+

- +
- + -

+

- +
- + -

+

diff --git a/views/admin/configuration.php b/views/admin/configuration.php index 37f5805f..6ef31f71 100644 --- a/views/admin/configuration.php +++ b/views/admin/configuration.php @@ -57,23 +57,23 @@ function comfino_prepare_tab_url(string $subsection): string return wp_nonce_url($urlParts['path'] . '?' . http_build_query(array_map('strip_tags', $queryArgs)), 'comfino_settings', 'comfino_nonce'); } ?> -

-

- +

+

+

- - - + + + - +

- +

-

Comfino API host:

-

Plugin build time: UTC

-

Shop domain:

-

Widget key:

-

New widget API:

+

Comfino API host:

+

Plugin build time: UTC

+

Shop domain:

+

Widget key:

+

New widget API:

Latest available version: Managed by WordPress auto-updates - + ')): ?> (Download from GitHub) @@ -118,11 +118,11 @@ function comfino_prepare_tab_url(string $subsection): string

Cache root directory writable: YESNO - () + ()

Cache directory writable: YESNO - () + ()

'; + form.action = ''; const actionInput = document.createElement('input'); actionInput.type = 'hidden'; From ae5868eb367ae5bc47202c66f0728a7493a324e8 Mon Sep 17 00:00:00 2001 From: Artur Kozubski Date: Tue, 12 May 2026 19:05:28 +0200 Subject: [PATCH 03/67] FN-15832 Added support for new Comfino paywall integration v3 with new SDK, including frontend SDK initialization, dynamic script loading, installment term limits, and custom CSS support. --- changelog.txt | 10 + readme.txt | 13 +- resources/js/front/comfino-blocks.js | 141 +++++++++++ resources/js/front/comfino-blocks.min.js | 4 + resources/js/front/comfino-checkout.js | 131 ++++++++++ resources/js/front/comfino-checkout.min.js | 3 + src/Api/ApiService.php | 238 +----------------- src/Configuration/ConfigManager.php | 24 ++ src/Main.php | 98 +++++--- src/PaymentGateway.php | 56 ++++- src/PaywallAuthTokenGenerator.php | 27 ++ src/View/Block/PaymentGateway.php | 101 +++++--- src/View/FrontendManager.php | 48 ++-- src/View/SettingsForm.php | 130 +++++++++- tests/Configuration/ConfigManagerTest.php | 10 + tests/MainTest.php | 15 -- tests/View/FrontendManagerTest.php | 44 ++-- .../Api/Dto/Payment/AllowedProductConfig.php | 35 +++ .../src/Api/Dto/Payment/LoanQueryCriteria.php | 10 +- .../Api/Exception/RequestValidationError.php | 2 +- .../src/Api/Request/CreateOrder.php | 22 ++ .../src/Api/Request/GetFinancialProducts.php | 42 ++++ .../src/Api/Request/GetPaywall.php | 1 + .../Common/Backend/Factory/OrderFactory.php | 11 +- .../src/Shop/Order/Order.php | 15 +- .../src/Shop/Order/OrderInterface.php | 2 + .../flysystem/src/FileExistsException.php | 2 +- .../flysystem/src/FileNotFoundException.php | 2 +- vendor/league/flysystem/src/Filesystem.php | 2 +- .../flysystem/src/FilesystemInterface.php | 2 +- vendor/league/flysystem/src/MountManager.php | 2 +- .../_configure/allowed-products-config.php | 66 +++++ views/admin/_configure/debug-log.php | 8 +- views/admin/_configure/error-log.php | 8 +- views/admin/_configure/module-reset.php | 23 +- .../_configure/product-category-filter.php | 14 +- views/admin/debug-mode-notice.php | 6 +- views/admin/php-compatibility-notice.php | 12 +- views/front/error.php | 12 +- views/front/payment.php | 25 +- views/front/plugin-disabled.php | 6 + 41 files changed, 976 insertions(+), 447 deletions(-) create mode 100644 resources/js/front/comfino-blocks.js create mode 100644 resources/js/front/comfino-blocks.min.js create mode 100644 resources/js/front/comfino-checkout.js create mode 100644 resources/js/front/comfino-checkout.min.js create mode 100644 src/PaywallAuthTokenGenerator.php create mode 100644 vendor/comfino/shop-plugins-shared/src/Api/Dto/Payment/AllowedProductConfig.php create mode 100644 views/admin/_configure/allowed-products-config.php diff --git a/changelog.txt b/changelog.txt index 034dcc39..bff50123 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,13 @@ +4.3.0 + * Paywall frontend migrated to V3 API and new frontend Comfino SDK — faster loading, improved stability. + * Fixed: paywall invisible when Cloudflare RocketLoader is active (added data-cfasync="false" to prevent async script deferral). + * Fixed: paywall invisible or broken with JS optimization plugins (PhastPress, Autoptimize, WP Rocket) that bundle or defer scripts. + * Fixed: paywall rendered inside hidden Elementor builder wrapper instead of the visible checkout — only the first visible paywall container is now used. + * Added support for strict Content Security Policy environments: shops using a nonce-based CSP can now propagate the nonce to the dynamically injected SDK script via the comfino_csp_script_nonce WordPress filter. + * Added per-product-type installment term limits (allowedProductsConfig): admins can now restrict available installment terms per financial product type in the sale settings. Limits are enforced on both the paywall (financial products listing) and order creation. + * Added direct redirect mode: when enabled, the full paywall offer browser is skipped and the customer is redirected straight to the Comfino payment gateway with the default financial product. + * Added a custom paywall CSS style option: admins can inject a custom CSS file into the paywall iframe (only URLs within the store domain are accepted). + 4.2.8 * Fixed a bug in webhook (payment status notifications): order not found error when "Use order reference as external ID" option is active, fixed a frontend bug concerned with Gutenberg blocks (empty comfino_loan_type error). diff --git a/readme.txt b/readme.txt index 1371ad6d..922432bd 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://comfino.pl/ Tags: comfino, woocommerce, gateway, payment, bank WC tested up to: 10.5.0 WC requires at least: 3.0 -Stable tag: 4.2.8 +Stable tag: 4.3.0 Tested up to: 6.9 Requires at least: 5.0 Requires PHP: 7.1 @@ -21,5 +21,12 @@ Comfino is an innovative payment method for customers of e-commerce stores! Thes === Changelog === -4.2.8 - * Fixed a bug in webhook (payment status notifications): order not found error when "Use order reference as external ID" option is active, fixed a frontend bug concerned with Gutenberg blocks (empty comfino_loan_type error). +4.3.0 + * Paywall frontend migrated to V3 API and new frontend Comfino SDK — faster loading, improved stability. + * Fixed: paywall invisible when Cloudflare RocketLoader is active (added data-cfasync="false" to prevent async script deferral). + * Fixed: paywall invisible or broken with JS optimization plugins (PhastPress, Autoptimize, WP Rocket) that bundle or defer scripts. + * Fixed: paywall rendered inside hidden Elementor builder wrapper instead of the visible checkout — only the first visible paywall container is now used. + * Added support for strict Content Security Policy environments: shops using a nonce-based CSP can now propagate the nonce to the dynamically injected SDK script via the comfino_csp_script_nonce WordPress filter. + * Added per-product-type installment term limits (allowedProductsConfig): admins can now restrict available installment terms per financial product type in the sale settings. Limits are enforced on both the paywall (financial products listing) and order creation. + * Added direct redirect mode: when enabled, the full paywall offer browser is skipped and the customer is redirected straight to the Comfino payment gateway with the default financial product. + * Added a custom paywall CSS style option: admins can inject a custom CSS file into the paywall iframe (only URLs within the store domain are accepted). diff --git a/resources/js/front/comfino-blocks.js b/resources/js/front/comfino-blocks.js new file mode 100644 index 00000000..3a093b0e --- /dev/null +++ b/resources/js/front/comfino-blocks.js @@ -0,0 +1,141 @@ +/* Comfino web frontend SDK — WooCommerce Blocks checkout init */ +(function () { + 'use strict'; + + const registerPaymentMethod = window.wc && window.wc.wcBlocksRegistry + ? window.wc.wcBlocksRegistry.registerPaymentMethod + : null; + + if (!registerPaymentMethod) { + return; + } + + const createElement = window.wp.element.createElement; + + // Comfino payment method configuration + const config = window.wc.wcSettings.getSetting('comfino_data', {}); + + const ComfinoPaymentContent = { + name: 'comfino', + label: config.label || 'Comfino', + content: createElement( + window.wp.element.Fragment, + null, + createElement('input', {id: 'comfino-loan-type', name: 'comfino_loan_type', type: 'hidden', value: ''}), + createElement('input', {id: 'comfino-loan-term', name: 'comfino_loan_term', type: 'hidden', value: ''}), + createElement('div', {id: 'comfino-paywall-container'}) + ), + edit: createElement('div', null, 'Comfino'), + canMakePayment: function () { + return true; + }, + ariaLabel: config.ariaLabel || 'Comfino payment method', + supports: {features: config.supports || []}, + paymentMethodId: 'comfino', + savedTokenComponent: null, + }; + + registerPaymentMethod(ComfinoPaymentContent); + + // Watch for payment method selection. + if (window.wc && window.wc.wcBlocksData && window.wc.wcBlocksData.PAYMENT_STORE_KEY) { + const select = window.wp.data.select(window.wc.wcBlocksData.PAYMENT_STORE_KEY); + + window.wp.data.subscribe(function () { + if (select.getActivePaymentMethod() !== 'comfino') { + return; + } + + // SDK already injected — re-trigger init for React re-renders that recreate the paywall container. + if (document.querySelector('script[data-comfino-sdk]')) { + if (window.ComfinoPaywallInit) { + window.ComfinoPaywallInit.init(); + } + + return; + } + + if (!config.sdkScriptUrl || !config.authToken) { + return; + } + + // allowedProductTypes: null = no filter active, [] = all filtered (don't load SDK), + // [...] = filtered subset to pass to bootstrapPaywall(). + const allowedProductTypes = config.productTypes; + const allowedProductsConfig = config.allowedProductsConfig; + + if (Array.isArray(allowedProductTypes) && allowedProductTypes.length === 0) { + // All product types filtered out for this cart — don't load the paywall. + return; + } + + // Comfino paywall bootstrap options + const comfinoPaywallData = { + authToken: config.authToken, + loanAmount: config.loanAmount, + environment: config.environment, + platform: 'woocommerce' + }; + + if (Array.isArray(allowedProductTypes) && allowedProductTypes.length > 0) { + // Set allowed financial product types for paywall if provided. + comfinoPaywallData.productTypes = allowedProductTypes; + } + + if (Array.isArray(allowedProductsConfig) && allowedProductsConfig.length > 0) { + comfinoPaywallData.allowedProductsConfig = allowedProductsConfig; + } + + if (config.paywallSettings && typeof config.paywallSettings === 'object') { + comfinoPaywallData.paywallSettings = config.paywallSettings; + } + + if (config.directRedirect) { + comfinoPaywallData.directRedirect = true; + } + + if (config.customPaywallCss) { + comfinoPaywallData.customPaywallCss = config.customPaywallCss; + } + + /* Load Comfino web frontend SDK as a plain script via DOM injection. + + Why not a dynamic import or async load? The SDK is a UMD bundle. When RequireJS's global define() + is present (e.g. in some WP themes), UMD takes the AMD branch — it calls define() and returns its + export to RequireJS, but skips the global assignment (window.Comfino.*). + + Solution: hide window.define before the script executes so the SDK's UMD wrapper sees no AMD + environment, takes the global-assignment branch, and sets window.Comfino. Restore define() in + onload/onerror. By the time the user reaches the payment step, all modules are already defined, + so the brief window where define is hidden is safe. + + Pass data directly to bootstrapPaywall() in onload — no intermediate global state used. */ + + // Preserve original window.define for later restoration. + const _amdDefine = window.define; + + /* Temporarily hide window.define so the SDK's UMD bundle takes the global-assignment branch and + exposes window.Comfino. */ + window.define = undefined; + + // Construct SDK script element and append to DOM. + const script = document.createElement('script'); + script.src = config.sdkScriptUrl; + script.setAttribute('data-comfino-sdk', '1'); + + if (config.scriptNonce) { + script.setAttribute('nonce', config.scriptNonce); + } + + script.onload = function () { + window.define = _amdDefine; + window.Comfino.bootstrapPaywall(comfinoPaywallData); + }; + script.onerror = function () { + window.define = _amdDefine; + }; + + document.head.appendChild(script); + }); + } +}()); diff --git a/resources/js/front/comfino-blocks.min.js b/resources/js/front/comfino-blocks.min.js new file mode 100644 index 00000000..47ad0a21 --- /dev/null +++ b/resources/js/front/comfino-blocks.min.js @@ -0,0 +1,4 @@ +(function(){const f=window.wc&&window.wc.wcBlocksRegistry?window.wc.wcBlocksRegistry.registerPaymentMethod:null;if(f){var c=window.wp.element.createElement,a=window.wc.wcSettings.getSetting("comfino_data",{});c={name:"comfino",label:a.label||"Comfino",content:c(window.wp.element.Fragment,null,c("input",{id:"comfino-loan-type",name:"comfino_loan_type",type:"hidden",value:""}),c("input",{id:"comfino-loan-term",name:"comfino_loan_term",type:"hidden",value:""}),c("div",{id:"comfino-paywall-container"})), +edit:c("div",null,"Comfino"),canMakePayment:function(){return!0},ariaLabel:a.ariaLabel||"Comfino payment method",supports:{features:a.supports||[]},paymentMethodId:"comfino",savedTokenComponent:null};f(c);if(window.wc&&window.wc.wcBlocksData&&window.wc.wcBlocksData.PAYMENT_STORE_KEY){const h=window.wp.data.select(window.wc.wcBlocksData.PAYMENT_STORE_KEY);window.wp.data.subscribe(function(){if("comfino"===h.getActivePaymentMethod())if(document.querySelector("script[data-comfino-sdk]"))window.ComfinoPaywallInit&& +window.ComfinoPaywallInit.init();else if(a.sdkScriptUrl&&a.authToken){var b=a.productTypes,e=a.allowedProductsConfig;if(!Array.isArray(b)||0!==b.length){var d={authToken:a.authToken,loanAmount:a.loanAmount,environment:a.environment,platform:"woocommerce"};Array.isArray(b)&&0 0) { + // Set allowed financial product types for paywall if provided. + comfinoPaywallData.productTypes = allowedProductTypes; + } + + if (Array.isArray(allowedProductsConfig) && allowedProductsConfig.length > 0) { + comfinoPaywallData.allowedProductsConfig = allowedProductsConfig; + } + + if (config.paywallSettings && typeof config.paywallSettings === 'object') { + comfinoPaywallData.paywallSettings = config.paywallSettings; + } + + if (config.directRedirect) { + comfinoPaywallData.directRedirect = true; + } + + if (config.customPaywallCss) { + comfinoPaywallData.customPaywallCss = config.customPaywallCss; + } + + /* Load Comfino web frontend SDK as a plain script via DOM injection. + + Why not a dynamic import or async load? The SDK is a UMD bundle. When RequireJS's global define() + is present (e.g. in some WP themes), UMD takes the AMD branch — it calls define() and returns its + export to RequireJS, but skips the global assignment (window.Comfino.*). + + Solution: hide window.define before the script executes so the SDK's UMD wrapper sees no AMD + environment, takes the global-assignment branch, and sets window.Comfino. Restore define() in + onload/onerror. By the time the user reaches the payment step, all modules are already defined, + so the brief window where define is hidden is safe. + + Pass data directly to bootstrapPaywall() in onload — no intermediate global state used. */ + + // Preserve original window.define for later restoration. + const _amdDefine = window.define; + + /* Temporarily hide window.define so the SDK's UMD bundle takes the global-assignment branch and + exposes window.Comfino. */ + window.define = undefined; + + // Construct SDK script element and append to DOM. + const script = document.createElement('script'); + script.src = config.sdkScriptUrl; + script.setAttribute('data-comfino-sdk', '1'); + + if (config.scriptNonce) { + script.setAttribute('nonce', config.scriptNonce); + } + + script.onload = function () { + window.define = _amdDefine; + + /* Resolve visible paywall container — guards against Elementor rendering a hidden duplicate of the checkout + (including payment_fields()) in a builder-preview wrapper. */ + function isInVisibleContext(element) + { + let node = element; + + while (node && node !== document.body) { + const computedStyle = window.getComputedStyle(node); + + if (computedStyle.display === 'none' || computedStyle.visibility === 'hidden') { + return false; + } + + node = node.parentElement; + } + + return true; + } + + let container = document.getElementById('comfino-paywall-container'); + + if (container && !isInVisibleContext(container)) { + const candidates = document.querySelectorAll('[id="comfino-paywall-container"]'); + + container = null; + + for (let i = 0; i < candidates.length; i++) { + if (isInVisibleContext(candidates[i])) { + container = candidates[i]; + + break; + } + } + } + + if (!container) { + return; + } + + comfinoPaywallData.container = container; + + window.Comfino.bootstrapPaywall(comfinoPaywallData); + }; + script.onerror = function () { + window.define = _amdDefine; + }; + + document.head.appendChild(script); +}()); diff --git a/resources/js/front/comfino-checkout.min.js b/resources/js/front/comfino-checkout.min.js new file mode 100644 index 00000000..8fe7d7f5 --- /dev/null +++ b/resources/js/front/comfino-checkout.min.js @@ -0,0 +1,3 @@ +(function(){const a=window.comfinoSettings||{};if(a.sdkScriptUrl&&a.authToken&&!document.querySelector("script[data-comfino-sdk]")){var b=a.productTypes,g=a.allowedProductsConfig;if(!Array.isArray(b)||0!==b.length){var d={authToken:a.authToken,loanAmount:a.loanAmount,environment:a.environment,platform:"woocommerce"};Array.isArray(b)&&0 [self::class, 'getPaywall'], - 'paywallItemDetails' => [self::class, 'getPaywallItemDetails'], - ]; + private static $requestCallbacks = []; public static function init(): void { @@ -79,46 +67,6 @@ static function (bool $served, \WP_HTTP_Response $result, \WP_REST_Request $requ ] ); - self::registerWordPressApiEndpoint( - 'paywall', - [ - [ - 'methods' => \WP_REST_Server::READABLE, - 'callback' => function (\WP_REST_Request $request): \WP_REST_Response { - return self::processRequest('paywall', $request); - }, - 'permission_callback' => '__return_true', - ], - ] - ); - - self::registerWordPressApiEndpoint( - 'paywallItemDetails', - [ - [ - 'methods' => \WP_REST_Server::READABLE, - 'callback' => function (\WP_REST_Request $request): \WP_REST_Response { - return self::processRequest('paywallItemDetails', $request); - }, - 'permission_callback' => '__return_true', - ], - ] - ); - - self::registerWordPressApiEndpoint( - 'productDetails', - [ - [ - 'methods' => \WP_REST_Server::READABLE, - 'callback' => function (\WP_REST_Request $request): \WP_REST_Response { - return self::processRequest('productDetails', $request); - }, - 'args' => ['loanTypeSelected' => ['sanitize_callback' => 'sanitize_text_field']], - 'permission_callback' => '__return_true', - ], - ] - ); - /* Comfino API callback endpoints - require CR-Signature authentication. These are server-to-server requests from Comfino API (no WordPress user context). Authentication is performed by RestEndpointManager::verifyRequest() using SHA3-256 HMAC signature verification. */ @@ -209,9 +157,6 @@ public static function registerEndpoints(): void { self::$endpointUrls = [ 'availableOfferTypes' => '/availableoffertypes(?:/(?P\d+))?', - 'paywall' => '/paywall', - 'paywallItemDetails' => '/paywallitemdetails', - 'productDetails' => '/productdetails(?:/(?P\d+))?(?:/(?P[A-Z_]+))?', 'transactionStatus' => '/transactionstatus', 'configuration' => '/configuration(?:/(?P[a-f0-9]+))?', 'cacheInvalidate' => '/cacheinvalidate', @@ -380,185 +325,4 @@ private static function createServerRequest(\WP_REST_Request $request): ?ServerR : null; } - private static function getPaywall(\WP_REST_Request $request): void - { - header('Content-Type: text/html'); - - FrontendManager::resetScripts(); - FrontendManager::resetStyles(); - - if (!ConfigManager::isEnabled()) { - TemplateManager::renderView('plugin-disabled', 'front'); - - exit; - } - - if ($request->has_param('priceModifier') && is_numeric($request->get_param('priceModifier'))) { - $priceModifier = (int) filter_var($request->get_param('priceModifier'), FILTER_VALIDATE_INT); - } else { - $priceModifier = 0; - } - - $loanAmount = (int) round(WC()->cart->get_total('edit') * 100); - - try { - $shopCart = OrderManager::getShopCart(WC()->cart, $priceModifier); - } catch (\Exception $e) { - TemplateManager::renderView( - 'paywall-disabled', - 'front', - array_merge(FrontendManager::processError('Shop cart creation error', $e, 400), ['styles' => []]) - ); - - exit; - } - - $allowedProductTypes = SettingsManager::getAllowedProductTypes( - ProductTypesListTypeEnum::LIST_TYPE_PAYWALL, - $shopCart - ); - - if ($allowedProductTypes === []) { - // Filters active - all product types disabled. - TemplateManager::renderView('paywall-disabled', 'front'); - - exit; - } - - DebugLogger::logEvent( - '[PAYWALL]', - 'renderPaywall', - [ - '$loanAmount' => $loanAmount, - '$priceModifier' => $priceModifier, - '$cartTotalValue' => $shopCart->getTotalValue(), - '$allowedProductTypes' => $allowedProductTypes, - '$shopCart' => $shopCart->getAsArray(), - ] - ); - - $paywallRenderer = FrontendManager::getPaywallRenderer(); - $paywallUrl = self::getEndpointUrl('paywall'); - $templateVariables = [ - 'language' => Main::getShopLanguage(), - 'styles' => FrontendManager::registerExternalStyles($paywallRenderer->getStyles()), - 'scripts' => FrontendManager::includeExternalScripts($paywallRenderer->getScripts()), - 'shop_url' => Main::getShopUrl(), - ]; - - try { - $paywallContents = ApiClient::getInstance()->getPaywall( - new LoanQueryCriteria($loanAmount, null, null, $allowedProductTypes), - $paywallUrl - ); - - $templateName = 'paywall'; - $templateVariables['paywall_hash'] = $paywallRenderer->getPaywallHash( - $paywallContents->paywallBody, - ConfigManager::getApiKey() - ); - $templateVariables['frontend_elements'] = [ - 'paywallBody' => $paywallContents->paywallBody, - 'paywallHash' => $paywallContents->paywallHash, - ]; - } catch (\Throwable $e) { - http_response_code($e instanceof HttpErrorExceptionInterface ? $e->getStatusCode() : 500); - - $templateVariables = array_merge($templateVariables, ApiClient::processApiError('Paywall endpoint', $e)); - $templateName = 'api-error'; - } finally { - if (($apiRequest = ApiClient::getInstance()->getRequest()) !== null) { - DebugLogger::logEvent( - '[PAYWALL_API_REQUEST]', - 'renderPaywall', - [ - '$paywallUrl' => $paywallUrl, - '$request' => $apiRequest->getRequestBody(), - '$templateVariables' => $templateVariables - ] - ); - } - } - - TemplateManager::renderView($templateName, 'front', $templateVariables); - - exit; - } - - private static function getPaywallItemDetails(\WP_REST_Request $request): \WP_REST_Response - { - if (!ConfigManager::isEnabled()) { - TemplateManager::renderView('plugin-disabled', 'front'); - - exit; - } - - $loanAmount = (int) round(WC()->cart->get_total('edit') * 100); - $loanTypeSelected = $request->get_param('loanTypeSelected'); - $loadProductCategories = ($request->get_param('reqProdCat') === 'yes'); - - if ($request->has_param('priceModifier') && is_numeric($request->get_param('priceModifier'))) { - $priceModifier = (int) filter_var($request->get_param('priceModifier'), FILTER_VALIDATE_INT); - } else { - $priceModifier = 0; - } - - try { - $shopCart = OrderManager::getShopCart(WC()->cart, $priceModifier); - } catch (\Exception $e) { - FrontendManager::processError('Shop cart creation error', $e); - - return new \WP_REST_Response(['listItemData' => '', 'productDetails' => ''], 400); - } - - DebugLogger::logEvent( - '[PAYWALL_ITEM_DETAILS]', - 'getPaywallItemDetails', - [ - '$loanAmount' => $loanAmount, - '$loanTypeSelected' => $loanTypeSelected, - '$priceModifier' => $priceModifier, - '$loadProductCategories' => $loadProductCategories, - '$shopCart' => $shopCart->getAsArray(), - ] - ); - - if (empty($loanTypeSelected)) { - // Financial product type not passed - return empty response. - return new \WP_REST_Response(['listItemData' => '', 'productDetails' => '']); - } - - try { - $paywallItemDetails = ApiClient::getInstance()->getPaywallItemDetails( - $loanAmount, - LoanTypeEnum::from($loanTypeSelected), - new Cart( - $shopCart->getCartItems(), - $shopCart->getTotalValue(), - $shopCart->getDeliveryCost(), - $shopCart->getDeliveryNetCost(), - $shopCart->getDeliveryTaxRate(), - $shopCart->getDeliveryTaxValue() - ) - ); - } catch (\Throwable $e) { - return new \WP_REST_Response( - ApiClient::processApiError('Paywall item details endpoint', $e)['error_details'], - $e instanceof HttpErrorExceptionInterface ? $e->getStatusCode() : 500 - ); - } finally { - if (($apiRequest = ApiClient::getInstance()->getRequest()) !== null) { - DebugLogger::logEvent( - '[PAYWALL_ITEM_DETAILS_API_REQUEST]', - 'getPaywallItemDetails', - ['$request' => $apiRequest->getRequestBody()] - ); - } - } - - return new \WP_REST_Response([ - 'listItemData' => $paywallItemDetails->listItemData, - 'productDetails' => $paywallItemDetails->productDetails - ]); - } } diff --git a/src/Configuration/ConfigManager.php b/src/Configuration/ConfigManager.php index dce804b5..30a941eb 100644 --- a/src/Configuration/ConfigManager.php +++ b/src/Configuration/ConfigManager.php @@ -24,6 +24,9 @@ final class ConfigManager { + private const COMFINO_SDK_JS_PRODUCTION = 'https://widget.comfino.pl/sdk/v1/comfino-sdk.min.js'; + private const COMFINO_SDK_JS_SANDBOX = 'https://widget.craty.pl/sdk/v1/comfino-sdk.min.js'; + public const CONFIG_OPTIONS_MAP = [ 'COMFINO_ENABLED' => 'enabled', 'COMFINO_API_KEY' => 'production_key', @@ -37,7 +40,10 @@ final class ConfigManager 'COMFINO_DEV_ENV_VARS' => 'dev_env_vars', 'COMFINO_SANDBOX_API_KEY' => 'sandbox_key', 'COMFINO_PRODUCT_CATEGORY_FILTERS' => 'product_category_filters', + 'COMFINO_ALLOWED_PRODUCTS_CONFIG' => 'allowed_products_config', 'COMFINO_CAT_FILTER_AVAIL_PROD_TYPES' => 'cat_filter_avail_prod_types', + 'COMFINO_PAYWALL_DIRECT_REDIRECT' => 'paywall_direct_redirect', + 'COMFINO_PAYWALL_CUSTOM_CSS_URL' => 'paywall_custom_css_url', 'COMFINO_WIDGET_ENABLED' => 'widget_enabled', 'COMFINO_WIDGET_KEY' => 'widget_key', 'COMFINO_WIDGET_PRICE_SELECTOR' => 'widget_price_selector', @@ -76,8 +82,11 @@ final class ConfigManager 'COMFINO_MINIMAL_CART_AMOUNT' => ConfigurationManager::OPT_VALUE_TYPE_FLOAT, 'COMFINO_SHOW_LOGO' => ConfigurationManager::OPT_VALUE_TYPE_BOOL, 'COMFINO_USE_ORDER_REFERENCE' => ConfigurationManager::OPT_VALUE_TYPE_BOOL, + 'COMFINO_PAYWALL_DIRECT_REDIRECT' => ConfigurationManager::OPT_VALUE_TYPE_BOOL, + 'COMFINO_PAYWALL_CUSTOM_CSS_URL' => ConfigurationManager::OPT_VALUE_TYPE_STRING, ], 'sale_settings' => [ + 'COMFINO_ALLOWED_PRODUCTS_CONFIG' => ConfigurationManager::OPT_VALUE_TYPE_JSON, 'COMFINO_PRODUCT_CATEGORY_FILTERS' => ConfigurationManager::OPT_VALUE_TYPE_JSON, ], 'widget_settings' => [ @@ -130,9 +139,12 @@ final class ConfigManager 'COMFINO_SHOW_LOGO', 'COMFINO_MINIMAL_CART_AMOUNT', 'COMFINO_USE_ORDER_REFERENCE', + 'COMFINO_PAYWALL_DIRECT_REDIRECT', + 'COMFINO_PAYWALL_CUSTOM_CSS_URL', 'COMFINO_IS_SANDBOX', 'COMFINO_DEBUG', 'COMFINO_SERVICE_MODE', + 'COMFINO_ALLOWED_PRODUCTS_CONFIG', 'COMFINO_PRODUCT_CATEGORY_FILTERS', 'COMFINO_CAT_FILTER_AVAIL_PROD_TYPES', 'COMFINO_WIDGET_ENABLED', @@ -554,6 +566,15 @@ public static function getCurrentWidgetCode(?int $productId = null): string return $widgetCode; } + public static function getSdkScriptUrl(): string + { + if (self::useDevEnvVars() && getenv('COMFINO_DEV_SDK_SCRIPT_URL')) { + return sanitize_url(wp_unslash(getenv('COMFINO_DEV_SDK_SCRIPT_URL'))); + } + + return self::isSandboxMode() ? self::COMFINO_SDK_JS_SANDBOX : self::COMFINO_SDK_JS_PRODUCTION; + } + public static function getWidgetScriptUrl(): string { if (self::useDevEnvVars() && getenv('COMFINO_DEV_WIDGET_SCRIPT_URL')) { @@ -630,7 +651,10 @@ public static function getDefaultConfigurationValues(): array 'COMFINO_DEBUG' => false, 'COMFINO_SERVICE_MODE' => false, 'COMFINO_PRODUCT_CATEGORY_FILTERS' => '', + 'COMFINO_ALLOWED_PRODUCTS_CONFIG' => null, 'COMFINO_CAT_FILTER_AVAIL_PROD_TYPES' => 'INSTALLMENTS_ZERO_PERCENT,PAY_LATER,COMPANY_BNPL,COMPANY_INSTALLMENTS,LEASING,PAY_IN_PARTS', + 'COMFINO_PAYWALL_DIRECT_REDIRECT' => false, + 'COMFINO_PAYWALL_CUSTOM_CSS_URL' => '', 'COMFINO_WIDGET_ENABLED' => false, 'COMFINO_WIDGET_KEY' => '', 'COMFINO_WIDGET_PRICE_SELECTOR' => '.price .woocommerce-Price-amount bdi', diff --git a/src/Main.php b/src/Main.php index dbd1d8af..8d20578a 100644 --- a/src/Main.php +++ b/src/Main.php @@ -153,6 +153,17 @@ public static function init(): void return $statuses; }); + // Prevent Cloudflare RocketLoader and JS bundlers (PhastPress, Autoptimize, WP Rocket) + // from deferring Comfino frontend scripts asynchronously. These scripts depend on the + // wp_localize_script inline data block that immediately precedes them in the HTML; async + // delivery breaks that ordering guarantee. + add_filter('script_loader_tag', static function (string $tag, string $handle): string { + if (strpos($handle, 'comfino-script-') === 0) { + return str_replace(' - + + + + +
diff --git a/views/front/plugin-disabled.php b/views/front/plugin-disabled.php index 5c539fc2..5fb03a46 100644 --- a/views/front/plugin-disabled.php +++ b/views/front/plugin-disabled.php @@ -1,4 +1,10 @@ Date: Tue, 12 May 2026 19:12:48 +0200 Subject: [PATCH 04/67] FN-14460 Updated tests to use mocked WC_Settings_API instances instead of direct instantiation. --- tests/View/FrontendManagerTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/View/FrontendManagerTest.php b/tests/View/FrontendManagerTest.php index a7a8d2b8..88049e3b 100644 --- a/tests/View/FrontendManagerTest.php +++ b/tests/View/FrontendManagerTest.php @@ -36,7 +36,7 @@ public function testRenderHiddenInput(): void $fieldKey = 'test_field'; $fieldValue = 'test_value'; $data = ['title' => 'Test Field', 'type' => 'hidden']; - $wcSettings = new WC_Settings_API(); + $wcSettings = $this->getMockForAbstractClass(WC_Settings_API::class); $html = FrontendManager::renderHiddenInput($fieldKey, $fieldValue, $data, $wcSettings); @@ -57,7 +57,7 @@ public function testRenderCheckboxSet(): void 'option3' => 'Option 3' ] ]; - $wcSettings = new WC_Settings_API(); + $wcSettings = $this->getMockForAbstractClass(WC_Settings_API::class); $html = FrontendManager::renderCheckboxSet($fieldKey, $fieldValue, $data, $wcSettings); @@ -72,7 +72,7 @@ public function testRenderCheckboxSetWithEmptyValues(): void $fieldKey = 'test_checkboxes'; $fieldValue = []; $data = ['title' => 'Test Checkboxes']; // No 'values' key. - $wcSettings = new WC_Settings_API(); + $wcSettings = $this->getMockForAbstractClass(WC_Settings_API::class); $html = FrontendManager::renderCheckboxSet($fieldKey, $fieldValue, $data, $wcSettings); @@ -342,7 +342,7 @@ public function testRenderHiddenInputWithCustomAttributes(): void 'data-id' => '123', ], ]; - $wcSettings = new WC_Settings_API(); + $wcSettings = $this->getMockForAbstractClass(WC_Settings_API::class); $html = FrontendManager::renderHiddenInput($fieldKey, $fieldValue, $data, $wcSettings); @@ -360,7 +360,7 @@ public function testRenderHiddenInputWithDisabled(): void 'type' => 'hidden', 'disabled' => true, ]; - $wcSettings = new WC_Settings_API(); + $wcSettings = $this->getMockForAbstractClass(WC_Settings_API::class); $html = FrontendManager::renderHiddenInput($fieldKey, $fieldValue, $data, $wcSettings); @@ -379,7 +379,7 @@ public function testRenderCheckboxSetWithDescription(): void 'option2' => 'Option 2', ] ]; - $wcSettings = new WC_Settings_API(); + $wcSettings = $this->getMockForAbstractClass(WC_Settings_API::class); $html = FrontendManager::renderCheckboxSet($fieldKey, $fieldValue, $data, $wcSettings); From e808eb17e7a711455d9d65c2bbe405ed103a07ff Mon Sep 17 00:00:00 2001 From: Artur Kozubski Date: Fri, 15 May 2026 09:14:19 +0200 Subject: [PATCH 05/67] FN-14460 Integration with new paywall API and new frontend SDK. Added backend support for creditors including caching, API integration, and frontend data availability. Updated dependencies for shared plugins. --- composer.lock | 8 ++--- resources/js/front/comfino-blocks.js | 4 +++ resources/js/front/comfino-checkout.js | 4 +++ src/Configuration/ConfigManager.php | 8 ++++- src/Configuration/SettingsManager.php | 36 +++++++++++++++++++ src/Main.php | 1 + src/PaymentGateway.php | 2 +- src/View/Block/PaymentGateway.php | 1 + .../shop-plugins-shared/src/Api/Client.php | 17 +++++++++ vendor/composer/autoload_classmap.php | 2 ++ vendor/composer/autoload_static.php | 2 ++ vendor/composer/installed.json | 8 ++--- vendor/composer/installed.php | 2 +- 13 files changed, 84 insertions(+), 11 deletions(-) diff --git a/composer.lock b/composer.lock index e33485a5..712512a3 100644 --- a/composer.lock +++ b/composer.lock @@ -344,12 +344,12 @@ "source": { "type": "git", "url": "git@github.com:comfino/shop-plugins-shared.git", - "reference": "04ac87168a8ac50bc0932ed584f683c4e15a3bc4" + "reference": "ab08b1a16c261d5cddd74cd309ecb211836a118d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/comfino/shop-plugins-shared/zipball/04ac87168a8ac50bc0932ed584f683c4e15a3bc4", - "reference": "04ac87168a8ac50bc0932ed584f683c4e15a3bc4", + "url": "https://api.github.com/repos/comfino/shop-plugins-shared/zipball/ab08b1a16c261d5cddd74cd309ecb211836a118d", + "reference": "ab08b1a16c261d5cddd74cd309ecb211836a118d", "shasum": "" }, "require": { @@ -399,7 +399,7 @@ "source": "https://github.com/comfino/shop-plugins-shared/tree/master", "issues": "https://github.com/comfino/shop-plugins-shared/issues" }, - "time": "2026-05-12T13:26:11+00:00" + "time": "2026-05-13T15:09:39+00:00" }, { "name": "fig/http-message-util", diff --git a/resources/js/front/comfino-blocks.js b/resources/js/front/comfino-blocks.js index 3a093b0e..d85e4876 100644 --- a/resources/js/front/comfino-blocks.js +++ b/resources/js/front/comfino-blocks.js @@ -98,6 +98,10 @@ comfinoPaywallData.customPaywallCss = config.customPaywallCss; } + if (config.creditors && typeof config.creditors === 'object') { + comfinoPaywallData.creditors = config.creditors; + } + /* Load Comfino web frontend SDK as a plain script via DOM injection. Why not a dynamic import or async load? The SDK is a UMD bundle. When RequireJS's global define() diff --git a/resources/js/front/comfino-checkout.js b/resources/js/front/comfino-checkout.js index ffe18ad1..95b61acb 100644 --- a/resources/js/front/comfino-checkout.js +++ b/resources/js/front/comfino-checkout.js @@ -48,6 +48,10 @@ comfinoPaywallData.customPaywallCss = config.customPaywallCss; } + if (config.creditors && typeof config.creditors === 'object') { + comfinoPaywallData.creditors = config.creditors; + } + /* Load Comfino web frontend SDK as a plain script via DOM injection. Why not a dynamic import or async load? The SDK is a UMD bundle. When RequireJS's global define() diff --git a/src/Configuration/ConfigManager.php b/src/Configuration/ConfigManager.php index 30a941eb..8fcd2eb9 100644 --- a/src/Configuration/ConfigManager.php +++ b/src/Configuration/ConfigManager.php @@ -569,7 +569,13 @@ public static function getCurrentWidgetCode(?int $productId = null): string public static function getSdkScriptUrl(): string { if (self::useDevEnvVars() && getenv('COMFINO_DEV_SDK_SCRIPT_URL')) { - return sanitize_url(wp_unslash(getenv('COMFINO_DEV_SDK_SCRIPT_URL'))); + $sdkScriptUrl = sanitize_url(wp_unslash(getenv('COMFINO_DEV_SDK_SCRIPT_URL'))); + + if (self::useUnminifiedScripts()) { + $sdkScriptUrl = str_replace('.min.js', '.js', $sdkScriptUrl); + } + + return $sdkScriptUrl; } return self::isSandboxMode() ? self::COMFINO_SDK_JS_SANDBOX : self::COMFINO_SDK_JS_PRODUCTION; diff --git a/src/Configuration/SettingsManager.php b/src/Configuration/SettingsManager.php index 66a4acaf..3c9b1003 100644 --- a/src/Configuration/SettingsManager.php +++ b/src/Configuration/SettingsManager.php @@ -77,6 +77,42 @@ public static function getProductTypes(string $listType, bool $returnErrors = fa return []; } + /** + * Returns a map of available creditors grouped by product type, cached with a single entry. + * + * @return array + */ + public static function getCreditors(): array + { + $cacheKey = 'creditors'; + + if (($creditors = CacheManager::get($cacheKey)) !== null) { + return is_array($creditors) ? $creditors : []; + } + + if (empty(ApiClient::getInstance()->getApiKey())) { + return []; + } + + try { + $response = ApiClient::getInstance()->getCreditors(); + $creditorsList = $response->creditors; + $cacheTtl = (int) $response->getHeader('Cache-TTL', '0'); + + CacheManager::set($cacheKey, $creditorsList, $cacheTtl, ['admin_product_types']); + + return $creditorsList; + } catch (FilesystemException $e) { + ErrorLogger::getLoggerInstance()->logError('Creditors cache error', $e->getMessage()); + + return $creditorsList ?? []; + } catch (\Throwable $e) { + ApiClient::processApiError('Settings error on page "' . Main::getCurrentUrl() . '" (Comfino API)', $e); + } + + return []; + } + /** * @return string[] */ diff --git a/src/Main.php b/src/Main.php index 8d20578a..d555385c 100644 --- a/src/Main.php +++ b/src/Main.php @@ -269,6 +269,7 @@ public static function renderPaywallIframe(\WC_Cart $cart, float $total, bool $i 'sdkScriptUrl' => ConfigManager::getSdkScriptUrl(), 'productTypes' => $allowedProductTypes !== null ? array_map('strval', $allowedProductTypes) : null, 'allowedProductsConfig' => self::buildAllowedProductsConfigForFrontend(), + 'creditors' => SettingsManager::getCreditors() ?: null, 'paywallSettings' => [ 'language' => self::getShopLanguage(), 'currency' => self::getShopCurrency(), diff --git a/src/PaymentGateway.php b/src/PaymentGateway.php index eb87cac7..49c04db9 100644 --- a/src/PaymentGateway.php +++ b/src/PaymentGateway.php @@ -32,7 +32,7 @@ class PaymentGateway extends \WC_Payment_Gateway { public const GATEWAY_ID = 'comfino'; public const VERSION = '4.3.0'; - public const BUILD_TS = 1778592613; + public const BUILD_TS = 1778685018; public const WIDGET_INIT_SCRIPT_HASH = '0603f4e0904fd65e2aef1aded0c57c40'; public const WIDGET_INIT_SCRIPT_LAST_HASH = '55e4306bb493ff6f99b2f8f617e18038'; diff --git a/src/View/Block/PaymentGateway.php b/src/View/Block/PaymentGateway.php index 99eeccba..0b8c7f44 100644 --- a/src/View/Block/PaymentGateway.php +++ b/src/View/Block/PaymentGateway.php @@ -130,6 +130,7 @@ public function get_payment_method_data(): array 'currency' => \Comfino\Main::getShopCurrency(), ], 'allowedProductsConfig' => self::buildAllowedProductsConfigForFrontend(), + 'creditors' => SettingsManager::getCreditors() ?: null, 'directRedirect' => (bool) ConfigManager::getConfigurationValue('COMFINO_PAYWALL_DIRECT_REDIRECT'), 'customPaywallCss' => ConfigManager::getConfigurationValue('COMFINO_PAYWALL_CUSTOM_CSS_URL') ?: null, 'scriptNonce' => (string) apply_filters('comfino_csp_script_nonce', ''), diff --git a/vendor/comfino/shop-plugins-shared/src/Api/Client.php b/vendor/comfino/shop-plugins-shared/src/Api/Client.php index 070f2953..d664d18a 100644 --- a/vendor/comfino/shop-plugins-shared/src/Api/Client.php +++ b/vendor/comfino/shop-plugins-shared/src/Api/Client.php @@ -18,6 +18,7 @@ use Comfino\Api\Request\GetOrder as GetOrderRequest; use Comfino\Api\Request\GetPaywall as GetPaywallRequest; use Comfino\Api\Request\GetPaywallItemDetails as GetPaywallItemDetailsRequest; +use Comfino\Api\Request\GetCreditors as GetCreditorsRequest; use Comfino\Api\Request\GetProductTypes as GetProductTypesRequest; use Comfino\Api\Request\GetWidgetKey as GetWidgetKeyRequest; use Comfino\Api\Request\GetWidgetTypes as GetWidgetTypesRequest; @@ -29,6 +30,7 @@ use Comfino\Api\Response\GetOrder as GetOrderResponse; use Comfino\Api\Response\GetPaywall as GetPaywallResponse; use Comfino\Api\Response\GetPaywallItemDetails as GetPaywallItemDetailsResponse; +use Comfino\Api\Response\GetCreditors as GetCreditorsResponse; use Comfino\Api\Response\GetProductTypes as GetProductTypesResponse; use Comfino\Api\Response\GetWidgetKey as GetWidgetKeyResponse; use Comfino\Api\Response\GetWidgetTypes as GetWidgetTypesResponse; @@ -408,6 +410,21 @@ public function getProductTypes($listType): GetProductTypesResponse return new GetProductTypesResponse($this->request, $this->sendRequest($this->request), $this->serializer); } + /** + * @throws RequestValidationError + * @throws ResponseValidationError + * @throws AuthorizationError + * @throws AccessDenied + * @throws ServiceUnavailable + * @throws ClientExceptionInterface + */ + public function getCreditors(): GetCreditorsResponse + { + $this->request = (new GetCreditorsRequest())->setSerializer($this->serializer); + + return new GetCreditorsResponse($this->request, $this->sendRequest($this->request), $this->serializer); + } + /** * @throws RequestValidationError * @throws ResponseValidationError diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index f315fbf3..6d9d2ff2 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -222,6 +222,7 @@ 'Comfino\\Api\\Request' => $vendorDir . '/comfino/shop-plugins-shared/src/Api/Request.php', 'Comfino\\Api\\Request\\CancelOrder' => $vendorDir . '/comfino/shop-plugins-shared/src/Api/Request/CancelOrder.php', 'Comfino\\Api\\Request\\CreateOrder' => $vendorDir . '/comfino/shop-plugins-shared/src/Api/Request/CreateOrder.php', + 'Comfino\\Api\\Request\\GetCreditors' => $vendorDir . '/comfino/shop-plugins-shared/src/Api/Request/GetCreditors.php', 'Comfino\\Api\\Request\\GetFinancialProductDetails' => $vendorDir . '/comfino/shop-plugins-shared/src/Api/Request/GetFinancialProductDetails.php', 'Comfino\\Api\\Request\\GetFinancialProducts' => $vendorDir . '/comfino/shop-plugins-shared/src/Api/Request/GetFinancialProducts.php', 'Comfino\\Api\\Request\\GetOrder' => $vendorDir . '/comfino/shop-plugins-shared/src/Api/Request/GetOrder.php', @@ -234,6 +235,7 @@ 'Comfino\\Api\\Response' => $vendorDir . '/comfino/shop-plugins-shared/src/Api/Response.php', 'Comfino\\Api\\Response\\Base' => $vendorDir . '/comfino/shop-plugins-shared/src/Api/Response/Base.php', 'Comfino\\Api\\Response\\CreateOrder' => $vendorDir . '/comfino/shop-plugins-shared/src/Api/Response/CreateOrder.php', + 'Comfino\\Api\\Response\\GetCreditors' => $vendorDir . '/comfino/shop-plugins-shared/src/Api/Response/GetCreditors.php', 'Comfino\\Api\\Response\\GetFinancialProductDetails' => $vendorDir . '/comfino/shop-plugins-shared/src/Api/Response/GetFinancialProductDetails.php', 'Comfino\\Api\\Response\\GetFinancialProducts' => $vendorDir . '/comfino/shop-plugins-shared/src/Api/Response/GetFinancialProducts.php', 'Comfino\\Api\\Response\\GetOrder' => $vendorDir . '/comfino/shop-plugins-shared/src/Api/Response/GetOrder.php', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 46f3e44a..589201ff 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -520,6 +520,7 @@ class ComposerStaticInitc881c954c3f7c2bbd7196d2eee3dca74 'Comfino\\Api\\Request' => __DIR__ . '/..' . '/comfino/shop-plugins-shared/src/Api/Request.php', 'Comfino\\Api\\Request\\CancelOrder' => __DIR__ . '/..' . '/comfino/shop-plugins-shared/src/Api/Request/CancelOrder.php', 'Comfino\\Api\\Request\\CreateOrder' => __DIR__ . '/..' . '/comfino/shop-plugins-shared/src/Api/Request/CreateOrder.php', + 'Comfino\\Api\\Request\\GetCreditors' => __DIR__ . '/..' . '/comfino/shop-plugins-shared/src/Api/Request/GetCreditors.php', 'Comfino\\Api\\Request\\GetFinancialProductDetails' => __DIR__ . '/..' . '/comfino/shop-plugins-shared/src/Api/Request/GetFinancialProductDetails.php', 'Comfino\\Api\\Request\\GetFinancialProducts' => __DIR__ . '/..' . '/comfino/shop-plugins-shared/src/Api/Request/GetFinancialProducts.php', 'Comfino\\Api\\Request\\GetOrder' => __DIR__ . '/..' . '/comfino/shop-plugins-shared/src/Api/Request/GetOrder.php', @@ -532,6 +533,7 @@ class ComposerStaticInitc881c954c3f7c2bbd7196d2eee3dca74 'Comfino\\Api\\Response' => __DIR__ . '/..' . '/comfino/shop-plugins-shared/src/Api/Response.php', 'Comfino\\Api\\Response\\Base' => __DIR__ . '/..' . '/comfino/shop-plugins-shared/src/Api/Response/Base.php', 'Comfino\\Api\\Response\\CreateOrder' => __DIR__ . '/..' . '/comfino/shop-plugins-shared/src/Api/Response/CreateOrder.php', + 'Comfino\\Api\\Response\\GetCreditors' => __DIR__ . '/..' . '/comfino/shop-plugins-shared/src/Api/Response/GetCreditors.php', 'Comfino\\Api\\Response\\GetFinancialProductDetails' => __DIR__ . '/..' . '/comfino/shop-plugins-shared/src/Api/Response/GetFinancialProductDetails.php', 'Comfino\\Api\\Response\\GetFinancialProducts' => __DIR__ . '/..' . '/comfino/shop-plugins-shared/src/Api/Response/GetFinancialProducts.php', 'Comfino\\Api\\Response\\GetOrder' => __DIR__ . '/..' . '/comfino/shop-plugins-shared/src/Api/Response/GetOrder.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index fab2da00..4bbd340e 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -354,12 +354,12 @@ "source": { "type": "git", "url": "git@github.com:comfino/shop-plugins-shared.git", - "reference": "04ac87168a8ac50bc0932ed584f683c4e15a3bc4" + "reference": "ab08b1a16c261d5cddd74cd309ecb211836a118d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/comfino/shop-plugins-shared/zipball/04ac87168a8ac50bc0932ed584f683c4e15a3bc4", - "reference": "04ac87168a8ac50bc0932ed584f683c4e15a3bc4", + "url": "https://api.github.com/repos/comfino/shop-plugins-shared/zipball/ab08b1a16c261d5cddd74cd309ecb211836a118d", + "reference": "ab08b1a16c261d5cddd74cd309ecb211836a118d", "shasum": "" }, "require": { @@ -381,7 +381,7 @@ "phpspec/prophecy-phpunit": "^1.1", "phpunit/phpunit": "^5.7" }, - "time": "2026-05-12T13:26:11+00:00", + "time": "2026-05-13T15:09:39+00:00", "default-branch": true, "type": "library", "installation-source": "dist", diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 025d40ac..4368ab3f 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -58,7 +58,7 @@ 'comfino/shop-plugins-shared' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '04ac87168a8ac50bc0932ed584f683c4e15a3bc4', + 'reference' => 'ab08b1a16c261d5cddd74cd309ecb211836a118d', 'type' => 'library', 'install_path' => __DIR__ . '/../comfino/shop-plugins-shared', 'aliases' => array( From 255bd588f815886323f26b8e08f65eaa97590d23 Mon Sep 17 00:00:00 2001 From: Artur Kozubski Date: Fri, 15 May 2026 21:44:59 +0200 Subject: [PATCH 06/67] FN-15832 Enhanced paywall SDK integration by introducing PaywallCartSerializer for cart serialization, added cart data support via updated inline scripts, and refactored JavaScript logic for streamlined SDK initialization. Updated dependencies to integrate shared plugin updates. --- composer.lock | 8 +-- resources/js/front/comfino-blocks.js | 47 +++++---------- resources/js/front/comfino-blocks.min.js | 8 +-- resources/js/front/comfino-checkout.js | 47 +++++---------- resources/js/front/comfino-checkout.min.js | 6 +- src/Main.php | 57 +++++++++++------- src/PaymentGateway.php | 2 +- src/View/Block/PaymentGateway.php | 58 +++++++++++-------- src/View/PaywallCartSerializer.php | 23 ++++++++ .../src/Api/Request/GetCreditors.php | 21 +++++++ .../src/Api/Response/GetCreditors.php | 20 +++++++ .../src/Common/Shop/Cart.php | 28 ++++++++- vendor/composer/autoload_classmap.php | 1 + vendor/composer/autoload_static.php | 1 + vendor/composer/installed.json | 8 +-- vendor/composer/installed.php | 2 +- 16 files changed, 204 insertions(+), 133 deletions(-) create mode 100644 src/View/PaywallCartSerializer.php create mode 100644 vendor/comfino/shop-plugins-shared/src/Api/Request/GetCreditors.php create mode 100644 vendor/comfino/shop-plugins-shared/src/Api/Response/GetCreditors.php diff --git a/composer.lock b/composer.lock index 712512a3..5eaf977b 100644 --- a/composer.lock +++ b/composer.lock @@ -344,12 +344,12 @@ "source": { "type": "git", "url": "git@github.com:comfino/shop-plugins-shared.git", - "reference": "ab08b1a16c261d5cddd74cd309ecb211836a118d" + "reference": "63983770f8c9f71deec8fd9bb675a5f396d36146" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/comfino/shop-plugins-shared/zipball/ab08b1a16c261d5cddd74cd309ecb211836a118d", - "reference": "ab08b1a16c261d5cddd74cd309ecb211836a118d", + "url": "https://api.github.com/repos/comfino/shop-plugins-shared/zipball/63983770f8c9f71deec8fd9bb675a5f396d36146", + "reference": "63983770f8c9f71deec8fd9bb675a5f396d36146", "shasum": "" }, "require": { @@ -399,7 +399,7 @@ "source": "https://github.com/comfino/shop-plugins-shared/tree/master", "issues": "https://github.com/comfino/shop-plugins-shared/issues" }, - "time": "2026-05-13T15:09:39+00:00" + "time": "2026-05-15T19:00:59+00:00" }, { "name": "fig/http-message-util", diff --git a/resources/js/front/comfino-blocks.js b/resources/js/front/comfino-blocks.js index d85e4876..0443ef4a 100644 --- a/resources/js/front/comfino-blocks.js +++ b/resources/js/front/comfino-blocks.js @@ -59,49 +59,28 @@ return; } - // allowedProductTypes: null = no filter active, [] = all filtered (don't load SDK), - // [...] = filtered subset to pass to bootstrapPaywall(). - const allowedProductTypes = config.productTypes; - const allowedProductsConfig = config.allowedProductsConfig; - - if (Array.isArray(allowedProductTypes) && allowedProductTypes.length === 0) { - // All product types filtered out for this cart — don't load the paywall. + // productTypes: null = no filter active, [] = all filtered, [...] = filtered subset to pass to bootstrapPaywall(). + if (Array.isArray(config.productTypes) && config.productTypes.length === 0) { + // All product types filtered out for this cart — don't load the paywall SDK. return; } - // Comfino paywall bootstrap options + /* All paywall bootstrap options assigned directly from comfino_data — wcSettings (wp_json_encode) + preserves scalar types and the insertion order of associative arrays (creditors map ordering MUST + survive end-to-end because the paywall renderer uses it literally). */ const comfinoPaywallData = { authToken: config.authToken, loanAmount: config.loanAmount, + platform: 'woocommerce', environment: config.environment, - platform: 'woocommerce' + productTypes: config.productTypes, + cart: config.cart, + paywallSettings: config.paywallSettings, + directRedirect: config.directRedirect, + creditors: config.creditors, + allowedProductsConfig: config.allowedProductsConfig }; - if (Array.isArray(allowedProductTypes) && allowedProductTypes.length > 0) { - // Set allowed financial product types for paywall if provided. - comfinoPaywallData.productTypes = allowedProductTypes; - } - - if (Array.isArray(allowedProductsConfig) && allowedProductsConfig.length > 0) { - comfinoPaywallData.allowedProductsConfig = allowedProductsConfig; - } - - if (config.paywallSettings && typeof config.paywallSettings === 'object') { - comfinoPaywallData.paywallSettings = config.paywallSettings; - } - - if (config.directRedirect) { - comfinoPaywallData.directRedirect = true; - } - - if (config.customPaywallCss) { - comfinoPaywallData.customPaywallCss = config.customPaywallCss; - } - - if (config.creditors && typeof config.creditors === 'object') { - comfinoPaywallData.creditors = config.creditors; - } - /* Load Comfino web frontend SDK as a plain script via DOM injection. Why not a dynamic import or async load? The SDK is a UMD bundle. When RequireJS's global define() diff --git a/resources/js/front/comfino-blocks.min.js b/resources/js/front/comfino-blocks.min.js index 47ad0a21..75868c9b 100644 --- a/resources/js/front/comfino-blocks.min.js +++ b/resources/js/front/comfino-blocks.min.js @@ -1,4 +1,4 @@ -(function(){const f=window.wc&&window.wc.wcBlocksRegistry?window.wc.wcBlocksRegistry.registerPaymentMethod:null;if(f){var c=window.wp.element.createElement,a=window.wc.wcSettings.getSetting("comfino_data",{});c={name:"comfino",label:a.label||"Comfino",content:c(window.wp.element.Fragment,null,c("input",{id:"comfino-loan-type",name:"comfino_loan_type",type:"hidden",value:""}),c("input",{id:"comfino-loan-term",name:"comfino_loan_term",type:"hidden",value:""}),c("div",{id:"comfino-paywall-container"})), -edit:c("div",null,"Comfino"),canMakePayment:function(){return!0},ariaLabel:a.ariaLabel||"Comfino payment method",supports:{features:a.supports||[]},paymentMethodId:"comfino",savedTokenComponent:null};f(c);if(window.wc&&window.wc.wcBlocksData&&window.wc.wcBlocksData.PAYMENT_STORE_KEY){const h=window.wp.data.select(window.wc.wcBlocksData.PAYMENT_STORE_KEY);window.wp.data.subscribe(function(){if("comfino"===h.getActivePaymentMethod())if(document.querySelector("script[data-comfino-sdk]"))window.ComfinoPaywallInit&& -window.ComfinoPaywallInit.init();else if(a.sdkScriptUrl&&a.authToken){var b=a.productTypes,e=a.allowedProductsConfig;if(!Array.isArray(b)||0!==b.length){var d={authToken:a.authToken,loanAmount:a.loanAmount,environment:a.environment,platform:"woocommerce"};Array.isArray(b)&&0 0) { - // Set allowed financial product types for paywall if provided. - comfinoPaywallData.productTypes = allowedProductTypes; - } - - if (Array.isArray(allowedProductsConfig) && allowedProductsConfig.length > 0) { - comfinoPaywallData.allowedProductsConfig = allowedProductsConfig; - } - - if (config.paywallSettings && typeof config.paywallSettings === 'object') { - comfinoPaywallData.paywallSettings = config.paywallSettings; - } - - if (config.directRedirect) { - comfinoPaywallData.directRedirect = true; - } - - if (config.customPaywallCss) { - comfinoPaywallData.customPaywallCss = config.customPaywallCss; - } - - if (config.creditors && typeof config.creditors === 'object') { - comfinoPaywallData.creditors = config.creditors; - } - /* Load Comfino web frontend SDK as a plain script via DOM injection. Why not a dynamic import or async load? The SDK is a UMD bundle. When RequireJS's global define() diff --git a/resources/js/front/comfino-checkout.min.js b/resources/js/front/comfino-checkout.min.js index 8fe7d7f5..a9991fd3 100644 --- a/resources/js/front/comfino-checkout.min.js +++ b/resources/js/front/comfino-checkout.min.js @@ -1,3 +1,3 @@ -(function(){const a=window.comfinoSettings||{};if(a.sdkScriptUrl&&a.authToken&&!document.querySelector("script[data-comfino-sdk]")){var b=a.productTypes,g=a.allowedProductsConfig;if(!Array.isArray(b)||0!==b.length){var d={authToken:a.authToken,loanAmount:a.loanAmount,environment:a.environment,platform:"woocommerce"};Array.isArray(b)&&0session->init(); } - // For logged in customers, pull data from their account rather than the session which may contain incomplete data. + // For logged-in customers, pull data from their account rather than the session which may contain incomplete data. if (WC()->customer === null) { try { if (is_user_logged_in()) { @@ -153,14 +154,14 @@ public static function init(): void return $statuses; }); - // Prevent Cloudflare RocketLoader and JS bundlers (PhastPress, Autoptimize, WP Rocket) - // from deferring Comfino frontend scripts asynchronously. These scripts depend on the - // wp_localize_script inline data block that immediately precedes them in the HTML; async - // delivery breaks that ordering guarantee. + /* Prevent Cloudflare RocketLoader and JS bundlers (PhastPress, Autoptimize, WP Rocket) from deferring Comfino + frontend scripts asynchronously. These scripts depend on the wp_add_inline_script data block that immediately + precedes them in the HTML; async delivery breaks that ordering guarantee. */ add_filter('script_loader_tag', static function (string $tag, string $handle): string { if (strpos($handle, 'comfino-script-') === 0) { return str_replace('