我正在尝试将Paytm API集成到我的应用程序中。在生成校验和之后,Paytm尝试访问webview,但是出现此错误
Trying to make virtual context current without decoder
这是什么主要原因?
这是我的api调用,paytm从中生成校验和,而我正在获取校验和并启动paytm服务。但是在打开此webview时出现错误。
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 {
}
}
} );
}