mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-11-01 02:57:02 +08:00 
			
		
		
		
	feat(connector): [Trustpay] add authorize (cards 3ds, no3ds and bank redirects), refund, psync, rsync (#717)
Co-authored-by: Sangamesh <sangamesh.kulkarni@juspay.in> Co-authored-by: sai harsha <sai.harsha@sai.harsha-MacBookPro> Co-authored-by: Arun Raj M <jarnura47@gmail.com>
This commit is contained in:
		| @ -222,6 +222,7 @@ 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; | ||||
| } | ||||
|  | ||||
| impl CardData for api::Card { | ||||
| @ -237,6 +238,15 @@ 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 { | ||||
|         let year = self.get_card_expiry_year_2_digit(); | ||||
|         format!( | ||||
|             "{}{}{}", | ||||
|             self.card_exp_month.peek().clone(), | ||||
|             delimiter, | ||||
|             year.peek() | ||||
|         ) | ||||
|     } | ||||
| } | ||||
|  | ||||
| fn get_card_issuer(card_number: &str) -> Result<CardIssuer, Error> { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 saiharsha-juspay
					saiharsha-juspay