I am trying to integrate paytm for our android app.
New PaytmOrder object requires checksumhash as parameter.
To generate checksumhash, we are using jar file recommended from paytm.
https://github.com/Paytm-Payments/Paytm_Google_App_Engine_Kit
We have added this jar in our lib folder.
implementation files('src/main/libs/pg-checksum-1.0-jar-with-dependencies.jar')
This is the code used to generate checksumhash in our android app.
try{
String checkSum = CheckSumServiceHelper.getCheckSumServiceHelper().genrateCheckSum("7MTqfy715ot231CT", convertToTreeMap(paramMap));
paramMap.put("CHECKSUMHASH" , checkSum);
System.out.println("Paytm Payload: "+ paramMap);
}catch(Exception e) {
e.printStackTrace();
}
But we are getting below exception below when trying to get checksumhash.
System.err: java.security.NoSuchProviderException: No such provider: SunJCE
2020-01-01 11:32:33.581 26112-26112 W/System.err: at javax.crypto.Cipher.getInstance(Cipher.java:671)
2020-01-01 11:32:33.581 26112-26112 W/System.err: at com.paytm.pg.crypto.AesEncryption.encrypt(AesEncryption.java:34)
2020-01-01 11:32:33.581 26112-26112/System.err: at com.paytm.pg.merchant.CheckSumServiceHelper.genrateCheckSum(CheckSumServiceHelper.java:53)
I was able to fix this problem when i started generating checksum hash from my application server.
The above issue occurred because i was trying to generate checksum hash in android locally.