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

@ -1664,7 +1664,10 @@ impl GetPaymentMethodType for CryptoData {
impl GetPaymentMethodType for UpiData {
fn get_payment_method_type(&self) -> api_enums::PaymentMethodType {
api_enums::PaymentMethodType::UpiCollect
match self {
Self::UpiCollect(_) => api_enums::PaymentMethodType::UpiCollect,
Self::UpiIntent(_) => api_enums::PaymentMethodType::UpiIntent,
}
}
}
impl GetPaymentMethodType for VoucherData {
@ -2119,11 +2122,21 @@ pub struct CryptoData {
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub struct UpiData {
pub enum UpiData {
UpiCollect(UpiCollectData),
UpiIntent(UpiIntentData),
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub struct UpiCollectData {
#[schema(value_type = Option<String>, example = "successtest@iata")]
pub vpa_id: Option<Secret<String, pii::UpiVpaMaskingStrategy>>,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct UpiIntentData {}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct SofortBilling {
/// The country associated with the billing
@ -2960,6 +2973,11 @@ pub enum NextActionData {
/// The url for Qr code given by the connector
qr_code_url: Option<Url>,
},
/// Contains url to fetch Qr code data
FetchQrCodeInformation {
#[schema(value_type = String)]
qr_code_fetch_url: Url,
},
/// Contains the download url and the reference number for transaction
DisplayVoucherInformation {
#[schema(value_type = String)]
@ -3045,6 +3063,11 @@ pub struct SdkNextActionData {
pub next_action: NextActionCall,
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
pub struct FetchQrCodeInformation {
pub qr_code_fetch_url: Url,
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
pub struct BankTransferNextStepsData {
/// The instructions for performing a bank transfer