mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
fix(compatibility): map stripe country_code to payment_request country code (#667)
This commit is contained in:
@ -24,11 +24,12 @@ pub struct StripeBillingDetails {
|
||||
impl From<StripeBillingDetails> for payments::Address {
|
||||
fn from(details: StripeBillingDetails) -> Self {
|
||||
Self {
|
||||
address: details.address,
|
||||
phone: Some(payments::PhoneDetails {
|
||||
number: details.phone,
|
||||
country_code: None,
|
||||
country_code: details.address.as_ref().and_then(|a| a.country.clone()),
|
||||
}),
|
||||
|
||||
address: details.address,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -104,11 +105,11 @@ pub struct Shipping {
|
||||
impl From<Shipping> for payments::Address {
|
||||
fn from(details: Shipping) -> Self {
|
||||
Self {
|
||||
address: details.address,
|
||||
phone: Some(payments::PhoneDetails {
|
||||
number: details.phone,
|
||||
country_code: None,
|
||||
country_code: details.address.as_ref().and_then(|a| a.country.clone()),
|
||||
}),
|
||||
address: details.address,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user