add payment

This commit is contained in:
Sai Naw Wun
2020-10-28 05:11:06 +06:30
parent 2786acfd08
commit d5c2407545
28 changed files with 740 additions and 601 deletions

View File

@@ -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());
}
}