There are a couple of 5xx errors which are thrown during payouts flow. These include
Usage of unsupported payment method types for a given connector
Eg: Currently, Adyen supports only SEPA bank transfers. If a payout is created for ACH or Bacs transfers, the response would fail with 500 Internal Server Error
Fix: Map ConnectorError to ApiErrorResponse for payouts flow
If profile_id is not passed during a transaction, given that more than 1 business exist, we receive a 500 until a valid profile_id is passed. Even for an invalid profile_id it throws a 500 which is unexpected
Fix: Verify profile_id existence during request validation and map to appropriate error
Expected Behavior
For invalid requests, server throws - 500 Internal Server Error.
Actual Behavior
For invalid requests, server should throw - 4xx depending on the type of error.
Steps To Reproduce
Provide an unambiguous set of steps to reproduce this bug. Include code or configuration to reproduce, if relevant.
Head to Postman collection
Create a merchant with two business units
Create an API key
Create two payout connectors - adyen and wise
Issue 1 - 5xx when using payment method not supported by the underlying connector
Create ACH / Bacs bank payout for adyen with confirm: true
Issue 2 - 5xx when profile_id is not passed
Create a card payout for adyen without passing profile_id and confirm: true
Context For The Bug
No response
Environment
Are you using hyperswitch hosted version? No
If yes, please provide the value of the x-request-id response header to help us debug your issue.
If not (or if building/running locally), please provide the following details:
Operating System or Linux distribution: Debian GNU/Linux 12 (bookworm)
Bug Description
There are a couple of 5xx errors which are thrown during payouts flow. These include
Usage of unsupported payment method types for a given connector Eg: Currently, Adyen supports only SEPA bank transfers. If a payout is created for ACH or Bacs transfers, the response would fail with 500 Internal Server Error Fix: Map ConnectorError to ApiErrorResponse for payouts flow
If profile_id is not passed during a transaction, given that more than 1 business exist, we receive a 500 until a valid profile_id is passed. Even for an invalid profile_id it throws a 500 which is unexpected Fix: Verify profile_id existence during request validation and map to appropriate error
Expected Behavior
For invalid requests, server throws - 500 Internal Server Error.
Actual Behavior
For invalid requests, server should throw - 4xx depending on the type of error.
Steps To Reproduce
Provide an unambiguous set of steps to reproduce this bug. Include code or configuration to reproduce, if relevant.
adyen
andwise
Issue 1 - 5xx when using payment method not supported by the underlying connector
confirm: true
Issue 2 - 5xx when profile_id is not passed
profile_id
andconfirm: true
Context For The Bug
No response
Environment
Are you using hyperswitch hosted version? No If yes, please provide the value of the
x-request-id
response header to help us debug your issue.If not (or if building/running locally), please provide the following details:
Debian GNU/Linux 12 (bookworm)
rustc 1.72.0 (5680fa18f 2023-08-23)
router v1.58.0-3-ge922165-e922165-2023-10-16T15:20:02.000000000Z
Have you spent some time checking if this bug has been raised before?
Have you read the Contributing Guidelines?
Are you willing to submit a PR?
Yes, I am willing to submit a PR!