mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 09:38:33 +08:00
feat(payment_method): API to list countries and currencies supported by a country and payment method type (#4126)
Co-authored-by: Mani Chandra Dulam <mani.dchandra@juspay.in> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -3,8 +3,9 @@ use common_utils::events::{ApiEventMetric, ApiEventsType};
|
||||
use crate::{
|
||||
payment_methods::{
|
||||
CustomerDefaultPaymentMethodResponse, CustomerPaymentMethodsListResponse,
|
||||
DefaultPaymentMethod, PaymentMethodDeleteResponse, PaymentMethodListRequest,
|
||||
PaymentMethodListResponse, PaymentMethodResponse, PaymentMethodUpdate,
|
||||
DefaultPaymentMethod, ListCountriesCurrenciesRequest, ListCountriesCurrenciesResponse,
|
||||
PaymentMethodDeleteResponse, PaymentMethodListRequest, PaymentMethodListResponse,
|
||||
PaymentMethodResponse, PaymentMethodUpdate,
|
||||
},
|
||||
payments::{
|
||||
PaymentIdType, PaymentListConstraints, PaymentListFilterConstraints, PaymentListFilters,
|
||||
@ -131,6 +132,9 @@ impl ApiEventMetric for PaymentMethodListRequest {
|
||||
}
|
||||
}
|
||||
|
||||
impl ApiEventMetric for ListCountriesCurrenciesRequest {}
|
||||
|
||||
impl ApiEventMetric for ListCountriesCurrenciesResponse {}
|
||||
impl ApiEventMetric for PaymentMethodListResponse {}
|
||||
|
||||
impl ApiEventMetric for CustomerDefaultPaymentMethodResponse {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
use std::collections::HashMap;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
|
||||
use cards::CardNumber;
|
||||
use common_utils::{
|
||||
@ -914,6 +914,26 @@ pub struct TokenizedCardValue1 {
|
||||
pub card_token: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize, serde::Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ListCountriesCurrenciesRequest {
|
||||
pub connector: api_enums::Connector,
|
||||
pub payment_method_type: api_enums::PaymentMethodType,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize, serde::Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ListCountriesCurrenciesResponse {
|
||||
pub currencies: HashSet<api_enums::Currency>,
|
||||
pub countries: HashSet<CountryCodeWithName>,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize, serde::Deserialize, Eq, Hash, PartialEq)]
|
||||
pub struct CountryCodeWithName {
|
||||
pub code: api_enums::CountryAlpha2,
|
||||
pub name: api_enums::Country,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize, serde::Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct TokenizedCardValue2 {
|
||||
|
||||
Reference in New Issue
Block a user