feat(router): add endpoint for listing connector features #6612
+398
−40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
-> Why?
With new features being added, it is becoming increasingly difficult to track all the additions. This information is essential for accurately representing Hyperswitch's offerings. Having this solution will eliminate inconsistencies between the documentation and the actual implementation, ensuring clarity and alignment.
-> What?
Introduce an API endpoint that provides:
-> A list of all connectors.
-> The payment methods supported by each connector.
-> The status of these payment methods.
-> Whether these payment methods support mandates.
-> How?
-> Pre-validation for Payment Methods:
Before invoking a connector to process a payment, this function will check if the specified payment_method is implemented. This ensures developers update the relevant functions during development and testing.
-> Unified API Endpoint:
Build an endpoint that collects information from all connectors and consolidates it into a unified JSON response. This will act as a single source of truth for supported features.
Additional Changes
How did you test it?
Test the validation.
Create a Klarna payment with Bambora. It should fail with "payment method not supported" error.
Response
The payment intent status will be
requires_payment_method
Response
List for all connector (that implements this feature)
Response
Checklist
cargo +nightly fmt --all
cargo clippy