filter wallet payment option when user nto logged in

This commit is contained in:
2026-06-29 17:47:23 +02:00
parent c253a69566
commit dad09202c4

View File

@@ -185,8 +185,15 @@ class PayController extends ChangeNotifier {
model.paymentProcessors = getFakePaymentProcessors();
notifyListeners();
var labels = ['ECOCASH', 'MPGS'];
prefs = await SharedPreferences.getInstance();
if (prefs.get('token') != null) {
labels.add('WALLET');
}
final response = await http.get(
'/public/payment-processors?currency=$currency',
'/public/payment-processors?currency=$currency&labelIn=${labels.join(',')}',
);
final List<dynamic> content = response is List
? response