getPaymentModes method
Implementation
getPaymentModes(BuildContext context) async {
// Helper.progressDialog(context, "Please wait..");
// printLogs(dio);
await dio
.get(
'${ApiConstant.posBaseUrl}pos-payment-service-svc/payment-modes',
queryParameters: {
"sellerType": storage.read("DISTRIBUTER_LEVEL_ID"),
"paymentCollectionEntity": "CART",
"transactionType": "SELL_THRU",
"contractType": "STOCK_ORDER",
},
options: Options(
headers: {
'X-User-Id': storage.read("XUSER_ID"),
},
),
)
.then((response) {
// Get.back();
if (response.data != null) {
PaymentModeModel model = PaymentModeModel();
print('getPaymentModes${response.data}');
Map<String, dynamic> creditData = response.data;
model = PaymentModeModel.fromJson(creditData);
paymentModes = model.data!;
paymentModeList.value = paymentModes;
getPaymentModeList();
}
}).catchError((error) {
print(error.toString());
// Get.back();
MainController mainController = Get.put(MainController());
mainController.showErrorPopup();
});
}