在进行Paytm Transation后,Android ProgressDialog不会被解雇

时间:2016-04-28 10:14:18

标签: android webview progressdialog paytm

当paytm WebView调用"回到Activity"返回。什么应该是处理等待转换的方法完成。

我的进度对话在Paytm屏幕打开之前打开但是从paytm屏幕返回到活动进度对话框而不是解雇..

请关于这个问题的任何帮助或想法......

  1.OnSuccess of transaction i opened paytmcheckout() method 
  in this method i want to Dismiss or cancel the progressbarDialog.

  But it is not dismiss here.

    public void paytmCheckout(){
     if(_progressDialog.isShowing()) {
                _progressDialog.hide();
                _progressDialog.dismiss();
         }
    }

 2. progressDialog Declared globally
            ProgressDialog _progressDialog;

      onButtonClick()
             calls  openpaytm  Method


 My OpenPaytm method::
     private void openPaytm() {

        int price;
        if (discount != 0) {
        price = modalPlan.getInrPrice() - discount;
        } else {
            price = modalPlan.getInrPrice();
        }
 //Here`
 //my progressDialog is opened here successfully
//
    if(_progressDialog==null){
        mLoginFormView.setVisibility(View.INVISIBLE);
    final ProgressDialog _progressDialog = ProgressDialog.show(
            getActivity(),
            "Transation",
            "Progress....",
            true,
            true
    );
    }

    Random randomGenerator = new Random();
    randomInt = randomGenerator.nextInt(1000);
    Service = PaytmPGService.getStagingService(); //for production  environment
    PaytmMerchant Merchant = new    PaytmMerchant("https://app.mobikyte.com/paytm/generateChecksum.php", "https://app.mobikyte.com/paytm/verifyChecksum.php");

    HashMap<String, String> paramMap = new HashMap<>();
    paramMap.put("REQUEST_TYPE", "DEFAULT");
    paramMap.put("ORDER_ID", "" + modalAddCampign.getOrderId());
    paramMap.put("MID", "Audian53591216301431");
    paramMap.put("CUST_ID", modalLogin.getClientid());
    paramMap.put("CHANNEL_ID", "WAP");
    paramMap.put("INDUSTRY_TYPE_ID", "Retail");
    paramMap.put("WEBSITE", "AudianzN");
    paramMap.put("TXN_AMOUNT", "" + price);
    paramMap.put("THEME", "merchant");

    String par = paramMap.toString();
    Log.e("TESTING:", "Paytm Params" + par);
    PaytmOrder Order = new PaytmOrder(paramMap);
    Service.initialize(Order, Merchant, null);
    Service.startPaymentTransaction(getActivity(), false, false, new  PaytmPaymentTransactionCallback() {
        @Override
        public void onTransactionSuccess(Bundle bundle) {
            Log.d("TEST", "Bundle = =" + bundle);

              paytmCheckout();
        }

        @Override
        public void onTransactionFailure(String s, Bundle bundle) {
            Log.e("Error", "someErrorOccurred :" + s);

 //Not dismissing here also

            _progressDialog.dismiss();
    //             _progressDialog.cancel();
        }

        @Override
        public void networkNotAvailable() {
            Log.e("Error", "NetworkErrorOccurred :");
        }

        @Override
        public void clientAuthenticationFailed(String s) {
            Log.e("Error", "clientAuthenticationFailed :" + s);
        }

        @Override
        public void someUIErrorOccurred(String s) {
            Log.e("Error", "someUIErrorOccurred :" + s);
        }

        @Override
        public void onErrorLoadingWebPage(int i, String s, String s1) {
            Log.e("Error", "onErrorLoadingWebPage :" + s1);
        }
    });
}

0 个答案:

没有答案