Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ошибка при сериализации json['AccountTokens'] в запросе счетов для оплаты по СБП #57

Open
FeofanGreek opened this issue Jul 6, 2023 · 3 comments

Comments

@FeofanGreek
Copy link

Здравствуйте!
Получаю ошибочку:
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: type 'int' is not a subtype of type 'String?' in type cast
#0 _$AccountQrTokenFromJson (package:tinkoff_acquiring/src/core/models/common/account_qr_token.g.dart:11:38)
#1 new AccountQrToken.fromJson (package:tinkoff_acquiring/src/core/models/common/account_qr_token.dart:22:7)
#2 _$GetAccountQrListResponseFromJson. (package:tinkoff_acquiring/src/core/models/get_account_qr_list/get_account_qr_list_response.g.dart:19:39)
#3 MappedListIterable.elementAt (dart:_internal/iterable.dart:415:31)
#4 ListIterator.moveNext (dart:_internal/iterable.dart:344:26)
#5 new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:189:27)
#6 new _GrowableList.of (dart:core-patch/growable_array.dart:150:28)
#7 new List.of (dart:core-patch/array_patch.dart:47:28)
#8 ListIterable.toList (dart:_internal/iterable.dart:214:7)
#9 _$GetAccountQrListResponseFromJson (package:tinkof<…>

при выполнении:
///получаем список аккаунт токенов
var sbpAccountList = await acquiring.getAccountQrList(GetAccountQrListRequest(signToken: signToken));

при чем, когда ни одного счета не было возвращался нормально пустой массив
после привязки счета, ответ от сервера идет адекватный:
[Tinkoff | RawResponse] 200 | {"Success":true,"ErrorCode":"0","Message":"OK","TerminalKey":"**********","AccountTokens":[{"RequestKey":136971,"Status":"PROCESSING"}]}

а расшифровать его сериализатор не может: get_account_qr_list_response.g.dart строка 18

@FeofanGreek
Copy link
Author

еще точнее account_qr_token.g.dart строка 11, там строка ожидается, а прилетает явно инт

@FeofanGreek
Copy link
Author

далее, поправил временно конвертацию руками, ошибка по конвертации статуса
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: Invalid argument(s): PROCESSING is not one of the supported values: notExist, NEW, FORM_SHOWED, DEADLINE_EXPIRED, CANCELED, PREAUTHORIZING, AUTHORIZING, AUTH_FAIL, REJECTED, 3DS_CHECKING, 3DS_CHECKED, PAY_CHECKING, AUTHORIZED, REVERSING, PARTIAL_REVERSED, REVERSED, CONFIRMING, CONFIRM_CHECKING, CONFIRMED, REFUNDING, ASYNC_REFUNDING, PARTIAL_REFUNDED, REFUNDED, UNKNOWN, LOOP_CHECKING, LOOP_CHECKED, COMPLETED, PROCCESING, ACTIVE, INACITVE
#0 $enumDecodeNullable (package:json_annotation/src/enum_helpers.dart:37:5)
#1 _$AccountQrTokenFromJson (package:tinkoff_acquiring/src/core/models/common/account_qr_token.g.dart:12:15)
#2 new AccountQrToken.fromJson (package:tinkoff_acquiring/src/core/models/common/account_qr_token.dart:22:7)
#3 _$GetAccountQrListResponseFromJson. (package:tinkoff_acquiring/src/core/models/get_account_qr_list/get_account_qr_list_response.g.dart:19:39)
#4 MappedListIterable.element<…>

@FeofanGreek
Copy link
Author

опечатка Status.proccesing: 'PROCCESING',

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant