-
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(router): Override the setup_future_usage
to on_session
based on the merchant config
#5016
Conversation
…n merchant config
…le_pay/over_ride_setup_future_usage
{ | ||
if skip_saving_wallet_at_connector.contains(&payment_method_type) { | ||
payment_data.payment_intent.setup_future_usage = | ||
Some(enums::FutureUsage::OnSession); |
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.
since we are updating the setup_future_usage
based on config, it will be better if we log to know why it is updated to avoid confusion
{ | ||
match state | ||
.store | ||
.find_payment_method_by_customer_id_merchant_id_list( |
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.
pass the PM type directly in the query and return top 1. return Option to avoid iterating the list.
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.
We do not have db interface that accepts payment method type and list the payment method of the passed payment method type for given customer.
@ShankarSinghC can you also check whether the |
Yes it is getting updated. |
…ress-skip * 'main' of github.com:juspay/hyperswitch: (27 commits) feat(cypress): add 2 more payout connectors and bank transfer support for payout (#4993) chore(version): 2024.06.20.0 Refactor(core): reverts the payment method list filtering using constraint graph (#5044) feat(router): add payment method type duplication check for `google_pay` (#5023) refactor(storage): remove `id` from payment intent, attempt and remove datamodel ext from payment intent (#4923) fix(events): Correct parsing of API events with user event_type for Clickhouse (#5022) fix(connector): add local bank redirect type in compatibility layer, default the country to AT for Local Bank Redirect and add creds_identifier in access token (#5038) refactor(connector): add amount conversion framework for noon (#4843) fix(logging): fix stack overflow on recording restricted keys (#4423) feat(core): Add logger for sessions call failure (#5036) chore(version): 2024.06.19.0 fix(opensearch): handle index not present errors in search api (#4965) feat(multitenancy): add tenant_id as a field for data pipeline and support individual database for clickhouse (#4867) refactor: add basic counter metrics for IMC (#5006) fix(payment_methods): populate card fields while saving card again during metadata change condition (#5019) feat(router): Override the `setup_future_usage` to `on_session` based on the merchant config (#5016) chore(docker-compose): pass correct configuration values for running SDK demo app (#5012) refactor: Move trait ConnectorIntegration to crate hyperswitch_interfaces (#4946) chore(version): 2024.06.17.0 chore(process_tracker): use `const` instead of `String` for `business_status` (#4849) ...
Type of Change
Description
This is the use case where in which we need if the setup_future_usage is set to off_session in the payment method needs to be just saved at hyperswitch and not at connector.
skip_saving_wallet_at_connector_<merchant_id>
is the config which takes vector of payment method type as the value. When this config is set, thesetup_future_usage
is overridden toon_session
by which mandates won't be created at the connector's end.Also add a validation to add duplicate apple pay payment method being saved.
Additional Changes
Motivation and Context
How did you test it?
-> Create merchant connector account
-> Set below config for the merchant id
-> Create a Apple pay CIT with
setup_future_usage = off_session
-> Retrieve the payment
-> Perform the CIT with the same request (for the same customer). After which perform the list customer payment methods and it should I have still only one apple pay payment method saved.
-> Also for the above listed payment method verify there is no
connector_wallets_details
in thepayment_methods
table.Checklist
cargo +nightly fmt --all
cargo clippy