mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-29 00:49:42 +08:00 
			
		
		
		
	feat(payouts): make payout_type optional in payouts table (#4954)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
		| @ -140,26 +140,28 @@ pub enum Connector { | ||||
|  | ||||
| impl Connector { | ||||
|     #[cfg(feature = "payouts")] | ||||
|     pub fn supports_instant_payout(&self, payout_method: PayoutType) -> bool { | ||||
|     pub fn supports_instant_payout(&self, payout_method: Option<PayoutType>) -> bool { | ||||
|         matches!( | ||||
|             (self, payout_method), | ||||
|             (Self::Paypal, PayoutType::Wallet) | (_, PayoutType::Card) | (Self::Adyenplatform, _) | ||||
|             (Self::Paypal, Some(PayoutType::Wallet)) | ||||
|                 | (_, Some(PayoutType::Card)) | ||||
|                 | (Self::Adyenplatform, _) | ||||
|         ) | ||||
|     } | ||||
|     #[cfg(feature = "payouts")] | ||||
|     pub fn supports_create_recipient(&self, payout_method: PayoutType) -> bool { | ||||
|         matches!((self, payout_method), (_, PayoutType::Bank)) | ||||
|     pub fn supports_create_recipient(&self, payout_method: Option<PayoutType>) -> bool { | ||||
|         matches!((self, payout_method), (_, Some(PayoutType::Bank))) | ||||
|     } | ||||
|     #[cfg(feature = "payouts")] | ||||
|     pub fn supports_payout_eligibility(&self, payout_method: PayoutType) -> bool { | ||||
|         matches!((self, payout_method), (_, PayoutType::Card)) | ||||
|     pub fn supports_payout_eligibility(&self, payout_method: Option<PayoutType>) -> bool { | ||||
|         matches!((self, payout_method), (_, Some(PayoutType::Card))) | ||||
|     } | ||||
|     #[cfg(feature = "payouts")] | ||||
|     pub fn is_payout_quote_call_required(&self) -> bool { | ||||
|         matches!(self, Self::Wise) | ||||
|     } | ||||
|     #[cfg(feature = "payouts")] | ||||
|     pub fn supports_access_token_for_payout(&self, payout_method: PayoutType) -> bool { | ||||
|     pub fn supports_access_token_for_payout(&self, payout_method: Option<PayoutType>) -> bool { | ||||
|         matches!((self, payout_method), (Self::Paypal, _)) | ||||
|     } | ||||
|     #[cfg(feature = "payouts")] | ||||
|  | ||||
| @ -349,8 +349,8 @@ pub struct PayoutCreateResponse { | ||||
|     pub connector: Option<String>, | ||||
|  | ||||
|     /// The payout method that is to be used | ||||
|     #[schema(value_type = PayoutType, example = "bank")] | ||||
|     pub payout_type: api_enums::PayoutType, | ||||
|     #[schema(value_type = Option<PayoutType>, example = "bank")] | ||||
|     pub payout_type: Option<api_enums::PayoutType>, | ||||
|  | ||||
|     /// The billing address for the payout | ||||
|     #[schema(value_type = Option<Object>, example = json!(r#"{ | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 chikke srujan
					chikke srujan