Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

fix(connector): [nmi] fix the redirection throwing invalid http method error (#11632)

Pa1NarK0a8b2b4d5abd
diff --git a/crates/router/src/services/api.rs b/crates/router/src/services/api.rs
index ec8aea85e9..ccf9cfeb41 100644
--- a/crates/router/src/services/api.rs
+++ b/crates/router/src/services/api.rs
@@ -1390,7 +1390,7 @@ pub fn build_redirection_form(
threeDSsecureInterface.on('complete', function(e) {{
var responseForm = document.createElement('form');
- responseForm.action=window.location.pathname.replace(/payments\\/redirect\\/(\\w+)\\/(\\w+)\\/\\w+/, \"payments/$1/$2/redirect/complete/nmi\");
+ responseForm.action=window.location.pathname.replace(/payments\\/redirect\\/([^/]+)\\/([^/]+)\\/[^/]+/, \"payments/$1/$2/redirect/complete/nmi\");
responseForm.method='POST';
var item1=document.createElement('input');
@@ -1447,7 +1447,7 @@ pub fn build_redirection_form(
threeDSsecureInterface.on('failure', function(e) {{
var responseForm = document.createElement('form');
- responseForm.action=window.location.pathname.replace(/payments\\/redirect\\/(\\w+)\\/(\\w+)\\/\\w+/, \"payments/$1/$2/redirect/complete/nmi\");
+ responseForm.action=window.location.pathname.replace(/payments\\/redirect\\/([^/]+)\\/([^/]+)\\/[^/]+/, \"payments/$1/$2/redirect/complete/nmi\");
responseForm.method='POST';
var error_code=document.createElement('input');