Skip to content

Commit

Permalink
Merge branch 'main' into confirm-and-authorization-api-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hrithikesh026 authored Mar 12, 2024
2 parents 8887a03 + 45ed56f commit 3013d8e
Show file tree
Hide file tree
Showing 38 changed files with 880 additions and 268 deletions.
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,46 @@ All notable changes to HyperSwitch will be documented here.

- - -

## 2024.03.12.0

### Refactors

- **core:** Status handling for payment_method_status ([#3965](https://github.com/juspay/hyperswitch/pull/3965)) ([`e87f2ea`](https://github.com/juspay/hyperswitch/commit/e87f2ea8c5669473940df8bc2f5c61fdf3f218ff))

### Miscellaneous Tasks

- Add threedsecureio base url in deployment config files ([#4039](https://github.com/juspay/hyperswitch/pull/4039)) ([`d9f8423`](https://github.com/juspay/hyperswitch/commit/d9f84232a4a29814a1f9a792ebc74923862a1da6))

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

- - -

## 2024.03.11.1

### Features

- **router:** Add routing support for token-based mit payments ([#4012](https://github.com/juspay/hyperswitch/pull/4012)) ([`43ebfbc`](https://github.com/juspay/hyperswitch/commit/43ebfbc47f03eaaaf274847290861dcb00db26a5))
- **users:** Implemented Set-Cookie ([#3865](https://github.com/juspay/hyperswitch/pull/3865)) ([`44eef46`](https://github.com/juspay/hyperswitch/commit/44eef46e5d7f0a198be80602ceae1c843449319c))

### Refactors

- **connector:**
- [Multisafepay] Mask PII data ([#3869](https://github.com/juspay/hyperswitch/pull/3869)) ([`c2b1561`](https://github.com/juspay/hyperswitch/commit/c2b15615e3c61e6f497180be8fa66d008ed150bb))
- [Globalpay] Mask PII data ([#3840](https://github.com/juspay/hyperswitch/pull/3840)) ([`13f6d6c`](https://github.com/juspay/hyperswitch/commit/13f6d6c10ce421329a7eb8b494fbb3bd31aed91f))
- [Iatapay] Mask PII data ([#3850](https://github.com/juspay/hyperswitch/pull/3850)) ([`bd7accb`](https://github.com/juspay/hyperswitch/commit/bd7accb2c250b5f330b6bbb87f6f6edf4a479a61))
- [Payme][Payeezy] Mask PII data ([#3926](https://github.com/juspay/hyperswitch/pull/3926)) ([`ffcb2bc`](https://github.com/juspay/hyperswitch/commit/ffcb2bcf2b7a26d8fc7fc45f9878d41ba74d2fe0))
- [Nexinets] Mask PII data ([#3874](https://github.com/juspay/hyperswitch/pull/3874)) ([`9ea5310`](https://github.com/juspay/hyperswitch/commit/9ea531068d87b76e8f41ee7d9e9d26fd755bced4))
- [Noon] Mask PII data ([#3879](https://github.com/juspay/hyperswitch/pull/3879)) ([`96efc2a`](https://github.com/juspay/hyperswitch/commit/96efc2abf94e3e9174f625bee2270236bad50278))
- [stripe] capture error_code and error_message for psync ([#3771](https://github.com/juspay/hyperswitch/pull/3771)) ([`614182a`](https://github.com/juspay/hyperswitch/commit/614182ae4cdc7a762e0ce90d1336b1ff16fc9fa3))
- [Trustpay][Volt] Mask PII data ([#3932](https://github.com/juspay/hyperswitch/pull/3932)) ([`a179b9c`](https://github.com/juspay/hyperswitch/commit/a179b9c90c2b9a419f1ce394d06158f80c29ee45))
- [Nuvie] Mask PII data ([#3924](https://github.com/juspay/hyperswitch/pull/3924)) ([`6b2f71c`](https://github.com/juspay/hyperswitch/commit/6b2f71c850ff2ea36365375a81a7026fd8c87ebc))
- [adyen] add more fields in the payments request ([#4010](https://github.com/juspay/hyperswitch/pull/4010)) ([`5584f11`](https://github.com/juspay/hyperswitch/commit/5584f1131ae4180020be23d4c735b8356482c22d))
- **core:** Updated payments response with payment_method_id & payment_method_status ([#3883](https://github.com/juspay/hyperswitch/pull/3883)) ([`7391416`](https://github.com/juspay/hyperswitch/commit/7391416e2473eab0474bd01bb155a9ecc96da263))

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

- - -

## 2024.03.11.0

### Features
Expand Down
2 changes: 1 addition & 1 deletion config/deployments/production.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ payout_connector_list = "wise"

[connectors]
aci.base_url = "https://eu-test.oppwa.com/"
adyen.base_url = "https://{{merchant_endpoint_prefix}}-checkout-live.adyenpayments.com/"
adyen.base_url = "https://{{merchant_endpoint_prefix}}-checkout-live.adyenpayments.com/checkout"
adyen.secondary_base_url = "https://{{merchant_endpoint_prefix}}-pal-live.adyenpayments.com/"
airwallex.base_url = "https://api-demo.airwallex.com/"
applepay.base_url = "https://apple-pay-gateway.apple.com/"
Expand Down
8 changes: 4 additions & 4 deletions config/development.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ vault_private_key = ""
tunnel_private_key = ""

[connectors.supported]
wallets = ["klarna", "braintree", "applepay"]
wallets = ["klarna", "braintree", "applepay", "adyen"]
rewards = ["cashtocode", "zen"]
cards = [
"aci",
Expand Down Expand Up @@ -323,8 +323,8 @@ pay_bright = { country = "CA", currency = "CAD" }
walley = { country = "SE,NO,DK,FI", currency = "DKK,EUR,NOK,SEK" }
giropay = { country = "DE", currency = "EUR" }
eps = { country = "AT", currency = "EUR" }
sofort = { country = "AT,BE,DE,ES,CH,NL", currency = "CHF,EUR"}
ideal = { country = "NL", currency = "EUR" }
sofort = {not_available_flows = { capture_method = "manual" }, country = "AT,BE,DE,ES,CH,NL", currency = "CHF,EUR"}
ideal = { not_available_flows = { capture_method = "manual" }, country = "NL", currency = "EUR" }
blik = {country = "PL", currency = "PLN"}
trustly = {country = "ES,GB,SE,NO,AT,NL,DE,DK,FI,EE,LT,LV", currency = "CZK,DKK,EUR,GBP,NOK,SEK"}
online_banking_czech_republic = {country = "CZ", currency = "EUR,CZK"}
Expand Down Expand Up @@ -581,4 +581,4 @@ enabled = true
file_storage_backend = "file_system"

[unmasked_headers]
keys = "user-agent"
keys = "user-agent"
4 changes: 2 additions & 2 deletions crates/api_models/src/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ pub enum MandateTransactionType {

#[derive(Default, Eq, PartialEq, Debug, serde::Deserialize, serde::Serialize, Clone)]
pub struct MandateIds {
pub mandate_id: String,
pub mandate_id: Option<String>,
pub mandate_reference_id: Option<MandateReferenceId>,
}

Expand All @@ -767,7 +767,7 @@ pub struct UpdateHistory {
impl MandateIds {
pub fn new(mandate_id: String) -> Self {
Self {
mandate_id,
mandate_id: Some(mandate_id),
mandate_reference_id: None,
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/diesel_models/src/customers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ pub struct CustomerUpdateInternal {
pub modified_at: Option<PrimitiveDateTime>,
pub connector_customer: Option<serde_json::Value>,
pub address_id: Option<String>,
pub default_payment_method_id: Option<String>,
pub default_payment_method_id: Option<Option<String>>,
}
13 changes: 13 additions & 0 deletions crates/diesel_models/src/payment_method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ pub enum PaymentMethodUpdate {
LastUsedUpdate {
last_used_at: PrimitiveDateTime,
},
StatusUpdate {
status: Option<storage_enums::PaymentMethodStatus>,
},
}

#[derive(Clone, Debug, Default, AsChangeset, router_derive::DebugAsDisplay)]
Expand All @@ -131,6 +134,7 @@ pub struct PaymentMethodUpdateInternal {
metadata: Option<serde_json::Value>,
payment_method_data: Option<Encryption>,
last_used_at: Option<PrimitiveDateTime>,
status: Option<storage_enums::PaymentMethodStatus>,
}

impl PaymentMethodUpdateInternal {
Expand All @@ -148,18 +152,27 @@ impl From<PaymentMethodUpdate> for PaymentMethodUpdateInternal {
metadata,
payment_method_data: None,
last_used_at: None,
status: None,
},
PaymentMethodUpdate::PaymentMethodDataUpdate {
payment_method_data,
} => Self {
metadata: None,
payment_method_data,
last_used_at: None,
status: None,
},
PaymentMethodUpdate::LastUsedUpdate { last_used_at } => Self {
metadata: None,
payment_method_data: None,
last_used_at: Some(last_used_at),
status: None,
},
PaymentMethodUpdate::StatusUpdate { status } => Self {
metadata: None,
payment_method_data: None,
last_used_at: None,
status,
},
}
}
Expand Down
1 change: 1 addition & 0 deletions crates/diesel_models/src/query/generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ pub mod db_metrics {
DeleteWithResult,
UpdateWithResults,
UpdateOne,
Count,
}

#[inline]
Expand Down
35 changes: 34 additions & 1 deletion crates/diesel_models/src/query/payment_method.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods, Table};
use async_bb8_diesel::AsyncRunQueryDsl;
use diesel::{
associations::HasTable, debug_query, pg::Pg, BoolExpressionMethods, ExpressionMethods,
QueryDsl, Table,
};
use error_stack::{IntoReport, ResultExt};

use super::generics;
use crate::{
Expand Down Expand Up @@ -96,6 +101,34 @@ impl PaymentMethod {
.await
}

pub async fn get_count_by_customer_id_merchant_id_status(
conn: &PgPooledConn,
customer_id: &str,
merchant_id: &str,
status: common_enums::PaymentMethodStatus,
) -> StorageResult<i64> {
let filter = <Self as HasTable>::table()
.count()
.filter(
dsl::customer_id
.eq(customer_id.to_owned())
.and(dsl::merchant_id.eq(merchant_id.to_owned()))
.and(dsl::status.eq(status.to_owned())),
)
.into_boxed();

router_env::logger::debug!(query = %debug_query::<Pg, _>(&filter).to_string());

generics::db_metrics::track_database_call::<<Self as HasTable>::Table, _, _>(
filter.get_result_async::<i64>(conn),
generics::db_metrics::DatabaseOperation::Count,
)
.await
.into_report()
.change_context(errors::DatabaseError::Others)
.attach_printable("Failed to get a count of payment methods")
}

pub async fn find_by_customer_id_merchant_id_status(
conn: &PgPooledConn,
customer_id: &str,
Expand Down
Loading

0 comments on commit 3013d8e

Please sign in to comment.