Update: 2026-05-08 23:18:10

This commit is contained in:
Hamza-Ayed
2026-05-08 23:18:10 +03:00
parent 72424bf92c
commit 67cc322f5e
10 changed files with 99 additions and 23 deletions

View File

@@ -98,4 +98,22 @@ class SubscriptionController extends GetxController {
}
return null;
}
Future<bool> cancelPaymentRequest(String paymentId) async {
try {
isLoading.value = true;
final res = await DioClient().client.post('payments/cancel', data: {'payment_id': paymentId});
if (res.data['success'] == true) {
AppSnackbar.showSuccess('تم الإلغاء', 'تم إلغاء طلب الدفع بنجاح');
await loadAll();
return true;
}
} catch (e) {
AppLogger.error('Failed to cancel payment', e);
AppSnackbar.showError('خطأ', 'فشل إلغاء طلب الدفع');
} finally {
isLoading.value = false;
}
return false;
}
}