Update: 2026-05-08 23:18:10
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user