mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 04:04:43 +08:00
Merge branch 'main' of https://github.com/juspay/hyperswitch into diff-fork
This commit is contained in:
@ -23,6 +23,8 @@ pub enum AdditionalPayoutMethodData {
|
||||
Bank(Box<BankAdditionalData>),
|
||||
/// Additional data for wallet payout method
|
||||
Wallet(Box<WalletAdditionalData>),
|
||||
/// Additional data for Bank Redirect payout method
|
||||
BankRedirect(Box<BankRedirectAdditionalData>),
|
||||
}
|
||||
|
||||
crate::impl_to_sql_from_sql_json!(AdditionalPayoutMethodData);
|
||||
@ -238,3 +240,25 @@ pub struct VenmoAdditionalData {
|
||||
#[schema(value_type = Option<String>, example = "******* 3349")]
|
||||
pub telephone_number: Option<MaskedPhoneNumber>,
|
||||
}
|
||||
|
||||
/// Masked payout method details for wallet payout method
|
||||
#[derive(
|
||||
Eq, PartialEq, Clone, Debug, Deserialize, Serialize, FromSqlRow, AsExpression, ToSchema,
|
||||
)]
|
||||
#[diesel(sql_type = Jsonb)]
|
||||
#[serde(untagged)]
|
||||
pub enum BankRedirectAdditionalData {
|
||||
/// Additional data for interac bank redirect payout method
|
||||
Interac(Box<InteracAdditionalData>),
|
||||
}
|
||||
|
||||
/// Masked payout method details for interac bank redirect payout method
|
||||
#[derive(
|
||||
Default, Eq, PartialEq, Clone, Debug, Deserialize, Serialize, FromSqlRow, AsExpression, ToSchema,
|
||||
)]
|
||||
#[diesel(sql_type = Jsonb)]
|
||||
pub struct InteracAdditionalData {
|
||||
/// Email linked with interac account
|
||||
#[schema(value_type = Option<String>, example = "john.doe@example.com")]
|
||||
pub email: Option<MaskedEmail>,
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
use masking::{Maskable, Secret};
|
||||
use reqwest::multipart::Form;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use utoipa::ToSchema;
|
||||
|
||||
@ -66,7 +67,7 @@ impl std::fmt::Debug for RequestContent {
|
||||
pub enum RequestContent {
|
||||
Json(Box<dyn masking::ErasedMaskSerialize + Send>),
|
||||
FormUrlEncoded(Box<dyn masking::ErasedMaskSerialize + Send>),
|
||||
FormData(reqwest::multipart::Form),
|
||||
FormData((Form, Box<dyn masking::ErasedMaskSerialize + Send>)),
|
||||
Xml(Box<dyn masking::ErasedMaskSerialize + Send>),
|
||||
RawBytes(Vec<u8>),
|
||||
}
|
||||
@ -77,7 +78,7 @@ impl RequestContent {
|
||||
Self::Json(i) => serde_json::to_string(&i).unwrap_or_default().into(),
|
||||
Self::FormUrlEncoded(i) => serde_urlencoded::to_string(i).unwrap_or_default().into(),
|
||||
Self::Xml(i) => quick_xml::se::to_string(&i).unwrap_or_default().into(),
|
||||
Self::FormData(_) => String::new().into(),
|
||||
Self::FormData((_, i)) => serde_json::to_string(i).unwrap_or_default().into(),
|
||||
Self::RawBytes(_) => String::new().into(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user