hyperswitch
hyperswitch copied to clipboard
[BUG] 5xx in Payouts flow
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.
- Head to Postman collection
- Create a merchant with two business units
- Create an API key
- Create two payout connectors -
adyen
andwise
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
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:
- Operating System or Linux distribution:
Debian GNU/Linux 12 (bookworm)
- Rust version:
rustc 1.72.0 (5680fa18f 2023-08-23)
- App version:
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?
- [X] I checked and didn't find a similar issue
Have you read the Contributing Guidelines?
- [X] I have read the Contributing Guidelines
Are you willing to submit a PR?
Yes, I am willing to submit a PR!