Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [CHK-3572] improve send payment result policy #2649

Closed
8 changes: 4 additions & 4 deletions src/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@
| <a name="input_apim_logger_resource_id"></a> [apim\_logger\_resource\_id](#input\_apim\_logger\_resource\_id) | Resource id for the APIM logger | `string` | `null` | no |
| <a name="input_apim_nodo_auth_decoupler_enable"></a> [apim\_nodo\_auth\_decoupler\_enable](#input\_apim\_nodo\_auth\_decoupler\_enable) | Apply decoupler to nodo-auth product apim policy | `bool` | `false` | no |
| <a name="input_apim_nodo_decoupler_enable"></a> [apim\_nodo\_decoupler\_enable](#input\_apim\_nodo\_decoupler\_enable) | Apply decoupler to nodo product apim policy | `bool` | `false` | no |
| <a name="input_app_gateway_allowed_paths_pagopa_onprem_only"></a> [app\_gateway\_allowed\_paths\_pagopa\_onprem\_only](#input\_app\_gateway\_allowed\_paths\_pagopa\_onprem\_only) | Allowed paths from pagopa onprem only | <pre>object({<br/> paths = list(string)<br/> ips = list(string)<br/> })</pre> | n/a | yes |
| <a name="input_app_gateway_allowed_paths_pagopa_onprem_only"></a> [app\_gateway\_allowed\_paths\_pagopa\_onprem\_only](#input\_app\_gateway\_allowed\_paths\_pagopa\_onprem\_only) | Allowed paths from pagopa onprem only | <pre>object({<br> paths = list(string)<br> ips = list(string)<br> })</pre> | n/a | yes |
| <a name="input_bpd_hostname"></a> [bpd\_hostname](#input\_bpd\_hostname) | BPD hostname | `string` | `""` | no |
| <a name="input_buyer_banks_storage_account_replication_type"></a> [buyer\_banks\_storage\_account\_replication\_type](#input\_buyer\_banks\_storage\_account\_replication\_type) | (Optional) Buyer banks storage account replication type | `string` | `"LRS"` | no |
| <a name="input_buyerbanks_advanced_threat_protection"></a> [buyerbanks\_advanced\_threat\_protection](#input\_buyerbanks\_advanced\_threat\_protection) | Enable contract threat advanced protection | `bool` | `false` | no |
Expand All @@ -345,12 +345,12 @@
| <a name="input_dns_zone_prefix"></a> [dns\_zone\_prefix](#input\_dns\_zone\_prefix) | The dns subdomain. | `string` | `null` | no |
| <a name="input_dns_zone_prefix_prf"></a> [dns\_zone\_prefix\_prf](#input\_dns\_zone\_prefix\_prf) | The dns subdomain. | `string` | `""` | no |
| <a name="input_ecommerce_ingress_hostname"></a> [ecommerce\_ingress\_hostname](#input\_ecommerce\_ingress\_hostname) | ecommerce ingress hostname | `string` | `null` | no |
| <a name="input_enabled_features"></a> [enabled\_features](#input\_enabled\_features) | Features enabled in this domain | <pre>object({<br/> vnet_ita = bool<br/> node_forwarder_ha = optional(bool, false)<br/> })</pre> | <pre>{<br/> "vnet_ita": false<br/>}</pre> | no |
| <a name="input_enabled_features"></a> [enabled\_features](#input\_enabled\_features) | Features enabled in this domain | <pre>object({<br> vnet_ita = bool<br> node_forwarder_ha = optional(bool, false)<br> })</pre> | <pre>{<br> "vnet_ita": false<br>}</pre> | no |
| <a name="input_env"></a> [env](#input\_env) | Contains env description in extend format (dev,uat,prod) | `string` | n/a | yes |
| <a name="input_env_short"></a> [env\_short](#input\_env\_short) | Environment shot version | `string` | n/a | yes |
| <a name="input_external_domain"></a> [external\_domain](#input\_external\_domain) | Domain for delegation | `string` | `null` | no |
| <a name="input_fesp_hostname"></a> [fesp\_hostname](#input\_fesp\_hostname) | Fesp hostname | `string` | `""` | no |
| <a name="input_function_app_storage_account_info"></a> [function\_app\_storage\_account\_info](#input\_function\_app\_storage\_account\_info) | n/a | <pre>object({<br/> account_kind = optional(string, "StorageV2")<br/> account_tier = optional(string, "Standard")<br/> account_replication_type = optional(string, "LRS")<br/> access_tier = optional(string, "Hot")<br/> advanced_threat_protection_enable = optional(bool, true)<br/> })</pre> | <pre>{<br/> "access_tier": "Hot",<br/> "account_kind": "StorageV2",<br/> "account_replication_type": "LRS",<br/> "account_tier": "Standard",<br/> "advanced_threat_protection_enable": true<br/>}</pre> | no |
| <a name="input_function_app_storage_account_info"></a> [function\_app\_storage\_account\_info](#input\_function\_app\_storage\_account\_info) | n/a | <pre>object({<br> account_kind = optional(string, "StorageV2")<br> account_tier = optional(string, "Standard")<br> account_replication_type = optional(string, "LRS")<br> access_tier = optional(string, "Hot")<br> advanced_threat_protection_enable = optional(bool, true)<br> })</pre> | <pre>{<br> "access_tier": "Hot",<br> "account_kind": "StorageV2",<br> "account_replication_type": "LRS",<br> "account_tier": "Standard",<br> "advanced_threat_protection_enable": true<br>}</pre> | no |
| <a name="input_io_bpd_hostname"></a> [io\_bpd\_hostname](#input\_io\_bpd\_hostname) | IO BPD hostname | `string` | `""` | no |
| <a name="input_location"></a> [location](#input\_location) | Main location | `string` | `"westeurope"` | no |
| <a name="input_location_ita"></a> [location\_ita](#input\_location\_ita) | Main location | `string` | `"italynorth"` | no |
Expand All @@ -364,7 +364,7 @@
| <a name="input_postgres_private_endpoint_enabled"></a> [postgres\_private\_endpoint\_enabled](#input\_postgres\_private\_endpoint\_enabled) | Private endpoint database enable? | `bool` | `false` | no |
| <a name="input_prefix"></a> [prefix](#input\_prefix) | n/a | `string` | `"pagopa"` | no |
| <a name="input_satispay_hostname"></a> [satispay\_hostname](#input\_satispay\_hostname) | Satispay hostname | `string` | `""` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | n/a | `map(any)` | <pre>{<br/> "CreatedBy": "Terraform"<br/>}</pre> | no |
| <a name="input_tags"></a> [tags](#input\_tags) | n/a | `map(any)` | <pre>{<br> "CreatedBy": "Terraform"<br>}</pre> | no |
| <a name="input_xpay_hostname"></a> [xpay\_hostname](#input\_xpay\_hostname) | Nexi xpay hostname | `string` | `""` | no |

## Outputs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@
<base />

<set-variable name="transactionId" value="@(context.Request.MatchedParameters["transactionId"])" />
<set-variable name="backend-base-url" value="@($"{{pm-host}}/pp-restapi-CD/v2")" />
<set-variable name="ecommerce_url" value="${ecommerce_ingress_hostname}" />
<set-variable name="body_value" value="@(context.Request.Body.As<string>(preserveContent: true))" />
<set-backend-service base-url="@((string)context.Variables["backend-base-url"])" />

<set-backend-service base-url="@("https://${ecommerce_ingress_hostname}/pagopa-ecommerce-transactions-service/")" />
<!-- policy for WISP Dismantling -->
<set-variable name="enable_wisp_dismantling_switch" value="{{enable-wisp-dismantling-switch}}" />
<choose>
Expand All @@ -52,26 +49,6 @@
<base />
<!-- fragment necessary for WISP Dismantling -->
<include-fragment fragment-id="wisp-receipt-ko" />

<choose>
<when condition="@(context.Response.StatusCode == 200)">
<set-variable name="outcome" value="@(((string)((JObject)context.Response.Body.As<JObject>(preserveContent: true))["outcome"]))" />
</when>
</choose>
<choose>
<when condition="@(context.Response.StatusCode != 200 || !((string)context.Variables.GetValueOrDefault("outcome","")).Equals("OK"))">
<!-- addUserReceipt for ecommerce -->
<send-request ignore-error="true" timeout="10" response-variable-name="test-transaction" mode="new">
<set-url>@($"https://{(string)context.Variables["ecommerce_url"]}/pagopa-ecommerce-transactions-service/transactions/{(string)context.Variables["transactionId"]}/user-receipts")</set-url>
<set-method>POST</set-method>
<set-header name="Content-Type" exists-action="override">
<value>application/json</value>
</set-header>
<set-body>@($"{(string)context.Variables["body_value"]}")</set-body>
</send-request>
<return-response response-variable-name="test-transaction" />
</when>
</choose>
</outbound>
<on-error>
<base />
Expand Down
Loading