Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add prefix to connector_transaction_id #2981

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions crates/storage_impl/src/payments/payment_attempt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ impl<T: DatabaseStore> PaymentAttemptInterface for KVRouterStore<T> {
}
MerchantStorageScheme::RedisKv => {
// We assume that PaymentAttempt <=> PaymentIntent is a one-to-one relation for now
let lookup_id = format!("{merchant_id}_{connector_transaction_id}");
let lookup_id = format!("conn_trans_{merchant_id}_{connector_transaction_id}");
let lookup = self
.get_lookup_by_lookup_id(&lookup_id, storage_scheme)
.await?;
Expand Down Expand Up @@ -774,7 +774,7 @@ impl<T: DatabaseStore> PaymentAttemptInterface for KVRouterStore<T> {
.await
}
MerchantStorageScheme::RedisKv => {
let lookup_id = format!("{merchant_id}_{preprocessing_id}");
let lookup_id = format!("preprocessing_{merchant_id}_{preprocessing_id}");
let lookup = self
.get_lookup_by_lookup_id(&lookup_id, storage_scheme)
.await?;
Expand Down Expand Up @@ -1679,7 +1679,7 @@ async fn add_connector_txn_id_to_reverse_lookup<T: DatabaseStore>(
) -> CustomResult<ReverseLookup, errors::StorageError> {
let field = format!("pa_{}", updated_attempt_attempt_id);
let reverse_lookup_new = ReverseLookupNew {
lookup_id: format!("{}_{}", merchant_id, connector_transaction_id),
lookup_id: format!("conn_trans_{}_{}", merchant_id, connector_transaction_id),
pk_id: key.to_owned(),
sk_id: field.clone(),
source: "payment_attempt".to_string(),
Expand All @@ -1701,7 +1701,7 @@ async fn add_preprocessing_id_to_reverse_lookup<T: DatabaseStore>(
) -> CustomResult<ReverseLookup, errors::StorageError> {
let field = format!("pa_{}", updated_attempt_attempt_id);
let reverse_lookup_new = ReverseLookupNew {
lookup_id: format!("{}_{}", merchant_id, preprocessing_id),
lookup_id: format!("preprocessing_{}_{}", merchant_id, preprocessing_id),
pk_id: key.to_owned(),
sk_id: field.clone(),
source: "payment_attempt".to_string(),
Expand Down
Loading