MPU certification in progress + TMS
This commit is contained in:
parent
5d51f53440
commit
b073e62a20
@ -339,9 +339,9 @@ public class NetworkModule {
|
||||
// client.connectTimeout(10,TimeUnit.SECONDS);
|
||||
client.addNetworkInterceptor(new SiriusInterceptor());
|
||||
|
||||
if(BuildConfig.DEBUG) {
|
||||
client.addInterceptor(interceptor);
|
||||
}
|
||||
// if(BuildConfig.DEBUG) {
|
||||
client.addInterceptor(interceptor);
|
||||
// }
|
||||
|
||||
|
||||
String tmsAddress = SystemParamsOperation.getInstance().getTmsAddress();
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.utsmyanmar.baselib.network.interceptor;
|
||||
|
||||
import android.os.RemoteException;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.utsmyanmar.baselib.util.TerminalUtil;
|
||||
@ -29,7 +31,7 @@ public class SiriusInterceptor implements Interceptor {
|
||||
hashed = TerminalUtil.getInstance().generateHashedString(nonce).toLowerCase();
|
||||
|
||||
LogUtil.d(TAG,"hashed :"+ hashed);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
} catch (NoSuchAlgorithmException | RemoteException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@ public class TerminalUtil {
|
||||
basicOptV2.buzzerOnDevice(3,7,2000,1000);
|
||||
}
|
||||
|
||||
public String generateHashedString(String random) throws NoSuchAlgorithmException {
|
||||
public String generateHashedString(String random) throws NoSuchAlgorithmException,RemoteException {
|
||||
return terminalUtils.generateHashString(random,basicOptV2);
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
package com.utsmyanmar.baselib.util;
|
||||
|
||||
import android.os.RemoteException;
|
||||
|
||||
import com.sunmi.pay.hardware.aidlv2.system.BasicOptV2;
|
||||
import com.utsmyanmar.baselib.BaseApplication;
|
||||
import com.utsmyanmar.paylibs.utils.core_utils.ByteUtil;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@ -11,8 +14,14 @@ import java.util.Random;
|
||||
public class TerminalUtilsImpl implements TerminalUtils{
|
||||
@Override
|
||||
public String generateHashString(String random,BasicOptV2 basicOptV2) throws NoSuchAlgorithmException {
|
||||
String sn = "P30224BSJ0276";
|
||||
String snPN = "com.mob.utsmyanmar";
|
||||
String sn = null;
|
||||
try {
|
||||
sn = BaseApplication.basicOptV2.getSysParam("SN");
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
;
|
||||
String snPN = BaseApplication.getInstance().getPackageName();
|
||||
String text = sn + snPN + random;
|
||||
MessageDigest digest = MessageDigest.getInstance("SHA-256");
|
||||
byte[] hash = digest.digest(text.getBytes(StandardCharsets.UTF_8));
|
||||
|
||||
@ -338,10 +338,10 @@ public class ISOSocket {
|
||||
// serverPort = 5033;
|
||||
// serverIP = "192.168.0.100";
|
||||
// serverPort = 5001;
|
||||
serverIP = "103.84.101.82";
|
||||
serverPort = 60147;
|
||||
// serverIP = getSecondaryIp();
|
||||
// serverPort = getSecondaryPort();
|
||||
// serverIP = "103.84.101.82";
|
||||
// serverPort = 60147;
|
||||
serverIP = getSecondaryIp();
|
||||
serverPort = getSecondaryPort();
|
||||
}
|
||||
|
||||
public void enqueue(byte[] sendBuff, int sendLen, boolean reversalTrans, ISOCallback listener) {
|
||||
@ -358,13 +358,13 @@ public class ISOSocket {
|
||||
* If it is not secondary, go with primary
|
||||
*/
|
||||
if (!isSwitchIp) {
|
||||
// serverIP = getIp();
|
||||
// serverPort = getPort();
|
||||
serverIP = getIp();
|
||||
serverPort = getPort();
|
||||
// serverIP = "192.168.0.100";
|
||||
// serverPort = 5001;
|
||||
serverIP = "103.84.101.82";
|
||||
serverPort = 60147;
|
||||
SystemParamsOperation.getInstance().setSslSwitchStatus(true);
|
||||
// serverIP = "103.84.101.82";
|
||||
// serverPort = 60147;
|
||||
// SystemParamsOperation.getInstance().setSslSwitchStatus(true);
|
||||
// serverIP = "posuat.myanmarorientalbank.com";
|
||||
// serverPort = 5033;
|
||||
} else {
|
||||
|
||||
@ -106,11 +106,11 @@ public class Params {
|
||||
|
||||
// mock tid,mid
|
||||
|
||||
// payDetail.setTerminalNo("00000003");
|
||||
// payDetail.setMerchantNo("777031200000001");
|
||||
// mpu
|
||||
payDetail.setTerminalNo("10040018");
|
||||
payDetail.setMerchantNo("110400000000006");
|
||||
payDetail.setTerminalNo(dataOperation.getTerminalId());
|
||||
payDetail.setMerchantNo(dataOperation.getMerchantId());
|
||||
// // mpu
|
||||
// payDetail.setTerminalNo("10040018");
|
||||
// payDetail.setMerchantNo("110400000000006");
|
||||
|
||||
// 4, Nov ,2024
|
||||
payDetail.setTransCVM(TransCVM.NO_CVM);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user