add payment
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:fcs/domain/entities/invoice.dart';
|
||||
import 'package:fcs/domain/entities/payment.dart';
|
||||
import 'package:fcs/helpers/api_helper.dart';
|
||||
import 'package:fcs/helpers/firebase_helper.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
@@ -22,4 +23,14 @@ class InvoiceDataProvider {
|
||||
return await requestAPI("/invoices/cancel", "PUT",
|
||||
payload: {"id": invoice.id}, token: await getToken());
|
||||
}
|
||||
|
||||
Future<void> pay(Payment payment) async {
|
||||
return await requestAPI("/invoices/pay", "PUT",
|
||||
payload: payment.toMap(), token: await getToken());
|
||||
}
|
||||
|
||||
Future<void> updatPaymentStatus(Payment payment) async {
|
||||
return await requestAPI("/invoices/pay/status", "PUT",
|
||||
payload: payment.toMap(), token: await getToken());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user