fixed processing status
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import 'package:pshared/models/payment/operation.dart';
|
||||
import 'package:pshared/models/payment/payment.dart';
|
||||
import 'package:pshared/models/payment/state.dart';
|
||||
import 'package:pshared/models/payment/status.dart';
|
||||
import 'package:pshared/utils/money.dart';
|
||||
|
||||
import 'package:pweb/models/payment/payment_state.dart';
|
||||
|
||||
OperationItem mapPaymentToOperation(Payment payment) {
|
||||
final debit = payment.lastQuote?.amounts?.sourceDebitTotal;
|
||||
@@ -51,15 +51,15 @@ OperationItem mapPaymentToOperation(Payment payment) {
|
||||
}
|
||||
|
||||
OperationStatus statusFromPayment(Payment payment) {
|
||||
final state = paymentStateFromRaw(payment.state);
|
||||
switch (state) {
|
||||
case PaymentState.success:
|
||||
return OperationStatus.success;
|
||||
case PaymentState.failed:
|
||||
case PaymentState.cancelled:
|
||||
switch (payment.orchestrationState) {
|
||||
case PaymentOrchestrationState.failed:
|
||||
return OperationStatus.error;
|
||||
case PaymentState.processing:
|
||||
case PaymentState.unknown:
|
||||
case PaymentOrchestrationState.settled:
|
||||
return OperationStatus.success;
|
||||
case PaymentOrchestrationState.created:
|
||||
case PaymentOrchestrationState.executing:
|
||||
case PaymentOrchestrationState.needsAttention:
|
||||
case PaymentOrchestrationState.unspecified:
|
||||
return OperationStatus.processing;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user