mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 09:38:33 +08:00
fix: don't update payment on requires_capture (#405)
This commit is contained in:
@ -174,11 +174,14 @@ impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::PaymentsRequest> for Pa
|
|||||||
};
|
};
|
||||||
|
|
||||||
match payment_intent.status {
|
match payment_intent.status {
|
||||||
enums::IntentStatus::Succeeded | enums::IntentStatus::Failed => {
|
enums::IntentStatus::Succeeded
|
||||||
|
| enums::IntentStatus::Failed
|
||||||
|
| enums::IntentStatus::RequiresCapture => {
|
||||||
Err(report!(errors::ApiErrorResponse::PreconditionFailed {
|
Err(report!(errors::ApiErrorResponse::PreconditionFailed {
|
||||||
message:
|
message: format!(
|
||||||
"You cannot update this Payment because it has already succeeded/failed."
|
"You cannot update this Payment because the status of this payment is {}",
|
||||||
.into()
|
payment_intent.status
|
||||||
|
)
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
_ => Ok((
|
_ => Ok((
|
||||||
|
|||||||
Reference in New Issue
Block a user