Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/juspay/hyperswitch into fea…
Browse files Browse the repository at this point in the history
…t/sdk_analytics_load_time_metrics
  • Loading branch information
vsrivatsa-juspay committed Apr 9, 2024
2 parents f50fd98 + 06440eb commit 97158e2
Show file tree
Hide file tree
Showing 83 changed files with 3,533 additions and 1,350 deletions.
47 changes: 47 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,53 @@ All notable changes to HyperSwitch will be documented here.

- - -

## 2024.04.08.0

### Features

- **users:** Implemented cookie parsing for auth ([#4298](https://github.com/juspay/hyperswitch/pull/4298)) ([`2d394f9`](https://github.com/juspay/hyperswitch/commit/2d394f98e96d0beafca24abe2ac9f10a05460993))

### Bug Fixes

- **locker:** Handle card duplication in payouts flow ([#4013](https://github.com/juspay/hyperswitch/pull/4013)) ([`2fac436`](https://github.com/juspay/hyperswitch/commit/2fac436683060b8e7c81b210dfdf468f5194f24c))
- **mandates:** Store network transaction id only when `pg_agnostic` config is enabled in the `authorize_flow` ([#4318](https://github.com/juspay/hyperswitch/pull/4318)) ([`7b4c4fe`](https://github.com/juspay/hyperswitch/commit/7b4c4fea332d56f81a73b496fa0fefdbb64b3648))
- **redis_interface:** Remove mget function from redis interface ([#4303](https://github.com/juspay/hyperswitch/pull/4303)) ([`14035d2`](https://github.com/juspay/hyperswitch/commit/14035d2f838d88c56fe37f78caab6c88bc8b33e4))

### Refactors

- **payment_methods:** Add PayLater payment method data to new domain type to be used in connector module ([#4165](https://github.com/juspay/hyperswitch/pull/4165)) ([`6694852`](https://github.com/juspay/hyperswitch/commit/669485275db192b0e8e30f3528c0d61150d91847))

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

- - -

## 2024.04.05.0

### Features

- **payout-events:** Add kafka events for payout analytics ([#4211](https://github.com/juspay/hyperswitch/pull/4211)) ([`bc25f3f`](https://github.com/juspay/hyperswitch/commit/bc25f3fa40e807cc92d2d53a2287b92eff727d3c))
- **router:**
- Store `network_reference_id` against the `payment_method_id` in the `payment_method_table` ([#4041](https://github.com/juspay/hyperswitch/pull/4041)) ([`21e2d78`](https://github.com/juspay/hyperswitch/commit/21e2d78117a9e25708b8c6a2280f6a836ee86072))
- Use `NTID` in `MIT` payments if the `pg_agnostic_mit` config is enabled ([#4113](https://github.com/juspay/hyperswitch/pull/4113)) ([`b58d7a8`](https://github.com/juspay/hyperswitch/commit/b58d7a8e62eef9880f717731063101bf92af3f34))
- Add NTID flow for cybersource ([#4193](https://github.com/juspay/hyperswitch/pull/4193)) ([`071462f`](https://github.com/juspay/hyperswitch/commit/071462f2af8efeb16e48d351bbae68fd2fd64179))
- **webhooks:** Allow manually retrying delivery of outgoing webhooks ([#4176](https://github.com/juspay/hyperswitch/pull/4176)) ([`63d2b68`](https://github.com/juspay/hyperswitch/commit/63d2b6855acee1adeae2efff10f424e056af0bcb))

### Bug Fixes

- **payouts:** Persist status updates in payouts table ([#4280](https://github.com/juspay/hyperswitch/pull/4280)) ([`02ffe7e`](https://github.com/juspay/hyperswitch/commit/02ffe7e48068a43d319d67e0e976420d201776db))

### Refactors

- **connector:**
- [Multisafepay] handle authorize and psync 2xx failure error response ([#4124](https://github.com/juspay/hyperswitch/pull/4124)) ([`9ebe0f4`](https://github.com/juspay/hyperswitch/commit/9ebe0f4371f13c7527972242424af2d926c84b5e))
- Add support for GooglePay recurring payments ([#4300](https://github.com/juspay/hyperswitch/pull/4300)) ([`622aac3`](https://github.com/juspay/hyperswitch/commit/622aac3015e95de55e83abd047b5c680ecd8d662))
- **core:** Log the appropriate error message if the card fails to get saved in locker ([#4296](https://github.com/juspay/hyperswitch/pull/4296)) ([`9de3cdb`](https://github.com/juspay/hyperswitch/commit/9de3cdb7d37dd1d18c6a84368e70ceb52b7ae53a))
- **payment_link:** Decouple shimmer css from main payment_link css for better performance ([#4286](https://github.com/juspay/hyperswitch/pull/4286)) ([`9453e8f`](https://github.com/juspay/hyperswitch/commit/9453e8fcfac49fc399343ee7c4c1598412b370c7))

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

- - -

## 2024.04.04.0

### Features
Expand Down
1 change: 1 addition & 0 deletions config/config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ cryptopay.base_url = "https://business-sandbox.cryptopay.me"
cybersource.base_url = "https://apitest.cybersource.com/"
dlocal.base_url = "https://sandbox.dlocal.com/"
dummyconnector.base_url = "http://localhost:8080/dummy-connector"
ebanx.base_url = "https://sandbox.ebanxpay.com/"
fiserv.base_url = "https://cert.api.fiservapps.com/"
forte.base_url = "https://sandbox.forte.net/api/v3"
globalpay.base_url = "https://apis.sandbox.globalpay.com/ucp/"
Expand Down
1 change: 1 addition & 0 deletions config/deployments/production.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ cryptopay.base_url = "https://business.cryptopay.me/"
cybersource.base_url = "https://api.cybersource.com/"
dlocal.base_url = "https://sandbox.dlocal.com/"
dummyconnector.base_url = "http://localhost:8080/dummy-connector"
ebanx.base_url = "https://sandbox.ebanxpay.com/"
fiserv.base_url = "https://cert.api.fiservapps.com/"
forte.base_url = "https://sandbox.forte.net/api/v3"
globalpay.base_url = "https://apis.sandbox.globalpay.com/ucp/"
Expand Down
1 change: 1 addition & 0 deletions config/deployments/sandbox.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ cryptopay.base_url = "https://business-sandbox.cryptopay.me"
cybersource.base_url = "https://apitest.cybersource.com/"
dlocal.base_url = "https://sandbox.dlocal.com/"
dummyconnector.base_url = "http://localhost:8080/dummy-connector"
ebanx.base_url = "https://sandbox.ebanxpay.com/"
fiserv.base_url = "https://cert.api.fiservapps.com/"
forte.base_url = "https://sandbox.forte.net/api/v3"
globalpay.base_url = "https://apis.sandbox.globalpay.com/ucp/"
Expand Down
2 changes: 2 additions & 0 deletions config/development.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ cards = [
"cybersource",
"dlocal",
"dummyconnector",
"ebanx",
"fiserv",
"forte",
"globalpay",
Expand Down Expand Up @@ -181,6 +182,7 @@ cryptopay.base_url = "https://business-sandbox.cryptopay.me"
cybersource.base_url = "https://apitest.cybersource.com/"
dlocal.base_url = "https://sandbox.dlocal.com/"
dummyconnector.base_url = "http://localhost:8080/dummy-connector"
ebanx.base_url = "https://sandbox.ebanxpay.com/"
fiserv.base_url = "https://cert.api.fiservapps.com/"
forte.base_url = "https://sandbox.forte.net/api/v3"
globalpay.base_url = "https://apis.sandbox.globalpay.com/ucp/"
Expand Down
2 changes: 2 additions & 0 deletions config/docker_compose.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ cryptopay.base_url = "https://business-sandbox.cryptopay.me"
cybersource.base_url = "https://apitest.cybersource.com/"
dlocal.base_url = "https://sandbox.dlocal.com/"
dummyconnector.base_url = "http://localhost:8080/dummy-connector"
ebanx.base_url = "https://sandbox.ebanxpay.com/"
fiserv.base_url = "https://cert.api.fiservapps.com/"
forte.base_url = "https://sandbox.forte.net/api/v3"
globalpay.base_url = "https://apis.sandbox.globalpay.com/ucp/"
Expand Down Expand Up @@ -189,6 +190,7 @@ cards = [
"cybersource",
"dlocal",
"dummyconnector",
"ebanx",
"fiserv",
"forte",
"globalpay",
Expand Down
1 change: 1 addition & 0 deletions crates/api_models/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ pub enum Connector {
Cryptopay,
Cybersource,
Dlocal,
// Ebanx,
Fiserv,
Forte,
Globalpay,
Expand Down
30 changes: 17 additions & 13 deletions crates/api_models/src/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub struct BankData {

#[derive(serde::Deserialize)]
pub struct BankCodeInformation {
pub bank_name: api_enums::BankNames,
pub bank_name: common_enums::BankNames,
pub connector_codes: Vec<ConnectorCode>,
}

Expand All @@ -51,7 +51,7 @@ pub struct ConnectorCode {

#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema, PartialEq, Eq)]
pub struct BankCodeResponse {
pub bank_name: Vec<api_enums::BankNames>,
pub bank_name: Vec<common_enums::BankNames>,
pub eligible_connectors: Vec<String>,
}

Expand Down Expand Up @@ -1465,6 +1465,7 @@ impl GetPaymentMethodType for BankTransferData {
Self::MandiriVaBankTransfer { .. } => api_enums::PaymentMethodType::MandiriVa,
Self::Pix {} => api_enums::PaymentMethodType::Pix,
Self::Pse {} => api_enums::PaymentMethodType::Pse,
Self::LocalBankTransfer { .. } => api_enums::PaymentMethodType::LocalBankTransfer,
}
}
}
Expand Down Expand Up @@ -1571,7 +1572,7 @@ pub struct AdditionalCardInfo {
pub enum AdditionalPaymentData {
Card(Box<AdditionalCardInfo>),
BankRedirect {
bank_name: Option<api_enums::BankNames>,
bank_name: Option<common_enums::BankNames>,
},
Wallet {
apple_pay: Option<ApplepayPaymentMethod>,
Expand Down Expand Up @@ -1622,7 +1623,7 @@ pub enum BankRedirectData {

/// The hyperswitch bank code for eps
#[schema(value_type = BankNames, example = "triodos_bank")]
bank_name: Option<api_enums::BankNames>,
bank_name: Option<common_enums::BankNames>,

/// The country for bank payment
#[schema(value_type = CountryAlpha2, example = "US")]
Expand Down Expand Up @@ -1651,7 +1652,7 @@ pub enum BankRedirectData {

/// The hyperswitch bank code for ideal
#[schema(value_type = BankNames, example = "abn_amro")]
bank_name: Option<api_enums::BankNames>,
bank_name: Option<common_enums::BankNames>,

/// The country for bank payment
#[schema(value_type = CountryAlpha2, example = "US")]
Expand All @@ -1668,7 +1669,7 @@ pub enum BankRedirectData {
OnlineBankingCzechRepublic {
// Issuer banks
#[schema(value_type = BankNames)]
issuer: api_enums::BankNames,
issuer: common_enums::BankNames,
},
OnlineBankingFinland {
// Shopper Email
Expand All @@ -1678,25 +1679,25 @@ pub enum BankRedirectData {
OnlineBankingPoland {
// Issuer banks
#[schema(value_type = BankNames)]
issuer: api_enums::BankNames,
issuer: common_enums::BankNames,
},
OnlineBankingSlovakia {
// Issuer value corresponds to the bank
#[schema(value_type = BankNames)]
issuer: api_enums::BankNames,
issuer: common_enums::BankNames,
},
OpenBankingUk {
// Issuer banks
#[schema(value_type = BankNames)]
issuer: Option<api_enums::BankNames>,
issuer: Option<common_enums::BankNames>,
/// The country for bank payment
#[schema(value_type = CountryAlpha2, example = "US")]
country: Option<api_enums::CountryAlpha2>,
},
Przelewy24 {
//Issuer banks
#[schema(value_type = Option<BankNames>)]
bank_name: Option<api_enums::BankNames>,
bank_name: Option<common_enums::BankNames>,

// The billing details for bank redirect
billing_details: BankRedirectBilling,
Expand All @@ -1721,11 +1722,11 @@ pub enum BankRedirectData {
OnlineBankingFpx {
// Issuer banks
#[schema(value_type = BankNames)]
issuer: api_enums::BankNames,
issuer: common_enums::BankNames,
},
OnlineBankingThailand {
#[schema(value_type = BankNames)]
issuer: api_enums::BankNames,
issuer: common_enums::BankNames,
},
}

Expand Down Expand Up @@ -2029,6 +2030,9 @@ pub enum BankTransferData {
},
Pix {},
Pse {},
LocalBankTransfer {
bank_code: Option<String>,
},
}

impl GetAddressFromPaymentMethodData for BankTransferData {
Expand Down Expand Up @@ -2079,7 +2083,7 @@ impl GetAddressFromPaymentMethodData for BankTransferData {
phone: None,
email: Some(billing_details.email.clone()),
}),
Self::Pix {} | Self::Pse {} => None,
Self::LocalBankTransfer { .. } | Self::Pix {} | Self::Pse {} => None,
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions crates/api_models/src/payouts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,6 @@ pub struct PayoutAttemptResponse {
pub connector_transaction_id: Option<String>,
/// If the payout was cancelled the reason provided here
pub cancellation_reason: Option<String>,
/// Provide a reference to a stored payout method
pub payout_token: Option<String>,
/// error code unified across the connectors is received here if there was an error while calling connector
pub unified_code: Option<String>,
/// error message unified across the connectors is received here if there was an error while calling connector
Expand Down
3 changes: 3 additions & 0 deletions crates/common_enums/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::num::{ParseFloatError, TryFromIntError};

use serde::{Deserialize, Serialize};
use utoipa::ToSchema;

#[doc(hidden)]
pub mod diesel_exports {
pub use super::{
Expand Down Expand Up @@ -127,6 +128,7 @@ pub enum RoutableConnectors {
Cryptopay,
Cybersource,
Dlocal,
// Ebanx,
Fiserv,
Forte,
Globalpay,
Expand Down Expand Up @@ -1421,6 +1423,7 @@ pub enum PaymentMethodType {
FamilyMart,
Seicomart,
PayEasy,
LocalBankTransfer,
}

/// Indicates the type of payment method. Eg: 'card', 'wallet', etc.
Expand Down
1 change: 1 addition & 0 deletions crates/common_enums/src/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1842,6 +1842,7 @@ impl From<PaymentMethodType> for PaymentMethod {
PaymentMethodType::PermataBankTransfer => Self::BankTransfer,
PaymentMethodType::Pix => Self::BankTransfer,
PaymentMethodType::Pse => Self::BankTransfer,
PaymentMethodType::LocalBankTransfer => Self::BankTransfer,
PaymentMethodType::PayBright => Self::PayLater,
PaymentMethodType::Paypal => Self::Wallet,
PaymentMethodType::PaySafeCard => Self::GiftCard,
Expand Down
16 changes: 13 additions & 3 deletions crates/data_models/src/payouts/payouts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ pub trait PayoutsInterface {
_merchant_id: &str,
_filters: &PayoutFetchConstraints,
_storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<Vec<(Payouts, PayoutAttempt)>, errors::StorageError>;
) -> error_stack::Result<
Vec<(Payouts, PayoutAttempt, diesel_models::Customer)>,
errors::StorageError,
>;

#[cfg(feature = "olap")]
async fn filter_payouts_by_time_range_constraints(
Expand Down Expand Up @@ -155,14 +158,17 @@ pub enum PayoutsUpdate {
status: Option<storage_enums::PayoutStatus>,
},
PayoutMethodIdUpdate {
payout_method_id: Option<String>,
payout_method_id: String,
},
RecurringUpdate {
recurring: bool,
},
AttemptCountUpdate {
attempt_count: i16,
},
StatusUpdate {
status: storage_enums::PayoutStatus,
},
}

#[derive(Clone, Debug, Default)]
Expand Down Expand Up @@ -212,7 +218,7 @@ impl From<PayoutsUpdate> for PayoutsUpdateInternal {
..Default::default()
},
PayoutsUpdate::PayoutMethodIdUpdate { payout_method_id } => Self {
payout_method_id,
payout_method_id: Some(payout_method_id),
..Default::default()
},
PayoutsUpdate::RecurringUpdate { recurring } => Self {
Expand All @@ -223,6 +229,10 @@ impl From<PayoutsUpdate> for PayoutsUpdateInternal {
attempt_count: Some(attempt_count),
..Default::default()
},
PayoutsUpdate::StatusUpdate { status } => Self {
status: Some(status),
..Default::default()
},
}
}
}
11 changes: 9 additions & 2 deletions crates/diesel_models/src/payouts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,17 @@ pub enum PayoutsUpdate {
status: Option<storage_enums::PayoutStatus>,
},
PayoutMethodIdUpdate {
payout_method_id: Option<String>,
payout_method_id: String,
},
RecurringUpdate {
recurring: bool,
},
AttemptCountUpdate {
attempt_count: i16,
},
StatusUpdate {
status: storage_enums::PayoutStatus,
},
}

#[derive(Clone, Debug, AsChangeset, router_derive::DebugAsDisplay)]
Expand Down Expand Up @@ -168,7 +171,7 @@ impl From<PayoutsUpdate> for PayoutsUpdateInternal {
..Default::default()
},
PayoutsUpdate::PayoutMethodIdUpdate { payout_method_id } => Self {
payout_method_id,
payout_method_id: Some(payout_method_id),
..Default::default()
},
PayoutsUpdate::RecurringUpdate { recurring } => Self {
Expand All @@ -179,6 +182,10 @@ impl From<PayoutsUpdate> for PayoutsUpdateInternal {
attempt_count: Some(attempt_count),
..Default::default()
},
PayoutsUpdate::StatusUpdate { status } => Self {
status: Some(status),
..Default::default()
},
}
}
}
Expand Down
1 change: 1 addition & 0 deletions crates/euclid/src/frontend/dir/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ pub enum BankTransferType {
PermataBankTransfer,
Pix,
Pse,
LocalBankTransfer,
}

#[derive(
Expand Down
1 change: 1 addition & 0 deletions crates/euclid/src/frontend/dir/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ impl From<enums::BankTransferType> for global_enums::PaymentMethodType {
enums::BankTransferType::DanamonVa => Self::DanamonVa,
enums::BankTransferType::MandiriVa => Self::MandiriVa,
enums::BankTransferType::PermataBankTransfer => Self::PermataBankTransfer,
enums::BankTransferType::LocalBankTransfer => Self::LocalBankTransfer,
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions crates/euclid/src/frontend/dir/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ impl IntoDirValue for (global_enums::PaymentMethodType, global_enums::PaymentMet
global_enums::PaymentMethodType::DanamonVa => Ok(dirval!(BankTransferType = DanamonVa)),
global_enums::PaymentMethodType::Indomaret => Ok(dirval!(VoucherType = Indomaret)),
global_enums::PaymentMethodType::MandiriVa => Ok(dirval!(BankTransferType = MandiriVa)),
global_enums::PaymentMethodType::LocalBankTransfer => {
Ok(dirval!(BankTransferType = LocalBankTransfer))
}
global_enums::PaymentMethodType::PermataBankTransfer => {
Ok(dirval!(BankTransferType = PermataBankTransfer))
}
Expand Down

0 comments on commit 97158e2

Please sign in to comment.