juspay / hyperswitch

An open source payments switch written in Rust to make payments fast, reliable and affordable
https://hyperswitch.io/
Apache License 2.0
12.66k stars 1.35k forks source link

[BUG] 5xx in Payouts flow #2605

Open kashif-m opened 1 year ago

kashif-m commented 1 year ago

Bug Description

There are a couple of 5xx errors which are thrown during payouts flow. These include

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.

  1. Head to Postman collection
  2. Create a merchant with two business units
  3. Create an API key
  4. Create two payout connectors - adyen and wise

Issue 1 - 5xx when using payment method not supported by the underlying connector

  1. Create ACH / Bacs bank payout for adyen with confirm: true

Issue 2 - 5xx when profile_id is not passed

  1. 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:

  1. Operating System or Linux distribution: Debian GNU/Linux 12 (bookworm)
  2. Rust version: rustc 1.72.0 (5680fa18f 2023-08-23)
  3. 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?

Have you read the Contributing Guidelines?

Are you willing to submit a PR?

Yes, I am willing to submit a PR!

kashif-m commented 4 months ago

Relates to https://github.com/juspay/hyperswitch/issues/3791