db: Added Reverse lookup table (#147)

This commit is contained in:
Kartikeya Hegde
2022-12-19 18:50:05 +05:30
committed by GitHub
parent d6a3e508e2
commit 87fed68519
51 changed files with 937 additions and 201 deletions

View File

@ -323,7 +323,7 @@ pub fn create_startpay_url(
server.base_url,
payment_intent.payment_id,
payment_intent.merchant_id,
payment_attempt.txn_id
payment_attempt.attempt_id
)
}

View File

@ -67,7 +67,7 @@ impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::PaymentsCancelRequest>
.find_connector_response_by_payment_id_merchant_id_txn_id(
&payment_attempt.payment_id,
&payment_attempt.merchant_id,
&payment_attempt.txn_id,
&payment_attempt.attempt_id,
storage_scheme,
)
.await

View File

@ -89,7 +89,7 @@ impl<F: Send + Clone> GetTracker<F, payments::PaymentData<F>, api::PaymentsCaptu
.find_connector_response_by_payment_id_merchant_id_txn_id(
&payment_attempt.payment_id,
&payment_attempt.merchant_id,
&payment_attempt.txn_id,
&payment_attempt.attempt_id,
storage_scheme,
)
.await

View File

@ -97,7 +97,7 @@ impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::PaymentsRequest> for Pa
.find_connector_response_by_payment_id_merchant_id_txn_id(
&payment_attempt.payment_id,
&payment_attempt.merchant_id,
&payment_attempt.txn_id,
&payment_attempt.attempt_id,
storage_scheme,
)
.await

View File

@ -434,7 +434,7 @@ impl PaymentCreate {
storage::PaymentAttemptNew {
payment_id: payment_id.to_string(),
merchant_id: merchant_id.to_string(),
txn_id: Uuid::new_v4().to_string(),
attempt_id: Uuid::new_v4().to_string(),
status,
amount: amount.into(),
currency,
@ -495,7 +495,7 @@ impl PaymentCreate {
storage::ConnectorResponseNew {
payment_id: payment_attempt.payment_id.clone(),
merchant_id: payment_attempt.merchant_id.clone(),
txn_id: payment_attempt.txn_id.clone(),
txn_id: payment_attempt.attempt_id.clone(),
created_at: payment_attempt.created_at,
modified_at: payment_attempt.modified_at,
connector_name: payment_attempt.connector.clone(),

View File

@ -285,7 +285,7 @@ impl PaymentMethodValidate {
storage::PaymentAttemptNew {
payment_id: payment_id.to_string(),
merchant_id: merchant_id.to_string(),
txn_id: Uuid::new_v4().to_string(),
attempt_id: Uuid::new_v4().to_string(),
status,
// Amount & Currency will be zero in this case
amount: 0,

View File

@ -106,7 +106,7 @@ impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::PaymentsSessionRequest>
.find_connector_response_by_payment_id_merchant_id_txn_id(
&payment_intent.payment_id,
&payment_intent.merchant_id,
&payment_attempt.txn_id,
&payment_attempt.attempt_id,
storage_scheme,
)
.await

View File

@ -103,7 +103,7 @@ impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::PaymentsStartRequest> f
.find_connector_response_by_payment_id_merchant_id_txn_id(
&payment_intent.payment_id,
&payment_intent.merchant_id,
&payment_attempt.txn_id,
&payment_attempt.attempt_id,
storage_scheme,
)
.await

View File

@ -215,8 +215,8 @@ async fn get_tracker_for_sync<
api::PaymentIdType::ConnectorTransactionId(ref id) => {
db.find_payment_attempt_by_merchant_id_connector_txn_id(merchant_id, id, storage_scheme)
}
api::PaymentIdType::PaymentTxnId(ref id) => {
db.find_payment_attempt_by_merchant_id_txn_id(merchant_id, id, storage_scheme)
api::PaymentIdType::PaymentAttemptId(ref id) => {
db.find_payment_attempt_by_merchant_id_attempt_id(merchant_id, id, storage_scheme)
}
}
.await
@ -233,7 +233,7 @@ async fn get_tracker_for_sync<
.find_connector_response_by_payment_id_merchant_id_txn_id(
&payment_intent.payment_id,
&payment_intent.merchant_id,
&payment_attempt.txn_id,
&payment_attempt.attempt_id,
storage_scheme,
)
.await

View File

@ -116,7 +116,7 @@ impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::PaymentsRequest> for Pa
.find_connector_response_by_payment_id_merchant_id_txn_id(
&payment_intent.payment_id,
&payment_intent.merchant_id,
&payment_attempt.txn_id,
&payment_attempt.attempt_id,
storage_scheme,
)
.await