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