feat: integrate Basilisk locker for storing sensitive data (#34)

Co-authored-by: Manoj Ghorela <manoj.ghorela@manoj.ghorela-MacBookPro>
This commit is contained in:
Manoj Ghorela
2022-12-01 17:08:38 +05:30
committed by GitHub
parent f47c06a517
commit 63652a52ea
20 changed files with 727 additions and 146 deletions

View File

@ -7,7 +7,7 @@ use super::payments::{helpers, PaymentAddress};
use crate::{
consts,
core::errors::{self, RouterResult},
db::{merchant_connector_account::IMerchantConnectorAccount, temp_card::ITempCard},
db::merchant_connector_account::IMerchantConnectorAccount,
routes::AppState,
types::{
self, api,
@ -52,16 +52,9 @@ pub async fn construct_refund_router_data<'a, F>(
.get_required_value("payment_method_type")?;
let payment_method_data = match payment_method_data.cloned() {
Some(v) => v,
None => {
let temp_card = db
.find_tempcard_by_transaction_id(&payment_attempt.txn_id)
.await
.change_context(errors::ApiErrorResponse::PaymentMethodNotFound)?
.ok_or(errors::ApiErrorResponse::InvalidCardData { data: None })?;
helpers::payment_method_data_from_temp_card(&state.conf.keys, temp_card)
.await?
.get_required_value("payment_method_data")?
}
None => helpers::Vault::get_payment_method_data_from_locker(state, &payment_attempt.txn_id)
.await?
.get_required_value("payment_method_data")?,
};
let router_data = types::RouterData {