generated from pagopa/terraform-infrastructure-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: CHK-3572 optimize send payment result without passing by pm and…
… restore send payment result uat to dev (#2655) * set ecommerce ingress hostname * send payhment result update * fix send payment result policy * fix backend service url * update core readme * add uat to dev send payment result policy * add uat policy * fix apim resource deifnition * add named value and secret for ecommerce subscription key * add secret and named value for ecommerce dev send payment result subscription key * add count to avoid dev and prod fetch not existing secret * Update src/domains/ecommerce-app/04_apim_ecommerce.tf Co-authored-by: Pietro Tota <[email protected]> * remove unused named value * run pre-commit for ecommerce-app and ecommerce-common * remove unused variable * remove transactionId unused variable --------- Co-authored-by: Gianluca Ciuffa <[email protected]> Co-authored-by: Gianluca Ciuffa <[email protected]> Co-authored-by: Pietro Tota <[email protected]>
- Loading branch information
1 parent
856d8f1
commit d17e145
Showing
8 changed files
with
117 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
src/core/api/payment_manager_api/pm-per-nodo/v2/wisp-sendpaymentresult-uat.xml.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<!-- | ||
IMPORTANT: | ||
- Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements. | ||
- To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element. | ||
- To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element. | ||
- To add a policy, place the cursor at the desired insertion point and select a policy from the sidebar. | ||
- To remove a policy, delete the corresponding policy statement from the policy document. | ||
- Position the <base> element within a section element to inherit all policies from the corresponding section element in the enclosing scope. | ||
- Remove the <base> element to prevent inheriting policies from the corresponding section element in the enclosing scope. | ||
- Policies are applied in the order of their appearance, from the top down. | ||
- Comments within policy elements are not supported and may disappear. Place your comments between policy elements or at a higher level scope. | ||
--> | ||
|
||
<!-- policy closePaymentV2 & sendPaymentResultV2 : | ||
- On outbound call /receipt/KO wisp-conv | ||
- On inbound call /receipt/timer wisp-conv | ||
--> | ||
|
||
<policies> | ||
<inbound> | ||
<base /> | ||
<set-variable name="clientId" value="@(context.Request.OriginalUrl.Query.GetValueOrDefault("clientId"))" /> | ||
<choose> | ||
<when condition="@("ecomm".Equals(context.Variables["clientId"]))"> | ||
<set-backend-service base-url="@("https://${ecommerce_ingress_hostname}/pagopa-ecommerce-transactions-service/")" /> | ||
</when> | ||
<otherwise> | ||
<set-header name="Ocp-Apim-Subscription-Key" exists-action="override"> | ||
<value>{{ecommerce-dev-sendpaymentresult-subscription-key-value}}</value> | ||
</set-header> | ||
<set-backend-service base-url="https://api.dev.platform.pagopa.it/ecommerce/transaction-user-receipts-service/v1" /> | ||
</otherwise> | ||
</choose> | ||
<!-- policy for WISP Dismantling --> | ||
<set-variable name="enable_wisp_dismantling_switch" value="{{enable-wisp-dismantling-switch}}" /> | ||
<choose> | ||
<when condition="@(context.Variables.GetValueOrDefault<string>("enable_wisp_dismantling_switch", "").Equals("true"))"> | ||
<set-variable name="primitive-ko" value="sendPaymentResultV2" /> | ||
<set-variable name="request-body" value="@(context.Request.Body.As<JObject>(preserveContent: true))" /> | ||
<set-variable name="wisp-payment-tokens" value="@{ | ||
try { | ||
JObject request = (JObject) context.Variables["request-body"]; | ||
JArray payments = (JArray) request.Property("payments").Value; | ||
return string.Join(",", payments.Select(payment => payment["paymentToken"].ToString())); | ||
} catch (Exception e) { | ||
return ""; | ||
} | ||
}" /> | ||
<include-fragment fragment-id="wisp-disable-payment-token-timer" /> | ||
</when> | ||
</choose> | ||
</inbound> | ||
<backend> | ||
<base /> | ||
</backend> | ||
<outbound> | ||
<base /> | ||
<!-- fragment necessary for WISP Dismantling --> | ||
<include-fragment fragment-id="wisp-receipt-ko" /> | ||
</outbound> | ||
<on-error> | ||
<base /> | ||
</on-error> | ||
</policies> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.