Skip to content

Commit

Permalink
fix(payments): do not delete client secret on payment failure (#1226)
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhicodes-crypto authored May 22, 2023
1 parent ebf3de4 commit c1b631b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions crates/storage_models/src/payment_intent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,14 +293,15 @@ fn make_client_secret_null_based_on_status(
status: storage_enums::IntentStatus,
) -> Option<Option<String>> {
match status {
storage_enums::IntentStatus::Succeeded
| storage_enums::IntentStatus::Failed
| storage_enums::IntentStatus::Cancelled => Some(None),
storage_enums::IntentStatus::Succeeded | storage_enums::IntentStatus::Cancelled => {
Some(None)
}
storage_enums::IntentStatus::Processing
| storage_enums::IntentStatus::RequiresCustomerAction
| storage_enums::IntentStatus::RequiresMerchantAction
| storage_enums::IntentStatus::RequiresPaymentMethod
| storage_enums::IntentStatus::RequiresConfirmation
| storage_enums::IntentStatus::RequiresCapture => None,
| storage_enums::IntentStatus::RequiresCapture
| storage_enums::IntentStatus::Failed => None,
}
}

0 comments on commit c1b631b

Please sign in to comment.