mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 19:42:27 +08:00
feat: store card network for cards (#687)
This commit is contained in:
@ -48,6 +48,7 @@ pub async fn create_payment_method(
|
||||
payment_method: req.payment_method.foreign_into(),
|
||||
payment_method_type: req.payment_method_type.map(ForeignInto::foreign_into),
|
||||
payment_method_issuer: req.payment_method_issuer.clone(),
|
||||
scheme: req.card_network.clone(),
|
||||
metadata: req.metadata.clone(),
|
||||
..storage::PaymentMethodNew::default()
|
||||
})
|
||||
@ -129,6 +130,10 @@ pub async fn update_customer_payment_method(
|
||||
card: req.card,
|
||||
metadata: req.metadata,
|
||||
customer_id: Some(pm.customer_id),
|
||||
card_network: req
|
||||
.card_network
|
||||
.as_ref()
|
||||
.map(|card_network| card_network.to_string()),
|
||||
};
|
||||
add_payment_method(state, new_pm, &merchant_account).await
|
||||
}
|
||||
|
||||
@ -517,11 +517,15 @@ pub(crate) async fn call_payment_method(
|
||||
let payment_method_request = api::CreatePaymentMethod {
|
||||
payment_method: payment_method_type.foreign_into(),
|
||||
payment_method_type: None,
|
||||
payment_method_issuer: None,
|
||||
payment_method_issuer: card.card_issuer.clone(),
|
||||
payment_method_issuer_code: None,
|
||||
card: Some(card_detail),
|
||||
metadata: None,
|
||||
customer_id: Some(customer_id),
|
||||
card_network: card
|
||||
.card_network
|
||||
.as_ref()
|
||||
.map(|card_network| card_network.to_string()),
|
||||
};
|
||||
let resp = cards::add_payment_method(
|
||||
state,
|
||||
@ -553,6 +557,7 @@ pub(crate) async fn call_payment_method(
|
||||
card: None,
|
||||
metadata: None,
|
||||
customer_id: None,
|
||||
card_network: None,
|
||||
};
|
||||
let resp =
|
||||
cards::add_payment_method(state, payment_method_request, merchant_account)
|
||||
|
||||
Reference in New Issue
Block a user