Skip to content

Commit

Permalink
refactor(payment_attempt_v2): add payment attempt v2 domain and diese…
Browse files Browse the repository at this point in the history
…l models (juspay#6027)

Co-authored-by: hrithikesh026 <[email protected]>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 27, 2024
1 parent 354f530 commit c7bb9cc
Show file tree
Hide file tree
Showing 56 changed files with 2,589 additions and 1,996 deletions.
1 change: 0 additions & 1 deletion crates/api_models/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ recon = []
v1 = ["common_utils/v1"]
v2 = ["common_utils/v2", "customer_v2"]
customer_v2 = ["common_utils/customer_v2"]
payment_v2 = []
payment_methods_v2 = ["common_utils/payment_methods_v2"]

[dependencies]
Expand Down
1 change: 0 additions & 1 deletion crates/diesel_models/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ kv_store = []
v1 = []
v2 = []
customer_v2 = []
payment_v2 = []
payment_methods_v2 = []

[dependencies]
Expand Down
6 changes: 3 additions & 3 deletions crates/diesel_models/src/kv.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use error_stack::ResultExt;
use serde::{Deserialize, Serialize};

#[cfg(all(feature = "v2", feature = "payment_v2"))]
#[cfg(feature = "v2")]
use crate::payment_attempt::PaymentAttemptUpdateInternal;
use crate::{
address::{Address, AddressNew, AddressUpdateInternal},
Expand Down Expand Up @@ -111,11 +111,11 @@ impl DBOperation {
Updateable::PaymentIntentUpdate(a) => {
DBResult::PaymentIntent(Box::new(a.orig.update(conn, a.update_data).await?))
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "payment_v2")))]
#[cfg(feature = "v1")]
Updateable::PaymentAttemptUpdate(a) => DBResult::PaymentAttempt(Box::new(
a.orig.update_with_attempt_id(conn, a.update_data).await?,
)),
#[cfg(all(feature = "v2", feature = "payment_v2"))]
#[cfg(feature = "v2")]
Updateable::PaymentAttemptUpdate(a) => DBResult::PaymentAttempt(Box::new(
a.orig
.update_with_attempt_id(
Expand Down
Loading

0 comments on commit c7bb9cc

Please sign in to comment.