From ce156658a73fc5c67397403adf886d8ea70bb3ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jasi=C5=84ski?= Date: Fri, 5 Dec 2025 15:45:16 +0100 Subject: [PATCH] fix: show pending msg only if there is no return_url --- examples/dynamic-checkout/index.html | 2 +- package.json | 2 +- src/dynamic-checkout/clients/apple-pay.ts | 10 ++++++-- src/dynamic-checkout/clients/google-pay.ts | 10 ++++++-- src/dynamic-checkout/payment-methods/apm.ts | 25 +++++++++++++++---- src/dynamic-checkout/payment-methods/card.ts | 10 ++++++-- .../payment-methods/native-apm.ts | 10 ++++++-- .../payment-methods/saved-apm.ts | 10 ++++++-- .../payment-methods/saved-card.ts | 10 ++++++-- 9 files changed, 70 insertions(+), 19 deletions(-) diff --git a/examples/dynamic-checkout/index.html b/examples/dynamic-checkout/index.html index a22ae86..50cfd61 100644 --- a/examples/dynamic-checkout/index.html +++ b/examples/dynamic-checkout/index.html @@ -11,7 +11,7 @@ document.addEventListener("DOMContentLoaded", function () { // You need to replace these values with your own const projectId = "test-proj_qEi1u5BwoYcZb6mOMKDWIm4mpqKCq6bN" - const invoiceId = "iv_36NWNCq6bNv4SIQ0vHjXXXpZIuMKb0sM" + const invoiceId = "iv_36QjQCq6bN14YiVKrcFD6rHGEDqREPRS" const clientSecret = "" const client = new ProcessOut.ProcessOut(projectId) diff --git a/package.json b/package.json index 472ab18..284ac9a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "processout.js", - "version": "1.6.5", + "version": "1.6.6", "description": "ProcessOut.js is a JavaScript library for ProcessOut's payment processing API.", "scripts": { "build:processout": "tsc -p src/processout && uglifyjs --compress --keep-fnames --ie8 dist/processout.js -o dist/processout.js", diff --git a/src/dynamic-checkout/clients/apple-pay.ts b/src/dynamic-checkout/clients/apple-pay.ts index dc284ca..5815997 100644 --- a/src/dynamic-checkout/clients/apple-pay.ts +++ b/src/dynamic-checkout/clients/apple-pay.ts @@ -134,7 +134,10 @@ module ProcessOut { new DynamicCheckoutPaymentSuccessView(this.processOutInstance, this.paymentConfig) .element, ) - } else { + } else if ( + !this.paymentConfig.showStatusMessage && + !this.paymentConfig.invoiceDetails.return_url + ) { getViewContainer().appendChild( new DynamicCheckoutPaymentInfoView(this.processOutInstance, this.paymentConfig) .element, @@ -152,7 +155,10 @@ module ProcessOut { new DynamicCheckoutPaymentErrorView(this.processOutInstance, this.paymentConfig) .element, ) - } else { + } else if ( + !this.paymentConfig.showStatusMessage && + !this.paymentConfig.invoiceDetails.return_url + ) { getViewContainer().appendChild( new DynamicCheckoutPaymentInfoView(this.processOutInstance, this.paymentConfig) .element, diff --git a/src/dynamic-checkout/clients/google-pay.ts b/src/dynamic-checkout/clients/google-pay.ts index 026b176..71e0045 100644 --- a/src/dynamic-checkout/clients/google-pay.ts +++ b/src/dynamic-checkout/clients/google-pay.ts @@ -136,7 +136,10 @@ module ProcessOut { this.paymentConfig, ).element, ) - } else { + } else if ( + !this.paymentConfig.showStatusMessage && + !this.paymentConfig.invoiceDetails.return_url + ) { getViewContainer().appendChild( new DynamicCheckoutPaymentInfoView( this.processOutInstance, @@ -158,7 +161,10 @@ module ProcessOut { this.paymentConfig, ).element, ) - } else { + } else if ( + !this.paymentConfig.showStatusMessage && + !this.paymentConfig.invoiceDetails.return_url + ) { getViewContainer().appendChild( new DynamicCheckoutPaymentInfoView( this.processOutInstance, diff --git a/src/dynamic-checkout/payment-methods/apm.ts b/src/dynamic-checkout/payment-methods/apm.ts index e62b178..f85ee13 100644 --- a/src/dynamic-checkout/payment-methods/apm.ts +++ b/src/dynamic-checkout/payment-methods/apm.ts @@ -110,7 +110,10 @@ module ProcessOut { new DynamicCheckoutPaymentSuccessView(this.processOutInstance, this.paymentConfig) .element, ) - } else { + } else if ( + !this.paymentConfig.showStatusMessage && + !this.paymentConfig.invoiceDetails.return_url + ) { this.resetContainerHtml().appendChild( new DynamicCheckoutPaymentInfoView(this.processOutInstance, this.paymentConfig) .element, @@ -188,7 +191,10 @@ module ProcessOut { this.paymentConfig, ).element, ) - } else { + } else if ( + !this.paymentConfig.showStatusMessage && + !this.paymentConfig.invoiceDetails.return_url + ) { this.resetContainerHtml().appendChild( new DynamicCheckoutPaymentInfoView( this.processOutInstance, @@ -207,7 +213,10 @@ module ProcessOut { this.paymentConfig, ).element, ) - } else { + } else if ( + !this.paymentConfig.showStatusMessage && + !this.paymentConfig.invoiceDetails.return_url + ) { this.resetContainerHtml().appendChild( new DynamicCheckoutPaymentInfoView( this.processOutInstance, @@ -227,7 +236,10 @@ module ProcessOut { new DynamicCheckoutPaymentErrorView(this.processOutInstance, this.paymentConfig) .element, ) - } else { + } else if ( + !this.paymentConfig.showStatusMessage && + !this.paymentConfig.invoiceDetails.return_url + ) { this.resetContainerHtml().appendChild( new DynamicCheckoutPaymentInfoView(this.processOutInstance, this.paymentConfig) .element, @@ -246,7 +258,10 @@ module ProcessOut { new DynamicCheckoutPaymentErrorView(this.processOutInstance, this.paymentConfig) .element, ) - } else { + } else if ( + !this.paymentConfig.showStatusMessage && + !this.paymentConfig.invoiceDetails.return_url + ) { this.resetContainerHtml().appendChild( new DynamicCheckoutPaymentInfoView(this.processOutInstance, this.paymentConfig) .element, diff --git a/src/dynamic-checkout/payment-methods/card.ts b/src/dynamic-checkout/payment-methods/card.ts index 11c975a..0ffc26a 100644 --- a/src/dynamic-checkout/payment-methods/card.ts +++ b/src/dynamic-checkout/payment-methods/card.ts @@ -146,7 +146,10 @@ module ProcessOut { this.resetContainerHtml().appendChild( new DynamicCheckoutPaymentSuccessView(this.procesoutInstance, this.paymentConfig).element, ) - } else { + } else if ( + !this.paymentConfig.showStatusMessage && + !this.paymentConfig.invoiceDetails.return_url + ) { this.resetContainerHtml().appendChild( new DynamicCheckoutPaymentInfoView(this.processOutInstance, this.paymentConfig).element, ) @@ -163,7 +166,10 @@ module ProcessOut { this.resetContainerHtml().appendChild( new DynamicCheckoutPaymentErrorView(this.procesoutInstance, this.paymentConfig).element, ) - } else { + } else if ( + !this.paymentConfig.showStatusMessage && + !this.paymentConfig.invoiceDetails.return_url + ) { this.resetContainerHtml().appendChild( new DynamicCheckoutPaymentInfoView(this.processOutInstance, this.paymentConfig).element, ) diff --git a/src/dynamic-checkout/payment-methods/native-apm.ts b/src/dynamic-checkout/payment-methods/native-apm.ts index 5386344..c7354d0 100644 --- a/src/dynamic-checkout/payment-methods/native-apm.ts +++ b/src/dynamic-checkout/payment-methods/native-apm.ts @@ -68,7 +68,10 @@ module ProcessOut { new DynamicCheckoutPaymentSuccessView(this.processOutInstance, this.paymentConfig) .element, ) - } else { + } else if ( + !this.paymentConfig.showStatusMessage && + !this.paymentConfig.invoiceDetails.return_url + ) { this.resetContainerHtml().appendChild( new DynamicCheckoutPaymentInfoView(this.processOutInstance, this.paymentConfig).element, ) @@ -86,7 +89,10 @@ module ProcessOut { new DynamicCheckoutPaymentErrorView(this.processOutInstance, this.paymentConfig) .element, ) - } else { + } else if ( + !this.paymentConfig.showStatusMessage && + !this.paymentConfig.invoiceDetails.return_url + ) { this.resetContainerHtml().appendChild( new DynamicCheckoutPaymentInfoView(this.processOutInstance, this.paymentConfig).element, ) diff --git a/src/dynamic-checkout/payment-methods/saved-apm.ts b/src/dynamic-checkout/payment-methods/saved-apm.ts index 94037a6..29c0f26 100644 --- a/src/dynamic-checkout/payment-methods/saved-apm.ts +++ b/src/dynamic-checkout/payment-methods/saved-apm.ts @@ -125,7 +125,10 @@ module ProcessOut { this.paymentConfig, ).element, ) - } else { + } else if ( + !this.paymentConfig.showStatusMessage && + !this.paymentConfig.invoiceDetails.return_url + ) { this.resetContainerHtml().appendChild( new DynamicCheckoutPaymentInfoView(this.processOutInstance, this.paymentConfig) .element, @@ -140,7 +143,10 @@ module ProcessOut { new DynamicCheckoutPaymentErrorView(this.processOutInstance, this.paymentConfig) .element, ) - } else { + } else if ( + !this.paymentConfig.showStatusMessage && + !this.paymentConfig.invoiceDetails.return_url + ) { this.resetContainerHtml().appendChild( new DynamicCheckoutPaymentInfoView(this.processOutInstance, this.paymentConfig) .element, diff --git a/src/dynamic-checkout/payment-methods/saved-card.ts b/src/dynamic-checkout/payment-methods/saved-card.ts index cb47f66..f98751a 100644 --- a/src/dynamic-checkout/payment-methods/saved-card.ts +++ b/src/dynamic-checkout/payment-methods/saved-card.ts @@ -109,7 +109,10 @@ module ProcessOut { new DynamicCheckoutPaymentSuccessView(this.processOutInstance, this.paymentConfig) .element, ) - } else { + } else if ( + !this.paymentConfig.showStatusMessage && + !this.paymentConfig.invoiceDetails.return_url + ) { this.resetContainerHtml().appendChild( new DynamicCheckoutPaymentInfoView(this.processOutInstance, this.paymentConfig).element, ) @@ -126,7 +129,10 @@ module ProcessOut { this.resetContainerHtml().appendChild( new DynamicCheckoutPaymentErrorView(this.processOutInstance, this.paymentConfig).element, ) - } else { + } else if ( + !this.paymentConfig.showStatusMessage && + !this.paymentConfig.invoiceDetails.return_url + ) { this.resetContainerHtml().appendChild( new DynamicCheckoutPaymentInfoView(this.processOutInstance, this.paymentConfig).element, )