Skip to content

Commit 6765a1c

Browse files
fix: payment_method_data and description null during payment confirm (#2618)
Co-authored-by: Abhishek Marrivagu <[email protected]>
1 parent cc0b422 commit 6765a1c

File tree

2 files changed

+51
-4
lines changed

2 files changed

+51
-4
lines changed

crates/diesel_models/src/payment_attempt.rs

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,23 +289,47 @@ impl PaymentAttemptUpdate {
289289
amount: pa_update.amount.unwrap_or(source.amount),
290290
currency: pa_update.currency.or(source.currency),
291291
status: pa_update.status.unwrap_or(source.status),
292-
connector: pa_update.connector.or(source.connector),
293-
connector_transaction_id: source
292+
connector_transaction_id: pa_update
294293
.connector_transaction_id
295-
.or(pa_update.connector_transaction_id),
294+
.or(source.connector_transaction_id),
295+
amount_to_capture: pa_update.amount_to_capture.or(source.amount_to_capture),
296+
connector: pa_update.connector.or(source.connector),
296297
authentication_type: pa_update.authentication_type.or(source.authentication_type),
297298
payment_method: pa_update.payment_method.or(source.payment_method),
298299
error_message: pa_update.error_message.unwrap_or(source.error_message),
299300
payment_method_id: pa_update
300301
.payment_method_id
301302
.unwrap_or(source.payment_method_id),
302-
browser_info: pa_update.browser_info.or(source.browser_info),
303+
cancellation_reason: pa_update.cancellation_reason.or(source.cancellation_reason),
303304
modified_at: common_utils::date_time::now(),
305+
mandate_id: pa_update.mandate_id.or(source.mandate_id),
306+
browser_info: pa_update.browser_info.or(source.browser_info),
304307
payment_token: pa_update.payment_token.or(source.payment_token),
308+
error_code: pa_update.error_code.unwrap_or(source.error_code),
305309
connector_metadata: pa_update.connector_metadata.or(source.connector_metadata),
310+
payment_method_data: pa_update.payment_method_data.or(source.payment_method_data),
311+
payment_method_type: pa_update.payment_method_type.or(source.payment_method_type),
312+
payment_experience: pa_update.payment_experience.or(source.payment_experience),
313+
business_sub_label: pa_update.business_sub_label.or(source.business_sub_label),
314+
straight_through_algorithm: pa_update
315+
.straight_through_algorithm
316+
.or(source.straight_through_algorithm),
306317
preprocessing_step_id: pa_update
307318
.preprocessing_step_id
308319
.or(source.preprocessing_step_id),
320+
error_reason: pa_update.error_reason.unwrap_or(source.error_reason),
321+
capture_method: pa_update.capture_method.or(source.capture_method),
322+
connector_response_reference_id: pa_update
323+
.connector_response_reference_id
324+
.or(source.connector_response_reference_id),
325+
multiple_capture_count: pa_update
326+
.multiple_capture_count
327+
.or(source.multiple_capture_count),
328+
surcharge_amount: pa_update.surcharge_amount.or(source.surcharge_amount),
329+
tax_amount: pa_update.tax_amount.or(source.tax_amount),
330+
amount_capturable: pa_update
331+
.amount_capturable
332+
.unwrap_or(source.amount_capturable),
309333
surcharge_metadata: pa_update.surcharge_metadata.or(source.surcharge_metadata),
310334
updated_by: pa_update.updated_by,
311335
..source

crates/diesel_models/src/payment_intent.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,30 @@ impl PaymentIntentUpdate {
227227
.shipping_address_id
228228
.or(source.shipping_address_id),
229229
modified_at: common_utils::date_time::now(),
230+
active_attempt_id: internal_update
231+
.active_attempt_id
232+
.unwrap_or(source.active_attempt_id),
233+
business_country: internal_update.business_country.or(source.business_country),
234+
business_label: internal_update.business_label.or(source.business_label),
235+
description: internal_update.description.or(source.description),
236+
statement_descriptor_name: internal_update
237+
.statement_descriptor_name
238+
.or(source.statement_descriptor_name),
239+
statement_descriptor_suffix: internal_update
240+
.statement_descriptor_suffix
241+
.or(source.statement_descriptor_suffix),
230242
order_details: internal_update.order_details.or(source.order_details),
243+
attempt_count: internal_update
244+
.attempt_count
245+
.unwrap_or(source.attempt_count),
246+
profile_id: internal_update.profile_id.or(source.profile_id),
247+
merchant_decision: internal_update
248+
.merchant_decision
249+
.or(source.merchant_decision),
250+
payment_confirm_source: internal_update
251+
.payment_confirm_source
252+
.or(source.payment_confirm_source),
253+
updated_by: internal_update.updated_by,
231254
..source
232255
}
233256
}

0 commit comments

Comments
 (0)