Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
fix(kv): change partition key for PayoutAttempts (#12564)
Hrithikesh26d91c1f5956
diff --git a/crates/storage_impl/src/payouts/payout_attempt.rs b/crates/storage_impl/src/payouts/payout_attempt.rsindex d50c3e0758..2f8361a812 100644--- a/crates/storage_impl/src/payouts/payout_attempt.rs+++ b/crates/storage_impl/src/payouts/payout_attempt.rs@@ -56,10 +56,10 @@ impl<T: DatabaseStore> PayoutAttemptInterface for KVRouterStore<T> {}MerchantStorageScheme::RedisKv => {let merchant_id = new_payout_attempt.merchant_id.clone();- let payout_attempt_id = new_payout_attempt.payout_id.clone();- let key = PartitionKey::MerchantIdPayoutAttemptId {+ let payout_id = new_payout_attempt.payout_id.clone();+ let key = PartitionKey::MerchantIdPayoutId {merchant_id: &merchant_id,- payout_attempt_id: payout_attempt_id.get_string_repr(),+ payout_id: &payout_id,};let key_str = key.to_string();let created_attempt = PayoutAttempt {@@ -155,9 +155,9 @@ impl<T: DatabaseStore> PayoutAttemptInterface for KVRouterStore<T> {payouts: &Payouts,storage_scheme: MerchantStorageScheme,) -> error_stack::Result<PayoutAttempt, errors::StorageError> {- let key = PartitionKey::MerchantIdPayoutAttemptId {+ let key = PartitionKey::MerchantIdPayoutId {merchant_id: &this.merchant_id,- payout_attempt_id: this.payout_id.get_string_repr(),+ payout_id: &this.payout_id,};let field = format!("poa_{}", this.payout_attempt_id);let storage_scheme = Box::pin(decide_storage_scheme::<_, DieselPayoutAttempt>(diff --git a/crates/storage_impl/src/redis/kv_store.rs b/crates/storage_impl/src/redis/kv_store.rsindex 0c87e1ce14..e20ca31b99 100644--- a/crates/storage_impl/src/redis/kv_store.rs+++ b/crates/storage_impl/src/redis/kv_store.rs@@ -42,10 +42,6 @@ pub enum PartitionKey<'a> {merchant_id: &'a common_utils::id_type::MerchantId,payout_id: &'a common_utils::id_type::PayoutId,},- MerchantIdPayoutAttemptId {- merchant_id: &'a common_utils::id_type::MerchantId,- payout_attempt_id: &'a str,- },MerchantIdMandateId {merchant_id: &'a common_utils::id_type::MerchantId,mandate_id: &'a str,@@ -96,13 +92,6 @@ impl std::fmt::Display for PartitionKey<'_> {merchant_id.get_string_repr(),payout_id.get_string_repr())),- PartitionKey::MerchantIdPayoutAttemptId {- merchant_id,- payout_attempt_id,- } => f.write_str(&format!(- "mid_{}_poa_{payout_attempt_id}",- merchant_id.get_string_repr()- )),PartitionKey::MerchantIdMandateId {merchant_id,mandate_id,