Android Question Calling Java module using java object and getting result

Johnson Samuel

Member
Licensed User
Longtime User
Below I have given the Java Module to which i want to make a call by passing parameters and get back the result.
This I wish to include in my B4A App.
The Remote dependency is : com.paytm:pgplussdk:1.4.4, This I am declaring as a #additionalJar.
The java module is as below:

#If Java
protected void onPostExecute(String result) {
Log.e(" setup acc "," signup result " + result);
if (dialog.isShowing()) {
dialog.dismiss();
}
PaytmPGService Service = PaytmPGService.getStagingService();

HashMap<String, String> paramMap = new HashMap<String, String>();
//these are mandatory parameters
paramMap.put("MID", mid);
paramMap.put("ORDER_ID", orderId);
paramMap.put("CUST_ID", custid);
paramMap.put("CHANNEL_ID", "WAP");
paramMap.put("TXN_AMOUNT", "100");
paramMap.put("WEBSITE", "WEBSTAGING");
paramMap.put("CALLBACK_URL" ,varifyurl);

paramMap.put("CHECKSUMHASH" ,CHECKSUMHASH);

paramMap.put("INDUSTRY_TYPE_ID", "Retail");
PaytmOrder Order = new PaytmOrder(paramMap);
Log.e("checksum ", "param "+ paramMap.toString());
Service.initialize(Order,null);
// start payment service call here
Service.startPaymentTransaction(checksum.this, true, true,
checksum.this );
}
}
@override
public void onTransactionResponse(Bundle bundle) {
Log.e("checksum ", " respon true " + bundle.toString());
}
@override
public void networkNotAvailable() {
}
@override
public void clientAuthenticationFailed(String s) {
}
@override
public void someUIErrorOccurred(String s) {
Log.e("checksum ", " ui fail respon "+ s );
}
@override
public void onErrorLoadingWebPage(int i, String s, String s1) {
Log.e("checksum ", " error loading pagerespon true "+ s + " s1 " + s1);
}
@override
public void onBackPressedCancelTransaction() {
Log.e("checksum ", " cancel call back respon " );
}
@override
public void onTransactionCancel(String s, Bundle bundle) {
Log.e("checksum ", " transaction cancel " );
}
}
#end if

'-------------------------------------
Can any expert help me to call this java module with passing the parameters and getting back the Result.? I will be very glad to hear from you.
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Top