feat(core): add support for upi_intent and upi_qr (#9716)

Co-authored-by: Kanika Chaudhary <kanika.c@juspay.in>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
kanikac199
2025-10-13 18:01:53 +05:30
committed by GitHub
parent c2da9db91f
commit 5c7a607326
29 changed files with 197 additions and 23 deletions

View File

@ -3112,6 +3112,7 @@ impl GetPaymentMethodType for UpiData {
match self {
Self::UpiCollect(_) => api_enums::PaymentMethodType::UpiCollect,
Self::UpiIntent(_) => api_enums::PaymentMethodType::UpiIntent,
Self::UpiQr(_) => api_enums::PaymentMethodType::UpiQr,
}
}
}
@ -3661,6 +3662,7 @@ pub struct CryptoData {
pub enum UpiData {
UpiCollect(UpiCollectData),
UpiIntent(UpiIntentData),
UpiQr(UpiQrData),
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
@ -3670,6 +3672,9 @@ pub struct UpiCollectData {
pub vpa_id: Option<Secret<String, pii::UpiVpaMaskingStrategy>>,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct UpiQrData {}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct UpiIntentData {}
@ -5069,6 +5074,11 @@ pub enum NextActionData {
#[schema(value_type = String)]
qr_code_fetch_url: Url,
},
/// Contains the SDK UPI intent URI for payment processing
SdkUpiIntentInformation {
#[schema(value_type = String)]
sdk_uri: Url,
},
/// Contains the download url and the reference number for transaction
DisplayVoucherInformation {
#[schema(value_type = String)]
@ -5204,6 +5214,11 @@ pub struct FetchQrCodeInformation {
pub qr_code_fetch_url: Url,
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
pub struct SdkUpiIntentInformation {
pub sdk_uri: Url,
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
pub struct BankTransferNextStepsData {
/// The instructions for performing a bank transfer

View File

@ -223,6 +223,8 @@ pub enum UpiAdditionalData {
UpiCollect(Box<UpiCollectAdditionalData>),
#[schema(value_type = UpiIntentData)]
UpiIntent(Box<super::UpiIntentData>),
#[schema(value_type = UpiQrData)]
UpiQr(Box<super::UpiQrData>),
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]