mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 18:17:13 +08:00 
			
		
		
		
	feat(connector): Mandates for alternate payment methods via Stripe (#1041)
Co-authored-by: Manoj Ghorela <manoj.ghorela@juspay.in> Co-authored-by: Arjun Karthik <m.arjunkarthik@gmail.com>
This commit is contained in:
		| @ -210,8 +210,8 @@ impl PaymentsAuthorizeRequestData for types::PaymentsAuthorizeData { | ||||
|             .as_ref() | ||||
|             .and_then(|mandate_ids| match &mandate_ids.mandate_reference_id { | ||||
|                 Some(api_models::payments::MandateReferenceId::ConnectorMandateId( | ||||
|                     connector_mandate_id, | ||||
|                 )) => Some(connector_mandate_id.to_string()), | ||||
|                     connector_mandate_ids, | ||||
|                 )) => connector_mandate_ids.connector_mandate_id.clone(), | ||||
|                 _ => None, | ||||
|             }) | ||||
|     } | ||||
| @ -562,6 +562,18 @@ impl MandateData for payments::MandateAmountData { | ||||
|     } | ||||
| } | ||||
|  | ||||
| pub trait MandateReferenceData { | ||||
|     fn get_connector_mandate_id(&self) -> Result<String, Error>; | ||||
| } | ||||
|  | ||||
| impl MandateReferenceData for api_models::payments::ConnectorMandateReferenceId { | ||||
|     fn get_connector_mandate_id(&self) -> Result<String, Error> { | ||||
|         self.connector_mandate_id | ||||
|             .clone() | ||||
|             .ok_or_else(missing_field_err("mandate_id")) | ||||
|     } | ||||
| } | ||||
|  | ||||
| pub fn get_header_key_value<'a>( | ||||
|     key: &str, | ||||
|     headers: &'a actix_web::http::header::HeaderMap, | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Jagan
					Jagan