From 4d76a6d9d589528a6f666e23c0f0e2a1cadd67e8 Mon Sep 17 00:00:00 2001 From: Simone Infante Date: Thu, 4 Apr 2024 15:31:48 +0200 Subject: [PATCH] refactor: update auth request policy to zero downtime pgs->npg --- .../v1/_auth_request.xml.tpl | 53 +++++++++++++------ 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/src/domains/ecommerce-app/api/ecommerce-checkout/v1/_auth_request.xml.tpl b/src/domains/ecommerce-app/api/ecommerce-checkout/v1/_auth_request.xml.tpl index c517eea8a9..1b399f8945 100644 --- a/src/domains/ecommerce-app/api/ecommerce-checkout/v1/_auth_request.xml.tpl +++ b/src/domains/ecommerce-app/api/ecommerce-checkout/v1/_auth_request.xml.tpl @@ -18,26 +18,47 @@ } return ""; }"/> + - + + + + + + + string[] xpayList = ((string)context.Variables["XPAYPspsList"]).Split(','); + string[] vposList = ((string)context.Variables["VPOSPspsList"]).Split(','); + string[] npgList = ((string)context.Variables["NPGPspsList"]).Split(','); + + string pspId = (string)(context.Variables.GetValueOrDefault("pspId","")); + string detailType = (string)(context.Variables.GetValueOrDefault("detailType","")); + + string pgsId = ""; + + // card -> ecommerce with PGS request + + if ( detailType == "card" ){ + + if (xpayList.Contains(pspId)) { + + pgsId = "XPAY"; + } else if (vposList.Contains(pspId)) { + + pgsId = "VPOS"; + } + + // cards -> ecommerce with NPG request + + } else if ( detailType == "cards" && npgList.Contains(pspId)){ + pgsId = "NPG"; + } + + return pgsId; + }"/> +