Skip to content

Commit

Permalink
Merge branch 'main' of github.com:juspay/hyperswitch into move-creds-…
Browse files Browse the repository at this point in the history
…to-env

* 'main' of github.com:juspay/hyperswitch:
  Refactor(core): remove payment_method_id from RouterData struct (#4485)
  fix(euclid_wasm): connector config wasm metadata update (#4460)
  chore(version): 2024.04.30.0
  feat(user): add single purpose token and auth (#4470)
  feat: stripe connect integration for payouts (#2041)
  feat(router): handle authorization for frictionless flow in external 3ds flow (#4471)
  feat(FRM): Revise post FRM core flows (#4394)
  feat(router): send poll_config in next_action of confirm response for external 3ds flow (#4443)
  chore(version): 2024.04.29.0
  feat(connector): [CRYPTOPAY]  Report underpaid/overpaid amount in outgoing webhooks (#4468)
  feat(users): use cookie for auth (#4434)
  refactor(scheduler): join frequency and count in `RetryMapping` (#4313)
  refactor(required_fields): change required fields for billing address (#4258)
  refactor(access_token): use `merchant_connector_id` for storing access token (#4462)
  chore(version): 2024.04.26.0
  chore(postman): update Postman collection files
  • Loading branch information
PiX committed Apr 30, 2024
2 parents 0cdcb76 + 3077a0d commit fa597ef
Show file tree
Hide file tree
Showing 109 changed files with 2,995 additions and 892 deletions.
64 changes: 64 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,70 @@ All notable changes to HyperSwitch will be documented here.

- - -

## 2024.04.30.0

### Features

- **FRM:** Revise post FRM core flows ([#4394](https://github.com/juspay/hyperswitch/pull/4394)) ([`01ec7c6`](https://github.com/juspay/hyperswitch/commit/01ec7c64a4e0536b11052a6d5f3b398216d7b1e3))
- **router:**
- Send poll_config in next_action of confirm response for external 3ds flow ([#4443](https://github.com/juspay/hyperswitch/pull/4443)) ([`c3a1db1`](https://github.com/juspay/hyperswitch/commit/c3a1db16f32bd0b5aa49dfc831156a10d6d15838))
- Handle authorization for frictionless flow in external 3ds flow ([#4471](https://github.com/juspay/hyperswitch/pull/4471)) ([`79d8949`](https://github.com/juspay/hyperswitch/commit/79d8949413c8007e261b66b01596d257fb5959f9))
- **user:** Add single purpose token and auth ([#4470](https://github.com/juspay/hyperswitch/pull/4470)) ([`c20ecb8`](https://github.com/juspay/hyperswitch/commit/c20ecb855aa3c4b3ce1798dcc19910fb38345b46))
- Stripe connect integration for payouts ([#2041](https://github.com/juspay/hyperswitch/pull/2041)) ([`ac9d856`](https://github.com/juspay/hyperswitch/commit/ac9d856add0220701f809c8eb0668afe77003ef7))

**Full Changelog:** [`2024.04.29.0...2024.04.30.0`](https://github.com/juspay/hyperswitch/compare/2024.04.29.0...2024.04.30.0)

- - -

## 2024.04.29.0

### Features

- **connector:** [CRYPTOPAY] Report underpaid/overpaid amount in outgoing webhooks ([#4468](https://github.com/juspay/hyperswitch/pull/4468)) ([`cc1051d`](https://github.com/juspay/hyperswitch/commit/cc1051da99c1b4e007d7f730e2fe3cb08b078d80))
- **users:** Use cookie for auth ([#4434](https://github.com/juspay/hyperswitch/pull/4434)) ([`b2b9fab`](https://github.com/juspay/hyperswitch/commit/b2b9fab31dc838958e59a7a6755a0585d5a10302))

### Refactors

- **access_token:** Use `merchant_connector_id` for storing access token ([#4462](https://github.com/juspay/hyperswitch/pull/4462)) ([`d98551d`](https://github.com/juspay/hyperswitch/commit/d98551d80a14e2878fbac93e4ba0ecb537018802))
- **required_fields:** Change required fields for billing address ([#4258](https://github.com/juspay/hyperswitch/pull/4258)) ([`e730030`](https://github.com/juspay/hyperswitch/commit/e730030e24d177b3e696b446e5ccb964cc07ee37))
- **scheduler:** Join frequency and count in `RetryMapping` ([#4313](https://github.com/juspay/hyperswitch/pull/4313)) ([`3335195`](https://github.com/juspay/hyperswitch/commit/33351953baf32be96f6ec11982c05f2bb1edb989))

**Full Changelog:** [`2024.04.26.0...2024.04.29.0`](https://github.com/juspay/hyperswitch/compare/2024.04.26.0...2024.04.29.0)

- - -

## 2024.04.26.0

### Features

- **core:** [Payouts] Add access_token flow for Payout Create and Fulfill flow ([#4375](https://github.com/juspay/hyperswitch/pull/4375)) ([`7f0d04f`](https://github.com/juspay/hyperswitch/commit/7f0d04fe3782cf6777c67e40e708c7abb5c4f45e))
- Add an api for toggling extended card info feature ([#4444](https://github.com/juspay/hyperswitch/pull/4444)) ([`87d9fce`](https://github.com/juspay/hyperswitch/commit/87d9fced07e5cc1366eb6d16d2584bd920ad16fe))

### Bug Fixes

- **connector:** [CYBERSOURCE] Handle HTML Error Response and add Descriptor field in ApplePay payments request ([#4451](https://github.com/juspay/hyperswitch/pull/4451)) ([`dbd3160`](https://github.com/juspay/hyperswitch/commit/dbd3160fcf310b2942ef096bfb091881bfeec902))

### Refactors

- **configs:** Add comments to configs for deployments to environments ([#4458](https://github.com/juspay/hyperswitch/pull/4458)) ([`9d096e6`](https://github.com/juspay/hyperswitch/commit/9d096e6b4883e34908eca0d5aa134a88bec22b40))
- **connector:** Pass optional browser_info to stripe for increased trust ([#4374](https://github.com/juspay/hyperswitch/pull/4374)) ([`4c793c3`](https://github.com/juspay/hyperswitch/commit/4c793c3c00e93ebf4a4db3439a213474ff57b54d))
- **core:** Make save_payment_method as post_update_tracker trait function ([#4307](https://github.com/juspay/hyperswitch/pull/4307)) ([`5f40eee`](https://github.com/juspay/hyperswitch/commit/5f40eee3fa264390ea6ac7feaca7737d83dccb3a))
- **payment_methods:** Store `card_network` in locker ([#4425](https://github.com/juspay/hyperswitch/pull/4425)) ([`5b54d55`](https://github.com/juspay/hyperswitch/commit/5b54d55c5e0d2c8ae1090fb566434efb50120857))
- **voucher:** Remove billing details from voucher pmd ([#4361](https://github.com/juspay/hyperswitch/pull/4361)) ([`2dd0ee6`](https://github.com/juspay/hyperswitch/commit/2dd0ee68bf23e5f49d22011f0294f44f4e97423b))

### Documentation

- **cypress:** Update Cypress README Documentation ([#4380](https://github.com/juspay/hyperswitch/pull/4380)) ([`8ee1a58`](https://github.com/juspay/hyperswitch/commit/8ee1a58c386fc5f08025c6ac90c96468e6d26bc7))
- Add documentation page for building Docker images ([#4457](https://github.com/juspay/hyperswitch/pull/4457)) ([`705e827`](https://github.com/juspay/hyperswitch/commit/705e82779a2b7bfd0cb1cd856b4a760d487cd8c5))

### Miscellaneous Tasks

- **postman:** Update Postman collection files ([`047f917`](https://github.com/juspay/hyperswitch/commit/047f9171a5ae5e8211e18b1c882672dab0c26d07))

**Full Changelog:** [`2024.04.25.0...2024.04.26.0`](https://github.com/juspay/hyperswitch/compare/2024.04.25.0...2024.04.26.0)

- - -

## 2024.04.25.0

### Features
Expand Down
2 changes: 1 addition & 1 deletion config/config.example.toml
Expand Up @@ -487,7 +487,7 @@ debit = { currency = "USD" }

[connector_customer]
connector_list = "gocardless,stax,stripe"
payout_connector_list = "wise"
payout_connector_list = "stripe,wise"

[bank_config.online_banking_fpx]
adyen.banks = "affin_bank,agro_bank,alliance_bank,am_bank,bank_islam,bank_muamalat,bank_rakyat,bank_simpanan_nasional,cimb_bank,hong_leong_bank,hsbc_bank,kuwait_finance_house,maybank,ocbc_bank,public_bank,rhb_bank,standard_chartered_bank,uob_bank"
Expand Down
2 changes: 1 addition & 1 deletion config/development.toml
Expand Up @@ -474,7 +474,7 @@ payme = { payment_method = "card" }

[connector_customer]
connector_list = "gocardless,stax,stripe"
payout_connector_list = "wise"
payout_connector_list = "stripe,wise"

[dummy_connector]
enabled = true
Expand Down
2 changes: 1 addition & 1 deletion config/docker_compose.toml
Expand Up @@ -395,7 +395,7 @@ connector_list = "stripe,adyen,cybersource"

[connector_customer]
connector_list = "gocardless,stax,stripe"
payout_connector_list = "wise"
payout_connector_list = "stripe,wise"

[multiple_api_version_supported_connectors]
supported_connectors = "braintree"
Expand Down
8 changes: 8 additions & 0 deletions crates/api_models/src/enums.rs
Expand Up @@ -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),
Expand Down Expand Up @@ -338,6 +342,7 @@ pub enum AuthenticationConnectors {
#[strum(serialize_all = "snake_case")]
pub enum PayoutConnectors {
Adyen,
Stripe,
Wise,
Paypal,
}
Expand All @@ -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,
}
Expand All @@ -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,
}
Expand All @@ -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)),
Expand Down
12 changes: 12 additions & 0 deletions crates/api_models/src/payments.rs
Expand Up @@ -2825,6 +2825,8 @@ pub struct ThreeDsData {
pub three_ds_authorize_url: String,
/// ThreeDS method details
pub three_ds_method_details: ThreeDsMethodData,
/// Poll config for a connector
pub poll_config: PollConfigResponse,
}

#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, ToSchema)]
Expand All @@ -2841,6 +2843,16 @@ pub enum ThreeDsMethodData {
},
}

#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, ToSchema)]
pub struct PollConfigResponse {
/// Poll Id
pub poll_id: String,
/// Interval of the poll
pub delay_in_secs: i8,
/// Frequency of the poll
pub frequency: i8,
}

#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[serde(untagged)]
Expand Down
41 changes: 41 additions & 0 deletions crates/api_models/src/payouts.rs
Expand Up @@ -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)]
Expand All @@ -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)]
Expand All @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion crates/common_enums/src/enums.rs
Expand Up @@ -2113,6 +2113,7 @@ pub enum PayoutStatus {
RequiresCreation,
RequiresPayoutMethodData,
RequiresFulfillment,
RequiresVendorAccountCreation,
}

#[derive(
Expand Down Expand Up @@ -2249,7 +2250,7 @@ pub enum FrmSuggestion {
#[default]
FrmCancelTransaction,
FrmManualReview,
FrmAutoRefund,
FrmAuthorizeTransaction, // When manual capture payment which was marked fraud and held, when approved needs to be authorized.
}

#[derive(
Expand Down
11 changes: 11 additions & 0 deletions crates/common_utils/src/access_token.rs
@@ -0,0 +1,11 @@
//! Commonly used utilities for access token

use std::fmt::Display;

/// Create a key for fetching the access token from redis
pub fn create_access_token_key(
merchant_id: impl Display,
merchant_connector_id: impl Display,
) -> String {
format!("access_token_{merchant_id}_{merchant_connector_id}")
}
3 changes: 3 additions & 0 deletions crates/common_utils/src/consts.rs
Expand Up @@ -28,6 +28,9 @@ pub fn default_payments_list_limit() -> u32 {
10
}

/// Average delay (in seconds) between account onboarding's API response and the changes to actually reflect at Stripe's end
pub const STRIPE_ACCOUNT_ONBOARDING_DELAY_IN_SECONDS: i64 = 15;

/// Maximum limit for payment link list get api
pub const PAYMENTS_LINK_LIST_LIMIT: u32 = 100;

Expand Down
1 change: 1 addition & 0 deletions crates/common_utils/src/lib.rs
Expand Up @@ -2,6 +2,7 @@
#![warn(missing_docs, missing_debug_implementations)]
#![doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR" ), "/", "README.md"))]

pub mod access_token;
pub mod consts;
pub mod crypto;
pub mod custom_serde;
Expand Down
6 changes: 6 additions & 0 deletions crates/connector_configs/src/common_config.rs
Expand Up @@ -87,6 +87,9 @@ pub struct ApiModelMetaData {
pub merchant_name: Option<String>,
pub acquirer_bin: Option<String>,
pub acquirer_merchant_id: Option<String>,
pub three_ds_requestor_name: Option<String>,
pub three_ds_requestor_id: Option<String>,
pub pull_mechanism_for_external_3ds_enabled: Option<bool>,
}

#[serde_with::skip_serializing_none]
Expand Down Expand Up @@ -185,4 +188,7 @@ pub struct DashboardMetaData {
pub merchant_name: Option<String>,
pub acquirer_bin: Option<String>,
pub acquirer_merchant_id: Option<String>,
pub three_ds_requestor_name: Option<String>,
pub three_ds_requestor_id: Option<String>,
pub pull_mechanism_for_external_3ds_enabled: Option<bool>,
}
3 changes: 3 additions & 0 deletions crates/connector_configs/src/connector.rs
Expand Up @@ -161,6 +161,8 @@ pub struct ConnectorConfig {
pub rapyd: Option<ConnectorTomlConfig>,
pub shift4: Option<ConnectorTomlConfig>,
pub stripe: Option<ConnectorTomlConfig>,
#[cfg(feature = "payouts")]
pub stripe_payout: Option<ConnectorTomlConfig>,
pub signifyd: Option<ConnectorTomlConfig>,
pub trustpay: Option<ConnectorTomlConfig>,
pub threedsecureio: Option<ConnectorTomlConfig>,
Expand Down Expand Up @@ -214,6 +216,7 @@ impl ConnectorConfig {
let connector_data = Self::new()?;
match connector {
PayoutConnectors::Adyen => Ok(connector_data.adyen_payout),
PayoutConnectors::Stripe => Ok(connector_data.stripe_payout),
PayoutConnectors::Wise => Ok(connector_data.wise_payout),
PayoutConnectors::Paypal => Ok(connector_data.paypal),
}
Expand Down
4 changes: 4 additions & 0 deletions crates/connector_configs/src/response_modifier.rs
Expand Up @@ -317,6 +317,10 @@ impl From<ApiModelMetaData> for DashboardMetaData {
merchant_name: api_model.merchant_name,
acquirer_bin: api_model.acquirer_bin,
acquirer_merchant_id: api_model.acquirer_merchant_id,
three_ds_requestor_name: api_model.three_ds_requestor_name,
three_ds_requestor_id: api_model.three_ds_requestor_id,
pull_mechanism_for_external_3ds_enabled: api_model
.pull_mechanism_for_external_3ds_enabled,
}
}
}
Expand Down
14 changes: 12 additions & 2 deletions crates/connector_configs/src/transformer.rs
Expand Up @@ -114,8 +114,8 @@ impl DashboardRequestPayload {
maximum_amount: Some(68607706),
recurring_enabled: true,
installment_payment_enabled: false,
accepted_currencies: None,
accepted_countries: None,
accepted_currencies: method.accepted_currencies,
accepted_countries: method.accepted_countries,
payment_experience: None,
};
card_payment_method_types.push(data)
Expand Down Expand Up @@ -192,6 +192,9 @@ impl DashboardRequestPayload {
merchant_name: None,
acquirer_bin: None,
acquirer_merchant_id: None,
three_ds_requestor_name: None,
three_ds_requestor_id: None,
pull_mechanism_for_external_3ds_enabled: None,
};
let meta_data = match request.metadata {
Some(data) => data,
Expand All @@ -211,6 +214,10 @@ impl DashboardRequestPayload {
let merchant_name = meta_data.merchant_name;
let acquirer_bin = meta_data.acquirer_bin;
let acquirer_merchant_id = meta_data.acquirer_merchant_id;
let three_ds_requestor_name = meta_data.three_ds_requestor_name;
let three_ds_requestor_id = meta_data.three_ds_requestor_id;
let pull_mechanism_for_external_3ds_enabled =
meta_data.pull_mechanism_for_external_3ds_enabled;

Some(ApiModelMetaData {
google_pay,
Expand All @@ -227,6 +234,9 @@ impl DashboardRequestPayload {
merchant_name,
acquirer_bin,
acquirer_merchant_id,
three_ds_requestor_name,
three_ds_requestor_id,
pull_mechanism_for_external_3ds_enabled,
})
}

Expand Down
6 changes: 6 additions & 0 deletions crates/connector_configs/toml/development.toml
Expand Up @@ -2580,6 +2580,12 @@ api_key = "Adyen API Key (Payout creation)"
api_secret = "Adyen Key (Payout submission)"
key1 = "Adyen Account Id"

[stripe_payout]
[[stripe_payout.bank_transfer]]
payment_method_type = "ach"
[stripe_payout.connector_auth.HeaderKey]
api_key = "Stripe API Key"

[wise_payout]
[[wise_payout.bank_transfer]]
payment_method_type = "ach"
Expand Down
6 changes: 6 additions & 0 deletions crates/connector_configs/toml/sandbox.toml
Expand Up @@ -2582,6 +2582,12 @@ api_key = "Adyen API Key (Payout creation)"
api_secret = "Adyen Key (Payout submission)"
key1 = "Adyen Account Id"

[stripe_payout]
[[stripe_payout.bank_transfer]]
payment_method_type = "ach"
[stripe_payout.connector_auth.HeaderKey]
api_key = "Stripe API Key"

[wise_payout]
[[wise_payout.bank_transfer]]
payment_method_type = "ach"
Expand Down
1 change: 1 addition & 0 deletions crates/data_models/src/payments/payment_attempt.rs
Expand Up @@ -303,6 +303,7 @@ pub enum PaymentAttemptUpdate {
currency: storage_enums::Currency,
status: storage_enums::AttemptStatus,
authentication_type: Option<storage_enums::AuthenticationType>,
capture_method: Option<storage_enums::CaptureMethod>,
payment_method: Option<storage_enums::PaymentMethod>,
browser_info: Option<serde_json::Value>,
connector: Option<String>,
Expand Down

0 comments on commit fa597ef

Please sign in to comment.