Skip to content

Commit

Permalink
fix(payments_list): handle same payment/attempt ids for different mer…
Browse files Browse the repository at this point in the history
…chants (#6917)
  • Loading branch information
apoorvdixit88 authored Dec 24, 2024
1 parent c5717a8 commit 2e472e3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/storage_impl/src/payments/payment_intent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -831,10 +831,11 @@ impl<T: DatabaseStore> PaymentIntentInterface for crate::RouterStore<T> {
let conn = connection::pg_connection_read(self).await.switch()?;
let conn = async_bb8_diesel::Connection::as_async_conn(&conn);
let mut query = DieselPaymentIntent::table()
.filter(pi_dsl::merchant_id.eq(merchant_id.to_owned()))
.inner_join(
payment_attempt_schema::table.on(pa_dsl::attempt_id.eq(pi_dsl::active_attempt_id)),
)
.filter(pi_dsl::merchant_id.eq(merchant_id.to_owned()))
.filter(pa_dsl::merchant_id.eq(merchant_id.to_owned())) // Ensure merchant_ids match, as different merchants can share payment/attempt IDs.
.into_boxed();

query = match constraints {
Expand Down

0 comments on commit 2e472e3

Please sign in to comment.