refactor: Pass country and currency as json format in MCA (#523)

This commit is contained in:
Manoj Ghorela
2023-02-24 19:39:03 +05:30
committed by GitHub
parent 32de632ded
commit d27e6be599
5 changed files with 212 additions and 37 deletions

View File

@ -4,7 +4,7 @@ use common_utils::pii;
use serde::de;
use utoipa::ToSchema;
use crate::enums as api_enums;
use crate::{admin, enums as api_enums};
#[derive(Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema)]
#[serde(deny_unknown_fields)]
@ -322,12 +322,24 @@ pub struct ListPaymentMethod {
pub payment_schemes: Option<Vec<String>>,
/// List of Countries accepted or has the processing capabilities of the processor
#[schema(example = json!(["US", "UK", "IN"]))]
pub accepted_countries: Option<Vec<String>>,
#[schema(example = json!(
{
"enable_all":false,
"disable_only": ["FR", "DE","IN"],
"enable_only": ["UK","AU"]
}
))]
pub accepted_countries: Option<admin::AcceptedCountries>,
/// List of currencies accepted or has the processing capabilities of the processor
#[schema(value_type = Option<Vec<Currency>>,example = json!(["USD", "EUR"]))]
pub accepted_currencies: Option<Vec<api_enums::Currency>>,
#[schema(example = json!(
{
"enable_all":false,
"disable_only": ["INR", "CAD", "AED","JPY"],
"enable_only": ["EUR","USD"]
}
))]
pub accepted_currencies: Option<admin::AcceptedCurrencies>,
/// Minimum amount supported by the processor. To be represented in the lowest denomination of
/// the target currency (For example, for USD it should be in cents)