mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 09:38:33 +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 {
|
impl From<StripeBillingDetails> for payments::Address {
|
||||||
fn from(details: StripeBillingDetails) -> Self {
|
fn from(details: StripeBillingDetails) -> Self {
|
||||||
Self {
|
Self {
|
||||||
address: details.address,
|
|
||||||
phone: Some(payments::PhoneDetails {
|
phone: Some(payments::PhoneDetails {
|
||||||
number: details.phone,
|
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 {
|
impl From<Shipping> for payments::Address {
|
||||||
fn from(details: Shipping) -> Self {
|
fn from(details: Shipping) -> Self {
|
||||||
Self {
|
Self {
|
||||||
address: details.address,
|
|
||||||
phone: Some(payments::PhoneDetails {
|
phone: Some(payments::PhoneDetails {
|
||||||
number: details.phone,
|
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