refactor: attempt and intent status (#210)

This commit is contained in:
Sangamesh Kulkarni
2022-12-23 19:28:06 +05:30
committed by GitHub
parent c9276a30d7
commit 279961e169
10 changed files with 23 additions and 17 deletions

View File

@ -15,9 +15,9 @@
pub enum AttemptStatus {
Started,
AuthenticationFailed,
JuspayDeclined,
PendingVbv,
VbvSuccessful,
RouterDeclined,
AuthenticationPending,
AuthenticationSuccessful,
Authorized,
AuthorizationFailed,
Charged,
@ -506,11 +506,11 @@ impl From<AttemptStatus> for IntentStatus {
AttemptStatus::PaymentMethodAwaited => IntentStatus::RequiresPaymentMethod,
AttemptStatus::Authorized => IntentStatus::RequiresCapture,
AttemptStatus::PendingVbv => IntentStatus::RequiresCustomerAction,
AttemptStatus::AuthenticationPending => IntentStatus::RequiresCustomerAction,
AttemptStatus::PartialCharged
| AttemptStatus::Started
| AttemptStatus::VbvSuccessful
| AttemptStatus::AuthenticationSuccessful
| AttemptStatus::Authorizing
| AttemptStatus::CodInitiated
| AttemptStatus::VoidInitiated
@ -520,7 +520,7 @@ impl From<AttemptStatus> for IntentStatus {
AttemptStatus::AuthenticationFailed
| AttemptStatus::AuthorizationFailed
| AttemptStatus::VoidFailed
| AttemptStatus::JuspayDeclined
| AttemptStatus::RouterDeclined
| AttemptStatus::CaptureFailed
| AttemptStatus::Failure => IntentStatus::Failed,
AttemptStatus::Voided => IntentStatus::Cancelled,