mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-03 21:37:41 +08:00
feat(connector): [Noon] Add Card Mandates and Webhooks Support (#1243)
Co-authored-by: Arjun Karthik <m.arjunkarthik@gmail.com> Co-authored-by: Arun Raj M <jarnura47@gmail.com>
This commit is contained in:
@ -393,9 +393,13 @@ pub fn validate_request_amount_and_amount_to_capture(
|
||||
pub fn validate_mandate(
|
||||
req: impl Into<api::MandateValidationFields>,
|
||||
is_confirm_operation: bool,
|
||||
) -> RouterResult<Option<api::MandateTxnType>> {
|
||||
) -> CustomResult<Option<api::MandateTxnType>, errors::ApiErrorResponse> {
|
||||
let req: api::MandateValidationFields = req.into();
|
||||
match req.is_mandate() {
|
||||
match req.validate_and_get_mandate_type().change_context(
|
||||
errors::ApiErrorResponse::MandateValidationFailed {
|
||||
reason: "Expected one out of mandate_id and mandate_data but got both".to_string(),
|
||||
},
|
||||
)? {
|
||||
Some(api::MandateTxnType::NewMandateTxn) => {
|
||||
validate_new_mandate_request(req, is_confirm_operation)?;
|
||||
Ok(Some(api::MandateTxnType::NewMandateTxn))
|
||||
|
||||
Reference in New Issue
Block a user