mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 21:07:58 +08:00
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:
@ -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 {}),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user