Skip to content
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

refactor(payment_methods): add requires_cvv config while creating merchant account #2431

Merged
merged 17 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
a3e2b79
refactor(masking): move masking implementations to masking crate
Chethan-rao Sep 12, 2023
a621192
Merge branch 'main' of github.com:juspay/hyperswitch
Chethan-rao Sep 13, 2023
b1bc6c7
t Merge branch 'main' of github.com:juspay/hyperswitch
Chethan-rao Sep 14, 2023
9623ec8
Merge branch 'main' of github.com:juspay/hyperswitch
Chethan-rao Sep 15, 2023
0333593
Merge branch 'main' of github.com:juspay/hyperswitch
Chethan-rao Sep 20, 2023
587549f
Merge branch 'main' of github.com:juspay/hyperswitch
Chethan-rao Sep 24, 2023
57b3aad
Merge branch 'main' of github.com:juspay/hyperswitch
Chethan-rao Sep 25, 2023
687a4f2
Merge branch 'main' of github.com:juspay/hyperswitch
Chethan-rao Sep 25, 2023
9e8ce1f
Merge branch 'main' of github.com:juspay/hyperswitch
Chethan-rao Sep 26, 2023
06132d5
Merge branch 'main' of github.com:juspay/hyperswitch
Chethan-rao Sep 27, 2023
d06624c
Merge branch 'main' of github.com:juspay/hyperswitch
Chethan-rao Sep 28, 2023
c1ef143
Merge branch 'main' of github.com:juspay/hyperswitch
Chethan-rao Oct 3, 2023
b6bab27
refactor: add requires_cvv config while creating merchant account
Chethan-rao Oct 3, 2023
c4d7db1
Merge branch 'main' of github.com:juspay/hyperswitch into refactor_re…
Chethan-rao Oct 4, 2023
c4b786a
refactor: address requested changes
Chethan-rao Oct 4, 2023
01e236d
inMerge branch 'main' of github.com:juspay/hyperswitch into refactor_…
Chethan-rao Oct 4, 2023
ceb1efb
refactor: remove propagation of error and only log it
Chethan-rao Oct 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions crates/router/src/core/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,17 @@ pub async fn create_merchant_account(
.insert_merchant(merchant_account, &key_store)
.await
.to_duplicate_response(errors::ApiErrorResponse::DuplicateMerchantAccount)?;

db.insert_config(diesel_models::configs::ConfigNew {
key: format!("{}_requires_cvv", merchant_account.merchant_id),
config: "true".to_string(),
})
.await
.map_err(|err| {
crate::logger::error!("Error while setting requires_cvv config: {err:?}");
})
.ok();

Ok(service_api::ApplicationResponse::Json(
merchant_account
.try_into()
Expand Down
2 changes: 1 addition & 1 deletion crates/router/src/core/payment_methods/cards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1831,7 +1831,7 @@ pub async fn list_customer_payment_method(
)
.await
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("Failed to fetch merchant_id config for requires_cvv")?;
.attach_printable("Failed to fetch requires_cvv config")?;

let requires_cvv = is_requires_cvv.config != "false";

Expand Down
Loading