Попытка сделать виртуальный контекст текущим без декодера - PullRequest
1 голос
/ 22 апреля 2019

Я пытаюсь интегрировать Paytm API в свое приложение.Paytm пытался получить доступ к webview, после генерации контрольной суммы, но я получаю эту ошибку,

Trying to make virtual context current without decoder

в чем основная причина этого?

это мой вызов API, из которого paytm генерирует контрольную сумму, а я получаю контрольную сумму и запускаю сервис paytm.но при открытии этого веб-просмотра я получаю сообщение об ошибке.

public void paymentVerification(String authToken, String farmerId, Context context) {
        EndPoints.getPaymentDetails( authToken, farmerId, new Callback<BasicResponse>() {
            @Override
            public void onResponse(@NonNull Call<BasicResponse> call, @NotNull Response<BasicResponse> response) {
                if (response.isSuccessful()) {
                    BasicResponse basicResponse = response.body();
                    assert basicResponse != null;
                    ErrorCode errorCode = basicResponse.getErrorCode();
                    if (!NetworkErrorHandlingUtils.ErrorCheck( errorCode )) {
                        //  update farmerMutableLiveData Details...
                        PaymentLogResponse paymentLogResponse = GsonUtils.fromGson( basicResponse.getResponse(), PaymentLogResponse.class );

                        //  for production environment...
                        PaytmPGService Service = PaytmPGService.getStagingService();
                        HashMap<String, String> paramMap = new HashMap<>();
                        paramMap.put( "MID", paymentLogResponse.getMerchantId() );
                        // Key in your staging and production MID available in your dashboard
                        paramMap.put( "ORDER_ID", paymentLogResponse.getOrderId() );
                        paramMap.put( "CUST_ID", paymentLogResponse.getCustomerId() );
                        paramMap.put( "CHANNEL_ID", paymentLogResponse.getChannelId().name() );
                        paramMap.put( "TXN_AMOUNT", paymentLogResponse.getAmountPaid() );
                        paramMap.put( "WEBSITE", paymentLogResponse.getWebsite().name() );
                        // This is the staging value. Production value is available in your dashboard
                        paramMap.put( "INDUSTRY_TYPE_ID", paymentLogResponse.getIndustry_type().name() );
                        // This is the staging value. Production value is available in your dashboard
                        paramMap.put( "CALLBACK_URL", "https://securegw-stage.paytm.in/theia/paytmCallback?ORDER_ID=" + paymentLogResponse.getOrderId() );
                        paramMap.put( "CHECKSUMHASH", paymentLogResponse.getChecksumHash() );
                        PaytmOrder Order = new PaytmOrder( paramMap );
                        Service.initialize( Order, null );
                        Service.startPaymentTransaction( context, true, true, new PaytmPaymentTransactionCallback() {
                            /*Call Backs*/
                            public void someUIErrorOccurred(String inErrorMessage) {
                            }

                            public void onTransactionResponse(Bundle inResponse) {
                            }

                            public void networkNotAvailable() {
                            }

                            public void clientAuthenticationFailed(String inErrorMessage) {
                            }

                            public void onErrorLoadingWebPage(int iniErrorCode, String inErrorMessage, String inFailingUrl) {
                            }

                            public void onBackPressedCancelTransaction() {
                            }

                            public void onTransactionCancel(String inErrorMessage, Bundle inResponse) {
                            }
                        } );
                    } else {
                        //  show error dialog here..., the error could be from one of the Error Code...

                    }
                }
            }

            @Override
            public void onFailure(@NonNull Call<BasicResponse> call, @NotNull Throwable t) {
                //  show UI for API Failure...
                if (t instanceof NoConnectivityException) {
                    //  This is where it throws No Internet connectivity error...
                    //  show some UI here, sefu...
                    IntentUtils.PassIntent( context, NetworkErrorActivity.class );
                }
                //  there's some other error, not network connectivity issue...
                else {

                }
            }
        } );
    }
...