mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 10:06:32 +08:00 
			
		
		
		
	feat(connector): [Adyen] Add support for Samsung Pay (#1525)
This commit is contained in:
		 Sangamesh Kulkarni
					Sangamesh Kulkarni
				
			
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			 GitHub
						GitHub
					
				
			
						parent
						
							6bc4188ff9
						
					
				
				
					commit
					33309daf5c
				
			| @ -284,6 +284,7 @@ pub enum AdyenPaymentMethod<'a> { | ||||
|     #[serde(rename = "sepadirectdebit")] | ||||
|     SepaDirectDebit(Box<SepaDirectDebitData>), | ||||
|     BacsDirectDebit(Box<BacsDirectDebitData>), | ||||
|     SamsungPay(Box<SamsungPayPmData>), | ||||
| } | ||||
|  | ||||
| #[derive(Debug, Clone, Serialize)] | ||||
| @ -360,6 +361,14 @@ pub struct WalleyData { | ||||
|     payment_type: PaymentType, | ||||
| } | ||||
|  | ||||
| #[derive(Debug, Clone, Serialize)] | ||||
| pub struct SamsungPayPmData { | ||||
|     #[serde(rename = "type")] | ||||
|     payment_type: PaymentType, | ||||
|     #[serde(rename = "samsungPayToken")] | ||||
|     samsung_pay_token: Secret<String>, | ||||
| } | ||||
|  | ||||
| #[derive(Debug, Clone, Serialize)] | ||||
| pub struct PayBrightData { | ||||
|     #[serde(rename = "type")] | ||||
| @ -690,6 +699,7 @@ pub enum PaymentType { | ||||
|     SepaDirectDebit, | ||||
|     #[serde(rename = "directdebit_GB")] | ||||
|     BacsDirectDebit, | ||||
|     Samsungpay, | ||||
| } | ||||
|  | ||||
| pub struct AdyenTestBankNames<'a>(&'a str); | ||||
| @ -1097,6 +1107,13 @@ impl<'a> TryFrom<&api::WalletData> for AdyenPaymentMethod<'a> { | ||||
|                 }; | ||||
|                 Ok(AdyenPaymentMethod::WeChatPayWeb(Box::new(data))) | ||||
|             } | ||||
|             api_models::payments::WalletData::SamsungPay(samsung_data) => { | ||||
|                 let data = SamsungPayPmData { | ||||
|                     payment_type: PaymentType::Samsungpay, | ||||
|                     samsung_pay_token: samsung_data.token.to_owned(), | ||||
|                 }; | ||||
|                 Ok(AdyenPaymentMethod::SamsungPay(Box::new(data))) | ||||
|             } | ||||
|             _ => Err(errors::ConnectorError::NotImplemented("Payment method".to_string()).into()), | ||||
|         } | ||||
|     } | ||||
|  | ||||
| @ -222,6 +222,7 @@ Never share your secret api keys. Keep them guarded and secure. | ||||
|         api_models::payments::ApplepaySessionTokenResponse, | ||||
|         api_models::payments::SdkNextAction, | ||||
|         api_models::payments::NextActionCall, | ||||
|         api_models::payments::SamsungPayWalletData, | ||||
|         api_models::payments::GpayTokenizationData, | ||||
|         api_models::payments::GooglePayPaymentMethodInfo, | ||||
|         api_models::payments::ApplePayWalletData, | ||||
|  | ||||
		Reference in New Issue
	
	Block a user