Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
refactor: remove code related to temp locker (#2640)
Abhishek Marrivagucc0b42263257
diff --git a/crates/api_models/src/payment_methods.rs b/crates/api_models/src/payment_methods.rsindex 9d3983e73a..4656f6362c 100644--- a/crates/api_models/src/payment_methods.rs+++ b/crates/api_models/src/payment_methods.rs@@ -754,13 +754,6 @@ pub struct DeleteTokenizeByTokenRequest {pub service_name: String,}-#[derive(Debug, serde::Serialize)] // Blocked: Yet to be implemented by `basilisk`-pub struct DeleteTokenizeByDateRequest {- pub buffer_minutes: i32,- pub service_name: String,- pub max_rows: i32,-}-#[derive(Debug, serde::Deserialize)]pub struct GetTokenizePayloadResponse {pub lookup_key: String,diff --git a/crates/router/Cargo.toml b/crates/router/Cargo.tomlindex fd8b21520b..8cbded8f53 100644--- a/crates/router/Cargo.toml+++ b/crates/router/Cargo.toml@@ -13,9 +13,8 @@ default = ["kv_store", "stripe", "oltp", "olap", "accounts_cache", "dummy_connecs3 = ["dep:aws-sdk-s3", "dep:aws-config"]kms = ["external_services/kms", "dep:aws-config"]email = ["external_services/email", "dep:aws-config"]-basilisk = ["kms"]stripe = ["dep:serde_qs"]-release = ["kms", "stripe", "basilisk", "s3", "email","accounts_cache"]+release = ["kms", "stripe", "s3", "email","accounts_cache"]olap = ["data_models/olap", "storage_impl/olap", "scheduler/olap"]oltp = ["data_models/oltp", "storage_impl/oltp"]kv_store = ["scheduler/kv_store"]diff --git a/crates/router/src/configs/defaults.rs b/crates/router/src/configs/defaults.rsindex 8c1d00e212..c2e60bacb6 100644--- a/crates/router/src/configs/defaults.rs+++ b/crates/router/src/configs/defaults.rs@@ -49,7 +49,7 @@ impl Default for super::settings::Locker {Self {host: "localhost".into(),mock_locker: true,- basilisk_host: "localhost".into(),+locker_signing_key_id: "1".into(),redis_temp_locker_encryption_key: "".into(),}diff --git a/crates/router/src/configs/settings.rs b/crates/router/src/configs/settings.rsindex 122bc53e70..ec1ea7d77e 100644--- a/crates/router/src/configs/settings.rs+++ b/crates/router/src/configs/settings.rs@@ -411,7 +411,6 @@ pub struct Secrets {pub struct Locker {pub host: String,pub mock_locker: bool,- pub basilisk_host: String,pub locker_signing_key_id: String,pub redis_temp_locker_encryption_key: String,}diff --git a/crates/router/src/configs/validations.rs b/crates/router/src/configs/validations.rsindex d090ca00b8..f9c1c4a9b3 100644--- a/crates/router/src/configs/validations.rs+++ b/crates/router/src/configs/validations.rs@@ -56,10 +56,10 @@ impl super::settings::Locker {})?;when(- !self.mock_locker && self.basilisk_host.is_default_or_empty(),+ self.redis_temp_locker_encryption_key.is_default_or_empty(),|| {Err(ApplicationError::InvalidConfigurationValueError(- "basilisk host must not be empty when mock locker is disabled".into(),+ "redis_temp_locker_encryption_key must not be empty".into(),))},)?;diff --git a/crates/router/src/core/payment_methods/cards.rs b/crates/router/src/core/payment_methods/cards.rsindex 93918432f5..1c094a5716 100644--- a/crates/router/src/core/payment_methods/cards.rs+++ b/crates/router/src/core/payment_methods/cards.rs@@ -2010,7 +2010,8 @@ pub async fn get_lookup_key_from_locker(.change_context(errors::ApiErrorResponse::InternalServerError).attach_printable("Get Card Details Failed")?;let card = card_detail.clone();- let resp = BasiliskCardSupport::create_payment_method_data_in_temp_locker(++ let resp = TempLockerCardSupport::create_payment_method_data_in_temp_locker(state,payment_token,card,@@ -2062,9 +2063,9 @@ pub async fn get_lookup_key_for_payout_method(}}-pub struct BasiliskCardSupport;+pub struct TempLockerCardSupport;-impl BasiliskCardSupport {+impl TempLockerCardSupport {#[instrument(skip_all)]async fn create_payment_method_data_in_temp_locker(state: &routes::AppState,diff --git a/crates/router/src/core/payment_methods/transformers.rs b/crates/router/src/core/payment_methods/transformers.rsindex 086133ec78..6e95111354 100644--- a/crates/router/src/core/payment_methods/transformers.rs+++ b/crates/router/src/core/payment_methods/transformers.rs@@ -580,21 +580,6 @@ pub fn get_card_detail(}//------------------------------------------------TokenizeService-------------------------------------------------pub fn mk_crud_locker_request(- locker: &settings::Locker,- path: &str,- req: api::TokenizePayloadEncrypted,-) -> CustomResult<services::Request, errors::VaultError> {- let body = utils::Encode::<api::TokenizePayloadEncrypted>::encode_to_value(&req)- .change_context(errors::VaultError::RequestEncodingFailed)?;- let mut url = locker.basilisk_host.to_owned();- url.push_str(path);- let mut request = services::Request::new(services::Method::Post, &url);- request.add_default_headers();- request.add_header(headers::CONTENT_TYPE, "application/json".into());- request.set_body(body.to_string());- Ok(request)-}pub fn mk_card_value1(card_number: cards::CardNumber,diff --git a/crates/router/src/services/api/client.rs b/crates/router/src/services/api/client.rsindex 8eb6ab72f9..c47a28da08 100644--- a/crates/router/src/services/api/client.rs+++ b/crates/router/src/services/api/client.rs@@ -110,7 +110,6 @@ pub(super) fn create_client(pub fn proxy_bypass_urls(locker: &Locker) -> Vec<String> {let locker_host = locker.host.to_owned();- let basilisk_host = locker.basilisk_host.to_owned();vec![format!("{locker_host}/cards/add"),format!("{locker_host}/cards/retrieve"),@@ -118,10 +117,6 @@ pub fn proxy_bypass_urls(locker: &Locker) -> Vec<String> {format!("{locker_host}/card/addCard"),format!("{locker_host}/card/getCard"),format!("{locker_host}/card/deleteCard"),- format!("{basilisk_host}/tokenize"),- format!("{basilisk_host}/tokenize/get"),- format!("{basilisk_host}/tokenize/delete"),- format!("{basilisk_host}/tokenize/delete/token"),]}diff --git a/crates/router/src/types/api/payment_methods.rs b/crates/router/src/types/api/payment_methods.rsindex e5bf1d8dd1..39ef57dfa9 100644--- a/crates/router/src/types/api/payment_methods.rs+++ b/crates/router/src/types/api/payment_methods.rs@@ -1,12 +1,11 @@use api_models::enums as api_enums;pub use api_models::payment_methods::{CardDetail, CardDetailFromLocker, CardDetailsPaymentMethod, CustomerPaymentMethod,- CustomerPaymentMethodsListResponse, DeleteTokenizeByDateRequest, DeleteTokenizeByTokenRequest,- GetTokenizePayloadRequest, GetTokenizePayloadResponse, PaymentMethodCreate,- PaymentMethodDeleteResponse, PaymentMethodId, PaymentMethodList, PaymentMethodListRequest,- PaymentMethodListResponse, PaymentMethodResponse, PaymentMethodUpdate, PaymentMethodsData,- TokenizePayloadEncrypted, TokenizePayloadRequest, TokenizedCardValue1, TokenizedCardValue2,- TokenizedWalletValue1, TokenizedWalletValue2,+ CustomerPaymentMethodsListResponse, GetTokenizePayloadRequest, GetTokenizePayloadResponse,+ PaymentMethodCreate, PaymentMethodDeleteResponse, PaymentMethodId, PaymentMethodList,+ PaymentMethodListRequest, PaymentMethodListResponse, PaymentMethodResponse,+ PaymentMethodUpdate, PaymentMethodsData, TokenizePayloadEncrypted, TokenizePayloadRequest,+ TokenizedCardValue1, TokenizedCardValue2, TokenizedWalletValue1, TokenizedWalletValue2,};use error_stack::report;