2015-08-25 51 views

回答

0

整合paytym這樣的..

Random randomGenerator = new Random(); 
    randomInt = randomGenerator.nextInt(1000); 
    //for testing environment 
    Service = PaytmPGService.getStagingService(); 
    PaytmMerchant Merchant = new PaytmMerchant("https://pguat.paytm.com/merchant-chksum/ChecksumGenerator","https://pguat.paytm.com/merchant-chksum/ValidateChksum"); 

    Log.e("value","value"); 

    Map<String, String> paramMap = new HashMap<String, String>(); 

    //these are mandatory parameters 
    paramMap.put("REQUEST_TYPE", "DEFAULT"); 
    paramMap.put("ORDER_ID", String.valueOf(randomInt)); 
    //MID provided by paytm 
    paramMap.put("MID", "id provided by paytm"); 
    paramMap.put("CUST_ID", "CUST123"); 
    paramMap.put("CHANNEL_ID", "WAP"); 
    paramMap.put("INDUSTRY_TYPE_ID", "Retail"); 
    paramMap.put("WEBSITE", "paytm"); 
    paramMap.put("TXN_AMOUNT", "1"); 
    paramMap.put("THEME", "merchant"); 

    PaytmOrder Order = new PaytmOrder(paramMap); 


    Service.initialize(Order, Merchant,null); 
    Log.e("value1111","value"); 
    Service.startPaymentTransaction(this, true, true, new PaytmPaymentTransactionCallback() { 
     @Override 
     public void onTransactionSuccess(Bundle bundle) { 
      app.getLogger().error("Transaction Success :" + bundle); 
      Log.e("Transaction Success :",""+bundle); 
     } 

     @Override 
     public void onTransactionFailure(String s, Bundle bundle) { 
     app.getLogger().error("Transaction Failure :" + s + "\n" + bundle); 
      Log.e("Transaction Failure :",s+" "+bundle); 
     } 

     @Override 
     public void networkNotAvailable() { 
     app.getLogger().error("network unavailable :"); 
      Log.e("network unavailable :","network unavailable : "); 
     } 

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

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

     @Override 
     public void onErrorLoadingWebPage(int i, String s, String s2) { 
     app.getLogger().error("errorLoadingWebPage :" + i + "\n" + s + "\n" + s2); 
      Log.e("errorLoadingWebPage :",i+" "+s+" "+s2); 
     } 
    }); 
} 

ChecksumGeneratorValidateChksum是由paytym團隊提供。

+0

謝謝先生給我答案,但我不明白,這是paytm交易,但我想知道有關託管帳戶。 1000是我們可以設置的默認價格。請告訴我,這可能是美國價格的工作。 –