mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 12:06:56 +08:00
feat: encryption service integration to support batch encryption and decryption (#5164)
Co-authored-by: dracarys18 <karthikey.hegde@juspay.in> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -40,7 +40,7 @@ pub async fn create_payment_method_api(
|
||||
json_payload.into_inner(),
|
||||
|state, auth, req, _| async move {
|
||||
Box::pin(cards::get_client_secret_or_add_payment_method(
|
||||
state,
|
||||
&state,
|
||||
req,
|
||||
&auth.merchant_account,
|
||||
&auth.key_store,
|
||||
@ -88,9 +88,11 @@ async fn get_merchant_account(
|
||||
state: &SessionState,
|
||||
merchant_id: &str,
|
||||
) -> CustomResult<(MerchantKeyStore, domain::MerchantAccount), errors::ApiErrorResponse> {
|
||||
let key_manager_state = &state.into();
|
||||
let key_store = state
|
||||
.store
|
||||
.get_merchant_key_store_by_merchant_id(
|
||||
key_manager_state,
|
||||
merchant_id,
|
||||
&state.store.get_master_key().to_vec().into(),
|
||||
)
|
||||
@ -99,7 +101,7 @@ async fn get_merchant_account(
|
||||
|
||||
let merchant_account = state
|
||||
.store
|
||||
.find_merchant_account_by_merchant_id(merchant_id, &key_store)
|
||||
.find_merchant_account_by_merchant_id(key_manager_state, merchant_id, &key_store)
|
||||
.await
|
||||
.to_not_found_response(errors::ApiErrorResponse::MerchantAccountNotFound)?;
|
||||
Ok((key_store, merchant_account))
|
||||
@ -530,7 +532,7 @@ pub async fn default_payment_method_set_api(
|
||||
payload,
|
||||
|state, auth: auth::AuthenticationData, default_payment_method, _| async move {
|
||||
cards::set_default_payment_method(
|
||||
&*state.clone().store,
|
||||
&state,
|
||||
auth.merchant_account.merchant_id,
|
||||
auth.key_store,
|
||||
customer_id,
|
||||
|
||||
Reference in New Issue
Block a user