updated document upload according to fresh api
This commit is contained in:
@@ -10,18 +10,18 @@ import 'package:pweb/utils/error/snackbar.dart';
|
||||
|
||||
import 'package:pweb/generated/i18n/app_localizations.dart';
|
||||
|
||||
|
||||
Future<void> downloadPaymentAct(
|
||||
BuildContext context,
|
||||
String paymentRef, {
|
||||
String? operationRef,
|
||||
BuildContext context, {
|
||||
required String gatewayService,
|
||||
required String operationRef,
|
||||
}) async {
|
||||
final organizations = context.read<OrganizationsProvider>();
|
||||
if (!organizations.isOrganizationSet) {
|
||||
return;
|
||||
}
|
||||
final trimmed = paymentRef.trim();
|
||||
if (trimmed.isEmpty) {
|
||||
final gateway = gatewayService.trim();
|
||||
final operation = operationRef.trim();
|
||||
if (gateway.isEmpty || operation.isEmpty) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -29,10 +29,10 @@ Future<void> downloadPaymentAct(
|
||||
await executeActionWithNotification(
|
||||
context: context,
|
||||
action: () async {
|
||||
final file = await PaymentDocumentsService.getAct(
|
||||
final file = await PaymentDocumentsService.getOperationDocument(
|
||||
organizations.current.id,
|
||||
trimmed,
|
||||
operationRef: operationRef,
|
||||
gateway,
|
||||
operation,
|
||||
);
|
||||
await downloadFile(file);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user