refactor: use CountryAlpha2 instead of CountryCode for country codes (#904)

This commit is contained in:
Pa1NarK
2023-05-03 13:46:41 +05:30
committed by GitHub
parent c9e8a9b4b7
commit 2cff019a1b
39 changed files with 1952 additions and 2427 deletions

View File

@ -49,7 +49,7 @@ impl AccessTokenRequestInfo for types::RefreshTokenRouterData {
pub trait RouterData {
fn get_billing(&self) -> Result<&api::Address, Error>;
fn get_billing_country(&self) -> Result<api_models::enums::CountryCode, Error>;
fn get_billing_country(&self) -> Result<api_models::enums::CountryAlpha2, Error>;
fn get_billing_phone(&self) -> Result<&api::PhoneDetails, Error>;
fn get_description(&self) -> Result<String, Error>;
fn get_return_url(&self) -> Result<String, Error>;
@ -72,7 +72,7 @@ impl<Flow, Request, Response> RouterData for types::RouterData<Flow, Request, Re
.ok_or_else(missing_field_err("billing"))
}
fn get_billing_country(&self) -> Result<api_models::enums::CountryCode, Error> {
fn get_billing_country(&self) -> Result<api_models::enums::CountryAlpha2, Error> {
self.address
.billing
.as_ref()
@ -440,7 +440,7 @@ pub trait AddressDetailsData {
fn get_city(&self) -> Result<&String, Error>;
fn get_line2(&self) -> Result<&Secret<String>, Error>;
fn get_zip(&self) -> Result<&Secret<String>, Error>;
fn get_country(&self) -> Result<&api_models::enums::CountryCode, Error>;
fn get_country(&self) -> Result<&api_models::enums::CountryAlpha2, Error>;
fn get_combined_address_line(&self) -> Result<Secret<String>, Error>;
}
@ -481,7 +481,7 @@ impl AddressDetailsData for api::AddressDetails {
.ok_or_else(missing_field_err("address.zip"))
}
fn get_country(&self) -> Result<&api_models::enums::CountryCode, Error> {
fn get_country(&self) -> Result<&api_models::enums::CountryAlpha2, Error> {
self.country
.as_ref()
.ok_or_else(missing_field_err("address.country"))