Skip to content

Commit

Permalink
feat(payment_methods_v2): Implemented Diesel and Domain models for v2 (
Browse files Browse the repository at this point in the history
…#5700)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
  • Loading branch information
Sarthak1799 and hyperswitch-bot[bot] authored Sep 4, 2024
1 parent 1c39cc1 commit c3cc887
Show file tree
Hide file tree
Showing 39 changed files with 2,713 additions and 669 deletions.
1 change: 1 addition & 0 deletions crates/diesel_models/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ v1 = []
v2 = []
customer_v2 = []
payment_v2 = []
payment_methods_v2 = []

[dependencies]
async-bb8-diesel = { git = "https://github.com/jarnura/async-bb8-diesel", rev = "53b4ab901aab7635c8215fd1c2d542c8db443094" }
Expand Down
8 changes: 8 additions & 0 deletions crates/diesel_models/src/kv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,19 @@ impl DBOperation {
Updateable::PayoutAttemptUpdate(a) => DBResult::PayoutAttempt(Box::new(
a.orig.update_with_attempt_id(conn, a.update_data).await?,
)),
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "payment_methods_v2")
))]
Updateable::PaymentMethodUpdate(v) => DBResult::PaymentMethod(Box::new(
v.orig
.update_with_payment_method_id(conn, v.update_data)
.await?,
)),
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
Updateable::PaymentMethodUpdate(v) => DBResult::PaymentMethod(Box::new(
v.orig.update_with_id(conn, v.update_data).await?,
)),
Updateable::MandateUpdate(m) => DBResult::Mandate(Box::new(
Mandate::update_by_merchant_id_mandate_id(
conn,
Expand Down
Loading

0 comments on commit c3cc887

Please sign in to comment.