changes in TTQ[index 1] and CAPK modulus and checksum to lowercase/ datetime as ascii to string
This commit is contained in:
parent
328f114ca0
commit
bc3b2cbe4a
@ -13,6 +13,9 @@
|
||||
</DropdownSelection>
|
||||
<DialogSelection />
|
||||
</SelectionState>
|
||||
<SelectionState runConfigName="ecr-service">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
</SelectionState>
|
||||
</selectionStates>
|
||||
</component>
|
||||
</project>
|
||||
@ -13,6 +13,8 @@
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
<option value="$PROJECT_DIR$/baselib" />
|
||||
<option value="$PROJECT_DIR$/ecr" />
|
||||
<option value="$PROJECT_DIR$/ecr-client-lib" />
|
||||
<option value="$PROJECT_DIR$/ecr-service" />
|
||||
<option value="$PROJECT_DIR$/ecr-service-lib" />
|
||||
<option value="$PROJECT_DIR$/link-service-lib" />
|
||||
<option value="$PROJECT_DIR$/mpulib" />
|
||||
|
||||
@ -73,6 +73,11 @@ android {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
lint {
|
||||
abortOnError false
|
||||
checkReleaseBuilds false
|
||||
}
|
||||
|
||||
packagingOptions {
|
||||
pickFirst '**/libnative-lib.so'
|
||||
pickFirst '**/libxgd_ddi_jni.so'
|
||||
@ -100,6 +105,11 @@ kapt {
|
||||
arg("room.incremental", "true")
|
||||
arg("room.expandProjection", "true")
|
||||
}
|
||||
|
||||
// Exclude ECR integration classes from kapt processing
|
||||
javacOptions {
|
||||
option("-Xmaxerrs", 500)
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@ -176,8 +186,8 @@ dependencies {
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||
implementation "com.github.akarnokd:rxjava3-retrofit-adapter:3.0.0"
|
||||
|
||||
// ViewModel
|
||||
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.2.0'
|
||||
// ViewModel with Kotlin extensions
|
||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2'
|
||||
|
||||
// LiveData
|
||||
implementation 'androidx.lifecycle:lifecycle-livedata:2.2.0'
|
||||
@ -192,7 +202,11 @@ dependencies {
|
||||
// implementation 'com.sunmi:sunmiui:1.1.27' //1.1.27
|
||||
|
||||
|
||||
// ECR Dependencies - Modern ECR Client Library
|
||||
implementation project(path: ':ecr-client-lib')
|
||||
implementation project(path: ':ecr-service-lib')
|
||||
|
||||
// Core Libraries
|
||||
implementation project(path: ':paylibs')
|
||||
implementation project(path: ':mpulib')
|
||||
implementation project(path: ':baselib')
|
||||
@ -203,9 +217,15 @@ dependencies {
|
||||
// implementation project(path: ':sunmiui-lib')
|
||||
implementation project(path: ':qrgen-lib')
|
||||
//// implementation project(path: ':samlSirius')
|
||||
|
||||
// Legacy ECR (kept for backward compatibility during migration)
|
||||
implementation project(path: ':ecr')
|
||||
implementation project(path: ':nexdlkey-lib')
|
||||
|
||||
// Coroutines for modern ECR client
|
||||
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3'
|
||||
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'
|
||||
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.2' // 1.1.2
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.utsmm.kbz;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.ActionBarDrawerToggle;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
@ -161,7 +160,7 @@ public class MainActivity extends AppCompatActivity implements
|
||||
SystemParamsOperation.getInstance().setTmsAddress("https://api-tms-uat.kbzbank.com:8443/sirius");
|
||||
// SystemParamsOperation.getInstance().setTmsAddress("https://sirius-nest.utsmyanmar.com");
|
||||
SystemParamsOperation.getInstance().setEReceiptAddress("https://api-tms-uat.kbzbank.com:8443/receipt");
|
||||
// SystemParamsOperation.getInstance().setEReceiptAddress("https://receipt-nest.utsmyanmar.com");
|
||||
// SystemParamsOperation.getInstance().setEReceiptAddress("http://receipt-nest.utsmyanmar.com");
|
||||
|
||||
PinPad pinPad = MyApplication.getInstance().deviceEngine.getPinPad();
|
||||
byte[] encryptedPIK = SystemParamsOperation.getInstance().getPIK();
|
||||
|
||||
@ -33,7 +33,6 @@ import com.utsmyanmar.baselib.util.DataBindingConfig;
|
||||
import com.utsmyanmar.baselib.util.DialogCallback;
|
||||
import com.utsmyanmar.baselib.util.TerminalUtil;
|
||||
import com.utsmyanmar.checkxread.sdk.NexGoSDK;
|
||||
import com.utsmyanmar.ecr.ECRHelper;
|
||||
import com.utsmyanmar.ecr.ECRProcess;
|
||||
import com.utsmyanmar.ecr.data.ResultOf;
|
||||
import com.utsmyanmar.ecr.data.model.Transactions;
|
||||
@ -81,6 +80,10 @@ import dagger.hilt.android.AndroidEntryPoint;
|
||||
import com.utsmyanmar.paylibs.utils.LogUtil;
|
||||
import com.utsmyanmar.paylibs.utils.params.Params;
|
||||
|
||||
import com.utsmm.kbz.util.ecr.ModernECRFactory;
|
||||
import com.utsmm.kbz.util.ecr.ModernECRManager;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
@AndroidEntryPoint
|
||||
public class MainFragment extends DataBindingFragment {
|
||||
|
||||
@ -88,6 +91,7 @@ public class MainFragment extends DataBindingFragment {
|
||||
private SharedViewModel sharedViewModel;
|
||||
private MainViewModel mainViewModel;
|
||||
private TMSProcessViewModel tmsProcessViewModel;
|
||||
private ModernECRManager modernECRManager;
|
||||
private int routeId;
|
||||
private ImageSlider imgSlider;
|
||||
private final ArrayList<SlideModel> imgList = new ArrayList<>();
|
||||
@ -117,6 +121,10 @@ public class MainFragment extends DataBindingFragment {
|
||||
sharedViewModel = getFragmentScopeViewModel(SharedViewModel.class);
|
||||
mainViewModel = getFragmentScopeViewModel(MainViewModel.class);
|
||||
tmsProcessViewModel = getFragmentScopeViewModel(TMSProcessViewModel.class);
|
||||
|
||||
// Initialize ModernECRManager
|
||||
ModernECRFactory factory = new ModernECRFactory(requireContext(), sharedViewModel);
|
||||
modernECRManager = new ViewModelProvider(this, factory).get(ModernECRManager.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -125,10 +133,10 @@ public class MainFragment extends DataBindingFragment {
|
||||
|
||||
setNavBarIconWithTitle(getResourceString(R.string.menu_dashboard));
|
||||
|
||||
// logcat is resetting cuz of this setup , because it is using serial port
|
||||
// if(SystemParamsOperation.getInstance().getECRStatus()){
|
||||
// setUpECR();
|
||||
// }
|
||||
// Setup ECR Service
|
||||
if(SystemParamsOperation.getInstance().getECRStatus()){
|
||||
setUpECR();
|
||||
}
|
||||
|
||||
sharedViewModel.isEcrFinished.postValue(true);
|
||||
sharedViewModel.isEcr.postValue(false);
|
||||
@ -280,43 +288,24 @@ public class MainFragment extends DataBindingFragment {
|
||||
|
||||
private void setUpECR() {
|
||||
if (checkECRServiceAppExistOrNot()) {
|
||||
// Initialize Modern ECR Manager
|
||||
modernECRManager.init();
|
||||
|
||||
|
||||
if (!SystemParamsOperation.getInstance().isSetupEcr()) {
|
||||
initECR();
|
||||
delayFunctionCall(this::createECRInstance);
|
||||
SystemParamsOperation.getInstance().setSetupEcr(true);
|
||||
onReceivedEcrCommand();
|
||||
} else {
|
||||
onReceivedEcrCommand();
|
||||
// Observe navigation requests
|
||||
modernECRManager.getNavigationRequest().observe(getViewLifecycleOwner(), destinationId -> {
|
||||
if (destinationId != null) {
|
||||
delayFunctionCall(() -> isRouteValidAndNavigateToRoute(destinationId));
|
||||
}
|
||||
});
|
||||
|
||||
showShortToast("ECR Service initialized");
|
||||
} else {
|
||||
Toast.makeText(getContext(), "ECR Service Not Found!", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
private void createECRInstance() {
|
||||
//
|
||||
// currently will test with Bluetooth , afterward will switch to VSP mode
|
||||
// Legacy ECR methods removed
|
||||
|
||||
if (SystemParamsOperation.getInstance().isBluetoothMode()) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(ECRConstant.Configuration.MODE, ECRConstant.Mode.Bluetooth);
|
||||
bundle.putString(ECRConstant.Configuration.TYPE, ECRConstant.Type.MASTER);
|
||||
bundle.putString(ECRConstant.Configuration.BLUETOOTH_MAC_ADDRESS, "");
|
||||
// mainViewModel.ecrConnectionStatus.setValue(ECRConnectionStatus.CREATED);
|
||||
ECRHelper.INSTANCE.connect(bundle);
|
||||
showShortToast("ECR service is created!");
|
||||
} else {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(ECRConstant.Configuration.MODE, ECRConstant.Mode.VSP);
|
||||
bundle.putString(ECRConstant.Configuration.TYPE, ECRConstant.Type.MASTER); // MASTER
|
||||
ECRHelper.INSTANCE.connect(bundle);
|
||||
// mainViewModel.ecrConnectionStatus.setValue(ECRConnectionStatus.CREATED);
|
||||
showShortToast("ECR service is created!");
|
||||
}
|
||||
}
|
||||
|
||||
private void updateButtonStatus() {
|
||||
mainViewModel.settlementStatus.setValue(SystemParamsOperation.getInstance().getSettlementStatus());
|
||||
@ -350,7 +339,7 @@ public class MainFragment extends DataBindingFragment {
|
||||
private boolean checkECRServiceAppExistOrNot() {
|
||||
PackageInfo packageInfo;
|
||||
try {
|
||||
packageInfo = requireActivity().getPackageManager().getPackageInfo("com.pos.ecr.service", 0);
|
||||
packageInfo = requireActivity().getPackageManager().getPackageInfo("com.kizzy.ecrservice", 0);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
@ -407,147 +396,12 @@ public class MainFragment extends DataBindingFragment {
|
||||
} else {
|
||||
sharedViewModel.isEcr.postValue(false);
|
||||
sharedViewModel.isEcrFinished.postValue(true);
|
||||
ECRHelper.INSTANCE.send(getResourceString(R.string.txt_finish_current_process).getBytes());
|
||||
showDeclineDialog(getResourceString(R.string.txt_finish_current_process));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* init ECR service
|
||||
*/
|
||||
private void initECR() {
|
||||
ECRHelper.INSTANCE.registerECRListener();
|
||||
// ECR Legacy methods removed
|
||||
|
||||
ECRHelper.INSTANCE.setOnBindSuccess(() -> {
|
||||
ECRHelper.INSTANCE.registerECRListener();
|
||||
LogUtil.d(TAG, "on bind success!");
|
||||
return null;
|
||||
});
|
||||
|
||||
ECRHelper.INSTANCE.setOnBindFailure(() -> {
|
||||
LogUtil.d(TAG, "on bind failure!");
|
||||
return null;
|
||||
});
|
||||
|
||||
ECRHelper.INSTANCE.setOnECRConnected(() -> {
|
||||
delayFunctionCall(() -> mainViewModel.ecrConnectionStatus.postValue(ECRConnectionStatus.CONNECTED));
|
||||
LogUtil.d(TAG, "On ECR Connected!");
|
||||
|
||||
return null;
|
||||
});
|
||||
|
||||
ECRHelper.INSTANCE.setOnECRDisconnected((integer, s) -> {
|
||||
delayFunctionCall(() -> mainViewModel.ecrConnectionStatus.postValue(ECRConnectionStatus.DISCONNECTED));
|
||||
LogUtil.d(TAG, "On ECR Disconnected! Code:" + integer + ":Msg:" + s);
|
||||
return null;
|
||||
});
|
||||
|
||||
ECRHelper.INSTANCE.bindECRService();
|
||||
|
||||
LogUtil.d(TAG, "Bind ECR Service successfully!");
|
||||
}
|
||||
|
||||
private void onReceivedEcrCommand() {
|
||||
ECRHelper.INSTANCE.setOnECRReceive(bytes -> {
|
||||
String msg = new String(bytes, StandardCharsets.UTF_8);
|
||||
LogUtil.d(TAG, "Received : " + msg);
|
||||
if (sharedViewModel.isEcrFinished.getValue() != null) {
|
||||
if (sharedViewModel.isEcrFinished.getValue()) {
|
||||
ECRAction(msg);
|
||||
}
|
||||
} else {
|
||||
ECRAction(msg);
|
||||
}
|
||||
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param msg ECR Transaction Type
|
||||
*/
|
||||
private void ECRAction(String msg) {
|
||||
|
||||
// LogUtil.d(TAG, "ECR msg here : " + msg);
|
||||
|
||||
String ecrKey = SystemParamsOperation.getInstance().getEcrKey().toUpperCase();
|
||||
String pkgName = BuildConfig.APPLICATION_ID;
|
||||
String serialNo = TerminalUtil.getInstance().getSerialNo();
|
||||
|
||||
ResultOf<Transactions> result = ECRProcess.INSTANCE.parseECRRequest(ecrKey, pkgName, serialNo, msg);
|
||||
|
||||
if (result instanceof ResultOf.Success) {
|
||||
Transactions trans = ((ResultOf.Success<Transactions>) result).getValue();
|
||||
|
||||
|
||||
CoreUtils.getInstance(sharedViewModel).logTrans(trans);
|
||||
|
||||
sharedViewModel.ecrCMD.postValue(trans.getCMD());
|
||||
sharedViewModel.ecrTrans.postValue(trans);
|
||||
|
||||
switch (Objects.requireNonNull(trans.getCMD())) {
|
||||
case ECHO:
|
||||
CoreUtils.getInstance(sharedViewModel).setUpECREchoTest();
|
||||
break;
|
||||
case SALE:
|
||||
if (CoreUtils.getInstance(sharedViewModel).setUpECRSale(trans)) {
|
||||
delayFunctionCall(() -> isRouteValidAndNavigateToRoute(R.id.action_nav_main_to_cardWaitingFragment));
|
||||
}
|
||||
break;
|
||||
case VOID:
|
||||
if (!SystemParamsOperation.getInstance().getVoidStatus()) {
|
||||
CoreUtils.getInstance(sharedViewModel).responseRejectMsg(trans, "Void is disabled!");
|
||||
return;
|
||||
}
|
||||
if (CoreUtils.getInstance(sharedViewModel).setUpECRVoid(trans)) {
|
||||
delayFunctionCall(() -> {
|
||||
if (Objects.requireNonNull(getNavController(Constants.NAV_HOST_ID).getCurrentDestination()).getId() == R.id.nav_main) {
|
||||
setToolBarTitle(getResourceString(R.string.menu_sale_void));
|
||||
}
|
||||
|
||||
isRouteValidAndNavigateToRoute(R.id.action_nav_main_to_inputPasswordFragment);
|
||||
});
|
||||
}
|
||||
break;
|
||||
case CASH_ADVANCE: {
|
||||
|
||||
if (CoreUtils.getInstance(sharedViewModel).setUpECRCashAdvance(trans)) {
|
||||
delayFunctionCall(() -> isRouteValidAndNavigateToRoute(R.id.action_nav_main_to_cardWaitingFragment));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case QR_SALE: {
|
||||
if (CoreUtils.getInstance(sharedViewModel).setUpECRQR(trans)) {
|
||||
delayFunctionCall(() -> isRouteValidAndNavigateToRoute(R.id.action_nav_main_to_QRConnectingFragment));
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
case SETTLEMENT: {
|
||||
if (!SystemParamsOperation.getInstance().getSettlementStatus()) {
|
||||
CoreUtils.getInstance(sharedViewModel).responseRejectMsg(trans, "Settlement is disabled!");
|
||||
return;
|
||||
}
|
||||
CoreUtils.getInstance(sharedViewModel).setUpECRSettlement();
|
||||
|
||||
delayFunctionCall(() -> isRouteValidAndNavigateToRoute(R.id.action_nav_main_to_inputPasswordFragment));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
showDeclineDialog("No Action found on \n" + trans.getCMD());
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
String errorMsg = ((ResultOf.Failure) result).getMessage();
|
||||
showDeclineDialog("No Action found on \n" + errorMsg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void navigateToAmount() {
|
||||
routeId = R.id.action_nav_main_to_inputAmountFragment;
|
||||
|
||||
@ -176,7 +176,6 @@ public class ProcessingFragment extends DataBindingFragment {
|
||||
LogUtil.d(TAG,"Updated sharedViewmodel payDetail for non emv");
|
||||
sharedViewModel.payDetail.setValue(transProcessViewModel.payDetailResult.getValue());
|
||||
|
||||
|
||||
}
|
||||
|
||||
// if(sharedViewModel.payDetail.getValue() != null) {
|
||||
@ -261,10 +260,6 @@ public class ProcessingFragment extends DataBindingFragment {
|
||||
|
||||
private void observeData(ProcessingTransaction processingTransaction) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
processingTransaction.getTransStatus().observe(getViewLifecycleOwner(), transResultStatus -> {
|
||||
LogUtil.d(TAG,"Transaction RESULT :"+transResultStatus);
|
||||
PayDetail payDetail = isEmvTrans()
|
||||
|
||||
@ -482,7 +482,7 @@ public class EmvParamHelper {
|
||||
capkV2.setArithInd(Integer.parseInt(ridEntity.getArithInd()));
|
||||
}
|
||||
if (ridEntity.getModul() != null && !ridEntity.getModul().isEmpty()) {
|
||||
capkV2.setModulus(ridEntity.getModul());
|
||||
capkV2.setModulus(ridEntity.getModul().toLowerCase());
|
||||
}
|
||||
if (ridEntity.getExponent() != null && !ridEntity.getExponent().isEmpty()) {
|
||||
capkV2.setExponent(ridEntity.getExponent());
|
||||
@ -491,7 +491,7 @@ public class EmvParamHelper {
|
||||
capkV2.setExpireDate(ridEntity.getExpDate());
|
||||
}
|
||||
if (ridEntity.getCheckSum() != null && !ridEntity.getCheckSum().isEmpty()) {
|
||||
capkV2.setCheckSum(ridEntity.getCheckSum());
|
||||
capkV2.setCheckSum(ridEntity.getCheckSum().toLowerCase());
|
||||
}
|
||||
|
||||
return capkV2;
|
||||
|
||||
@ -707,6 +707,7 @@ public abstract class EmvBaseViewModel extends BaseViewModel {
|
||||
public void onContactlessTapCardAgain() {
|
||||
LogUtil.d(TAG, "onReadCardAgain");
|
||||
|
||||
mHandler.sendEmptyMessage(EMV_TRY_AGAIN);
|
||||
//this method only used for EMV contactless card if the host response the script. Such as paywave , AMEX...
|
||||
|
||||
//for paywave, onOnlineProc-->onSetOnlineProcResponse->onContactlessTapCardAgain--> search contactless card ->onReadCardAgainResponse->onFinish
|
||||
@ -717,6 +718,10 @@ public abstract class EmvBaseViewModel extends BaseViewModel {
|
||||
@Override
|
||||
public void onOnlineProc() {
|
||||
LogUtil.d(TAG, "onOnlineProc :");
|
||||
LogUtil.d(TAG, "getCardInfo :"+ new Gson().toJson(emvHandler.getEmvCardDataInfo()));
|
||||
LogUtil.d(TAG,"getEmvCvmResult:"+ emvHandler.getEmvCvmResult());
|
||||
LogUtil.d(TAG,"getSignNeed :"+emvHandler.getSignNeed());
|
||||
|
||||
getF055Data();
|
||||
|
||||
mProcessStep = EMV_ONLINE_PROCESS;
|
||||
@ -1219,6 +1224,7 @@ public abstract class EmvBaseViewModel extends BaseViewModel {
|
||||
//default TTQ value
|
||||
TTQ = ByteUtils.hexString2ByteArray("36A04000");
|
||||
kernelTTQ[0] = TTQ[0];
|
||||
kernelTTQ[1] = TTQ[1];
|
||||
kernelTTQ[2] = TTQ[2];
|
||||
kernelTTQ[3] = TTQ[3];
|
||||
|
||||
|
||||
@ -96,7 +96,7 @@
|
||||
"arithInd": "01",
|
||||
"modul": "996AF56F569187D09293C14810450ED8EE3357397B18A2458EFAA92DA3B6DF6514EC060195318FD43BE9B8F0CC669E3F844057CBDDF8BDA191BB64473BC8DC9A730DB8F6B4EDE3924186FFD9B8C7735789C23A36BA0B8AF65372EB57EA5D89E7D14E9C7B6B557460F10885DA16AC923F15AF3758F0F03EBD3C5C2C949CBA306DB44E6A2C076C5F67E281D7EF56785DC4D75945E491F01918800A9E2DC66F60080566CE0DAF8D17EAD46AD8E30A247C9F",
|
||||
"exponent": "03",
|
||||
"expDate": "3230333431323331",
|
||||
"expDate": "20201231",
|
||||
"checkSum": "429C954A3859CEF91295F663C963E582ED6EB253"
|
||||
},
|
||||
{
|
||||
@ -106,7 +106,7 @@
|
||||
"arithInd": "01",
|
||||
"modul": "ACD2B12302EE644F3F835ABD1FC7A6F62CCE48FFEC622AA8EF062BEF6FB8BA8BC68BBF6AB5870EED579BC3973E121303D34841A796D6DCBC41DBF9E52C4609795C0CCF7EE86FA1D5CB041071ED2C51D2202F63F1156C58A92D38BC60BDF424E1776E2BC9648078A03B36FB554375FC53D57C73F5160EA59F3AFC5398EC7B67758D65C9BFF7828B6B82D4BE124A416AB7301914311EA462C19F771F31B3B57336000DFF732D3B83DE07052D730354D297BEC72871DCCF0E193F171ABA27EE464C6A97690943D59BDABB2A27EB71CEEBDAFA1176046478FD62FEC452D5CA393296530AA3F41927ADFE434A2DF2AE3054F8840657A26E0FC617",
|
||||
"exponent": "03",
|
||||
"expDate": "3230333431323331",
|
||||
"expDate": "20201231",
|
||||
"checkSum": "C4A3C43CCF87327D136B804160E47D43B60E6E0F"
|
||||
},
|
||||
{
|
||||
@ -116,7 +116,7 @@
|
||||
"arithInd": "01",
|
||||
"modul": "BE9E1FA5E9A803852999C4AB432DB28600DCD9DAB76DFAAA47355A0FE37B1508AC6BF38860D3C6C2E5B12A3CAAF2A7005A7241EBAA7771112C74CF9A0634652FBCA0E5980C54A64761EA101A114E0F0B5572ADD57D010B7C9C887E104CA4EE1272DA66D997B9A90B5A6D624AB6C57E73C8F919000EB5F684898EF8C3DBEFB330C62660BED88EA78E909AFF05F6DA627B",
|
||||
"exponent": "03",
|
||||
"expDate": "3230323831323331",
|
||||
"expDate": "20201231",
|
||||
"checkSum": "EE1511CEC71020A9B90443B37B1D5F6E703030F6"
|
||||
},
|
||||
{
|
||||
@ -126,7 +126,7 @@
|
||||
"arithInd": "01",
|
||||
"modul": "AB79FCC9520896967E776E64444E5DCDD6E13611874F3985722520425295EEA4BD0C2781DE7F31CD3D041F565F747306EED62954B17EDABA3A6C5B85A1DE1BEB9A34141AF38FCF8279C9DEA0D5A6710D08DB4124F041945587E20359BAB47B7575AD94262D4B25F264AF33DEDCF28E09615E937DE32EDC03C54445FE7E382777",
|
||||
"exponent": "03",
|
||||
"expDate": "3230333431323331",
|
||||
"expDate": "20201231",
|
||||
"checkSum": "4ABFFD6B1C51212D05552E431C5B17007D2F5E6D"
|
||||
},
|
||||
{
|
||||
@ -136,7 +136,7 @@
|
||||
"arithInd": "01",
|
||||
"modul": "9D912248DE0A4E39C1A7DDE3F6D2588992C1A4095AFBD1824D1BA74847F2BC4926D2EFD904B4B54954CD189A54C5D1179654F8F9B0D2AB5F0357EB642FEDA95D3912C6576945FAB897E7062CAA44A4AA06B8FE6E3DBA18AF6AE3738E30429EE9BE03427C9D64F695FA8CAB4BFE376853EA34AD1D76BFCAD15908C077FFE6DC5521ECEF5D278A96E26F57359FFAEDA19434B937F1AD999DC5C41EB11935B44C18100E857F431A4A5A6BB65114F174C2D7B59FDF237D6BB1DD0916E644D709DED56481477C75D95CDD68254615F7740EC07F330AC5D67BCD75BF23D28A140826C026DBDE971A37CD3EF9B8DF644AC385010501EFC6509D7A41",
|
||||
"exponent": "03",
|
||||
"expDate": "3230333431323331",
|
||||
"expDate": "20201231",
|
||||
"checkSum": "1FF80A40173F52D7D27E0F26A146A1C8CCB29046"
|
||||
},
|
||||
{
|
||||
@ -146,7 +146,7 @@
|
||||
"arithInd": "01",
|
||||
"modul": "A0DCF4BDE19C3546B4B6F0414D174DDE294AABBB828C5A834D73AAE27C99B0B053A90278007239B6459FF0BBCD7B4B9C6C50AC02CE91368DA1BD21AAEADBC65347337D89B68F5C99A09D05BE02DD1F8C5BA20E2F13FB2A27C41D3F85CAD5CF6668E75851EC66EDBF98851FD4E42C44C1D59F5984703B27D5B9F21B8FA0D93279FBBF69E090642909C9EA27F898959541AA6757F5F624104F6E1D3A9532F2A6E51515AEAD1B43B3D7835088A2FAFA7BE7",
|
||||
"exponent": "03",
|
||||
"expDate": "3230333431323331",
|
||||
"expDate": "20201231",
|
||||
"checkSum": "D8E68DA167AB5A85D8C3D55ECB9B0517A1A5B4BB"
|
||||
},
|
||||
{
|
||||
@ -156,7 +156,7 @@
|
||||
"arithInd": "01",
|
||||
"modul": "A191CB87473F29349B5D60A88B3EAEE0973AA6F1A082F358D849FDDFF9C091F899EDA9792CAF09EF28F5D22404B88A2293EEBBC1949C43BEA4D60CFD879A1539544E09E0F09F60F065B2BF2A13ECC705F3D468B9D33AE77AD9D3F19CA40F23DCF5EB7C04DC8F69EBA565B1EBCB4686CD274785530FF6F6E9EE43AA43FDB02CE00DAEC15C7B8FD6A9B394BABA419D3F6DC85E16569BE8E76989688EFEA2DF22FF7D35C043338DEAA982A02B866DE5328519EBBCD6F03CDD686673847F84DB651AB86C28CF1462562C577B853564A290C8556D818531268D25CC98A4CC6A0BDFFFDA2DCCA3A94C998559E307FDDF915006D9A987B07DDAEB3B",
|
||||
"exponent": "03",
|
||||
"expDate": "3230333431323331",
|
||||
"expDate": "20201231",
|
||||
"checkSum": "21766EBB0EE122AFB65D7845B73DB46BAB65427A"
|
||||
}
|
||||
|
||||
|
||||
@ -17,6 +17,15 @@ import java.util.Random;
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
|
||||
|
||||
@Test
|
||||
public void testCAPKIndex() {
|
||||
String index = "99";
|
||||
int data = Integer.parseInt(index,16);
|
||||
|
||||
System.out.println("Data: "+data);
|
||||
}
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
|
||||
3
ecr-service/.idea/.gitignore
vendored
Normal file
3
ecr-service/.idea/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
6
ecr-service/.idea/AndroidProjectSystem.xml
Normal file
6
ecr-service/.idea/AndroidProjectSystem.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AndroidProjectSystem">
|
||||
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
|
||||
</component>
|
||||
</project>
|
||||
1282
ecr-service/.idea/caches/deviceStreaming.xml
Normal file
1282
ecr-service/.idea/caches/deviceStreaming.xml
Normal file
File diff suppressed because it is too large
Load Diff
12
ecr-service/.idea/gradle.xml
Normal file
12
ecr-service/.idea/gradle.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="CHOOSE_PER_TEST" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
10
ecr-service/.idea/migrations.xml
Normal file
10
ecr-service/.idea/migrations.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectMigrations">
|
||||
<option name="MigrateToGradleLocalJavaHome">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
10
ecr-service/.idea/misc.xml
Normal file
10
ecr-service/.idea/misc.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
||||
17
ecr-service/.idea/runConfigurations.xml
Normal file
17
ecr-service/.idea/runConfigurations.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
6
ecr-service/.idea/vcs.xml
Normal file
6
ecr-service/.idea/vcs.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@ -414,106 +414,55 @@ public class TransactionsOperation {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* handling issuer script
|
||||
* */
|
||||
// private void emvProcess(PayDetail payDetail) {
|
||||
// String resultStr = "";
|
||||
// try {
|
||||
// resultStr = Objects.requireNonNull(responseMap.get("F039")).getDataStr();
|
||||
// } catch (NullPointerException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//
|
||||
// LogUtil.d(Constant.TAG, "SALE PROCESS RESPONSE CODE :" + resultStr);
|
||||
//
|
||||
// HashMap<String, MsgField> resp = (responseMap instanceof HashMap) ? (HashMap<String, MsgField>) responseMap
|
||||
// : new HashMap<>(responseMap);
|
||||
//
|
||||
// if(BaseCardType.IC.getValue() == payDetail.getCardType() && responseMap.get("F055") != null) {
|
||||
// AuthorizationProcessUtil.authorizationProcess(resp, payDetail);
|
||||
// } else {
|
||||
// boolean equals = TextUtils.equals(resultStr, Constant.ANSWER_CODE_ACCEPT) || TextUtils.equals(resultStr, Constant.ANSWER_CODE_APPROVED);
|
||||
// EmvOnlineResultEntity emvOnlineResult = new EmvOnlineResultEntity();
|
||||
// MsgField field38,field39,field55;
|
||||
// if (resp != null) {
|
||||
// field38 = resp.get("F038");
|
||||
// field39 = resp.get("F039");
|
||||
// field55 = resp.get("F055");
|
||||
//
|
||||
// if(equals)
|
||||
// LogUtil.d(TAG,"Field 38:"+field38.getDataStr());
|
||||
// LogUtil.d(TAG,"Field 39:"+field39.getDataStr());
|
||||
// LogUtil.d(TAG,"Field 55:"+field55.getDataStr());
|
||||
// if(equals)
|
||||
// emvOnlineResult.setAuthCode(field38.getDataStr());
|
||||
// emvOnlineResult.setRejCode(field39.getDataStr());
|
||||
// emvOnlineResult.setRecvField55(ByteUtil.hexStr2Bytes(field55.getDataStr()));
|
||||
// }
|
||||
// if(equals) {
|
||||
// importOnlineProcessStatus(SdkResult.Success,emvOnlineResult);
|
||||
// } else {
|
||||
// importOnlineProcessStatus(SdkResult.Fail,emvOnlineResult);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
private void emvProcess(PayDetail payDetail) {
|
||||
|
||||
MsgField f39 = responseMap != null ? responseMap.get("F039") : null;
|
||||
String resultStr = f39 != null ? f39.getDataStr() : "";
|
||||
|
||||
LogUtil.d(Constant.TAG, "SALE PROCESS RESPONSE CODE : " + resultStr);
|
||||
|
||||
boolean approved =
|
||||
TextUtils.equals(resultStr, Constant.ANSWER_CODE_ACCEPT)
|
||||
|| TextUtils.equals(resultStr, Constant.ANSWER_CODE_APPROVED);
|
||||
|
||||
HashMap<String, MsgField> resp =
|
||||
(responseMap instanceof HashMap)
|
||||
? (HashMap<String, MsgField>) responseMap
|
||||
HashMap<String, MsgField> resp = (responseMap instanceof HashMap) ? (HashMap<String, MsgField>) responseMap
|
||||
: new HashMap<>(responseMap);
|
||||
|
||||
MsgField field38 = resp.get("F038");
|
||||
MsgField field55 = resp.get("F055");
|
||||
|
||||
LogUtil.d(TAG, "Field 55: " + (field55 != null ? field55.getDataStr() : "null"));
|
||||
|
||||
if (BaseCardType.IC.getValue() == payDetail.getCardType()
|
||||
&& approved
|
||||
&& field55 != null
|
||||
&& !TextUtils.isEmpty(field55.getDataStr())) {
|
||||
|
||||
if(BaseCardType.IC.getValue() == payDetail.getCardType() && responseMap.get("F055") != null) {
|
||||
AuthorizationProcessUtil.authorizationProcess(resp, payDetail);
|
||||
return;
|
||||
}
|
||||
|
||||
if (BaseCardType.IC.getValue() == payDetail.getCardType() && approved) {
|
||||
|
||||
EmvOnlineResultEntity emptyResult = new EmvOnlineResultEntity();
|
||||
emptyResult.setRejCode(resultStr);
|
||||
|
||||
importOnlineProcessStatus(SdkResult.Success, emptyResult);
|
||||
return;
|
||||
}
|
||||
|
||||
} else {
|
||||
boolean equals = TextUtils.equals(resultStr, Constant.ANSWER_CODE_ACCEPT) || TextUtils.equals(resultStr, Constant.ANSWER_CODE_APPROVED);
|
||||
EmvOnlineResultEntity emvOnlineResult = new EmvOnlineResultEntity();
|
||||
MsgField field38,field39,field55;
|
||||
if (resp != null) {
|
||||
field38 = resp.get("F038");
|
||||
field39 = resp.get("F039");
|
||||
field55 = resp.get("F055");
|
||||
|
||||
if (approved && field38 != null) {
|
||||
|
||||
LogUtil.d(TAG,"Field 39:"+field39.getDataStr());
|
||||
|
||||
if(equals && field38 != null)
|
||||
emvOnlineResult.setAuthCode(field38.getDataStr());
|
||||
emvOnlineResult.setRejCode(field39.getDataStr());
|
||||
|
||||
if(field55 != null) {
|
||||
LogUtil.d(TAG,"Field 55:"+field55.getDataStr());
|
||||
emvOnlineResult.setRecvField55(ByteUtil.hexStr2Bytes(field55.getDataStr()));
|
||||
} else {
|
||||
emvOnlineResult.setRecvField55(null);
|
||||
}
|
||||
|
||||
if (f39 != null) {
|
||||
emvOnlineResult.setRejCode(f39.getDataStr());
|
||||
}
|
||||
if(equals) {
|
||||
importOnlineProcessStatus(SdkResult.Success,emvOnlineResult);
|
||||
} else {
|
||||
importOnlineProcessStatus(SdkResult.Fail,emvOnlineResult);
|
||||
}
|
||||
}
|
||||
|
||||
importOnlineProcessStatus(
|
||||
approved ? SdkResult.Success : SdkResult.Fail,
|
||||
emvOnlineResult
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -10,6 +10,7 @@ pluginManagement {
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
maven { url "https://jitpack.io" }
|
||||
maven { url "https://repo.spring.io/libs-milestone/" }
|
||||
}
|
||||
}
|
||||
dependencyResolutionManagement {
|
||||
@ -18,6 +19,7 @@ dependencyResolutionManagement {
|
||||
google()
|
||||
mavenCentral()
|
||||
maven { url "https://jitpack.io" }
|
||||
maven { url "https://repo.spring.io/libs-milestone/" }
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,6 +31,8 @@ include ':paylibs'
|
||||
include ':baselib'
|
||||
include ':mpulib'
|
||||
|
||||
include ':ecr-client-lib'
|
||||
include ':ecr-service'
|
||||
include ':xpay'
|
||||
include ':ecr'
|
||||
include ':ecr-service-lib'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user