Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/domains/pay-wallet-app/04_apim_io_payment_wallet.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,20 @@ resource "azurerm_api_management_api_operation_policy" "get_payment_methods_for_
)
}

resource "azurerm_api_management_api_operation_policy" "post_payment_methods_for_io" {
api_name = "${local.project}-io-payment-wallet-api-v1"
resource_group_name = local.pagopa_apim_rg
api_management_name = local.pagopa_apim_name
operation_id = "getAllPaymentMethodsForIOPost"

xml_content = templatefile(
"./api/io-payment-wallet/v1/_post_payment_methods.xml.tpl",
{
ecommerce_hostname = local.ecommerce_hostname
}
)
}

resource "azurerm_api_management_named_value" "pay_wallet_jwt_issuer_api_key_value" {
name = "pay-wallet-jwt-issuer-api-key-value"
api_management_name = local.pagopa_apim_name
Expand Down
1 change: 1 addition & 0 deletions src/domains/pay-wallet-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
| [azurerm_api_management_api_operation_policy.notify_wallet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.notify_wallet_auth_request](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.post_io_wallets](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.post_payment_methods_for_io](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_version_set.io_payment_wallet_api](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_version_set) | resource |
| [azurerm_api_management_api_version_set.npg_notifications_api](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_version_set) | resource |
| [azurerm_api_management_api_version_set.pay_wallet_healthcheck_api](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_version_set) | resource |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,71 @@
"description": "Timeout serving request"
}
}
},
"post": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing b.e. url handling -> this api should be redirect to payment-methods-handler.
see how it have been done for get methods api here and replicate for this api too

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

"tags": [
"paymentMethods"
],
"operationId": "getAllPaymentMethodsForIOPost",
"summary": "Retrieve all Payment Methods for IO (by filter)",
"description": "POST with body payload - no resources created: API for retrieves payment methods using filter criteria provided in the request body.",
"security": [
{
"pagoPAPlatformSessionToken": []
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaymentMethodsRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Payment method successfully retrieved",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaymentMethodsResponse"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemJson"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemJson"
}
}
}
},
"500": {
"description": "Service unavailable",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemJson"
}
}
}
}
}
}
},
"/wallets": {
Expand Down Expand Up @@ -419,6 +484,142 @@
},
"components": {
"schemas": {
"PaymentMethodsRequest": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This body changes recently. Please update according to this spec

"PaymentMethodsRequest": {
"required": [
"paymentNotice",
"totalAmount",
"userTouchpoint"
],
"type": "object",
"properties": {
"userTouchpoint": {
"type": "string",
"enum": [
"IO",
"CHECKOUT",
"CHECKOUT_CART"
]
},
"userDevice": {
"type": "string",
"enum": [
"IOS",
"ANDROID",
"WEB",
"SAFARI"
]
},
"totalAmount": {
"type": "integer",
"format": "int64"
},
"language": {
"type": "string",
"description": "The user language",
"enum": [
"IT",
"EN",
"FR",
"DE",
"SL"
]
},
"sortBy": {
"type": "string",
"enum": [
"NAME",
"DESCRIPTION",
"FEE"
]
},
"sortOrder": {
"type": "string",
"enum": [
"ASC",
"DESC"
]
},
"priorityGroups": {
"type": "array",
"items": {
"type": "string",
"enum": [
"CP",
"MYBK",
"BPAY",
"PPAL",
"RPIC",
"RBPS",
"SATY",
"APPL",
"RICO",
"RBPB",
"RBPP",
"RBPR",
"GOOG",
"KLRN"
]
}
},
"paymentNotice": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PaymentNoticeItem"
}
},
"allCCp": {
"type": "boolean"
},
"targetKey": {
"type": "string"
},
"deviceVersion": {
"type": "string",
"description": "The user device version"
}
}
},

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

"required": [
"paymentNotice",
"totalAmount",
"userTouchpoint"
],
"type": "object",
"properties": {
"userTouchpoint": {
"type": "string",
"enum": [
"IO",
"CHECKOUT",
"CHECKOUT_CART"
]
},
"userDevice": {
"type": "string",
"enum": [
"IOS",
"ANDROID",
"WEB",
"SAFARI"
]
},
"language": {
"type": "string",
"description": "The user language",
"enum": [
"IT",
"EN",
"FR",
"DE",
"SL"
]
},
"sortBy": {
"type": "string",
"enum": [
"NAME",
"DESCRIPTION",
"FEE"
]
},
"sortOrder": {
"type": "string",
"enum": [
"ASC",
"DESC"
]
},
"totalAmount": {
"type": "integer",
"format": "int64"
},
"priorityGroups": {
"type": "array",
"items": {
"type": "string",
"enum": [
"CP",
"MYBK",
"BPAY",
"PPAL",
"RPIC",
"RBPS",
"SATY",
"APPL",
"RICO",
"RBPB",
"RBPP",
"RBPR",
"GOOG",
"KLRN"
]
}
},
"paymentNotice": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PaymentNoticeItem"
}
},
"allCCp": {
"type": "boolean"
},
"targetKey": {
"type": "string"
},
"deviceVersion": {
"type": "string",
"description": "The user device version"

}
}
},
"PaymentNoticeItem": {
"required": [
"paymentAmount",
"primaryCreditorInstitution"
],
"type": "object",
"properties": {
"paymentAmount": {
"type": "integer",
"format": "int64"
},
"primaryCreditorInstitution": {
"type": "string"
},
"transferList": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TransferListItem"
}
}
}
},
"TransferListItem": {
"description": "Transfer list item",
"type": "object",
"properties": {
"creditorInstitution": {
"description": "Creditor institution",
"type": "string"
},
"digitalStamp": {
"description": "Boolean value indicating if there is digital stamp",
"type": "boolean"
},
"transferCategory": {
"description": "Transfer category",
"type": "string"
}
}
},
"WalletId": {
"description": "Wallet identifier",
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<policies>
<inbound>
<base />
<!-- Set payment-methods API Key header -->
<set-header name="x-api-key" exists-action="override">
<value>{{ecommerce-payment-methods-api-key-value}}</value>
</set-header>
<set-backend-service base-url="https://${ecommerce_hostname}/pagopa-ecommerce-payment-methods-handler"/>
</inbound>
<outbound>
<base />
</outbound>
<backend>
<base />
</backend>
<on-error>
<base />
</on-error>
</policies>