small fixes for single payout and big chunck for multiple payouts
This commit is contained in:
@@ -8,6 +8,8 @@ class Payment {
|
||||
final String? failureCode;
|
||||
final String? failureReason;
|
||||
final PaymentQuote? lastQuote;
|
||||
final Map<String, String>? metadata;
|
||||
final DateTime? createdAt;
|
||||
|
||||
const Payment({
|
||||
required this.paymentRef,
|
||||
@@ -16,5 +18,13 @@ class Payment {
|
||||
required this.failureCode,
|
||||
required this.failureReason,
|
||||
required this.lastQuote,
|
||||
required this.metadata,
|
||||
required this.createdAt,
|
||||
});
|
||||
|
||||
bool get isFailure {
|
||||
if ((failureCode ?? '').trim().isNotEmpty) return true;
|
||||
final normalized = (state ?? '').trim().toLowerCase();
|
||||
return normalized.contains('fail') || normalized.contains('cancel');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user