Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into 6719-bug-mandate-deta…
Browse files Browse the repository at this point in the history
…ils-are-not-persisted-for-adyen-connector
  • Loading branch information
kashif-m committed Dec 2, 2024
2 parents b28645c + 797a0db commit e980b2b
Show file tree
Hide file tree
Showing 36 changed files with 248 additions and 224 deletions.
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,44 @@ All notable changes to HyperSwitch will be documented here.

- - -

## 2024.12.02.1

### Bug Fixes

- **openapi:** Revert Standardise API naming scheme for V2 Dashboard Changes ([#6712](https://github.com/juspay/hyperswitch/pull/6712)) ([`b097d7f`](https://github.com/juspay/hyperswitch/commit/b097d7f5a984b32421494ea033029d01d034fab8))

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

- - -

## 2024.12.02.0

### Features

- **connector:**
- [Adyen] Fetch email from customer email for payment request ([#6676](https://github.com/juspay/hyperswitch/pull/6676)) ([`9998c55`](https://github.com/juspay/hyperswitch/commit/9998c557c9c88496ffbee883e7fc4b76614cff50))
- [REDSYS] add Connector Template Code ([#6659](https://github.com/juspay/hyperswitch/pull/6659)) ([`19cbcdd`](https://github.com/juspay/hyperswitch/commit/19cbcdd979bb74119d80c37c313fd0ffeb58bb8d))
- **payments:** [Payment links] add showCardFormByDefault config for payment links ([#6663](https://github.com/juspay/hyperswitch/pull/6663)) ([`b1d1073`](https://github.com/juspay/hyperswitch/commit/b1d1073389f58c480a53a27be24aa91554520ff1))
- **users:** Add tenant id reads in user roles ([#6661](https://github.com/juspay/hyperswitch/pull/6661)) ([`9212f77`](https://github.com/juspay/hyperswitch/commit/9212f77684b04115332d9be5c3d20bdc56b02160))

### Bug Fixes

- **analytics:** Fix first_attempt filter value parsing for Payments ([#6667](https://github.com/juspay/hyperswitch/pull/6667)) ([`abcaa53`](https://github.com/juspay/hyperswitch/commit/abcaa539eccdae86c7a68fd4ce60ab9889f9fb43))
- **openapi:** Standardise API naming scheme for V2 ([#6510](https://github.com/juspay/hyperswitch/pull/6510)) ([`96393ff`](https://github.com/juspay/hyperswitch/commit/96393ff3d6b11d4726a6cb2224236414507d9848))
- **opensearch:** Handle empty free-text query search in global search ([#6685](https://github.com/juspay/hyperswitch/pull/6685)) ([`b1cdff0`](https://github.com/juspay/hyperswitch/commit/b1cdff0950f32b38e3ff0eeac2b726ba0f671051))
- **router:** Populate card network in the network transaction id based MIT flow ([#6690](https://github.com/juspay/hyperswitch/pull/6690)) ([`6a20701`](https://github.com/juspay/hyperswitch/commit/6a2070172b8d845e6db36b7789defddf8ea4e1e9))
- **users:** Mark user as verified if user logins from SSO ([#6694](https://github.com/juspay/hyperswitch/pull/6694)) ([`880ad1e`](https://github.com/juspay/hyperswitch/commit/880ad1e883fb42f73c2805287e64bc2c2dcbb9f3))

### Refactors

- **currency_conversion:** Release redis lock if api call fails ([#6671](https://github.com/juspay/hyperswitch/pull/6671)) ([`ae7d16e`](https://github.com/juspay/hyperswitch/commit/ae7d16e23699c8ed95a7e2eab7539cfe20f847d0))
- **router:** [ZSL] remove partially capture status ([#6689](https://github.com/juspay/hyperswitch/pull/6689)) ([`0572626`](https://github.com/juspay/hyperswitch/commit/05726262e6a3f6fcb18c0dbe41c18e4d6e84608b))
- **users:** Use domain email type in user DB functions ([#6699](https://github.com/juspay/hyperswitch/pull/6699)) ([`55fe82f`](https://github.com/juspay/hyperswitch/commit/55fe82fdcd78df9608842190f1423088740d1087))

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

- - -

## 2024.11.29.0

### Features
Expand Down
8 changes: 4 additions & 4 deletions api-reference-v2/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -7153,6 +7153,7 @@
"customer_id",
"payment_method_type",
"recurring_enabled",
"created",
"requires_cvv",
"is_default"
],
Expand Down Expand Up @@ -7210,9 +7211,8 @@
"created": {
"type": "string",
"format": "date-time",
"description": "A timestamp (ISO 8601 code) that determines when the customer was created",
"example": "2023-01-18T11:04:09.922Z",
"nullable": true
"description": "A timestamp (ISO 8601 code) that determines when the payment method was created",
"example": "2023-01-18T11:04:09.922Z"
},
"surcharge_details": {
"allOf": [
Expand Down Expand Up @@ -13542,7 +13542,7 @@
"created": {
"type": "string",
"format": "date-time",
"description": "A timestamp (ISO 8601 code) that determines when the customer was created",
"description": "A timestamp (ISO 8601 code) that determines when the payment method was created",
"example": "2023-01-18T11:04:09.922Z",
"nullable": true
},
Expand Down
4 changes: 2 additions & 2 deletions api-reference/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -9739,7 +9739,7 @@
"created": {
"type": "string",
"format": "date-time",
"description": "A timestamp (ISO 8601 code) that determines when the customer was created",
"description": "A timestamp (ISO 8601 code) that determines when the payment method was created",
"example": "2023-01-18T11:04:09.922Z",
"nullable": true
},
Expand Down Expand Up @@ -16326,7 +16326,7 @@
"created": {
"type": "string",
"format": "date-time",
"description": "A timestamp (ISO 8601 code) that determines when the customer was created",
"description": "A timestamp (ISO 8601 code) that determines when the payment method was created",
"example": "2023-01-18T11:04:09.922Z",
"nullable": true
},
Expand Down
14 changes: 7 additions & 7 deletions crates/api_models/src/payment_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ pub struct PaymentMethodResponse {
#[schema(value_type = Option<Object>, example = json!({ "city": "NY", "unit": "245" }))]
pub metadata: Option<pii::SecretSerdeValue>,

/// A timestamp (ISO 8601 code) that determines when the customer was created
/// A timestamp (ISO 8601 code) that determines when the payment method was created
#[schema(value_type = Option<PrimitiveDateTime>, example = "2023-01-18T11:04:09.922Z")]
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
pub created: Option<time::PrimitiveDateTime>,
Expand Down Expand Up @@ -801,7 +801,7 @@ pub struct PaymentMethodResponse {
#[schema(example = true)]
pub recurring_enabled: bool,

/// A timestamp (ISO 8601 code) that determines when the customer was created
/// A timestamp (ISO 8601 code) that determines when the payment method was created
#[schema(value_type = Option<PrimitiveDateTime>, example = "2023-01-18T11:04:09.922Z")]
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
pub created: Option<time::PrimitiveDateTime>,
Expand Down Expand Up @@ -1802,10 +1802,10 @@ pub struct CustomerPaymentMethod {
#[schema(example = json!({"mask": "0000"}))]
pub bank: Option<MaskedBankDetails>,

/// A timestamp (ISO 8601 code) that determines when the customer was created
#[schema(value_type = Option<PrimitiveDateTime>,example = "2023-01-18T11:04:09.922Z")]
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
pub created: Option<time::PrimitiveDateTime>,
/// A timestamp (ISO 8601 code) that determines when the payment method was created
#[schema(value_type = PrimitiveDateTime, example = "2023-01-18T11:04:09.922Z")]
#[serde(with = "common_utils::custom_serde::iso8601")]
pub created: time::PrimitiveDateTime,

/// Surcharge details for this saved card
pub surcharge_details: Option<SurchargeDetailsResponse>,
Expand Down Expand Up @@ -1890,7 +1890,7 @@ pub struct CustomerPaymentMethod {
#[schema(value_type = Option<Object>,example = json!({ "city": "NY", "unit": "245" }))]
pub metadata: Option<pii::SecretSerdeValue>,

/// A timestamp (ISO 8601 code) that determines when the customer was created
/// A timestamp (ISO 8601 code) that determines when the payment method was created
#[schema(value_type = Option<PrimitiveDateTime>,example = "2023-01-18T11:04:09.922Z")]
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
pub created: Option<time::PrimitiveDateTime>,
Expand Down
4 changes: 2 additions & 2 deletions crates/common_utils/src/id_type/global_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ pub(crate) enum GlobalIdError {
impl GlobalId {
/// Create a new global id from entity and cell information
/// The entity prefix is used to identify the entity, `cus` for customers, `pay`` for payments etc.
pub fn generate(cell_id: CellId, entity: GlobalEntity) -> Self {
pub fn generate(cell_id: &CellId, entity: GlobalEntity) -> Self {
let prefix = format!("{}_{}", cell_id.get_string_repr(), entity.prefix());
let id = generate_time_ordered_id(&prefix);
let alphanumeric_id = AlphaNumericId::new_unchecked(id);
Expand Down Expand Up @@ -201,7 +201,7 @@ mod global_id_tests {
let cell_id_string = "12345";
let entity = GlobalEntity::Customer;
let cell_id = CellId::from_str(cell_id_string).unwrap();
let global_id = GlobalId::generate(cell_id, entity);
let global_id = GlobalId::generate(&cell_id, entity);

/// Generate a regex for globalid
/// Eg - 12abc_cus_abcdefghijklmnopqrstuvwxyz1234567890
Expand Down
4 changes: 2 additions & 2 deletions crates/common_utils/src/id_type/global_id/payment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl GlobalPaymentId {
}

/// Generate a new GlobalPaymentId from a cell id
pub fn generate(cell_id: crate::id_type::CellId) -> Self {
pub fn generate(cell_id: &crate::id_type::CellId) -> Self {
let global_id = super::GlobalId::generate(cell_id, super::GlobalEntity::Payment);
Self(global_id)
}
Expand Down Expand Up @@ -57,7 +57,7 @@ crate::impl_to_sql_from_sql_global_id_type!(GlobalAttemptId);
impl GlobalAttemptId {
/// Generate a new GlobalAttemptId from a cell id
pub fn generate(cell_id: &super::CellId) -> Self {
let global_id = super::GlobalId::generate(cell_id.clone(), super::GlobalEntity::Attempt);
let global_id = super::GlobalId::generate(cell_id, super::GlobalEntity::Attempt);
Self(global_id)
}

Expand Down
5 changes: 1 addition & 4 deletions crates/common_utils/src/id_type/global_id/payment_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ pub enum GlobalPaymentMethodIdError {

impl GlobalPaymentMethodId {
/// Create a new GlobalPaymentMethodId from cell id information
pub fn generate(cell_id: &str) -> error_stack::Result<Self, GlobalPaymentMethodIdError> {
let cell_id = CellId::from_str(cell_id)
.change_context(GlobalPaymentMethodIdError::ConstructionError)
.attach_printable("Failed to construct CellId from str")?;
pub fn generate(cell_id: &CellId) -> error_stack::Result<Self, GlobalPaymentMethodIdError> {
let global_id = GlobalId::generate(cell_id, GlobalEntity::PaymentMethod);
Ok(Self(global_id))
}
Expand Down
2 changes: 1 addition & 1 deletion crates/common_utils/src/id_type/global_id/refunds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl GlobalRefundId {
}

/// Generate a new GlobalRefundId from a cell id
pub fn generate(cell_id: crate::id_type::CellId) -> Self {
pub fn generate(cell_id: &crate::id_type::CellId) -> Self {
let global_id = super::GlobalId::generate(cell_id, super::GlobalEntity::Refund);
Self(global_id)
}
Expand Down
7 changes: 3 additions & 4 deletions crates/hyperswitch_domain_models/src/payment_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use masking::{PeekInterface, Secret};
use time::PrimitiveDateTime;

#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
use crate::type_encryption::EncryptedJsonType;
use crate::type_encryption::OptionalEncryptableJsonType;
use crate::type_encryption::{crypto_operation, AsyncLift, CryptoOperation};

#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
Expand Down Expand Up @@ -80,9 +80,8 @@ pub struct PaymentMethod {
pub last_modified: PrimitiveDateTime,
pub payment_method_type: Option<storage_enums::PaymentMethod>,
pub payment_method_subtype: Option<storage_enums::PaymentMethodType>,
pub payment_method_data: Option<
Encryptable<Secret<EncryptedJsonType<api_models::payment_methods::PaymentMethodsData>>>,
>,
pub payment_method_data:
OptionalEncryptableJsonType<api_models::payment_methods::PaymentMethodsData>,
pub locker_id: Option<VaultId>,
pub last_used_at: PrimitiveDateTime,
pub connector_mandate_details: Option<diesel_models::PaymentsMandateReference>,
Expand Down
Loading

0 comments on commit e980b2b

Please sign in to comment.