mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 18:17:13 +08:00 
			
		
		
		
	test(connector): add and update tests for stripe, cybersource and shift4 connectors (#485)
This commit is contained in:
		| @ -1,9 +1,11 @@ | ||||
| use error_stack::ResultExt; | ||||
| use masking::Secret; | ||||
|  | ||||
| use crate::{ | ||||
|     core::errors, | ||||
|     pii::PeekInterface, | ||||
|     types::{self, api}, | ||||
|     utils::OptionExt, | ||||
| }; | ||||
|  | ||||
| pub fn missing_field_err( | ||||
| @ -40,6 +42,19 @@ pub trait PaymentsRequestData { | ||||
|     fn get_card(&self) -> Result<api::Card, Error>; | ||||
| } | ||||
|  | ||||
| pub trait RefundsRequestData { | ||||
|     fn get_connector_refund_id(&self) -> Result<String, Error>; | ||||
| } | ||||
|  | ||||
| impl RefundsRequestData for types::RefundsData { | ||||
|     fn get_connector_refund_id(&self) -> Result<String, Error> { | ||||
|         self.connector_refund_id | ||||
|             .clone() | ||||
|             .get_required_value("connector_refund_id") | ||||
|             .change_context(errors::ConnectorError::MissingConnectorTransactionID) | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl PaymentsRequestData for types::PaymentsAuthorizeRouterData { | ||||
|     fn get_attempt_id(&self) -> Result<String, Error> { | ||||
|         self.attempt_id | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Jagan
					Jagan