-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: filter out payment_methods which does not support mandates during list api call #1318
Conversation
…ter_pmd_mandates
…ter_pmd_mandates
…switch into filter_pmd_mandates
…ter_pmd_mandates
…ter_pmd_mandates
…ter_pmd_mandates
|
||
#[derive(Debug, Deserialize, Clone)] | ||
pub struct SupportedPaymentMethodsForMandate( | ||
pub HashMap<enums::PaymentMethod, SupportedPaymentMethodTypesForMandate>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this hashmap be built through config or can there be a global static? I understand that having a config based approach will let us turn things on/off during startup, but the config structure keeps getting bloated, which gets cloned, passed to each actix thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that config structure is getting messy, but making it a global static will require re-deploying the application if any changes in the config right?
Type of Change
Description
When a mandate payment is created, sdk makes a payment_method_list api call which lists all the payment_methods. But not all of them support mandate payments.
Added a filter for payment_methods which filters payment methods that doesn't support mandates and list only those which supports, during payment_method_list api call.
Created an hashmap containing info about which payment_methods through which connector, supports mandates. And while listing payment methods, validate between the merchant configured payment_methods and the supported payment_methods.
Additional Changes
crates/router/src/configs/settings.rs
Motivation and Context
List the payment_methods which support mandates filtering out others.
How did you test it?
Postman
Configured payment methods -
Filtered payment methods -
Checklist
cargo +nightly fmt --all
cargo clippy