usability fixes

This commit is contained in:
2026-06-24 18:01:34 +02:00
parent 9e55ec1097
commit a6b4a04bd5
26 changed files with 1099 additions and 216 deletions

View File

@@ -35,6 +35,7 @@ abstract class PaymentProcessor with _$PaymentProcessor {
required String accountFieldName,
required String accountFieldLabel,
required String label,
required String currency,
required String authType,
}) = _PaymentProcessor;
@@ -176,15 +177,22 @@ class PayController extends ChangeNotifier {
}
}
Future<ApiResponse<List<PaymentProcessor>>> getPaymentProcessors() async {
Future<ApiResponse<List<PaymentProcessor>>> getPaymentProcessors(
String currency,
) async {
try {
model.isLoading = true;
model.paymentProcessors = getFakePaymentProcessors();
notifyListeners();
List<dynamic> response = await http.get('/public/payment-processors');
model.paymentProcessors = response
.map((e) => PaymentProcessor.fromJson(e))
final response = await http.get(
'/public/payment-processors?currency=$currency',
);
final List<dynamic> content = response is List
? response
: (response['content'] ?? []);
model.paymentProcessors = content
.map((e) => PaymentProcessor.fromJson(e as Map<String, dynamic>))
.toList();
model.isLoading = false;
@@ -238,6 +246,7 @@ class PayController extends ChangeNotifier {
accountFieldLabel: "EcoCash Phone Number",
label: "ECOCASH",
authType: "REMOTE",
currency: "USD",
),
];
}