mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-11-01 02:57:02 +08:00 
			
		
		
		
	refactor: use newtype pattern for email addresses (#819)
Co-authored-by: Sanchith Hegde <22217505+SanchithHegde@users.noreply.github.com>
This commit is contained in:
		| @ -155,7 +155,7 @@ impl<Flow, Request, Response> RouterData for types::RouterData<Flow, Request, Re | ||||
|  | ||||
| pub trait PaymentsAuthorizeRequestData { | ||||
|     fn is_auto_capture(&self) -> Result<bool, Error>; | ||||
|     fn get_email(&self) -> Result<Secret<String, Email>, Error>; | ||||
|     fn get_email(&self) -> Result<Email, Error>; | ||||
|     fn get_browser_info(&self) -> Result<types::BrowserInformation, Error>; | ||||
|     fn get_order_details(&self) -> Result<OrderDetails, Error>; | ||||
|     fn get_card(&self) -> Result<api::Card, Error>; | ||||
| @ -174,7 +174,7 @@ impl PaymentsAuthorizeRequestData for types::PaymentsAuthorizeData { | ||||
|             Some(_) => Err(errors::ConnectorError::CaptureMethodNotSupported.into()), | ||||
|         } | ||||
|     } | ||||
|     fn get_email(&self) -> Result<Secret<String, Email>, Error> { | ||||
|     fn get_email(&self) -> Result<Email, Error> { | ||||
|         self.email.clone().ok_or_else(missing_field_err("email")) | ||||
|     } | ||||
|     fn get_browser_info(&self) -> Result<types::BrowserInformation, Error> { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Nachiket Kanore
					Nachiket Kanore