mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 18:17:13 +08:00 
			
		
		
		
	feat(connector): add authorize, capture, void, psync, refund, rsync for PayPal connector (#747)
Co-authored-by: Arjun Karthik <m.arjunkarthik@gmail.com> Co-authored-by: Arun Raj M <jarnura47@gmail.com>
This commit is contained in:
		| @ -247,7 +247,11 @@ pub enum CardIssuer { | ||||
| pub trait CardData { | ||||
|     fn get_card_expiry_year_2_digit(&self) -> Secret<String>; | ||||
|     fn get_card_issuer(&self) -> Result<CardIssuer, Error>; | ||||
|     fn get_card_expiry_month_year_2_digit_with_delimiter(&self, delimiter: String) -> String; | ||||
|     fn get_card_expiry_month_year_2_digit_with_delimiter( | ||||
|         &self, | ||||
|         delimiter: String, | ||||
|     ) -> Secret<String>; | ||||
|     fn get_expiry_date_as_yyyymm(&self, delimiter: &str) -> Secret<String>; | ||||
| } | ||||
|  | ||||
| impl CardData for api::Card { | ||||
| @ -263,14 +267,29 @@ impl CardData for api::Card { | ||||
|             .map(|card| card.split_whitespace().collect()); | ||||
|         get_card_issuer(card.peek().clone().as_str()) | ||||
|     } | ||||
|     fn get_card_expiry_month_year_2_digit_with_delimiter(&self, delimiter: String) -> String { | ||||
|     fn get_card_expiry_month_year_2_digit_with_delimiter( | ||||
|         &self, | ||||
|         delimiter: String, | ||||
|     ) -> Secret<String> { | ||||
|         let year = self.get_card_expiry_year_2_digit(); | ||||
|         format!( | ||||
|         Secret::new(format!( | ||||
|             "{}{}{}", | ||||
|             self.card_exp_month.peek().clone(), | ||||
|             delimiter, | ||||
|             year.peek() | ||||
|         ) | ||||
|         )) | ||||
|     } | ||||
|     fn get_expiry_date_as_yyyymm(&self, delimiter: &str) -> Secret<String> { | ||||
|         let mut x = self.card_exp_year.peek().clone(); | ||||
|         if x.len() == 2 { | ||||
|             x = format!("20{}", x); | ||||
|         } | ||||
|         Secret::new(format!( | ||||
|             "{}{}{}", | ||||
|             x, | ||||
|             delimiter, | ||||
|             self.card_exp_month.peek().clone() | ||||
|         )) | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Prasunna Soppa
					Prasunna Soppa