mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 18:17:13 +08:00 
			
		
		
		
	refactor(mandate): allow merchant to pass the mandate details and customer acceptance separately (#1188)
This commit is contained in:
		| @ -561,27 +561,27 @@ impl ForeignTryFrom<(Option<MandateOption>, Option<String>)> for Option<payments | ||||
|         let mandate_data = mandate_options.map(|mandate| payments::MandateData { | ||||
|             mandate_type: match mandate.mandate_type { | ||||
|                 Some(item) => match item { | ||||
|                     StripeMandateType::SingleUse => { | ||||
|                         payments::MandateType::SingleUse(payments::MandateAmountData { | ||||
|                     StripeMandateType::SingleUse => Some(payments::MandateType::SingleUse( | ||||
|                         payments::MandateAmountData { | ||||
|                             amount: mandate.amount.unwrap_or_default(), | ||||
|                             currency, | ||||
|                             start_date: mandate.start_date, | ||||
|                             end_date: mandate.end_date, | ||||
|                             metadata: None, | ||||
|                         }) | ||||
|                     } | ||||
|                     StripeMandateType::MultiUse => payments::MandateType::MultiUse(None), | ||||
|                         }, | ||||
|                     )), | ||||
|                     StripeMandateType::MultiUse => Some(payments::MandateType::MultiUse(None)), | ||||
|                 }, | ||||
|                 None => api_models::payments::MandateType::MultiUse(None), | ||||
|                 None => Some(api_models::payments::MandateType::MultiUse(None)), | ||||
|             }, | ||||
|             customer_acceptance: payments::CustomerAcceptance { | ||||
|             customer_acceptance: Some(payments::CustomerAcceptance { | ||||
|                 acceptance_type: payments::AcceptanceType::Online, | ||||
|                 accepted_at: mandate.accepted_at, | ||||
|                 online: Some(payments::OnlineMandate { | ||||
|                     ip_address: mandate.ip_address.unwrap_or_default(), | ||||
|                     user_agent: mandate.user_agent.unwrap_or_default(), | ||||
|                 }), | ||||
|             }, | ||||
|             }), | ||||
|         }); | ||||
|         Ok(mandate_data) | ||||
|     } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user