feat(connector): [Iatapay] add upi qr support (#4728)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: SamraatBansal <55536657+SamraatBansal@users.noreply.github.com>
This commit is contained in:
AkshayaFoiger
2024-05-28 13:06:53 +05:30
committed by GitHub
parent d15cb31814
commit c9fa94febe
22 changed files with 257 additions and 65 deletions

View File

@ -289,10 +289,20 @@ pub struct CryptoData {
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub struct UpiData {
pub enum UpiData {
UpiCollect(UpiCollectData),
UpiIntent(UpiIntentData),
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub struct UpiCollectData {
pub vpa_id: Option<Secret<String, pii::UpiVpaMaskingStrategy>>,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct UpiIntentData {}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum VoucherData {
@ -690,8 +700,12 @@ impl From<api_models::payments::CryptoData> for CryptoData {
impl From<api_models::payments::UpiData> for UpiData {
fn from(value: api_models::payments::UpiData) -> Self {
let api_models::payments::UpiData { vpa_id } = value;
Self { vpa_id }
match value {
api_models::payments::UpiData::UpiCollect(upi) => {
Self::UpiCollect(UpiCollectData { vpa_id: upi.vpa_id })
}
api_models::payments::UpiData::UpiIntent(_) => Self::UpiIntent(UpiIntentData {}),
}
}
}