Skip to content

[REFACTOR]: [CryptoPay] Remove Default Case Handling #2267

@Sakilmostak

Description

@Sakilmostak

📝 Feature Description

  • We utilize match statements to make pivotal decisions, such as generating requests based on the payment method type and managing responses received from the connector.
  • These conditions generally go hand in hand with enum variants.
  • Default case is used because a match statement needs to be exhaustive i.e. every variant needs to be covered.
  • So, if all the explicit cases are handled then default is used to handle the rest.
  • Each connector have these match statements but many of them don’t provide reference to each variant in their default case, rather a _ is put to handle all the other cases.
  • This approach carries a risk because developers may inadvertently overlook the need for explicit handling of the new cases.

🔨 Possible Implementation

🔖 Note: All the changes needed should be contained within hyperswitch/crates/router/src/connector/

📦 Have you spent some time checking if this feature request has been raised before?

  • I checked and didn't find a similar issue

📦 Have you read the Contributing Guidelines?

✨ Are you willing to submit a PR?

Metadata

Metadata

Assignees

Labels

A-connector-integrationArea: Connector integrationC-featureCategory: Feature request or enhancementgood first issueGood for newcomershacktoberfestIssues that are up for grabs for Hacktoberfest participants

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions