Compare commits
No commits in common. "86adf1b2cfa7d4bfc63351600caf443013e45034" and "9ab70203acb2f87f8b1c18e14ccb05a6471c10f4" have entirely different histories.
86adf1b2cf
...
9ab70203ac
|
|
@ -30,7 +30,8 @@
|
||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/LaunchTheme"
|
android:theme="@style/LaunchTheme"
|
||||||
android:windowSoftInputMode="adjustResize">
|
android:windowSoftInputMode="adjustResize"
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<meta-data
|
<meta-data
|
||||||
|
|
|
||||||
|
|
@ -69,10 +69,14 @@ class MainActivity : FlutterActivity() {
|
||||||
if (call.argument<Long>("amount") != null) {
|
if (call.argument<Long>("amount") != null) {
|
||||||
amount = call.argument<Long>("amount")!!.toLong()
|
amount = call.argument<Long>("amount")!!.toLong()
|
||||||
}
|
}
|
||||||
val operationParameters = createOperationParameters(token)
|
|
||||||
val packageName = call.argument<String>("packageName").toString()
|
val packageName = call.argument<String>("packageName").toString()
|
||||||
|
val operationParameters = createOperationParameters(token)
|
||||||
startOperation(OperationType.PAYMENT, JsonForExternalCall.getPaymentCardJson(operationParameters.authToken, amount.toString()), packageName)
|
val body = JsonForExternalCall.getRefundCardJson(operationParameters.authToken, terminalId, operDay, transNum, amount)
|
||||||
|
startOperation(
|
||||||
|
OperationType.REFUND,
|
||||||
|
body,
|
||||||
|
packageName
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun operationRefund(call: MethodCall) {
|
private fun operationRefund(call: MethodCall) {
|
||||||
|
|
@ -125,8 +129,7 @@ class MainActivity : FlutterActivity() {
|
||||||
private fun startOperation(
|
private fun startOperation(
|
||||||
operationType: OperationType,
|
operationType: OperationType,
|
||||||
inputJsonData: String?,
|
inputJsonData: String?,
|
||||||
packageName: String
|
packageName: String) {
|
||||||
) {
|
|
||||||
try {
|
try {
|
||||||
val intent = Intent()
|
val intent = Intent()
|
||||||
intent.component = ComponentName(packageName, "ru.m4bank.feature.externalapplication.ExternalApplicationActivity")
|
intent.component = ComponentName(packageName, "ru.m4bank.feature.externalapplication.ExternalApplicationActivity")
|
||||||
|
|
@ -143,6 +146,7 @@ class MainActivity : FlutterActivity() {
|
||||||
} catch (e: ActivityNotFoundException) {
|
} catch (e: ActivityNotFoundException) {
|
||||||
_result.error("008", "Не удалось найти подходящее приложение", "aaa")
|
_result.error("008", "Не удалось найти подходящее приложение", "aaa")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
mavenCentral()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
@ -19,7 +18,6 @@ allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
mavenCentral()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
configurations.all {
|
configurations.all {
|
||||||
|
|
|
||||||
|
|
@ -33,9 +33,9 @@ class CloseDayResultsBean {
|
||||||
static CloseDayResultsBean? fromMap(Map<String, dynamic>? map) {
|
static CloseDayResultsBean? fromMap(Map<String, dynamic>? map) {
|
||||||
if (map == null) return null;
|
if (map == null) return null;
|
||||||
CloseDayResultsBean closeDayResultsBean = CloseDayResultsBean();
|
CloseDayResultsBean closeDayResultsBean = CloseDayResultsBean();
|
||||||
closeDayResultsBean.reconciliationResult = (map['reconciliationResult'] as List)
|
closeDayResultsBean.reconciliationResult = List.empty()..addAll(
|
||||||
.map((o) => ReconciliationResultBean.fromMap(o))
|
(map['reconciliationResult'] as List).map((o) => ReconciliationResultBean.fromMap(o))
|
||||||
.toList();
|
);
|
||||||
return closeDayResultsBean;
|
return closeDayResultsBean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -76,9 +76,9 @@ class TransactionsBean {
|
||||||
static TransactionsBean? fromMap(Map<String, dynamic>? map) {
|
static TransactionsBean? fromMap(Map<String, dynamic>? map) {
|
||||||
if (map == null) return null;
|
if (map == null) return null;
|
||||||
TransactionsBean transactionsBean = TransactionsBean();
|
TransactionsBean transactionsBean = TransactionsBean();
|
||||||
transactionsBean.transaction = (map['transaction'] as List)
|
transactionsBean.transaction = List.empty()..addAll(
|
||||||
.map((o) => TransactionBean.fromMap(o))
|
(map['transaction'] as List).map((o) => TransactionBean.fromMap(o))
|
||||||
.toList();
|
);
|
||||||
return transactionsBean;
|
return transactionsBean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,12 @@
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
class FortePosSession {
|
class FortePosSession {
|
||||||
const FortePosSession({
|
const FortePosSession(
|
||||||
this.login,
|
{this.login,
|
||||||
this.token,
|
this.token,
|
||||||
this.serverTime,
|
this.serverTime,
|
||||||
this.tokenTimeout,
|
this.tokenTimeout,
|
||||||
this.result,
|
this.result});
|
||||||
});
|
|
||||||
|
|
||||||
final String? login;
|
final String? login;
|
||||||
final String? token;
|
final String? token;
|
||||||
|
|
@ -16,64 +15,61 @@ class FortePosSession {
|
||||||
final ResultBean? result;
|
final ResultBean? result;
|
||||||
|
|
||||||
static FortePosSession fromJson(Map<String, dynamic> data) => FortePosSession(
|
static FortePosSession fromJson(Map<String, dynamic> data) => FortePosSession(
|
||||||
login: data['login'] as String?,
|
login: data['login'],
|
||||||
token: data['token'] as String?,
|
token: data['token'],
|
||||||
result: data['result'] != null ? ResultBean.fromMap(data['result'] as Map<String, dynamic>) : null,
|
result: ResultBean.fromMap(data['result']),
|
||||||
serverTime: data['ServerTime'] != null
|
serverTime: data['ServerTime'] != null
|
||||||
? DateFormat("dd.MM.yyyy HH:mm:ss ZZZ").parse(data['ServerTime'])
|
? new DateFormat("dd.MM.yyyy HH:mm:ss ZZZ").parse(data['ServerTime'])
|
||||||
: null,
|
: null,
|
||||||
tokenTimeout: data['TokenTimeout'] as int?,
|
tokenTimeout: data['TokenTimeout']);
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
|
||||||
"login": login,
|
|
||||||
"token": token,
|
|
||||||
"ServerTime": serverTime != null
|
|
||||||
? DateFormat("dd.MM.yyyy HH:mm:ss ZZZ").format(serverTime!)
|
|
||||||
: null,
|
|
||||||
"TokenTimeout": tokenTimeout,
|
|
||||||
"result": result?.toJson(),
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// ServerTime : "25.06.2021 13:18:00 GMT+06:00"
|
||||||
|
/// ResultCode : "040"
|
||||||
|
/// ResultStr : "Unknown operator login. Check the correctness of the data or contact support."
|
||||||
|
/// Response : {"Code":"040","Description":"Unknown operator login. Check the correctness of the data or contact support."}
|
||||||
|
|
||||||
class ResultBean {
|
class ResultBean {
|
||||||
late String ServerTime;
|
String? ServerTime;
|
||||||
late String ResultCode;
|
String? ResultCode;
|
||||||
late String ResultStr;
|
String? ResultStr;
|
||||||
late ResponseBean? Response;
|
ResponseBean? Response;
|
||||||
|
|
||||||
static ResultBean? fromMap(Map<String, dynamic>? map) {
|
static ResultBean? fromMap(Map<String, dynamic>? map) {
|
||||||
if (map == null) return null;
|
if (map == null) return null;
|
||||||
ResultBean resultBean = ResultBean();
|
ResultBean resultBean = ResultBean();
|
||||||
resultBean.ServerTime = map['ServerTime'] as String? ?? '';
|
resultBean.ServerTime = map['ServerTime'];
|
||||||
resultBean.ResultCode = map['ResultCode'] as String? ?? '';
|
resultBean.ResultCode = map['ResultCode'];
|
||||||
resultBean.ResultStr = map['ResultStr'] as String? ?? '';
|
resultBean.ResultStr = map['ResultStr'];
|
||||||
resultBean.Response = map['Response'] != null ? ResponseBean.fromMap(map['Response'] as Map<String, dynamic>) : null;
|
resultBean.Response = ResponseBean.fromMap(map['Response']);
|
||||||
return resultBean;
|
return resultBean;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map toJson() => {
|
||||||
"ServerTime": ServerTime,
|
"ServerTime": ServerTime,
|
||||||
"ResultCode": ResultCode,
|
"ResultCode": ResultCode,
|
||||||
"ResultStr": ResultStr,
|
"ResultStr": ResultStr,
|
||||||
"Response": Response?.toJson(),
|
"Response": Response,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Code : "040"
|
||||||
|
/// Description : "Unknown operator login. Check the correctness of the data or contact support."
|
||||||
|
|
||||||
class ResponseBean {
|
class ResponseBean {
|
||||||
late String Code;
|
String? Code;
|
||||||
late String Description;
|
String? Description;
|
||||||
|
|
||||||
static ResponseBean? fromMap(Map<String, dynamic>? map) {
|
static ResponseBean? fromMap(Map<String, dynamic>? map) {
|
||||||
if (map == null) return null;
|
if (map == null) return null;
|
||||||
ResponseBean responseBean = ResponseBean();
|
ResponseBean responseBean = ResponseBean();
|
||||||
responseBean.Code = map['Code'] as String? ?? '';
|
responseBean.Code = map['Code'];
|
||||||
responseBean.Description = map['Description'] as String? ?? '';
|
responseBean.Description = map['Description'];
|
||||||
return responseBean;
|
return responseBean;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map toJson() => {
|
||||||
"Code": Code,
|
"Code": Code,
|
||||||
"Description": Description,
|
"Description": Description,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ class ResultBean {
|
||||||
/// description : "Successfully completed"
|
/// description : "Successfully completed"
|
||||||
|
|
||||||
class HostResponseBean {
|
class HostResponseBean {
|
||||||
int? code;
|
String? code;
|
||||||
String? description;
|
String? description;
|
||||||
|
|
||||||
static HostResponseBean? fromMap(Map<String, dynamic>? map) {
|
static HostResponseBean? fromMap(Map<String, dynamic>? map) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:aman_kassa_flutter/core/models/halyk/close_day_data.dart' as halyk;
|
import 'package:aman_kassa_flutter/core/models/halyk/close_day_data.dart';
|
||||||
import 'package:aman_kassa_flutter/core/models/forte/close_day_data.dart' as forte;
|
import 'package:aman_kassa_flutter/core/models/forte/close_day_data.dart';
|
||||||
import 'package:aman_kassa_flutter/views/bank_setting/bank_setting_view.dart';
|
import 'package:aman_kassa_flutter/views/bank_setting/bank_setting_view.dart';
|
||||||
import 'package:aman_kassa_flutter/views/bank_view/bank_view.dart';
|
import 'package:aman_kassa_flutter/views/bank_view/bank_view.dart';
|
||||||
import 'package:aman_kassa_flutter/views/check/image_show_container.dart';
|
import 'package:aman_kassa_flutter/views/check/image_show_container.dart';
|
||||||
|
|
@ -17,8 +17,6 @@ import 'package:aman_kassa_flutter/views/settings/printer/views/PrinterEncoding.
|
||||||
import 'package:aman_kassa_flutter/views/settings/printer/views/PrinterPaperSize.dart';
|
import 'package:aman_kassa_flutter/views/settings/printer/views/PrinterPaperSize.dart';
|
||||||
import 'package:aman_kassa_flutter/views/settings/setting_printer_view.dart';
|
import 'package:aman_kassa_flutter/views/settings/setting_printer_view.dart';
|
||||||
import 'package:aman_kassa_flutter/views/login/login_view.dart';
|
import 'package:aman_kassa_flutter/views/login/login_view.dart';
|
||||||
import '../redux/state/bank_state.dart';
|
|
||||||
import '../redux/store.dart';
|
|
||||||
import './route_names.dart';
|
import './route_names.dart';
|
||||||
import 'package:aman_kassa_flutter/views/bank_setting/forte_setting_view.dart';
|
import 'package:aman_kassa_flutter/views/bank_setting/forte_setting_view.dart';
|
||||||
|
|
||||||
|
|
@ -111,33 +109,12 @@ Route<dynamic> generateRoute(RouteSettings settings) {
|
||||||
routeName: settings.name!,
|
routeName: settings.name!,
|
||||||
viewToShow: PrinterPaperView(),
|
viewToShow: PrinterPaperView(),
|
||||||
);
|
);
|
||||||
case CloseDayShowRoute:
|
// case CloseDayShowRoute:
|
||||||
var data = settings.arguments;
|
// CloseDayData data = settings.arguments as CloseDayData;
|
||||||
|
// return _getPageRoute(
|
||||||
if (data is halyk.CloseDayData) {
|
// routeName: settings.name!,
|
||||||
return _getPageRoute(
|
// viewToShow: CloseDayShowContainer(data),
|
||||||
routeName: settings.name!,
|
// );
|
||||||
viewToShow: CloseDayShowContainer(data),
|
|
||||||
);
|
|
||||||
} else if (data is forte.CloseDayData) {
|
|
||||||
return _getPageRoute(
|
|
||||||
routeName: settings.name!,
|
|
||||||
viewToShow: CloseDayShowContainer(data),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return _getPageRoute(
|
|
||||||
routeName: settings.name!,
|
|
||||||
viewToShow: Scaffold(
|
|
||||||
appBar: AppBar(
|
|
||||||
title: Text('Информация недоступна'),
|
|
||||||
),
|
|
||||||
body: Center(
|
|
||||||
child: Text('Данные не могут быть отображены. Пожалуйста, попробуйте позже.'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return MaterialPageRoute(
|
return MaterialPageRoute(
|
||||||
builder: (_) => Scaffold(
|
builder: (_) => Scaffold(
|
||||||
|
|
|
||||||
|
|
@ -86,8 +86,7 @@ class ApiService extends BaseService {
|
||||||
print(hash);
|
print(hash);
|
||||||
|
|
||||||
Map<String, String> requestBody = <String, String>{'login': login, 'hash': hash};
|
Map<String, String> requestBody = <String, String>{'login': login, 'hash': hash};
|
||||||
// String pointUrl = '/fortepos/test/gettoken';
|
String pointUrl = test ? '/fortepos/test/gettoken' : '/fortepos/prod/gettoken';
|
||||||
String pointUrl = '/fortepos/prod/gettoken';
|
|
||||||
var response = await requestFormData(pointUrl, requestBody, bodyEntry: true, posEndPoint: true, statusCheck: false);
|
var response = await requestFormData(pointUrl, requestBody, bodyEntry: true, posEndPoint: true, statusCheck: false);
|
||||||
print(response);
|
print(response);
|
||||||
return FortePosSession.fromJson(jsonDecode(response));
|
return FortePosSession.fromJson(jsonDecode(response));
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
|
|
||||||
import 'package:aman_kassa_flutter/core/models/halyk/halyk_post_session.dart';
|
import 'package:aman_kassa_flutter/core/models/halyk/halyk_post_session.dart';
|
||||||
import 'package:aman_kassa_flutter/core/models/forte/forte_post_session.dart';
|
|
||||||
import 'package:aman_kassa_flutter/redux/state/bank_state.dart';
|
import 'package:aman_kassa_flutter/redux/state/bank_state.dart';
|
||||||
import 'package:meta/meta.dart';
|
import 'package:meta/meta.dart';
|
||||||
import 'package:redux/redux.dart';
|
import 'package:redux/redux.dart';
|
||||||
import 'package:redux_thunk/redux_thunk.dart';
|
import 'package:redux_thunk/redux_thunk.dart';
|
||||||
|
|
||||||
|
import '../../core/models/forte/forte_post_session.dart';
|
||||||
import '../store.dart';
|
import '../store.dart';
|
||||||
|
|
||||||
@immutable
|
@immutable
|
||||||
|
|
@ -60,12 +60,6 @@ ThunkAction<AppState> saveData(String login, String password, {String? sessionTy
|
||||||
: null,
|
: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
store.dispatch(SetBankStateAction(BankState(
|
|
||||||
login: login,
|
|
||||||
password: password,
|
|
||||||
session: session,
|
|
||||||
sessionType: sessionType,
|
|
||||||
)));
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,6 @@ import 'package:vocsy_esys_flutter_share/vocsy_esys_flutter_share.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
import '../../core/models/aman_dao.dart';
|
import '../../core/models/aman_dao.dart';
|
||||||
import '../../redux/state/bank_state.dart';
|
|
||||||
import '../payment/forte_pos_service.dart';
|
|
||||||
|
|
||||||
class ImageShowContainer extends StatefulWidget {
|
class ImageShowContainer extends StatefulWidget {
|
||||||
final ImageShowModel showModel;
|
final ImageShowModel showModel;
|
||||||
|
|
@ -235,13 +233,7 @@ class _MyFloatingActionButtonState extends State<MyFloatingActionButton> {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
await Redux.store!.dispatch(changePinSkipFromSetting(true));
|
await Redux.store!.dispatch(changePinSkipFromSetting(true));
|
||||||
// Определяем метод отмены в зависимости от типа сессии
|
AmanDao<CardData> response = await reversalHalykPos(widget.data.cardData!, widget.data.voucher!.total!);
|
||||||
final BankState? state = Redux.store?.state.bankState;
|
|
||||||
final isForteSessionActive = state?.sessionType == 'Forte';
|
|
||||||
|
|
||||||
final AmanDao<CardData> response = isForteSessionActive
|
|
||||||
? await reversalFortePos(widget.data.cardData!, widget.data.voucher!.total!)
|
|
||||||
: await reversalHalykPos(widget.data.cardData!, widget.data.voucher!.total!);
|
|
||||||
if (response.success == true) {
|
if (response.success == true) {
|
||||||
pressRefund();
|
pressRefund();
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -282,12 +274,7 @@ class _MyFloatingActionButtonState extends State<MyFloatingActionButton> {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await Redux.store!.dispatch(changePinSkipFromSetting(true));
|
await Redux.store!.dispatch(changePinSkipFromSetting(true));
|
||||||
final BankState? state = Redux.store?.state.bankState;
|
AmanDao<CardData> response = await refundHalykPos(widget.data.cardData!, widget.data.voucher!.total!);
|
||||||
final isForteSessionActive = state?.sessionType == 'Forte';
|
|
||||||
|
|
||||||
final AmanDao<CardData> response = isForteSessionActive
|
|
||||||
? await refundFortePos(widget.data.cardData!, widget.data.voucher!.total!)
|
|
||||||
: await refundHalykPos(widget.data.cardData!, widget.data.voucher!.total!);
|
|
||||||
if (response.success == true) {
|
if (response.success == true) {
|
||||||
pressRefund();
|
pressRefund();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,13 @@
|
||||||
import 'package:aman_kassa_flutter/core/models/halyk/close_day_data.dart' as halyk;
|
import 'package:aman_kassa_flutter/core/models/halyk/close_day_data.dart';
|
||||||
import 'package:aman_kassa_flutter/core/models/halyk/halyk_close_day_dao.dart' as halykDao;
|
import 'package:aman_kassa_flutter/core/models/halyk/halyk_close_day_dao.dart';
|
||||||
import 'package:aman_kassa_flutter/core/models/forte/close_day_data.dart' as forte;
|
|
||||||
import 'package:aman_kassa_flutter/core/models/forte/forte_close_day_dao.dart' as forteDao;
|
|
||||||
import 'package:aman_kassa_flutter/core/models/transaction_item.dart';
|
import 'package:aman_kassa_flutter/core/models/transaction_item.dart';
|
||||||
import 'package:aman_kassa_flutter/shared/shared_styles.dart';
|
import 'package:aman_kassa_flutter/shared/shared_styles.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
import '../../redux/state/bank_state.dart';
|
|
||||||
import '../../redux/store.dart';
|
|
||||||
|
|
||||||
class CloseDayShowContainer extends StatelessWidget {
|
class CloseDayShowContainer extends StatelessWidget {
|
||||||
final dynamic data;
|
final CloseDayData data;
|
||||||
DateFormat dateFormat = DateFormat("dd.MM.yyyy HH:mm:ss");
|
DateFormat dateFormat = DateFormat("dd.MM.yyyy HH:mm:ss");
|
||||||
CloseDayShowContainer(this.data);
|
CloseDayShowContainer(this.data);
|
||||||
@override
|
@override
|
||||||
|
|
@ -65,15 +60,7 @@ class CloseDayShowContainer extends StatelessWidget {
|
||||||
return Divider();
|
return Divider();
|
||||||
},
|
},
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
final BankState? state = Redux.store?.state.bankState;
|
TransactionBean item = data.items!.elementAt(index);
|
||||||
final isForteSessionActive = state?.sessionType == 'Forte';
|
|
||||||
|
|
||||||
var item;
|
|
||||||
if (isForteSessionActive == true) {
|
|
||||||
item = data.items!.elementAt(index) as forteDao.TransactionBean;
|
|
||||||
} else {
|
|
||||||
item = data.items!.elementAt(index) as halykDao.TransactionBean;
|
|
||||||
}
|
|
||||||
return ListTile(
|
return ListTile(
|
||||||
title: Text(item.instrumentSpecificData?.maskedPan ?? ''),
|
title: Text(item.instrumentSpecificData?.maskedPan ?? ''),
|
||||||
subtitle: Column(
|
subtitle: Column(
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import 'package:aman_kassa_flutter/core/models/product_dao.dart';
|
||||||
import 'package:aman_kassa_flutter/core/models/response.dart';
|
import 'package:aman_kassa_flutter/core/models/response.dart';
|
||||||
import 'package:aman_kassa_flutter/core/route_names.dart';
|
import 'package:aman_kassa_flutter/core/route_names.dart';
|
||||||
import 'package:aman_kassa_flutter/core/services/BankService.dart';
|
import 'package:aman_kassa_flutter/core/services/BankService.dart';
|
||||||
import 'package:aman_kassa_flutter/core/services/ForteService.dart';
|
|
||||||
import 'package:aman_kassa_flutter/core/services/DataService.dart';
|
import 'package:aman_kassa_flutter/core/services/DataService.dart';
|
||||||
import 'package:aman_kassa_flutter/core/services/dialog_service.dart';
|
import 'package:aman_kassa_flutter/core/services/dialog_service.dart';
|
||||||
import 'package:aman_kassa_flutter/core/services/navigator_service.dart';
|
import 'package:aman_kassa_flutter/core/services/navigator_service.dart';
|
||||||
|
|
@ -38,7 +37,6 @@ import 'package:aman_kassa_flutter/views/payment/halyk_pos_service.dart';
|
||||||
import '../../core/models/aman_dao.dart';
|
import '../../core/models/aman_dao.dart';
|
||||||
import '../../core/models/card_data.dart';
|
import '../../core/models/card_data.dart';
|
||||||
import '../../core/models/card_data.dart';
|
import '../../core/models/card_data.dart';
|
||||||
import 'forte_pos_service.dart';
|
|
||||||
|
|
||||||
class PaymentView extends StatefulWidget {
|
class PaymentView extends StatefulWidget {
|
||||||
final PaymentModel model;
|
final PaymentModel model;
|
||||||
|
|
@ -53,7 +51,7 @@ class _PaymentViewState extends State<PaymentView> {
|
||||||
final GlobalKey<State> _keyLoader = new GlobalKey<State>();
|
final GlobalKey<State> _keyLoader = new GlobalKey<State>();
|
||||||
final DataService _dataService = locator<DataService>();
|
final DataService _dataService = locator<DataService>();
|
||||||
final DialogService _dialogService = locator<DialogService>();
|
final DialogService _dialogService = locator<DialogService>();
|
||||||
dynamic _bankService;
|
BankService _bankService = locator<BankService>();
|
||||||
final NavigatorService _navigatorService = locator<NavigatorService>();
|
final NavigatorService _navigatorService = locator<NavigatorService>();
|
||||||
final TextEditingController _iinController = new TextEditingController();
|
final TextEditingController _iinController = new TextEditingController();
|
||||||
late bool isBusy;
|
late bool isBusy;
|
||||||
|
|
@ -76,25 +74,12 @@ class _PaymentViewState extends State<PaymentView> {
|
||||||
}
|
}
|
||||||
|
|
||||||
_bankInit() async {
|
_bankInit() async {
|
||||||
BankState? state = Redux.store?.state.bankState;
|
|
||||||
|
|
||||||
print(state?.toJson());
|
|
||||||
|
|
||||||
if (state?.sessionType == 'Halyk' && state?.session != null) {
|
|
||||||
_bankService = locator<BankService>();
|
|
||||||
} else if (state?.sessionType == 'Forte' && state?.session != null) {
|
|
||||||
_bankService = locator<ForteService>();
|
|
||||||
} else {
|
|
||||||
setState(() {
|
|
||||||
isBankApiAccess = false;
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int version = await _bankService.version();
|
int version = await _bankService.version();
|
||||||
setState(() {
|
if (version >= _bankService.sdkVersion) {
|
||||||
isBankApiAccess = version >= _bankService.sdkVersion;
|
setState(() {
|
||||||
});
|
isBankApiAccess = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -262,15 +247,6 @@ class _PaymentViewState extends State<PaymentView> {
|
||||||
state.password!.length < 1 || state.login!.length < 1) {
|
state.password!.length < 1 || state.login!.length < 1) {
|
||||||
return Container();
|
return Container();
|
||||||
}
|
}
|
||||||
final bool isForteSessionActive = state.sessionType == 'Forte';
|
|
||||||
|
|
||||||
final String imageAsset = isForteSessionActive
|
|
||||||
? 'assets/images/fortepos.png'
|
|
||||||
: 'assets/images/halykpos.png';
|
|
||||||
final Color sessionColor = isForteSessionActive ? forteColor : halykColor;
|
|
||||||
final Future<AmanDao<CardData>> Function(double) paymentMethod =
|
|
||||||
isForteSessionActive ? paymentFortePos : paymentHalykPos;
|
|
||||||
|
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: isBusy ?
|
onTap: isBusy ?
|
||||||
() {} :
|
() {} :
|
||||||
|
|
@ -292,7 +268,7 @@ class _PaymentViewState extends State<PaymentView> {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await Redux.store!.dispatch(changePinSkipFromSetting(true));
|
await Redux.store!.dispatch(changePinSkipFromSetting(true));
|
||||||
AmanDao<CardData> data = await paymentMethod(_total);
|
AmanDao<CardData> data = await paymentHalykPos(_total);
|
||||||
if (data.success == true) {
|
if (data.success == true) {
|
||||||
pressPayment('card', data.data);
|
pressPayment('card', data.data);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -317,7 +293,7 @@ class _PaymentViewState extends State<PaymentView> {
|
||||||
border: Border.all(color: Colors.white),
|
border: Border.all(color: Colors.white),
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
image: AssetImage(imageAsset),
|
image: AssetImage('assets/images/halykpos.png'),
|
||||||
fit: BoxFit.fitWidth
|
fit: BoxFit.fitWidth
|
||||||
),
|
),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ packages:
|
||||||
name: barcode_scan2
|
name: barcode_scan2
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.2.4"
|
version: "4.2.1"
|
||||||
bluetooth_print:
|
bluetooth_print:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
name: aman_kassa_flutter
|
name: aman_kassa_flutter
|
||||||
description: A new Flutter project.
|
description: A new Flutter project.
|
||||||
version: 1.4.0+43
|
version: 1.4.0+42
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=2.15.0 <4.0.0'
|
sdk: '>=2.15.0 <3.0.0'
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue