mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
refactor(mandate): allow merchant to pass the mandate details and customer acceptance separately (#1188)
This commit is contained in:
@ -429,6 +429,9 @@ pub struct PaymentMethodListResponse {
|
||||
]
|
||||
))]
|
||||
pub payment_methods: Vec<ResponsePaymentMethodsEnabled>,
|
||||
/// Value indicating if the current payment is a mandate payment
|
||||
#[schema(example = "new_mandate_txn")]
|
||||
pub mandate_payment: Option<payments::MandateTxnType>,
|
||||
}
|
||||
|
||||
#[derive(Eq, PartialEq, Hash, Debug, serde::Deserialize, ToSchema)]
|
||||
|
||||
@ -300,7 +300,8 @@ impl From<PaymentsRequest> for VerifyRequest {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum MandateTxnType {
|
||||
NewMandateTxn,
|
||||
RecurringMandateTxn,
|
||||
@ -333,13 +334,15 @@ impl MandateIds {
|
||||
}
|
||||
}
|
||||
|
||||
// The fields on this struct are optional, as we want to allow the merchant to provide partial
|
||||
// information about creating mandates
|
||||
#[derive(Default, Eq, PartialEq, Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct MandateData {
|
||||
/// A concent from the customer to store the payment method
|
||||
pub customer_acceptance: CustomerAcceptance,
|
||||
pub customer_acceptance: Option<CustomerAcceptance>,
|
||||
/// A way to select the type of mandate used
|
||||
pub mandate_type: MandateType,
|
||||
pub mandate_type: Option<MandateType>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Eq, PartialEq, Copy, Debug, Default, serde::Serialize, serde::Deserialize)]
|
||||
|
||||
Reference in New Issue
Block a user