mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 17:47:54 +08:00
feat: stripe connect integration for payouts (#2041)
Co-authored-by: Rachit Naithani <81706961+racnan@users.noreply.github.com> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Apoorv Dixit <64925866+apoorvdixit88@users.noreply.github.com> Co-authored-by: Swangi Kumari <85639103+swangi-kumari@users.noreply.github.com> Co-authored-by: Narayan Bhat <narayan.bhat@juspay.in> Co-authored-by: Shankar Singh C <83439957+ShankarSinghC@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Sakil Mostak <73734619+Sakilmostak@users.noreply.github.com> Co-authored-by: AkshayaFoiger <131388445+AkshayaFoiger@users.noreply.github.com>
This commit is contained in:
@ -154,6 +154,10 @@ impl Connector {
|
||||
pub fn supports_access_token_for_payout(&self, payout_method: PayoutType) -> bool {
|
||||
matches!((self, payout_method), (Self::Paypal, _))
|
||||
}
|
||||
#[cfg(feature = "payouts")]
|
||||
pub fn supports_vendor_disburse_account_create_for_payout(&self) -> bool {
|
||||
matches!(self, Self::Stripe)
|
||||
}
|
||||
pub fn supports_access_token(&self, payment_method: PaymentMethod) -> bool {
|
||||
matches!(
|
||||
(self, payment_method),
|
||||
@ -338,6 +342,7 @@ pub enum AuthenticationConnectors {
|
||||
#[strum(serialize_all = "snake_case")]
|
||||
pub enum PayoutConnectors {
|
||||
Adyen,
|
||||
Stripe,
|
||||
Wise,
|
||||
Paypal,
|
||||
}
|
||||
@ -347,6 +352,7 @@ impl From<PayoutConnectors> for RoutableConnectors {
|
||||
fn from(value: PayoutConnectors) -> Self {
|
||||
match value {
|
||||
PayoutConnectors::Adyen => Self::Adyen,
|
||||
PayoutConnectors::Stripe => Self::Stripe,
|
||||
PayoutConnectors::Wise => Self::Wise,
|
||||
PayoutConnectors::Paypal => Self::Paypal,
|
||||
}
|
||||
@ -358,6 +364,7 @@ impl From<PayoutConnectors> for Connector {
|
||||
fn from(value: PayoutConnectors) -> Self {
|
||||
match value {
|
||||
PayoutConnectors::Adyen => Self::Adyen,
|
||||
PayoutConnectors::Stripe => Self::Stripe,
|
||||
PayoutConnectors::Wise => Self::Wise,
|
||||
PayoutConnectors::Paypal => Self::Paypal,
|
||||
}
|
||||
@ -370,6 +377,7 @@ impl TryFrom<Connector> for PayoutConnectors {
|
||||
fn try_from(value: Connector) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
Connector::Adyen => Ok(Self::Adyen),
|
||||
Connector::Stripe => Ok(Self::Stripe),
|
||||
Connector::Wise => Ok(Self::Wise),
|
||||
Connector::Paypal => Ok(Self::Paypal),
|
||||
_ => Err(format!("Invalid payout connector {}", value)),
|
||||
|
||||
@ -446,6 +446,7 @@ pub struct PayoutAttemptResponse {
|
||||
#[derive(Default, Debug, Clone, Deserialize, ToSchema)]
|
||||
pub struct PayoutRetrieveBody {
|
||||
pub force_sync: Option<bool>,
|
||||
pub merchant_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Serialize, ToSchema, Clone, Deserialize)]
|
||||
@ -464,6 +465,9 @@ pub struct PayoutRetrieveRequest {
|
||||
/// (defaults to false)
|
||||
#[schema(value_type = Option<bool>, default = false, example = true)]
|
||||
pub force_sync: Option<bool>,
|
||||
|
||||
/// The identifier for the Merchant Account.
|
||||
pub merchant_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Serialize, ToSchema, Clone, Deserialize)]
|
||||
@ -479,6 +483,43 @@ pub struct PayoutActionRequest {
|
||||
pub payout_id: String,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, ToSchema, Clone, Deserialize)]
|
||||
pub struct PayoutVendorAccountDetails {
|
||||
pub vendor_details: PayoutVendorDetails,
|
||||
pub individual_details: PayoutIndividualDetails,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Serialize, ToSchema, Clone, Deserialize)]
|
||||
pub struct PayoutVendorDetails {
|
||||
pub account_type: String,
|
||||
pub business_type: String,
|
||||
pub business_profile_mcc: Option<i32>,
|
||||
pub business_profile_url: Option<String>,
|
||||
pub business_profile_name: Option<Secret<String>>,
|
||||
pub company_address_line1: Option<Secret<String>>,
|
||||
pub company_address_line2: Option<Secret<String>>,
|
||||
pub company_address_postal_code: Option<Secret<String>>,
|
||||
pub company_address_city: Option<Secret<String>>,
|
||||
pub company_address_state: Option<Secret<String>>,
|
||||
pub company_phone: Option<Secret<String>>,
|
||||
pub company_tax_id: Option<Secret<String>>,
|
||||
pub company_owners_provided: Option<bool>,
|
||||
pub capabilities_card_payments: Option<bool>,
|
||||
pub capabilities_transfers: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Serialize, ToSchema, Clone, Deserialize)]
|
||||
pub struct PayoutIndividualDetails {
|
||||
pub tos_acceptance_date: Option<i64>,
|
||||
pub tos_acceptance_ip: Option<Secret<String>>,
|
||||
pub individual_dob_day: Option<Secret<String>>,
|
||||
pub individual_dob_month: Option<Secret<String>>,
|
||||
pub individual_dob_year: Option<Secret<String>>,
|
||||
pub individual_id_number: Option<Secret<String>>,
|
||||
pub individual_ssn_last_4: Option<Secret<String>>,
|
||||
pub external_account_account_holder_type: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, serde::Deserialize, ToSchema, serde::Serialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct PayoutListConstraints {
|
||||
|
||||
Reference in New Issue
Block a user