MadBrains / Mad-Pay-Flutter

Mad Pay will help you make payments through Apple Pay and Google Pay
https://pub.dev/packages/mad_pay
MIT License
30 stars 16 forks source link

D/plugins.madbrains.ru/mad_pay_channel(10071): ignoring exception: java.lang.IllegalStateException: Reply already submitted. See https://github.com/flutter/flutter/issues/29092 for details. #40

Open FeofanGreek opened 2 years ago

FeofanGreek commented 2 years ago

Здравствуйте! После нажатия на кнопку GPay и выбора карты для оплаты в консоль вываливается ошибка D/plugins.madbrains.ru/mad_pay_channel(10071): ignoring exception: java.lang.IllegalStateException: Reply already submitted. See https://github.com/flutter/flutter/issues/29092 for details.

Дальнейшее выполнение программы не идет.

Ошибку вызывает функция из андроид пакета, находится в файле MadPayAndroidPlugin.kt на строке 61:

  private fun invokeSuccessResult(@Nullable data: ByteArray?) {
        val res = MadPay.Response.newBuilder().setSuccess(true)
        if (data != null)
            res.data = ByteString.copyFrom(data)

        ignoreIllegalState { activeResult.success(res.build().toByteArray()) }
    } 
mit-73 commented 2 years ago

Здравствуйте @FeofanGreek, скажите пожалуйста какую версию mad_pay и flutter вы используете?

FeofanGreek commented 2 years ago

Добрый день

Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 2.5.3, on macOS 12.1 21C52 darwin-arm, locale ru) [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) [✓] Xcode - develop for iOS and macOS [✓] Chrome - develop for the web [✓] Android Studio (version 2020.3) [✓] Connected device (2 available)

• No issues found!

tinkoff_acquiring: ^3.0.4 tinkoff_acquiring_flutter: ^3.0.4 mad_pay: ^2.2.7

26 янв. 2022 г., в 07:57, MiT @.***> написал(а):

Здравствуйте @FeofanGreek https://github.com/FeofanGreek, скажите пожалуйста какую версию mad_pay и flutter вы используете?

— Reply to this email directly, view it on GitHub https://github.com/MadBrains/Mad-Pay-Flutter/issues/40#issuecomment-1021890577, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANTRAK4CFW3CYPEQAOOB3A3UX6ELTANCNFSM5MZGWMWA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.

FeofanGreek commented 2 years ago

Пример моей реализации

`final MadPay pay = MadPay(environment: Environment.test);

GooglePayButton( environment: Environment.test, type: GooglePayButtonType.plain, request: PaymentRequest.google( google: GoogleParameters( gatewayName: 'tinkoff', gatewayMerchantId: '*DEMO', merchantId: '****', ), currencyCode: 'RUB', countryCode: 'RU', paymentItems: [ PaymentItem(name: 'T-Shirt', price: 11.00), ], paymentNetworks: [ PaymentNetwork.visa, PaymentNetwork.mastercard, PaymentNetwork.mir, PaymentNetwork.maestro ] ), onPaymentResult: (PaymentResponse? req) async { print(1); const String terminalKey = '*DEMO'; const String password = '**'; String customerKey = userId.toString(); final TinkoffAcquiring acquiring = TinkoffAcquiring( TinkoffAcquiringConfig( terminalKey: terminalKey, password: password, debug: false, ), ); final InitResponse init = await acquiring.init(InitRequest( orderId: orderNum, // id заказа customerKey: customerKey, // ключ продовца amount: amount, // сумма в копейках //… // другие параметры )); // производим оплату final FinishAuthorizeResponse fa = await acquiring.finishAuthorize(FinishAuthorizeRequest( paymentId: int.parse(init.paymentId!), // id из платежной сессии encryptedPaymentData: req!.token, // данные из Apple/Google Pay route: Route.Route.acq, source: Source.googlePay // ApplePay или GooglePay //… // другие параметры )); // Проверяем есть ли запрос на прохождение классической провер final Completer<Submit3DSAuthorizationResponse?> webView = Completer<Submit3DSAuthorizationResponse?>(); if (fa.status == Status.threeDsChecking) { Navigator.of(context).push(MaterialPageRoute( builder: (BuildContext context) => Scaffold( body: WebView3DS( config: acquiring.config, is3DsVersion2: fa.is3DsVersion2 , serverTransId: fa.serverTransId , acsUrl: fa.acsUrl!, md: fa.md, paReq: fa.paReq, acsTransId: fa.acsTransId, //version: check3DSVersion.version, onLoad: (bool v) { debugPrint('WebView load: $v'); }, onFinished: ( Submit3DSAuthorizationResponse? v) { Navigator.of(context).pop(); webView.complete(v); }, ), ), )); } else { webView.complete(null); } }, onError: (Object? e) { print(e); }, )`

FeofanGreek commented 2 years ago

IMG_0202 D/plugins.madbrains.ru/mad_pay_channel(25255): ignoring exception: java.lang.IllegalStateException: Reply already submitted. See https://github.com/flutter/flutter/issues/29092 for details.

mit-73 commented 2 years ago

@FeofanGreek к сожалению мы не смогли воспроизвести вашу проблему. Скажите пожалуйста проблема все еще актуальна?