mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
chore: address some clippy lints arising from v2 code (#6015)
This commit is contained in:
@ -958,7 +958,7 @@ impl Default for CellInformation {
|
||||
// around the time of deserializing application settings.
|
||||
// And a panic at application startup is considered acceptable.
|
||||
#[allow(clippy::expect_used)]
|
||||
let cell_id = common_utils::id_type::CellId::from_str("defid")
|
||||
let cell_id = common_utils::id_type::CellId::from_string("defid")
|
||||
.expect("Failed to create a default for Cell Id");
|
||||
Self { id: cell_id }
|
||||
}
|
||||
|
||||
@ -198,7 +198,7 @@ impl super::settings::CellInformation {
|
||||
pub fn validate(&self) -> Result<(), ApplicationError> {
|
||||
use common_utils::{fp_utils::when, id_type};
|
||||
|
||||
when(self == &super::settings::CellInformation::default(), || {
|
||||
when(self == &Self::default(), || {
|
||||
Err(ApplicationError::InvalidConfigurationValueError(
|
||||
"CellId cannot be set to a default".into(),
|
||||
))
|
||||
|
||||
@ -21,13 +21,13 @@ use api_models::payment_methods;
|
||||
pub use api_models::{enums::PayoutConnectors, payouts as payout_types};
|
||||
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
|
||||
use common_utils::ext_traits::Encode;
|
||||
use common_utils::{consts::DEFAULT_LOCALE, id_type::CustomerId};
|
||||
use common_utils::{consts::DEFAULT_LOCALE, id_type};
|
||||
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
|
||||
use common_utils::{
|
||||
crypto::{self, Encryptable},
|
||||
ext_traits::{AsyncExt, Encode, ValueExt},
|
||||
fp_utils::when,
|
||||
generate_id, id_type,
|
||||
generate_id,
|
||||
request::RequestContent,
|
||||
types as util_types,
|
||||
};
|
||||
@ -40,9 +40,7 @@ use hyperswitch_domain_models::api::{GenericLinks, GenericLinksData};
|
||||
use hyperswitch_domain_models::payments::{payment_attempt::PaymentAttempt, PaymentIntent};
|
||||
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
|
||||
use masking::ExposeInterface;
|
||||
use masking::PeekInterface;
|
||||
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
|
||||
use masking::Secret;
|
||||
use masking::{PeekInterface, Secret};
|
||||
use router_env::{instrument, tracing};
|
||||
use time::Duration;
|
||||
|
||||
@ -198,10 +196,10 @@ pub async fn initiate_pm_collect_link(
|
||||
req.return_url.clone(),
|
||||
)
|
||||
.await?;
|
||||
let customer_id = CustomerId::try_from(Cow::from(pm_collect_link.primary_reference))
|
||||
let customer_id = id_type::CustomerId::try_from(Cow::from(pm_collect_link.primary_reference))
|
||||
.change_context(errors::ApiErrorResponse::InvalidDataValue {
|
||||
field_name: "customer_id",
|
||||
})?;
|
||||
field_name: "customer_id",
|
||||
})?;
|
||||
|
||||
// Return response
|
||||
let url = pm_collect_link.url.peek();
|
||||
@ -321,11 +319,12 @@ pub async fn render_pm_collect_link(
|
||||
|
||||
// else, send back form link
|
||||
} else {
|
||||
let customer_id =
|
||||
CustomerId::try_from(Cow::from(pm_collect_link.primary_reference.clone()))
|
||||
.change_context(errors::ApiErrorResponse::InvalidDataValue {
|
||||
field_name: "customer_id",
|
||||
})?;
|
||||
let customer_id = id_type::CustomerId::try_from(Cow::from(
|
||||
pm_collect_link.primary_reference.clone(),
|
||||
))
|
||||
.change_context(errors::ApiErrorResponse::InvalidDataValue {
|
||||
field_name: "customer_id",
|
||||
})?;
|
||||
// Fetch customer
|
||||
|
||||
let customer = db
|
||||
@ -349,7 +348,7 @@ pub async fn render_pm_collect_link(
|
||||
))?;
|
||||
|
||||
let js_data = payment_methods::PaymentMethodCollectLinkDetails {
|
||||
publishable_key: masking::Secret::new(merchant_account.publishable_key),
|
||||
publishable_key: Secret::new(merchant_account.publishable_key),
|
||||
client_secret: link_data.client_secret.clone(),
|
||||
pm_collect_link_id: pm_collect_link.link_id,
|
||||
customer_id: customer.customer_id,
|
||||
@ -448,7 +447,7 @@ pub async fn add_payment_method_status_update_task(
|
||||
payment_method: &domain::PaymentMethod,
|
||||
prev_status: enums::PaymentMethodStatus,
|
||||
curr_status: enums::PaymentMethodStatus,
|
||||
merchant_id: &common_utils::id_type::MerchantId,
|
||||
merchant_id: &id_type::MerchantId,
|
||||
) -> Result<(), errors::ProcessTrackerError> {
|
||||
let created_at = payment_method.created_at;
|
||||
let schedule_time =
|
||||
@ -496,6 +495,7 @@ pub async fn add_payment_method_status_update_task(
|
||||
}
|
||||
|
||||
#[cfg(feature = "v2")]
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[instrument(skip_all)]
|
||||
pub async fn retrieve_payment_method_with_token(
|
||||
_state: &SessionState,
|
||||
@ -671,8 +671,8 @@ pub(crate) async fn get_payment_method_create_request(
|
||||
payment_method_data: Option<&domain::PaymentMethodData>,
|
||||
payment_method: Option<storage_enums::PaymentMethod>,
|
||||
payment_method_type: Option<storage_enums::PaymentMethodType>,
|
||||
customer_id: &Option<CustomerId>,
|
||||
billing_name: Option<masking::Secret<String>>,
|
||||
customer_id: &Option<id_type::CustomerId>,
|
||||
billing_name: Option<Secret<String>>,
|
||||
) -> RouterResult<payment_methods::PaymentMethodCreate> {
|
||||
match payment_method_data {
|
||||
Some(pm_data) => match payment_method {
|
||||
@ -748,8 +748,8 @@ pub(crate) async fn get_payment_method_create_request(
|
||||
payment_method_data: Option<&domain::PaymentMethodData>,
|
||||
payment_method: Option<storage_enums::PaymentMethod>,
|
||||
payment_method_type: Option<storage_enums::PaymentMethodType>,
|
||||
customer_id: &Option<CustomerId>,
|
||||
billing_name: Option<masking::Secret<String>>,
|
||||
customer_id: &Option<id_type::CustomerId>,
|
||||
billing_name: Option<Secret<String>>,
|
||||
) -> RouterResult<payment_methods::PaymentMethodCreate> {
|
||||
match payment_method_data {
|
||||
Some(pm_data) => match payment_method {
|
||||
@ -833,7 +833,7 @@ pub async fn create_payment_method(
|
||||
req: api::PaymentMethodCreate,
|
||||
merchant_account: &domain::MerchantAccount,
|
||||
key_store: &domain::MerchantKeyStore,
|
||||
) -> errors::RouterResponse<api::PaymentMethodResponse> {
|
||||
) -> RouterResponse<api::PaymentMethodResponse> {
|
||||
req.validate()?;
|
||||
|
||||
let db = &*state.store;
|
||||
@ -844,7 +844,7 @@ pub async fn create_payment_method(
|
||||
&(state.into()),
|
||||
&customer_id,
|
||||
merchant_account.get_id(),
|
||||
&key_store,
|
||||
key_store,
|
||||
merchant_account.storage_scheme,
|
||||
)
|
||||
.await
|
||||
@ -860,10 +860,9 @@ pub async fn create_payment_method(
|
||||
.attach_printable("Unable to encrypt Payment method billing address")?;
|
||||
|
||||
// create pm
|
||||
let payment_method_id =
|
||||
common_utils::id_type::GlobalPaymentMethodId::generate("random_cell_id")
|
||||
.change_context(errors::ApiErrorResponse::InternalServerError)
|
||||
.attach_printable("Unable to generate GlobalPaymentMethodId")?;
|
||||
let payment_method_id = id_type::GlobalPaymentMethodId::generate("random_cell_id")
|
||||
.change_context(errors::ApiErrorResponse::InternalServerError)
|
||||
.attach_printable("Unable to generate GlobalPaymentMethodId")?;
|
||||
|
||||
let payment_method = create_payment_method_for_intent(
|
||||
state,
|
||||
@ -897,7 +896,7 @@ pub async fn create_payment_method(
|
||||
let payment_method = db
|
||||
.update_payment_method(
|
||||
&(state.into()),
|
||||
&key_store,
|
||||
key_store,
|
||||
payment_method,
|
||||
pm_update,
|
||||
merchant_account.storage_scheme,
|
||||
@ -917,7 +916,7 @@ pub async fn create_payment_method(
|
||||
|
||||
db.update_payment_method(
|
||||
&(state.into()),
|
||||
&key_store,
|
||||
key_store,
|
||||
payment_method,
|
||||
pm_update,
|
||||
merchant_account.storage_scheme,
|
||||
@ -940,7 +939,7 @@ pub async fn payment_method_intent_create(
|
||||
req: api::PaymentMethodIntentCreate,
|
||||
merchant_account: &domain::MerchantAccount,
|
||||
key_store: &domain::MerchantKeyStore,
|
||||
) -> errors::RouterResponse<api::PaymentMethodResponse> {
|
||||
) -> RouterResponse<api::PaymentMethodResponse> {
|
||||
let db = &*state.store;
|
||||
let merchant_id = merchant_account.get_id();
|
||||
let customer_id = req.customer_id.to_owned();
|
||||
@ -949,7 +948,7 @@ pub async fn payment_method_intent_create(
|
||||
&(state.into()),
|
||||
&customer_id,
|
||||
merchant_account.get_id(),
|
||||
&key_store,
|
||||
key_store,
|
||||
merchant_account.storage_scheme,
|
||||
)
|
||||
.await
|
||||
@ -966,10 +965,9 @@ pub async fn payment_method_intent_create(
|
||||
|
||||
// create pm entry
|
||||
|
||||
let payment_method_id =
|
||||
common_utils::id_type::GlobalPaymentMethodId::generate("random_cell_id")
|
||||
.change_context(errors::ApiErrorResponse::InternalServerError)
|
||||
.attach_printable("Unable to generate GlobalPaymentMethodId")?;
|
||||
let payment_method_id = id_type::GlobalPaymentMethodId::generate("random_cell_id")
|
||||
.change_context(errors::ApiErrorResponse::InternalServerError)
|
||||
.attach_printable("Unable to generate GlobalPaymentMethodId")?;
|
||||
|
||||
let payment_method = create_payment_method_for_intent(
|
||||
state,
|
||||
@ -997,19 +995,19 @@ pub async fn payment_method_intent_confirm(
|
||||
merchant_account: &domain::MerchantAccount,
|
||||
key_store: &domain::MerchantKeyStore,
|
||||
pm_id: String,
|
||||
) -> errors::RouterResponse<api::PaymentMethodResponse> {
|
||||
) -> RouterResponse<api::PaymentMethodResponse> {
|
||||
req.validate()?;
|
||||
|
||||
let db = &*state.store;
|
||||
let client_secret = req.client_secret.clone();
|
||||
let pm_id = common_utils::id_type::GlobalPaymentMethodId::generate_from_string(pm_id)
|
||||
let pm_id = id_type::GlobalPaymentMethodId::generate_from_string(pm_id)
|
||||
.change_context(errors::ApiErrorResponse::InternalServerError)
|
||||
.attach_printable("Unable to generate GlobalPaymentMethodId")?;
|
||||
|
||||
let payment_method = db
|
||||
.find_payment_method(
|
||||
&(state.into()),
|
||||
&key_store,
|
||||
key_store,
|
||||
&pm_id,
|
||||
merchant_account.storage_scheme,
|
||||
)
|
||||
@ -1037,7 +1035,7 @@ pub async fn payment_method_intent_confirm(
|
||||
&(state.into()),
|
||||
&customer_id,
|
||||
merchant_account.get_id(),
|
||||
&key_store,
|
||||
key_store,
|
||||
merchant_account.storage_scheme,
|
||||
)
|
||||
.await
|
||||
@ -1062,7 +1060,7 @@ pub async fn payment_method_intent_confirm(
|
||||
let payment_method = db
|
||||
.update_payment_method(
|
||||
&(state.into()),
|
||||
&key_store,
|
||||
key_store,
|
||||
payment_method,
|
||||
pm_update,
|
||||
merchant_account.storage_scheme,
|
||||
@ -1082,7 +1080,7 @@ pub async fn payment_method_intent_confirm(
|
||||
|
||||
db.update_payment_method(
|
||||
&(state.into()),
|
||||
&key_store,
|
||||
key_store,
|
||||
payment_method,
|
||||
pm_update,
|
||||
merchant_account.storage_scheme,
|
||||
@ -1228,7 +1226,7 @@ pub async fn create_pm_additional_data_update(
|
||||
vault_id: Option<String>,
|
||||
payment_method: Option<api_enums::PaymentMethod>,
|
||||
payment_method_type: Option<api_enums::PaymentMethodType>,
|
||||
) -> errors::RouterResult<storage::PaymentMethodUpdate> {
|
||||
) -> RouterResult<storage::PaymentMethodUpdate> {
|
||||
let card = match pmd.clone() {
|
||||
api::PaymentMethodCreateData::Card(card) => api::PaymentMethodsData::Card(card.into()),
|
||||
};
|
||||
@ -1244,7 +1242,7 @@ pub async fn create_pm_additional_data_update(
|
||||
locker_id: vault_id,
|
||||
payment_method,
|
||||
payment_method_type,
|
||||
payment_method_data: Some(pmd).map(Into::into),
|
||||
payment_method_data: Some(pmd.into()),
|
||||
network_token_requestor_reference_id: None,
|
||||
network_token_locker_id: None,
|
||||
network_token_payment_method_data: None,
|
||||
@ -1260,7 +1258,7 @@ pub async fn vault_payment_method(
|
||||
pmd: &api::PaymentMethodCreateData,
|
||||
merchant_account: &domain::MerchantAccount,
|
||||
key_store: &domain::MerchantKeyStore,
|
||||
) -> errors::RouterResult<pm_types::AddVaultResponse> {
|
||||
) -> RouterResult<pm_types::AddVaultResponse> {
|
||||
let db = &*state.store;
|
||||
|
||||
// get fingerprint_id from locker
|
||||
@ -1377,7 +1375,7 @@ pub async fn list_customer_payment_method_util(
|
||||
req: Option<api::PaymentMethodListRequest>,
|
||||
customer_id: Option<id_type::CustomerId>,
|
||||
is_payment_associated: bool,
|
||||
) -> errors::RouterResponse<api::CustomerPaymentMethodsListResponse> {
|
||||
) -> RouterResponse<api::CustomerPaymentMethodsListResponse> {
|
||||
let limit = req.as_ref().and_then(|pml_req| pml_req.limit);
|
||||
|
||||
let (customer_id, payment_intent) = if is_payment_associated {
|
||||
@ -1431,11 +1429,11 @@ pub async fn list_customer_payment_method(
|
||||
state: &SessionState,
|
||||
merchant_account: domain::MerchantAccount,
|
||||
key_store: domain::MerchantKeyStore,
|
||||
payment_intent: Option<storage::PaymentIntent>,
|
||||
payment_intent: Option<PaymentIntent>,
|
||||
customer_id: &id_type::CustomerId,
|
||||
limit: Option<i64>,
|
||||
is_payment_associated: bool,
|
||||
) -> errors::RouterResponse<api::CustomerPaymentMethodsListResponse> {
|
||||
) -> RouterResponse<api::CustomerPaymentMethodsListResponse> {
|
||||
let db = &*state.store;
|
||||
let key_manager_state = &(state).into();
|
||||
// let key = key_store.key.get_inner().peek();
|
||||
@ -1661,12 +1659,12 @@ async fn generate_saved_pm_response(
|
||||
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
|
||||
impl pm_types::SavedPMLPaymentsInfo {
|
||||
pub async fn form_payments_info(
|
||||
payment_intent: storage::PaymentIntent,
|
||||
payment_intent: PaymentIntent,
|
||||
merchant_account: &domain::MerchantAccount,
|
||||
db: &dyn StorageInterface,
|
||||
key_manager_state: &util_types::keymanager::KeyManagerState,
|
||||
key_store: &domain::MerchantKeyStore,
|
||||
) -> errors::RouterResult<Self> {
|
||||
) -> RouterResult<Self> {
|
||||
let requires_cvv = db
|
||||
.find_config_by_key_unwrap_or(
|
||||
format!(
|
||||
@ -1718,7 +1716,7 @@ impl pm_types::SavedPMLPaymentsInfo {
|
||||
parent_payment_method_token: Option<String>,
|
||||
pma: &api::CustomerPaymentMethod,
|
||||
pm_list_context: PaymentMethodListContext,
|
||||
) -> errors::RouterResult<()> {
|
||||
) -> RouterResult<()> {
|
||||
let token = parent_payment_method_token
|
||||
.as_ref()
|
||||
.get_required_value("parent_payment_method_token")?;
|
||||
|
||||
@ -226,7 +226,7 @@ async fn create_vault_request<R: pm_types::VaultingInterface>(
|
||||
jwekey: &settings::Jwekey,
|
||||
locker: &settings::Locker,
|
||||
payload: Vec<u8>,
|
||||
) -> errors::CustomResult<services::Request, errors::VaultError> {
|
||||
) -> errors::CustomResult<Request, errors::VaultError> {
|
||||
let private_key = jwekey.vault_private_key.peek().as_bytes();
|
||||
|
||||
let jws = services::encryption::jws_sign_payload(
|
||||
@ -241,7 +241,7 @@ async fn create_vault_request<R: pm_types::VaultingInterface>(
|
||||
|
||||
let mut url = locker.host.to_owned();
|
||||
url.push_str(R::get_vaulting_request_url());
|
||||
let mut request = services::Request::new(services::Method::Post, &url);
|
||||
let mut request = Request::new(services::Method::Post, &url);
|
||||
request.add_header(
|
||||
headers::CONTENT_TYPE,
|
||||
router_consts::VAULT_HEADER_CONTENT_TYPE.into(),
|
||||
|
||||
@ -310,15 +310,11 @@ pub async fn create_jwe_body_for_vault(
|
||||
|
||||
let public_key = jwekey.vault_encryption_key.peek().as_bytes();
|
||||
|
||||
let jwe_encrypted = encryption::encrypt_jwe(
|
||||
&payload,
|
||||
public_key,
|
||||
encryption::EncryptionAlgorithm::A256GCM,
|
||||
None,
|
||||
)
|
||||
.await
|
||||
.change_context(errors::VaultError::SaveCardFailed)
|
||||
.attach_printable("Error on jwe encrypt")?;
|
||||
let jwe_encrypted =
|
||||
encryption::encrypt_jwe(&payload, public_key, EncryptionAlgorithm::A256GCM, None)
|
||||
.await
|
||||
.change_context(errors::VaultError::SaveCardFailed)
|
||||
.attach_printable("Error on jwe encrypt")?;
|
||||
let jwe_payload: Vec<&str> = jwe_encrypted.split('.').collect();
|
||||
|
||||
let generate_jwe_body = |payload: Vec<&str>| -> Option<encryption::JweBody> {
|
||||
|
||||
@ -1788,7 +1788,7 @@ pub async fn retrieve_payment_method_with_temporary_token(
|
||||
pub async fn retrieve_card_with_permanent_token(
|
||||
state: &SessionState,
|
||||
locker_id: &str,
|
||||
_payment_method_id: &common_utils::id_type::GlobalPaymentMethodId,
|
||||
_payment_method_id: &id_type::GlobalPaymentMethodId,
|
||||
payment_intent: &PaymentIntent,
|
||||
card_token_data: Option<&domain::CardToken>,
|
||||
_merchant_key_store: &domain::MerchantKeyStore,
|
||||
|
||||
@ -785,7 +785,7 @@ impl MerchantConnectorAccountInterface for Store {
|
||||
format!("{}_{}", _profile_id.get_string_repr(), _connector_name).into(),
|
||||
),
|
||||
cache::CacheKind::Accounts(
|
||||
format!("{}", _merchant_connector_id.get_string_repr()).into(),
|
||||
_merchant_connector_id.get_string_repr().to_string().into(),
|
||||
),
|
||||
cache::CacheKind::CGraph(
|
||||
format!(
|
||||
|
||||
@ -173,7 +173,7 @@ impl ForeignTryFrom<domain::Profile> for ProfileResponse {
|
||||
}
|
||||
|
||||
#[cfg(feature = "v2")]
|
||||
impl ForeignTryFrom<domain::Profile> for admin::ProfileResponse {
|
||||
impl ForeignTryFrom<domain::Profile> for ProfileResponse {
|
||||
type Error = error_stack::Report<errors::ParsingError>;
|
||||
|
||||
fn foreign_try_from(item: domain::Profile) -> Result<Self, Self::Error> {
|
||||
@ -193,7 +193,7 @@ impl ForeignTryFrom<domain::Profile> for admin::ProfileResponse {
|
||||
|
||||
let order_fulfillment_time = item
|
||||
.order_fulfillment_time
|
||||
.map(api_models::admin::OrderFulfillmentTime::try_new)
|
||||
.map(admin::OrderFulfillmentTime::try_new)
|
||||
.transpose()
|
||||
.change_context(errors::ParsingError::IntegerOverflow)?;
|
||||
|
||||
|
||||
@ -69,25 +69,25 @@ impl PaymentMethodCreateExt for PaymentMethodCreate {
|
||||
self.payment_method_type,
|
||||
),
|
||||
|| {
|
||||
return Err(report!(errors::ApiErrorResponse::InvalidRequestData {
|
||||
Err(report!(errors::ApiErrorResponse::InvalidRequestData {
|
||||
message: "Invalid 'payment_method_type' provided".to_string()
|
||||
})
|
||||
.attach_printable("Invalid payment method type"));
|
||||
.attach_printable("Invalid payment method type"))
|
||||
},
|
||||
);
|
||||
)?;
|
||||
|
||||
utils::when(
|
||||
!PaymentMethodCreate::validate_payment_method_data_against_payment_method(
|
||||
!Self::validate_payment_method_data_against_payment_method(
|
||||
self.payment_method,
|
||||
self.payment_method_data.clone(),
|
||||
),
|
||||
|| {
|
||||
return Err(report!(errors::ApiErrorResponse::InvalidRequestData {
|
||||
Err(report!(errors::ApiErrorResponse::InvalidRequestData {
|
||||
message: "Invalid 'payment_method_data' provided".to_string()
|
||||
})
|
||||
.attach_printable("Invalid payment method data"));
|
||||
.attach_printable("Invalid payment method data"))
|
||||
},
|
||||
);
|
||||
)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@ -101,25 +101,25 @@ impl PaymentMethodCreateExt for PaymentMethodIntentConfirm {
|
||||
self.payment_method_type,
|
||||
),
|
||||
|| {
|
||||
return Err(report!(errors::ApiErrorResponse::InvalidRequestData {
|
||||
Err(report!(errors::ApiErrorResponse::InvalidRequestData {
|
||||
message: "Invalid 'payment_method_type' provided".to_string()
|
||||
})
|
||||
.attach_printable("Invalid payment method type"));
|
||||
.attach_printable("Invalid payment method type"))
|
||||
},
|
||||
);
|
||||
)?;
|
||||
|
||||
utils::when(
|
||||
!PaymentMethodIntentConfirm::validate_payment_method_data_against_payment_method(
|
||||
!Self::validate_payment_method_data_against_payment_method(
|
||||
self.payment_method,
|
||||
self.payment_method_data.clone(),
|
||||
),
|
||||
|| {
|
||||
return Err(report!(errors::ApiErrorResponse::InvalidRequestData {
|
||||
Err(report!(errors::ApiErrorResponse::InvalidRequestData {
|
||||
message: "Invalid 'payment_method_data' provided".to_string()
|
||||
})
|
||||
.attach_printable("Invalid payment method data"));
|
||||
.attach_printable("Invalid payment method data"))
|
||||
},
|
||||
);
|
||||
)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ impl VaultingInterface for GetVaultFingerprint {
|
||||
impl VaultingDataInterface for api::PaymentMethodCreateData {
|
||||
fn get_vaulting_data_key(&self) -> String {
|
||||
match &self {
|
||||
api::PaymentMethodCreateData::Card(card) => card.card_number.to_string(),
|
||||
Self::Card(card) => card.card_number.to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user