mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-11-01 02:57:02 +08:00 
			
		
		
		
	refactor(router): store ApplepayPaymentMethod in payment_method_data column of payment_attempt table (#3940)
				
					
				
			Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
		| @ -1359,6 +1359,12 @@ pub struct AdditionalCardInfo { | ||||
|     pub card_holder_name: Option<Secret<String>>, | ||||
| } | ||||
|  | ||||
| #[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)] | ||||
| #[serde(rename_all = "snake_case")] | ||||
| pub enum Wallets { | ||||
|     ApplePay(ApplepayPaymentMethod), | ||||
| } | ||||
|  | ||||
| #[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)] | ||||
| #[serde(rename_all = "snake_case")] | ||||
| pub enum AdditionalPaymentData { | ||||
| @ -1366,7 +1372,7 @@ pub enum AdditionalPaymentData { | ||||
|     BankRedirect { | ||||
|         bank_name: Option<api_enums::BankNames>, | ||||
|     }, | ||||
|     Wallet {}, | ||||
|     Wallet(Option<Wallets>), | ||||
|     PayLater {}, | ||||
|     BankTransfer {}, | ||||
|     Crypto {}, | ||||
| @ -1939,7 +1945,7 @@ pub enum PaymentMethodDataResponse { | ||||
|     #[serde(rename = "card")] | ||||
|     Card(Box<CardResponse>), | ||||
|     BankTransfer {}, | ||||
|     Wallet {}, | ||||
|     Wallet(Option<Wallets>), | ||||
|     PayLater {}, | ||||
|     Paypal {}, | ||||
|     BankRedirect {}, | ||||
| @ -2868,7 +2874,7 @@ impl From<AdditionalPaymentData> for PaymentMethodDataResponse { | ||||
|         match payment_method_data { | ||||
|             AdditionalPaymentData::Card(card) => Self::Card(Box::new(CardResponse::from(*card))), | ||||
|             AdditionalPaymentData::PayLater {} => Self::PayLater {}, | ||||
|             AdditionalPaymentData::Wallet {} => Self::Wallet {}, | ||||
|             AdditionalPaymentData::Wallet(wallet) => Self::Wallet(wallet), | ||||
|             AdditionalPaymentData::BankRedirect { .. } => Self::BankRedirect {}, | ||||
|             AdditionalPaymentData::Crypto {} => Self::Crypto {}, | ||||
|             AdditionalPaymentData::BankDebit {} => Self::BankDebit {}, | ||||
|  | ||||
| @ -3448,9 +3448,16 @@ pub async fn get_additional_payment_data( | ||||
|                 _ => api_models::payments::AdditionalPaymentData::BankRedirect { bank_name: None }, | ||||
|             } | ||||
|         } | ||||
|         api_models::payments::PaymentMethodData::Wallet(_) => { | ||||
|             api_models::payments::AdditionalPaymentData::Wallet {} | ||||
|         api_models::payments::PaymentMethodData::Wallet(wallet) => match wallet { | ||||
|             api_models::payments::WalletData::ApplePay(apple_pay_wallet_data) => { | ||||
|                 api_models::payments::AdditionalPaymentData::Wallet(Some( | ||||
|                     api_models::payments::Wallets::ApplePay( | ||||
|                         apple_pay_wallet_data.payment_method.to_owned(), | ||||
|                     ), | ||||
|                 )) | ||||
|             } | ||||
|             _ => api_models::payments::AdditionalPaymentData::Wallet(None), | ||||
|         }, | ||||
|         api_models::payments::PaymentMethodData::PayLater(_) => { | ||||
|             api_models::payments::AdditionalPaymentData::PayLater {} | ||||
|         } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Shankar Singh C
					Shankar Singh C