Skip to content

Commit 9aa1c75

Browse files
lsamprasdracarys18
andauthored
fix(payments): fix payment update enum being inserted into kv (#2612)
Co-authored-by: Kartikeya Hegde <[email protected]>
1 parent 1548ee6 commit 9aa1c75

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

crates/storage_impl/src/payments/payment_intent.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,21 +130,21 @@ impl<T: DatabaseStore> PaymentIntentInterface for KVRouterStore<T> {
130130
async fn update_payment_intent(
131131
&self,
132132
this: PaymentIntent,
133-
payment_intent: PaymentIntentUpdate,
133+
payment_intent_update: PaymentIntentUpdate,
134134
storage_scheme: MerchantStorageScheme,
135135
) -> error_stack::Result<PaymentIntent, StorageError> {
136136
match storage_scheme {
137137
MerchantStorageScheme::PostgresOnly => {
138138
self.router_store
139-
.update_payment_intent(this, payment_intent, storage_scheme)
139+
.update_payment_intent(this, payment_intent_update, storage_scheme)
140140
.await
141141
}
142142
MerchantStorageScheme::RedisKv => {
143143
let key = format!("mid_{}_pid_{}", this.merchant_id, this.payment_id);
144144
let field = format!("pi_{}", this.payment_id);
145145

146-
let updated_intent = payment_intent.clone().apply_changeset(this.clone());
147-
let diesel_intent = payment_intent.to_storage_model();
146+
let updated_intent = payment_intent_update.clone().apply_changeset(this.clone());
147+
let diesel_intent = updated_intent.clone().to_storage_model();
148148
// Check for database presence as well Maybe use a read replica here ?
149149

150150
let redis_value =
@@ -156,7 +156,7 @@ impl<T: DatabaseStore> PaymentIntentInterface for KVRouterStore<T> {
156156
updatable: kv::Updateable::PaymentIntentUpdate(
157157
kv::PaymentIntentUpdateMems {
158158
orig: this.to_storage_model(),
159-
update_data: diesel_intent,
159+
update_data: payment_intent_update.to_storage_model(),
160160
},
161161
),
162162
},

0 commit comments

Comments
 (0)