mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 10:06:32 +08:00 
			
		
		
		
	refactor(connector): [Square] remove default case handling (#2701)
Co-authored-by: DEEPANSHU BANSAL <41580413+deepanshu-iiitu@users.noreply.github.com>
This commit is contained in:
		| @ -23,7 +23,10 @@ impl TryFrom<(&types::TokenizationRouterData, BankDebitData)> for SquareTokenReq | ||||
|                 "Payment Method".to_string(), | ||||
|             )) | ||||
|             .into_report(), | ||||
|             _ => Err(errors::ConnectorError::NotSupported { | ||||
|  | ||||
|             BankDebitData::SepaBankDebit { .. } | ||||
|             | BankDebitData::BecsBankDebit { .. } | ||||
|             | BankDebitData::BacsBankDebit { .. } => Err(errors::ConnectorError::NotSupported { | ||||
|                 message: format!("{:?}", item.request.payment_method_data), | ||||
|                 connector: "Square", | ||||
|             })?, | ||||
| @ -85,7 +88,14 @@ impl TryFrom<(&types::TokenizationRouterData, PayLaterData)> for SquareTokenRequ | ||||
|                 errors::ConnectorError::NotImplemented("Payment Method".to_string()), | ||||
|             ) | ||||
|             .into_report(), | ||||
|             _ => Err(errors::ConnectorError::NotSupported { | ||||
|  | ||||
|             PayLaterData::KlarnaRedirect { .. } | ||||
|             | PayLaterData::KlarnaSdk { .. } | ||||
|             | PayLaterData::AffirmRedirect { .. } | ||||
|             | PayLaterData::PayBrightRedirect { .. } | ||||
|             | PayLaterData::WalleyRedirect { .. } | ||||
|             | PayLaterData::AlmaRedirect { .. } | ||||
|             | PayLaterData::AtomeRedirect { .. } => Err(errors::ConnectorError::NotSupported { | ||||
|                 message: format!("{:?}", item.request.payment_method_data), | ||||
|                 connector: "Square", | ||||
|             })?, | ||||
| @ -106,7 +116,31 @@ impl TryFrom<(&types::TokenizationRouterData, WalletData)> for SquareTokenReques | ||||
|                 "Payment Method".to_string(), | ||||
|             )) | ||||
|             .into_report(), | ||||
|             _ => Err(errors::ConnectorError::NotSupported { | ||||
|  | ||||
|             WalletData::AliPayQr(_) | ||||
|             | WalletData::AliPayRedirect(_) | ||||
|             | WalletData::AliPayHkRedirect(_) | ||||
|             | WalletData::MomoRedirect(_) | ||||
|             | WalletData::KakaoPayRedirect(_) | ||||
|             | WalletData::GoPayRedirect(_) | ||||
|             | WalletData::GcashRedirect(_) | ||||
|             | WalletData::ApplePayRedirect(_) | ||||
|             | WalletData::ApplePayThirdPartySdk(_) | ||||
|             | WalletData::DanaRedirect {} | ||||
|             | WalletData::GooglePayRedirect(_) | ||||
|             | WalletData::GooglePayThirdPartySdk(_) | ||||
|             | WalletData::MbWayRedirect(_) | ||||
|             | WalletData::MobilePayRedirect(_) | ||||
|             | WalletData::PaypalRedirect(_) | ||||
|             | WalletData::PaypalSdk(_) | ||||
|             | WalletData::SamsungPay(_) | ||||
|             | WalletData::TwintRedirect {} | ||||
|             | WalletData::VippsRedirect {} | ||||
|             | WalletData::TouchNGoRedirect(_) | ||||
|             | WalletData::WeChatPayRedirect(_) | ||||
|             | WalletData::WeChatPayQr(_) | ||||
|             | WalletData::CashappQr(_) | ||||
|             | WalletData::SwishQr(_) => Err(errors::ConnectorError::NotSupported { | ||||
|                 message: format!("{:?}", item.request.payment_method_data), | ||||
|                 connector: "Square", | ||||
|             })?, | ||||
| @ -295,7 +329,14 @@ impl TryFrom<&types::ConnectorAuthType> for SquareAuthType { | ||||
|                 api_key: api_key.to_owned(), | ||||
|                 key1: key1.to_owned(), | ||||
|             }), | ||||
|             _ => Err(errors::ConnectorError::FailedToObtainAuthType.into()), | ||||
|  | ||||
|             types::ConnectorAuthType::HeaderKey { .. } | ||||
|             | types::ConnectorAuthType::SignatureKey { .. } | ||||
|             | types::ConnectorAuthType::MultiAuthKey { .. } | ||||
|             | types::ConnectorAuthType::CurrencyAuthKey { .. } | ||||
|             | types::ConnectorAuthType::NoKey { .. } => { | ||||
|                 Err(errors::ConnectorError::FailedToObtainAuthType.into()) | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 HeetVekariya
					HeetVekariya