|
|
|
|
@ -1,14 +1,21 @@
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
|
|
|
|
|
import '../../../core/config/server_response.dart';
|
|
|
|
|
import '../../../core/constants/app_contants.dart';
|
|
|
|
|
import '../../../core/data/repositories/app_repositories.dart';
|
|
|
|
|
import '../../../core/enums/request_constants.dart';
|
|
|
|
|
import '../../../core/utils/SessionCache.dart';
|
|
|
|
|
import '../../../core/utils/logs_utils.dart';
|
|
|
|
|
import '../../../custom_widgets/Fields/field_validations.dart';
|
|
|
|
|
import '../../../custom_widgets/Fields/input_field.dart';
|
|
|
|
|
import '../../../custom_widgets/custom_dropdown.dart';
|
|
|
|
|
import '../../../custom_widgets/custom_toasty.dart';
|
|
|
|
|
import '../../../models/DepositAccountResponse.dart';
|
|
|
|
|
import '../../../models/ExchangeRate.dart';
|
|
|
|
|
import '../../../models/SendTransactionStep1ResponseModel.dart';
|
|
|
|
|
import '../../../models/TransactionPinRequestModel.dart';
|
|
|
|
|
import '../../../models/TransactionSubmitRequestModel.dart';
|
|
|
|
|
import '../../../routes/app_pages.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -115,62 +122,62 @@ class InternalAccountTransController extends GetxController {
|
|
|
|
|
|
|
|
|
|
/// Send Transaction function
|
|
|
|
|
Future<void> sendTransaction() async {
|
|
|
|
|
// if (!validate()) {
|
|
|
|
|
// Toasty.error("Please input and then proceed");
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// TransactionSubmitRequestModel transactionSubmitRequestModel = TransactionSubmitRequestModel(
|
|
|
|
|
// porOrgacode: RequestConstants.porOrgacode,
|
|
|
|
|
// pctCstycode: RequestConstants.pctCstycode,
|
|
|
|
|
// channelCode: RequestConstants.channelCode,
|
|
|
|
|
// cmpCustcode: SessionCache.instance.userInfo.cmpCustcode,
|
|
|
|
|
// drMbmBkmsnumber: selectedFromAccount.value.mbmBkmsnumber,
|
|
|
|
|
// drMbmBkmstitle: selectedFromAccount.value.mbmBkmstitle,
|
|
|
|
|
// drPcrCurrcode: selectedFromAccount.value.pcrCurrcode,
|
|
|
|
|
// drPcrCurrdesc: selectedFromAccount.value.pcrCurrdesc,
|
|
|
|
|
// drPcrCurrshort: selectedFromAccount.value.pcrCurrshort,
|
|
|
|
|
// crMbmBkmsnumber: selectedToAccount.value.mbmBkmsnumber,
|
|
|
|
|
// crMbmBkmstitle: selectedToAccount.value.mbmBkmstitle,
|
|
|
|
|
// crPcrCurrcode: selectedExchangeRate!.pcrCurrcode,
|
|
|
|
|
// crPcrCurrdesc: selectedExchangeRate!.pcrCurrdesc,
|
|
|
|
|
// crPcrCurrshort: selectedExchangeRate!.pcrCurrshort,
|
|
|
|
|
// sgtGntrnarration: "",
|
|
|
|
|
// dmpProdCode: selectedFromAccount.value.dmpProdcode,
|
|
|
|
|
// transType: "DR",
|
|
|
|
|
// notificationId: "",
|
|
|
|
|
// transMode: "Online",
|
|
|
|
|
// sgtGntramtfc: double.parse(sendingAmountField.getCustomText().isEmpty ? "0.0" : sendingAmountField.getCustomText()),
|
|
|
|
|
// otdTrancomment: messageField.getCustomText(),
|
|
|
|
|
// isOtpRequired: false,
|
|
|
|
|
// cmpRefcode: referenceCodeField.getCustomText(),
|
|
|
|
|
// );
|
|
|
|
|
//
|
|
|
|
|
// dp("********************>>>>>>>>>>>>******************", transactionSubmitRequestModel);
|
|
|
|
|
// TransactionPinRequestModel transactionPinRequestModel = TransactionPinRequestModel(
|
|
|
|
|
// porOrgacode: RequestConstants.porOrgacode,
|
|
|
|
|
// pctCstycode: RequestConstants.pctCstycode,
|
|
|
|
|
// channelCode: RequestConstants.channelCode,
|
|
|
|
|
// cmpCustcode: SessionCache.instance.userInfo.cmpCustcode,
|
|
|
|
|
// email: SessionCache.instance.userInfo.cmpUserId,
|
|
|
|
|
// pinType: "TRAN",
|
|
|
|
|
// transPincode: userTransactionPinField.getCustomText(),
|
|
|
|
|
// isOtpRequired: false,
|
|
|
|
|
// );
|
|
|
|
|
//
|
|
|
|
|
// ServerResponse response = await repository.sendTransactionStep1(transactionPinRequestModel);
|
|
|
|
|
// if (response.isError) {
|
|
|
|
|
// Toasty.error(response.errorMsg);
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
// SendTransactionStep1ResponseModel step1responseModel = SendTransactionStep1ResponseModel.fromMap(response.response);
|
|
|
|
|
// transactionSubmitRequestModel.notificationId = step1responseModel.notificationId.toString();
|
|
|
|
|
Get.toNamed(Routes.INTERNAL_TRANSACTION_OPT);
|
|
|
|
|
// arguments: {
|
|
|
|
|
// AppConstants.SEND_TRANS_STEP1_DATA: transactionSubmitRequestModel,
|
|
|
|
|
// AppConstants.INTERNAL_TRANSACTION_PIN_REQUEST: transactionPinRequestModel,
|
|
|
|
|
// AppConstants.EXCHANGE_RATE: exchangeRateField.getCustomText(),
|
|
|
|
|
// });
|
|
|
|
|
if (!validate()) {
|
|
|
|
|
Toasty.error("Please input and then proceed");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TransactionSubmitRequestModel transactionSubmitRequestModel = TransactionSubmitRequestModel(
|
|
|
|
|
porOrgacode: RequestConstants.porOrgacode,
|
|
|
|
|
pctCstycode: RequestConstants.pctCstycode,
|
|
|
|
|
channelCode: RequestConstants.channelCode,
|
|
|
|
|
cmpCustcode: SessionCache.instance.userInfo.cmpCustcode,
|
|
|
|
|
drMbmBkmsnumber: selectedFromAccount.value.mbmBkmsnumber,
|
|
|
|
|
drMbmBkmstitle: selectedFromAccount.value.mbmBkmstitle,
|
|
|
|
|
drPcrCurrcode: selectedFromAccount.value.pcrCurrcode,
|
|
|
|
|
drPcrCurrdesc: selectedFromAccount.value.pcrCurrdesc,
|
|
|
|
|
drPcrCurrshort: selectedFromAccount.value.pcrCurrshort,
|
|
|
|
|
crMbmBkmsnumber: selectedToAccount.value.mbmBkmsnumber,
|
|
|
|
|
crMbmBkmstitle: selectedToAccount.value.mbmBkmstitle,
|
|
|
|
|
crPcrCurrcode: selectedExchangeRate!.pcrCurrcode,
|
|
|
|
|
crPcrCurrdesc: selectedExchangeRate!.pcrCurrdesc,
|
|
|
|
|
crPcrCurrshort: selectedExchangeRate!.pcrCurrshort,
|
|
|
|
|
sgtGntrnarration: "",
|
|
|
|
|
dmpProdCode: selectedFromAccount.value.dmpProdcode,
|
|
|
|
|
transType: "DR",
|
|
|
|
|
notificationId: "",
|
|
|
|
|
transMode: "Online",
|
|
|
|
|
sgtGntramtfc: double.parse(sendingAmountField.getCustomText().isEmpty ? "0.0" : sendingAmountField.getCustomText()),
|
|
|
|
|
otdTrancomment: messageField.getCustomText(),
|
|
|
|
|
isOtpRequired: false,
|
|
|
|
|
cmpRefcode: referenceCodeField.getCustomText(),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
dp("********************>>>>>>>>>>>>******************", transactionSubmitRequestModel);
|
|
|
|
|
TransactionPinRequestModel transactionPinRequestModel = TransactionPinRequestModel(
|
|
|
|
|
porOrgacode: RequestConstants.porOrgacode,
|
|
|
|
|
pctCstycode: RequestConstants.pctCstycode,
|
|
|
|
|
channelCode: RequestConstants.channelCode,
|
|
|
|
|
cmpCustcode: SessionCache.instance.userInfo.cmpCustcode,
|
|
|
|
|
email: SessionCache.instance.userInfo.cmpUserId,
|
|
|
|
|
pinType: "TRAN",
|
|
|
|
|
transPincode: userTransactionPinField.getCustomText(),
|
|
|
|
|
isOtpRequired: false,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
ServerResponse response = await repository.sendTransactionStep1(transactionPinRequestModel);
|
|
|
|
|
if (response.isError) {
|
|
|
|
|
Toasty.error(response.errorMsg);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
SendTransactionStep1ResponseModel step1responseModel = SendTransactionStep1ResponseModel.fromMap(response.response);
|
|
|
|
|
transactionSubmitRequestModel.notificationId = step1responseModel.notificationId.toString();
|
|
|
|
|
Get.toNamed(Routes.INTERNAL_TRANSACTION_OPT,
|
|
|
|
|
arguments: {
|
|
|
|
|
AppConstants.SEND_TRANS_STEP1_DATA: transactionSubmitRequestModel,
|
|
|
|
|
AppConstants.INTERNAL_TRANSACTION_PIN_REQUEST: transactionPinRequestModel,
|
|
|
|
|
AppConstants.EXCHANGE_RATE: exchangeRateField.getCustomText(),
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void clearTransaction() {
|
|
|
|
|
|