Compare commits
48 Commits
main
...
merge-late
| Author | SHA1 | Date | |
|---|---|---|---|
| 8200cefb96 | |||
| 1a7e86077c | |||
| 8b211ca530 | |||
| 6bf49b3f19 | |||
| 2f4db87441 | |||
| aa37e14ea4 | |||
| 1ac8c14b09 | |||
| 44f4e1ea94 | |||
|
|
c619166ea8 | ||
| 49b929ab27 | |||
|
|
ab4801d687 | ||
|
|
d8befb7f2a | ||
|
|
3d2b316e99 | ||
|
|
8bf4d6da22 | ||
|
|
adfa73070f | ||
|
|
a449a366e0 | ||
|
|
5d450e0a48 | ||
| ced683e302 | |||
|
|
1811fefec1 | ||
|
|
b484f69cb3 | ||
|
|
8cd56777cc | ||
|
|
53f6414f70 | ||
|
|
bb60828767 | ||
|
|
749abb1455 | ||
| a8624195b0 | |||
|
|
65eb17e3b9 | ||
| 2f9f06ce87 | |||
| 41b6fb7782 | |||
|
|
7e2a589636 | ||
|
|
7c266677e7 | ||
|
|
063dfae87f | ||
|
|
9502ee7a04 | ||
|
|
5509bf4349 | ||
| 476e1d9eaa | |||
| 28d4672878 | |||
|
|
644df8211d | ||
|
|
2358782f3d | ||
|
|
f142df0144 | ||
| 8da4b2399e | |||
|
|
efb0c76f69 | ||
|
|
d861c278a2 | ||
| 5efcc7ef24 | |||
| c7ac1e90bf | |||
| 1b4a56c29f | |||
| a885d05b62 | |||
| 1cedbc987c | |||
| 0a2cc295a1 | |||
| b5a82a5fd1 |
@ -1 +1 @@
|
|||||||
KBZ-Master
|
KBZ-Master-latest
|
||||||
File diff suppressed because one or more lines are too long
6
.idea/copilot.data.migration.agent.xml
Normal file
6
.idea/copilot.data.migration.agent.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="AgentMigrationStateService">
|
||||||
|
<option name="migrationStatus" value="COMPLETED" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
.idea/copilot.data.migration.ask.xml
Normal file
6
.idea/copilot.data.migration.ask.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="AskMigrationStateService">
|
||||||
|
<option name="migrationStatus" value="COMPLETED" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
.idea/copilot.data.migration.ask2agent.xml
Normal file
6
.idea/copilot.data.migration.ask2agent.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Ask2AgentMigrationStateService">
|
||||||
|
<option name="migrationStatus" value="COMPLETED" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
.idea/copilot.data.migration.edit.xml
Normal file
6
.idea/copilot.data.migration.edit.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="EditMigrationStateService">
|
||||||
|
<option name="migrationStatus" value="COMPLETED" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@ -4,14 +4,6 @@
|
|||||||
<selectionStates>
|
<selectionStates>
|
||||||
<SelectionState runConfigName="app">
|
<SelectionState runConfigName="app">
|
||||||
<option name="selectionMode" value="DROPDOWN" />
|
<option name="selectionMode" value="DROPDOWN" />
|
||||||
<DropdownSelection timestamp="2025-10-28T19:40:02.148831Z">
|
|
||||||
<Target type="DEFAULT_BOOT">
|
|
||||||
<handle>
|
|
||||||
<DeviceId pluginId="PhysicalDevice" identifier="serial=0123456789ABCDEF" />
|
|
||||||
</handle>
|
|
||||||
</Target>
|
|
||||||
</DropdownSelection>
|
|
||||||
<DialogSelection />
|
|
||||||
</SelectionState>
|
</SelectionState>
|
||||||
</selectionStates>
|
</selectionStates>
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
@ -15,6 +15,7 @@
|
|||||||
<option value="$PROJECT_DIR$/ecr" />
|
<option value="$PROJECT_DIR$/ecr" />
|
||||||
<option value="$PROJECT_DIR$/ecr-service-lib" />
|
<option value="$PROJECT_DIR$/ecr-service-lib" />
|
||||||
<option value="$PROJECT_DIR$/mpulib" />
|
<option value="$PROJECT_DIR$/mpulib" />
|
||||||
|
<option value="$PROJECT_DIR$/nexdlkey-lib" />
|
||||||
<option value="$PROJECT_DIR$/nexsdk-lib" />
|
<option value="$PROJECT_DIR$/nexsdk-lib" />
|
||||||
<option value="$PROJECT_DIR$/paylibs" />
|
<option value="$PROJECT_DIR$/paylibs" />
|
||||||
<option value="$PROJECT_DIR$/paysdk-lib" />
|
<option value="$PROJECT_DIR$/paysdk-lib" />
|
||||||
|
|||||||
@ -11,11 +11,11 @@ android {
|
|||||||
compileSdk 34
|
compileSdk 34
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.utsmm.kbz"
|
applicationId "com.utsmm.kbz" //mpu
|
||||||
minSdk 24
|
minSdk 24
|
||||||
targetSdk 33
|
targetSdk 33
|
||||||
versionCode 5
|
versionCode 8
|
||||||
versionName "1.05"
|
versionName "1.08"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
@ -90,7 +90,6 @@ dependencies {
|
|||||||
implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
|
implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def nav_version = "2.3.2"
|
def nav_version = "2.3.2"
|
||||||
def lottieVersion = "3.5.0"
|
def lottieVersion = "3.5.0"
|
||||||
def fragment_version = "1.2.0"
|
def fragment_version = "1.2.0"
|
||||||
@ -189,6 +188,7 @@ dependencies {
|
|||||||
implementation project(path: ':qrgen-lib')
|
implementation project(path: ':qrgen-lib')
|
||||||
//// implementation project(path: ':samlSirius')
|
//// implementation project(path: ':samlSirius')
|
||||||
implementation project(path: ':ecr')
|
implementation project(path: ':ecr')
|
||||||
|
implementation project(path: ':nexdlkey-lib')
|
||||||
|
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.2' // 1.1.2
|
androidTestImplementation 'androidx.test.ext:junit:1.1.2' // 1.1.2
|
||||||
@ -196,6 +196,10 @@ dependencies {
|
|||||||
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.3.0'
|
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.3.0'
|
||||||
|
|
||||||
|
|
||||||
|
androidTestImplementation 'androidx.test:core:1.5.0'
|
||||||
|
androidTestImplementation 'androidx.test:runner:1.5.2'
|
||||||
|
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||||
|
|
||||||
// Add Mockito dependency for mocking
|
// Add Mockito dependency for mocking
|
||||||
testImplementation 'org.mockito:mockito-core:3.12.4'
|
testImplementation 'org.mockito:mockito-core:3.12.4'
|
||||||
androidTestImplementation 'org.mockito:mockito-android:3.12.4'
|
androidTestImplementation 'org.mockito:mockito-android:3.12.4'
|
||||||
|
|||||||
BIN
app/release/app-release.apk
Normal file
BIN
app/release/app-release.apk
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -4,15 +4,15 @@
|
|||||||
"type": "APK",
|
"type": "APK",
|
||||||
"kind": "Directory"
|
"kind": "Directory"
|
||||||
},
|
},
|
||||||
"applicationId": "com.utsmm.kbz",
|
"applicationId": "com.utsmm.kbz.mpu",
|
||||||
"variantName": "release",
|
"variantName": "release",
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
"type": "SINGLE",
|
"type": "SINGLE",
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 5,
|
"versionCode": 8,
|
||||||
"versionName": "1.05",
|
"versionName": "1.08",
|
||||||
"outputFile": "app-release.apk"
|
"outputFile": "app-release.apk"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@ -10,6 +10,29 @@ import org.junit.runner.RunWith;
|
|||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
import com.sunmi.pay.hardware.aidl.AidlConstants;
|
||||||
|
import com.utsmm.kbz.util.MockData;
|
||||||
|
import com.utsmm.kbz.util.TransactionUtil;
|
||||||
|
import com.utsmyanmar.checkxread.model.CardDataX;
|
||||||
|
import com.utsmyanmar.checkxread.util.CardTypeX;
|
||||||
|
import com.utsmyanmar.paylibs.Constant;
|
||||||
|
import com.utsmyanmar.paylibs.isobuilder.ISOMode;
|
||||||
|
import com.utsmyanmar.paylibs.isobuilder.builderx.ISOMsgX;
|
||||||
|
import com.utsmyanmar.paylibs.isobuilder.builderx.ISOVersion;
|
||||||
|
import com.utsmyanmar.paylibs.model.PayDetail;
|
||||||
|
import com.utsmyanmar.paylibs.model.TradeData;
|
||||||
|
import com.utsmyanmar.paylibs.model.enums.TransCVM;
|
||||||
|
import com.utsmyanmar.paylibs.utils.LogUtil;
|
||||||
|
import com.utsmyanmar.paylibs.utils.MessageType;
|
||||||
|
import com.utsmyanmar.paylibs.utils.core_utils.ByteUtil;
|
||||||
|
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation;
|
||||||
|
import com.utsmyanmar.paylibs.utils.enums.HostName;
|
||||||
|
import com.utsmyanmar.paylibs.utils.iso_utils.BitmapConfig;
|
||||||
|
import com.utsmyanmar.paylibs.utils.iso_utils.TransactionsType;
|
||||||
|
import com.utsmyanmar.paylibs.utils.params.Params;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instrumented test, which will execute on an Android device.
|
* Instrumented test, which will execute on an Android device.
|
||||||
*
|
*
|
||||||
@ -23,4 +46,131 @@ public class ExampleInstrumentedTest {
|
|||||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||||
assertEquals("com.utsmm.kbz", appContext.getPackageName());
|
assertEquals("com.utsmm.kbz", appContext.getPackageName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testVoidPacket() {
|
||||||
|
|
||||||
|
CardDataX cardDataX = MockData.getInstance().generateMPUCard();
|
||||||
|
|
||||||
|
TradeData tradeData = TransactionUtil.getInstance().initMPUTransaction(cardDataX, CardTypeX.IC);
|
||||||
|
|
||||||
|
String bitmap = BitmapConfig.MPU_NEW_VOID;
|
||||||
|
MessageType messageType = MessageType.FINANCIAL;
|
||||||
|
|
||||||
|
ISOMsgX isoMsgX = new ISOMsgX.ISOMsgXBuilder(ISOVersion.VERSION_1987, ISOMode.ONLY_HEADER, HostName.FINEXUS)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
TradeData transTradeData = setUpRebuildTransactions(tradeData, TransactionsType.VOID, HostName.FINEXUS);
|
||||||
|
|
||||||
|
transTradeData.getPayDetail().setAmount(50000);
|
||||||
|
PayDetail transPayDetail = transTradeData.getPayDetail();
|
||||||
|
|
||||||
|
byte[] sendBytes;
|
||||||
|
try {
|
||||||
|
sendBytes = isoMsgX.buildISOPackets(transTradeData, bitmap, messageType);
|
||||||
|
|
||||||
|
System.out.println("Hex Str : "+ ByteUtil.bytes2HexStr(sendBytes));
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private TradeData setUpRebuildTransactions(TradeData tradeData, TransactionsType transactionsType, HostName hostName) {
|
||||||
|
LogUtil.d(Constant.TAG, "Starting Online Transaction--" + hostName + "--" + transactionsType);
|
||||||
|
|
||||||
|
TradeData newTrade = Params.newTrade(true);
|
||||||
|
PayDetail newPay = newTrade.getPayDetail();
|
||||||
|
PayDetail oldPay = tradeData.getPayDetail();
|
||||||
|
|
||||||
|
newPay.setCardType(100);
|
||||||
|
newPay.setPINCipher("");
|
||||||
|
newPay.setHostName(hostName.name);
|
||||||
|
newPay.setTransType(transactionsType.name);
|
||||||
|
newPay.setProcessCode(transactionsType.processCode);
|
||||||
|
newPay.setCardNo(oldPay.getCardNo());
|
||||||
|
newPay.setCardHolderName(oldPay.getCardHolderName());
|
||||||
|
newPay.setEXPDate(oldPay.getEXPDate());
|
||||||
|
newPay.setTradeDate(oldPay.getTradeDate());
|
||||||
|
newPay.setTradeTime(oldPay.getTradeTime());
|
||||||
|
newPay.setAmount(oldPay.getAmount());
|
||||||
|
newPay.setTransactionType(transactionsType.value);
|
||||||
|
newPay.setAccountType(oldPay.getAccountType());
|
||||||
|
|
||||||
|
newPay.setCardInfo(oldPay.getCardInfo());
|
||||||
|
|
||||||
|
newPay.setSettlementEnabled(SystemParamsOperation.getInstance().getSettlementStatus());
|
||||||
|
|
||||||
|
// added on Nov, 13 2024
|
||||||
|
newPay.setICC55(oldPay.getICC55());
|
||||||
|
|
||||||
|
if(newPay.getICC55() != null && !newPay.getICC55().isEmpty()) {
|
||||||
|
newPay.setAppLabel(oldPay.getAppLabel());
|
||||||
|
newPay.setAppName(oldPay.getAppName());
|
||||||
|
newPay.setTSI(oldPay.getTSI());
|
||||||
|
newPay.setAID(oldPay.getAID());
|
||||||
|
newPay.setArqC(oldPay.getArqC());
|
||||||
|
newPay.setTVR(oldPay.getTVR());
|
||||||
|
}
|
||||||
|
|
||||||
|
if(transactionsType != TransactionsType.PRE_AUTH_COMPLETE) {
|
||||||
|
|
||||||
|
newPay.setTradeDateTime(oldPay.getTradeDateTime());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (transactionsType == TransactionsType.VOID || transactionsType == TransactionsType.REFUND) {
|
||||||
|
String field60;
|
||||||
|
if(hostName == HostName.BPC) {
|
||||||
|
field60 = String.format(Locale.getDefault(), "%010d00", oldPay.getAmount());
|
||||||
|
} else {
|
||||||
|
field60 = String.format(Locale.getDefault(), "%012d", oldPay.getAmount());
|
||||||
|
}
|
||||||
|
// String field60 = String.format(Locale.getDefault(), "%010d00", oldPay.getAmount());
|
||||||
|
newPay.setReferNo(oldPay.getReferNo());
|
||||||
|
newPay.setTransCVM(TransCVM.SIGNATURE);
|
||||||
|
newTrade.setField60(field60);
|
||||||
|
} else if (transactionsType == TransactionsType.PRE_AUTH_VOID) {
|
||||||
|
newPay.setCardType(oldPay.getCardType());
|
||||||
|
newPay.setCustomOrderNo(oldPay.getVoucherNo());
|
||||||
|
newPay.setReferNo(oldPay.getReferNo());
|
||||||
|
newPay.setCardInfo(oldPay.getCardInfo());
|
||||||
|
newPay.setPINCipher(oldPay.getPINCipher());
|
||||||
|
newPay.setTempKSN(oldPay.getTempKSN());
|
||||||
|
newPay.setTransCVM(TransCVM.SIGNATURE);
|
||||||
|
// for manual entry reversal which need de 35
|
||||||
|
|
||||||
|
} else if (transactionsType == TransactionsType.TIP_ADJUSTMENT ) {
|
||||||
|
newPay.setReferNo(oldPay.getReferNo());
|
||||||
|
newPay.setApprovalCode(oldPay.getApprovalCode());
|
||||||
|
} else if (transactionsType == TransactionsType.PRE_AUTH_COMPLETE) {
|
||||||
|
newPay.setCardType(oldPay.getCardType());
|
||||||
|
newPay.setCardInfo(oldPay.getCardInfo());
|
||||||
|
newPay.setPINCipher(oldPay.getPINCipher());
|
||||||
|
newPay.setReferNo(oldPay.getReferNo());
|
||||||
|
newPay.setTempKSN(oldPay.getTempKSN());
|
||||||
|
} else if (transactionsType == TransactionsType.PRE_AUTH_COMPLETE_VOID) {
|
||||||
|
newPay.setVoucherNo(oldPay.getVoucherNo());
|
||||||
|
newPay.setCustomOrderNo(oldPay.getVoucherNo());
|
||||||
|
newPay.setReferNo(oldPay.getReferNo());
|
||||||
|
newPay.setCardInfo(oldPay.getCardInfo());
|
||||||
|
|
||||||
|
/*
|
||||||
|
* new requirements */
|
||||||
|
newPay.setCardType(AidlConstants.CardType.IC.getValue());
|
||||||
|
newPay.setPINCipher("55");
|
||||||
|
newPay.setTransCVM(TransCVM.SIGNATURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(oldPay.getAccountType().equals("MPU")){
|
||||||
|
// newPay.setIsFreeSign(true);
|
||||||
|
newPay.setTransCVM(TransCVM.SIGNATURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
newTrade.setPayDetail(newPay);
|
||||||
|
return newTrade;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -10,6 +10,7 @@
|
|||||||
android:name="android.hardware.telephony"
|
android:name="android.hardware.telephony"
|
||||||
android:required="false" />
|
android:required="false" />
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||||
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" tools:ignore="QueryAllPackagesPermission" />
|
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" tools:ignore="QueryAllPackagesPermission" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
@ -46,30 +47,32 @@
|
|||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar">
|
||||||
>
|
|
||||||
<!-- android:manageSpaceActivity="com.utsmyanmar.upos.config.UTSManageSpaceActivity"-->
|
<!-- android:manageSpaceActivity="com.utsmyanmar.upos.config.UTSManageSpaceActivity"-->
|
||||||
<!-- <activity-->
|
<!-- <activity-->
|
||||||
<!-- android:screenOrientation="portrait"-->
|
<!-- android:screenOrientation="portrait"-->
|
||||||
<!-- android:name=".config.UTSManageSpaceActivity"/>-->
|
<!-- android:name=".config.UTSManageSpaceActivity"/>-->
|
||||||
<activity android:name="com.utsmm.kbz.MainActivity"
|
<activity android:name="com.utsmm.kbz.MainActivity"
|
||||||
android:exported="true">
|
android:exported="true"
|
||||||
|
android:showWhenLocked="true"
|
||||||
|
android:turnScreenOn="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.HOME"/>
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
|
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity android:name="com.journeyapps.barcodescanner.CaptureActivity"
|
<activity android:name="com.journeyapps.barcodescanner.CaptureActivity"
|
||||||
android:screenOrientation="fullSensor"
|
android:screenOrientation="fullSensor"
|
||||||
tools:replace="screenOrientation" />
|
tools:replace="screenOrientation" />
|
||||||
|
|
||||||
<receiver android:name="com.utsmm.kbz.service.SmileAlarmReceiver" />
|
<receiver android:name="com.utsmm.kbz.service.AutoAlarmReceiver" />
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name="com.utsmm.kbz.service.SmileSettleService"
|
android:name="com.utsmm.kbz.service.AutoSettleService"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:exported="false">
|
android:exported="false">
|
||||||
<meta-data
|
<meta-data
|
||||||
|
|||||||
@ -16,23 +16,30 @@ import android.app.PendingIntent;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.google.android.material.appbar.MaterialToolbar;
|
import com.google.android.material.appbar.MaterialToolbar;
|
||||||
import com.google.android.material.navigation.NavigationView;
|
import com.google.android.material.navigation.NavigationView;
|
||||||
|
import com.nexgo.downloadkey.downloadflow.DownloadFEntity;
|
||||||
|
import com.nexgo.downloadkey.downloadflow.DownloadFlow;
|
||||||
|
import com.nexgo.downloadkey.downloadflow.DownloadFlowProcessListener;
|
||||||
|
import com.nexgo.downloadkey.downloadflow.DownloadFlowResultEntity;
|
||||||
|
import com.nexgo.downloadkey.downloadflow.DownloadResult;
|
||||||
import com.utsmyanmar.baselib.repo.Repository;
|
import com.utsmyanmar.baselib.repo.Repository;
|
||||||
import com.utsmyanmar.baselib.ui.AnimationDialog;
|
import com.utsmyanmar.baselib.ui.AnimationDialog;
|
||||||
import com.utsmyanmar.checkxread.sdk.NexGoSDK;
|
import com.utsmyanmar.checkxread.sdk.NexGoSDK;
|
||||||
import com.utsmyanmar.ecr.ECRHelper;
|
import com.utsmyanmar.ecr.ECRHelper;
|
||||||
import com.utsmyanmar.paylibs.Constant;
|
import com.utsmyanmar.paylibs.Constant;
|
||||||
import com.utsmyanmar.paylibs.print.printx.PrintXReceipt;
|
import com.utsmyanmar.paylibs.print.printx.PrintXReceipt;
|
||||||
|
import com.utsmyanmar.paylibs.utils.POSUtil;
|
||||||
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation;
|
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation;
|
||||||
import com.utsmyanmar.paylibs.utils.enums.TransMenu;
|
import com.utsmyanmar.paylibs.utils.enums.TransMenu;
|
||||||
import com.utsmyanmar.paylibs.utils.iso_utils.TransactionsType;
|
import com.utsmyanmar.paylibs.utils.iso_utils.TransactionsType;
|
||||||
import com.utsmm.kbz.databinding.ActivityMainNewBinding;
|
import com.utsmm.kbz.databinding.ActivityMainNewBinding;
|
||||||
import com.utsmm.kbz.service.SmileAlarmReceiver;
|
import com.utsmm.kbz.service.AutoAlarmReceiver;
|
||||||
import com.utsmm.kbz.ui.core_ui.InputPasswordFragment;
|
import com.utsmm.kbz.ui.core_ui.InputPasswordFragment;
|
||||||
import com.utsmm.kbz.ui.core_viewmodel.SharedViewModel;
|
import com.utsmm.kbz.ui.core_viewmodel.SharedViewModel;
|
||||||
import com.utsmm.kbz.ui.navigation.NaviAdminFragment;
|
import com.utsmm.kbz.ui.navigation.NaviAdminFragment;
|
||||||
@ -126,6 +133,8 @@ public class MainActivity extends AppCompatActivity implements
|
|||||||
initSpecialBackHandlingFragments();
|
initSpecialBackHandlingFragments();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void initViewModels() {
|
private void initViewModels() {
|
||||||
sharedViewModel = new ViewModelProvider(this).get(SharedViewModel.class);
|
sharedViewModel = new ViewModelProvider(this).get(SharedViewModel.class);
|
||||||
}
|
}
|
||||||
@ -240,7 +249,7 @@ public class MainActivity extends AppCompatActivity implements
|
|||||||
PendingIntent pendingIntent = PendingIntent.getBroadcast(
|
PendingIntent pendingIntent = PendingIntent.getBroadcast(
|
||||||
this,
|
this,
|
||||||
0,
|
0,
|
||||||
new Intent(this, SmileAlarmReceiver.class),
|
new Intent(this, AutoAlarmReceiver.class),
|
||||||
PendingIntent.FLAG_UPDATE_CURRENT
|
PendingIntent.FLAG_UPDATE_CURRENT
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -382,6 +391,32 @@ public class MainActivity extends AppCompatActivity implements
|
|||||||
|
|
||||||
SystemParamsOperation.getInstance().setSetupEcr(false);
|
SystemParamsOperation.getInstance().setSetupEcr(false);
|
||||||
SystemParamsOperation.getInstance().setDownloadedParams(false);
|
SystemParamsOperation.getInstance().setDownloadedParams(false);
|
||||||
|
|
||||||
|
handleAutoSettlementIntent(getIntent());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onNewIntent(Intent intent) {
|
||||||
|
super.onNewIntent(intent);
|
||||||
|
setIntent(intent);
|
||||||
|
handleAutoSettlementIntent(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleAutoSettlementIntent(Intent intent) {
|
||||||
|
if (intent == null) return;
|
||||||
|
boolean auto = intent.getBooleanExtra("AUTO_SETTLEMENT", false);
|
||||||
|
if (!auto) return;
|
||||||
|
|
||||||
|
com.utsmyanmar.paylibs.model.PayDetail payDetail = (com.utsmyanmar.paylibs.model.PayDetail) intent.getSerializableExtra("EXTRA_PAY_DETAIL");
|
||||||
|
if (payDetail != null) {
|
||||||
|
sharedViewModel.payDetail.setValue(payDetail);
|
||||||
|
sharedViewModel.transactionsType.setValue(com.utsmyanmar.paylibs.utils.iso_utils.TransactionsType.SETTLEMENT);
|
||||||
|
try {
|
||||||
|
navController.navigate(R.id.transactionResultFragment);
|
||||||
|
} catch (Exception e) {
|
||||||
|
LogUtil.e(TAG, "Navigation error: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -36,6 +36,7 @@ import com.utsmyanmar.ecr.data.model.Transactions;
|
|||||||
import com.utsmyanmar.paylibs.model.PayDetail;
|
import com.utsmyanmar.paylibs.model.PayDetail;
|
||||||
|
|
||||||
import com.utsmyanmar.paylibs.print.PrintHelper;
|
import com.utsmyanmar.paylibs.print.PrintHelper;
|
||||||
|
import com.utsmyanmar.paylibs.print.printx.PrintXReceipt;
|
||||||
import com.utsmyanmar.paylibs.utils.POSUtil;
|
import com.utsmyanmar.paylibs.utils.POSUtil;
|
||||||
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation;
|
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation;
|
||||||
import com.utsmyanmar.paylibs.utils.enums.CurrencyType;
|
import com.utsmyanmar.paylibs.utils.enums.CurrencyType;
|
||||||
@ -134,6 +135,7 @@ public class MainFragment extends DataBindingFragment {
|
|||||||
sharedViewModel.setAmountExist(false);
|
sharedViewModel.setAmountExist(false);
|
||||||
sharedViewModel.setCardDataExist(false);
|
sharedViewModel.setCardDataExist(false);
|
||||||
sharedViewModel.setTransMenu(null);
|
sharedViewModel.setTransMenu(null);
|
||||||
|
|
||||||
updateButtonStatus();
|
updateButtonStatus();
|
||||||
|
|
||||||
delayFunctionCall(this::checkTerminalStatus);
|
delayFunctionCall(this::checkTerminalStatus);
|
||||||
@ -292,7 +294,7 @@ public class MainFragment extends DataBindingFragment {
|
|||||||
|
|
||||||
private void updateButtonStatus() {
|
private void updateButtonStatus() {
|
||||||
mainViewModel.settlementStatus.setValue(SystemParamsOperation.getInstance().getSettlementStatus());
|
mainViewModel.settlementStatus.setValue(SystemParamsOperation.getInstance().getSettlementStatus());
|
||||||
mainViewModel.kPayStatus.setValue(SystemParamsOperation.getInstance().getWavePayStatus());
|
mainViewModel.kPayStatus.setValue(SystemParamsOperation.getInstance().getQRPayStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpCarouselImages() {
|
private void setUpCarouselImages() {
|
||||||
@ -844,11 +846,18 @@ public class MainFragment extends DataBindingFragment {
|
|||||||
} else {
|
} else {
|
||||||
processBatch();
|
processBatch();
|
||||||
sharedViewModel.transactionsType.setValue(TransactionsType.SALE);
|
sharedViewModel.transactionsType.setValue(TransactionsType.SALE);
|
||||||
|
sharedViewModel.setTransMenu(TransMenu.SALE);
|
||||||
sharedViewModel.processCode.postValue(ProcessCode.SALE_PURCHASE + ProcessCode.SMART + ProcessCode.TO_ACCOUNT);
|
sharedViewModel.processCode.postValue(ProcessCode.SALE_PURCHASE + ProcessCode.SMART + ProcessCode.TO_ACCOUNT);
|
||||||
navigateToAmount();
|
navigateToAmount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onClickQR(){
|
||||||
|
// navigate to new QR Pay fragment
|
||||||
|
routeId = R.id.action_nav_main_to_qrFragment;
|
||||||
|
safeNavigateToRouteId();
|
||||||
|
}
|
||||||
|
|
||||||
public void onClickQRPay() {
|
public void onClickQRPay() {
|
||||||
|
|
||||||
String mmqrIp = SystemParamsOperation.getInstance().getSecHostIpAddress();
|
String mmqrIp = SystemParamsOperation.getInstance().getSecHostIpAddress();
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import androidx.lifecycle.Observer;
|
|||||||
import androidx.lifecycle.ViewModel;
|
import androidx.lifecycle.ViewModel;
|
||||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||||
|
|
||||||
|
import com.utsmm.kbz.service.AutoSettleService;
|
||||||
import com.utsmyanmar.baselib.db.model.EmvDetail;
|
import com.utsmyanmar.baselib.db.model.EmvDetail;
|
||||||
import com.utsmyanmar.baselib.network.model.sirius.SiriusRequest;
|
import com.utsmyanmar.baselib.network.model.sirius.SiriusRequest;
|
||||||
import com.utsmyanmar.baselib.network.model.sirius.SiriusResponse;
|
import com.utsmyanmar.baselib.network.model.sirius.SiriusResponse;
|
||||||
@ -22,7 +23,6 @@ import com.utsmyanmar.paylibs.reversal.ReversalAction;
|
|||||||
import com.utsmyanmar.paylibs.reversal.ReversalListener;
|
import com.utsmyanmar.paylibs.reversal.ReversalListener;
|
||||||
import com.utsmyanmar.paylibs.system.SingleLiveEvent;
|
import com.utsmyanmar.paylibs.system.SingleLiveEvent;
|
||||||
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation;
|
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation;
|
||||||
import com.utsmm.kbz.service.SmileSettleService;
|
|
||||||
import com.utsmm.kbz.util.enums.ReversalStatus;
|
import com.utsmm.kbz.util.enums.ReversalStatus;
|
||||||
import com.utsmm.kbz.util.ecr.ECRConnectionStatus;
|
import com.utsmm.kbz.util.ecr.ECRConnectionStatus;
|
||||||
|
|
||||||
@ -75,8 +75,8 @@ public class MainViewModel extends ViewModel {
|
|||||||
private BroadcastReceiver dataReceiver = new BroadcastReceiver() {
|
private BroadcastReceiver dataReceiver = new BroadcastReceiver() {
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
if (intent.getAction().equals(SmileSettleService.ACTION_DATA_RECEIVED)) {
|
if (intent.getAction().equals(AutoSettleService.ACTION_DATA_RECEIVED)) {
|
||||||
String data = intent.getStringExtra(SmileSettleService.EXTRA_DATA);
|
String data = intent.getStringExtra(AutoSettleService.EXTRA_DATA);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -90,11 +90,11 @@ public class MainViewModel extends ViewModel {
|
|||||||
playAtOnce.setValue(false);
|
playAtOnce.setValue(false);
|
||||||
|
|
||||||
LocalBroadcastManager.getInstance(context).registerReceiver(dataReceiver,
|
LocalBroadcastManager.getInstance(context).registerReceiver(dataReceiver,
|
||||||
new IntentFilter(SmileSettleService.ACTION_DATA_RECEIVED));
|
new IntentFilter(AutoSettleService.ACTION_DATA_RECEIVED));
|
||||||
|
|
||||||
settlementStatus.setValue(SystemParamsOperation.getInstance().getSettlementStatus());
|
settlementStatus.setValue(SystemParamsOperation.getInstance().getSettlementStatus());
|
||||||
|
|
||||||
kPayStatus.setValue(SystemParamsOperation.getInstance().getWavePayStatus());
|
kPayStatus.setValue(SystemParamsOperation.getInstance().getQRPayStatus());
|
||||||
|
|
||||||
disabledMsg.setValue(SystemParamsOperation.getInstance().getDisabledMsg());
|
disabledMsg.setValue(SystemParamsOperation.getInstance().getDisabledMsg());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,5 +5,6 @@ public enum CardTransactionType {
|
|||||||
MPU,
|
MPU,
|
||||||
EMV,
|
EMV,
|
||||||
MAG,
|
MAG,
|
||||||
FALLBACK
|
FALLBACK,
|
||||||
|
MOCK
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,11 +4,11 @@ import android.content.BroadcastReceiver;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
|
||||||
public class SmileAlarmReceiver extends BroadcastReceiver {
|
public class AutoAlarmReceiver extends BroadcastReceiver {
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
// Start the service to send the API request
|
// Start the service to send the API request
|
||||||
Intent serviceIntent = new Intent(context, SmileSettleService.class);
|
Intent serviceIntent = new Intent(context, AutoSettleService.class);
|
||||||
context.startService(serviceIntent);
|
context.startService(serviceIntent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
307
app/src/main/java/com/utsmm/kbz/service/AutoSettleService.java
Normal file
307
app/src/main/java/com/utsmm/kbz/service/AutoSettleService.java
Normal file
@ -0,0 +1,307 @@
|
|||||||
|
package com.utsmm.kbz.service;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.app.NotificationChannel;
|
||||||
|
import android.app.NotificationManager;
|
||||||
|
import android.app.Service;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.IBinder;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.core.app.NotificationCompat;
|
||||||
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||||
|
|
||||||
|
import com.utsmyanmar.baselib.repo.Repository;
|
||||||
|
import com.utsmm.kbz.BuildConfig;
|
||||||
|
import com.utsmm.kbz.R;
|
||||||
|
import com.utsmm.kbz.ui.settlement.SettlementViewModel;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
|
||||||
|
import dagger.hilt.android.AndroidEntryPoint;
|
||||||
|
import com.utsmyanmar.paylibs.utils.LogUtil;
|
||||||
|
|
||||||
|
@AndroidEntryPoint
|
||||||
|
public class AutoSettleService extends Service {
|
||||||
|
|
||||||
|
private static final String TAG = AutoSettleService.class.getSimpleName();
|
||||||
|
|
||||||
|
public static final String ACTION_DATA_RECEIVED = BuildConfig.APPLICATION_ID + ".ACTION_DATA_RECEIVED";
|
||||||
|
public static final String EXTRA_DATA = BuildConfig.APPLICATION_ID + ".EXTRA_DATA";
|
||||||
|
|
||||||
|
|
||||||
|
private Handler handler;
|
||||||
|
|
||||||
|
|
||||||
|
private SettlementViewModel settlementViewModel;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
Repository repository;
|
||||||
|
|
||||||
|
public static final String NOTIFICATION_CHANNEL_ID = "10001";
|
||||||
|
private final static String default_notification_channel_id = "default";
|
||||||
|
private void createNotification() {
|
||||||
|
NotificationManager mNotificationManager = (NotificationManager)getSystemService( NOTIFICATION_SERVICE ) ;
|
||||||
|
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(getApplicationContext() , default_notification_channel_id ) ;
|
||||||
|
mBuilder.setContentTitle( "Alarm manager is running!" ) ;
|
||||||
|
mBuilder.setContentText( "Wiping out the transactions!" ) ;
|
||||||
|
mBuilder.setTicker( "Notification Listener Service Example" ) ;
|
||||||
|
mBuilder.setSmallIcon(R.drawable. ic_launcher_foreground ) ;
|
||||||
|
mBuilder.setAutoCancel( true ) ;
|
||||||
|
if (android.os.Build.VERSION. SDK_INT >= android.os.Build.VERSION_CODES. O ) {
|
||||||
|
int importance = NotificationManager. IMPORTANCE_HIGH ;
|
||||||
|
NotificationChannel notificationChannel = new NotificationChannel( NOTIFICATION_CHANNEL_ID , "NOTIFICATION_CHANNEL_NAME" , importance) ;
|
||||||
|
mBuilder.setChannelId( NOTIFICATION_CHANNEL_ID ) ;
|
||||||
|
assert mNotificationManager != null;
|
||||||
|
mNotificationManager.createNotificationChannel(notificationChannel) ;
|
||||||
|
}
|
||||||
|
assert mNotificationManager != null;
|
||||||
|
mNotificationManager.notify(( int ) System. currentTimeMillis () , mBuilder.build()) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendDataToViewModel(String data) {
|
||||||
|
Intent intent = new Intent(ACTION_DATA_RECEIVED);
|
||||||
|
intent.putExtra(EXTRA_DATA, data);
|
||||||
|
LocalBroadcastManager.getInstance(this).sendBroadcast(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("CheckResult")
|
||||||
|
@Override
|
||||||
|
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||||
|
// Perform the Settlement request here
|
||||||
|
// ...
|
||||||
|
|
||||||
|
LogUtil.d(TAG,"<<<<<<<<<<<<<<< This action was called >>>>>>>>>>>>>>>>.");
|
||||||
|
|
||||||
|
|
||||||
|
sendDataToViewModel("Hello there");
|
||||||
|
|
||||||
|
createNotification();
|
||||||
|
|
||||||
|
// Observer<List<PayDetail>> settleObserver = new Observer<List<PayDetail>>() {
|
||||||
|
// @Override
|
||||||
|
// public void onChanged(List<PayDetail> list) {
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// if(list == null || list.size() == 0) {
|
||||||
|
// LogUtil.d(TAG, "Settle is null");
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// LogUtil.d(TAG,"Size Settle : "+list.size());
|
||||||
|
//
|
||||||
|
// for (PayDetail pay:list) {
|
||||||
|
// repository.deletePayDetail(pay);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// repository.getSettlementPOS().observeForever(settleObserver);
|
||||||
|
//
|
||||||
|
// repository.getSettlementPOS().removeObserver(settleObserver);
|
||||||
|
//
|
||||||
|
// Observer<List<PayDetail>> deleteTransObserver = new Observer<List<PayDetail>>() {
|
||||||
|
// @Override
|
||||||
|
// public void onChanged(List<PayDetail> lists) {
|
||||||
|
// if(lists == null || lists.size() == 0) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// LogUtil.d(TAG,"Size Delete Trans : "+lists.size());
|
||||||
|
// for (PayDetail pay:lists) {
|
||||||
|
// repository.deletePayDetail(pay);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// repository.getDeleteTrans(SystemParamsOperation.getInstance().getCurrentBatchNum()).observeForever(deleteTransObserver);
|
||||||
|
//
|
||||||
|
// repository.getDeleteTrans(SystemParamsOperation.getInstance().getCurrentBatchNum()).removeObserver(deleteTransObserver);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
|
||||||
|
// try{
|
||||||
|
// handler.post(new Runnable() {
|
||||||
|
// @Override
|
||||||
|
// public void run() {
|
||||||
|
// // Create and show the dialog
|
||||||
|
// AlertDialog.Builder builder = new AlertDialog.Builder(SmileSettleService.this);
|
||||||
|
// builder.setTitle("Auto Settle!")
|
||||||
|
// .setMessage("Settlement process is going to start!")
|
||||||
|
// .setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||||
|
// @Override
|
||||||
|
// public void onClick(DialogInterface dialog, int which) {
|
||||||
|
// // Handle OK button click
|
||||||
|
// dialog.dismiss(); // Dismiss the dialog
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// .setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
|
||||||
|
// @Override
|
||||||
|
// public void onClick(DialogInterface dialog, int which) {
|
||||||
|
// // Handle Cancel button click
|
||||||
|
// dialog.dismiss(); // Dismiss the dialog
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// AlertDialog dialog = builder.create();
|
||||||
|
//// dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
|
||||||
|
//// dialog.show();
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }catch (Exception e){
|
||||||
|
// e.printStackTrace();
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
if(com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation.getInstance().getSettlementStatus()) {
|
||||||
|
final com.utsmyanmar.paylibs.isobuilder.builderx.ISOMsgX isoMsgX = new com.utsmyanmar.paylibs.isobuilder.builderx.ISOMsgX.ISOMsgXBuilder(
|
||||||
|
com.utsmyanmar.paylibs.isobuilder.builderx.ISOVersion.VERSION_1993,
|
||||||
|
com.utsmyanmar.paylibs.isobuilder.ISOMode.BOTH_HEADER_TPDU,
|
||||||
|
com.utsmyanmar.paylibs.utils.enums.HostName.BPC
|
||||||
|
).build();
|
||||||
|
|
||||||
|
repository.getSettlementPOS().observeForever(list -> {
|
||||||
|
int saleCount = 0;
|
||||||
|
long saleAmount = 0L;
|
||||||
|
int preCount = 0;
|
||||||
|
long preAmount = 0L;
|
||||||
|
int refundCount = 0;
|
||||||
|
long refundAmount = 0L;
|
||||||
|
int caCount = 0;
|
||||||
|
long caAmount = 0L;
|
||||||
|
|
||||||
|
if(list != null && !list.isEmpty()) {
|
||||||
|
for (com.utsmyanmar.paylibs.model.PayDetail pay : list) {
|
||||||
|
if (pay.getTransactionType() == com.utsmyanmar.paylibs.utils.iso_utils.TransactionType.SALE && !pay.isCanceled) {
|
||||||
|
saleCount++;
|
||||||
|
saleAmount += pay.getAmount();
|
||||||
|
} else if (pay.getTransactionType() == com.utsmyanmar.paylibs.utils.iso_utils.TransactionType.PRE_SALE_COMPLETE && !pay.isCanceled) {
|
||||||
|
preCount++;
|
||||||
|
preAmount += pay.getAmount();
|
||||||
|
} else if (pay.getTransactionType() == com.utsmyanmar.paylibs.utils.iso_utils.TransactionType.REFUND) {
|
||||||
|
refundCount++;
|
||||||
|
refundAmount += pay.getAmount();
|
||||||
|
} else if (pay.getTransactionType() == com.utsmyanmar.paylibs.utils.iso_utils.TransactionType.CASH_ADVANCE) {
|
||||||
|
caCount++;
|
||||||
|
caAmount += pay.getAmount();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
com.utsmyanmar.paylibs.model.TradeData tradeData = com.utsmyanmar.paylibs.utils.params.Params.newTrade(true);
|
||||||
|
com.utsmyanmar.paylibs.model.PayDetail payDetail = tradeData.getPayDetail();
|
||||||
|
|
||||||
|
String bitmap = com.utsmyanmar.paylibs.utils.iso_utils.BitmapConfig.BPC_SETTLEMENT;
|
||||||
|
payDetail.setTransType(com.utsmyanmar.paylibs.utils.iso_utils.TransactionsType.SETTLEMENT.name);
|
||||||
|
payDetail.setTransactionType(com.utsmyanmar.paylibs.utils.iso_utils.TransactionType.SETTLEMENT);
|
||||||
|
payDetail.setProcessCode(com.utsmyanmar.paylibs.utils.iso_utils.TransactionsType.SETTLEMENT.processCode);
|
||||||
|
payDetail.setBatchNo(com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation.getInstance().getCurrentBatchNum());
|
||||||
|
|
||||||
|
com.utsmyanmar.paylibs.model.SettleData settleData = new com.utsmyanmar.paylibs.model.SettleData(
|
||||||
|
saleCount,
|
||||||
|
saleAmount,
|
||||||
|
preCount,
|
||||||
|
preAmount,
|
||||||
|
refundCount,
|
||||||
|
refundAmount,
|
||||||
|
caCount,
|
||||||
|
caAmount
|
||||||
|
);
|
||||||
|
payDetail.setSettleDataObj(settleData);
|
||||||
|
|
||||||
|
long totalAmount = saleAmount + preAmount + refundAmount + caAmount;
|
||||||
|
String settlementData;
|
||||||
|
if (refundAmount != 0L) {
|
||||||
|
long creditTotal = saleAmount + preAmount + caAmount;
|
||||||
|
long subTotal = creditTotal - refundAmount;
|
||||||
|
if (subTotal < 0L) {
|
||||||
|
settlementData = "D" + String.format(java.util.Locale.getDefault(), "%012d", Math.abs(subTotal));
|
||||||
|
} else {
|
||||||
|
settlementData = "C" + String.format(java.util.Locale.getDefault(), "%012d", subTotal);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
settlementData = "C" + String.format(java.util.Locale.getDefault(), "%012d", totalAmount);
|
||||||
|
}
|
||||||
|
payDetail.setSettleData(settlementData);
|
||||||
|
payDetail.setAmount(totalAmount);
|
||||||
|
|
||||||
|
tradeData.setPayDetail(payDetail);
|
||||||
|
tradeData.setField60(com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation.getInstance().getCurrentBatchNum());
|
||||||
|
|
||||||
|
byte[] sendBytes = isoMsgX.buildISOPackets(tradeData, bitmap, com.utsmyanmar.paylibs.utils.MessageType.SETTLEMENT);
|
||||||
|
com.utsmyanmar.paylibs.network.ISOSocket.getInstance().enqueue(sendBytes, sendBytes.length, false, new com.utsmyanmar.paylibs.network.ISOCallback() {
|
||||||
|
@Override
|
||||||
|
public void onReceive(byte[] bytes, int length) {
|
||||||
|
java.util.Map<String, com.utsmyanmar.paylibs.model.MsgField> responseMap = isoMsgX.parseISOPackets(bytes, length);
|
||||||
|
if (responseMap != null) {
|
||||||
|
String resultStr = "";
|
||||||
|
try {
|
||||||
|
resultStr = responseMap.get("F039").getDataStr();
|
||||||
|
} catch (NullPointerException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
payDetail.setIsNeedReversal(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
payDetail.setTradeAnswerCode(resultStr);
|
||||||
|
if (TextUtils.equals(resultStr, com.utsmyanmar.paylibs.Constant.ANSWER_CODE_ACCEPT) || TextUtils.equals(resultStr, com.utsmyanmar.paylibs.Constant.ANSWER_CODE_APPROVED)) {
|
||||||
|
payDetail.setIsNeedReversal(false);
|
||||||
|
} else if (TextUtils.equals(resultStr, "95") || TextUtils.equals(resultStr, "095")) {
|
||||||
|
payDetail.setIsNeedReversal(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String msg) {
|
||||||
|
com.utsmyanmar.paylibs.network.ISOSocket.getInstance().switchIp();
|
||||||
|
com.utsmyanmar.paylibs.network.ISOSocket.getInstance().enqueue(sendBytes, sendBytes.length, false, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
if(list != null && !list.isEmpty()) {
|
||||||
|
for (com.utsmyanmar.paylibs.model.PayDetail p : list) {
|
||||||
|
repository.deletePayDetail(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
repository.insertPayDetail(payDetail);
|
||||||
|
|
||||||
|
Intent uiIntent = new Intent(getApplicationContext(), com.utsmm.kbz.MainActivity.class);
|
||||||
|
uiIntent.putExtra("AUTO_SETTLEMENT", true);
|
||||||
|
uiIntent.putExtra("EXTRA_TRANSACTION_TYPE", com.utsmyanmar.paylibs.utils.iso_utils.TransactionsType.SETTLEMENT.value);
|
||||||
|
uiIntent.putExtra("EXTRA_PAY_DETAIL", payDetail);
|
||||||
|
uiIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||||
|
startActivity(uiIntent);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return START_NOT_STICKY;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
handler = new Handler();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public IBinder onBind(Intent intent) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onUnbind(Intent intent) {
|
||||||
|
return super.onUnbind(intent);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,183 +0,0 @@
|
|||||||
package com.utsmm.kbz.service;
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
import android.app.NotificationChannel;
|
|
||||||
import android.app.NotificationManager;
|
|
||||||
import android.app.Service;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.os.IBinder;
|
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.core.app.NotificationCompat;
|
|
||||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
|
||||||
|
|
||||||
import com.utsmyanmar.baselib.repo.Repository;
|
|
||||||
import com.utsmm.kbz.BuildConfig;
|
|
||||||
import com.utsmm.kbz.R;
|
|
||||||
import com.utsmm.kbz.ui.settlement.SettlementViewModel;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
|
|
||||||
|
|
||||||
import dagger.hilt.android.AndroidEntryPoint;
|
|
||||||
import com.utsmyanmar.paylibs.utils.LogUtil;
|
|
||||||
|
|
||||||
// Temporarily disabled Hilt
|
|
||||||
// @AndroidEntryPoint
|
|
||||||
public class SmileSettleService extends Service {
|
|
||||||
|
|
||||||
private static final String TAG = SmileSettleService.class.getSimpleName();
|
|
||||||
|
|
||||||
public static final String ACTION_DATA_RECEIVED = BuildConfig.APPLICATION_ID + ".ACTION_DATA_RECEIVED";
|
|
||||||
public static final String EXTRA_DATA = BuildConfig.APPLICATION_ID + ".EXTRA_DATA";
|
|
||||||
|
|
||||||
|
|
||||||
private Handler handler;
|
|
||||||
|
|
||||||
|
|
||||||
private SettlementViewModel settlementViewModel;
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
Repository repository;
|
|
||||||
|
|
||||||
public static final String NOTIFICATION_CHANNEL_ID = "10001";
|
|
||||||
private final static String default_notification_channel_id = "default";
|
|
||||||
private void createNotification() {
|
|
||||||
NotificationManager mNotificationManager = (NotificationManager)getSystemService( NOTIFICATION_SERVICE ) ;
|
|
||||||
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(getApplicationContext() , default_notification_channel_id ) ;
|
|
||||||
mBuilder.setContentTitle( "Alarm manager is running!" ) ;
|
|
||||||
mBuilder.setContentText( "Wiping out the transactions!" ) ;
|
|
||||||
mBuilder.setTicker( "Notification Listener Service Example" ) ;
|
|
||||||
mBuilder.setSmallIcon(R.drawable. ic_launcher_foreground ) ;
|
|
||||||
mBuilder.setAutoCancel( true ) ;
|
|
||||||
if (android.os.Build.VERSION. SDK_INT >= android.os.Build.VERSION_CODES. O ) {
|
|
||||||
int importance = NotificationManager. IMPORTANCE_HIGH ;
|
|
||||||
NotificationChannel notificationChannel = new NotificationChannel( NOTIFICATION_CHANNEL_ID , "NOTIFICATION_CHANNEL_NAME" , importance) ;
|
|
||||||
mBuilder.setChannelId( NOTIFICATION_CHANNEL_ID ) ;
|
|
||||||
assert mNotificationManager != null;
|
|
||||||
mNotificationManager.createNotificationChannel(notificationChannel) ;
|
|
||||||
}
|
|
||||||
assert mNotificationManager != null;
|
|
||||||
mNotificationManager.notify(( int ) System. currentTimeMillis () , mBuilder.build()) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void sendDataToViewModel(String data) {
|
|
||||||
Intent intent = new Intent(ACTION_DATA_RECEIVED);
|
|
||||||
intent.putExtra(EXTRA_DATA, data);
|
|
||||||
LocalBroadcastManager.getInstance(this).sendBroadcast(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressLint("CheckResult")
|
|
||||||
@Override
|
|
||||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
|
||||||
// Perform the Settlement request here
|
|
||||||
// ...
|
|
||||||
|
|
||||||
LogUtil.d(TAG,"<<<<<<<<<<<<<<< This action was called >>>>>>>>>>>>>>>>.");
|
|
||||||
|
|
||||||
|
|
||||||
sendDataToViewModel("Hello there");
|
|
||||||
|
|
||||||
createNotification();
|
|
||||||
|
|
||||||
// Observer<List<PayDetail>> settleObserver = new Observer<List<PayDetail>>() {
|
|
||||||
// @Override
|
|
||||||
// public void onChanged(List<PayDetail> list) {
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// if(list == null || list.size() == 0) {
|
|
||||||
// LogUtil.d(TAG, "Settle is null");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// LogUtil.d(TAG,"Size Settle : "+list.size());
|
|
||||||
//
|
|
||||||
// for (PayDetail pay:list) {
|
|
||||||
// repository.deletePayDetail(pay);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// repository.getSettlementPOS().observeForever(settleObserver);
|
|
||||||
//
|
|
||||||
// repository.getSettlementPOS().removeObserver(settleObserver);
|
|
||||||
//
|
|
||||||
// Observer<List<PayDetail>> deleteTransObserver = new Observer<List<PayDetail>>() {
|
|
||||||
// @Override
|
|
||||||
// public void onChanged(List<PayDetail> lists) {
|
|
||||||
// if(lists == null || lists.size() == 0) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// LogUtil.d(TAG,"Size Delete Trans : "+lists.size());
|
|
||||||
// for (PayDetail pay:lists) {
|
|
||||||
// repository.deletePayDetail(pay);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
//
|
|
||||||
// repository.getDeleteTrans(SystemParamsOperation.getInstance().getCurrentBatchNum()).observeForever(deleteTransObserver);
|
|
||||||
//
|
|
||||||
// repository.getDeleteTrans(SystemParamsOperation.getInstance().getCurrentBatchNum()).removeObserver(deleteTransObserver);
|
|
||||||
//
|
|
||||||
//
|
|
||||||
|
|
||||||
// try{
|
|
||||||
// handler.post(new Runnable() {
|
|
||||||
// @Override
|
|
||||||
// public void run() {
|
|
||||||
// // Create and show the dialog
|
|
||||||
// AlertDialog.Builder builder = new AlertDialog.Builder(SmileSettleService.this);
|
|
||||||
// builder.setTitle("Auto Settle!")
|
|
||||||
// .setMessage("Settlement process is going to start!")
|
|
||||||
// .setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
|
||||||
// @Override
|
|
||||||
// public void onClick(DialogInterface dialog, int which) {
|
|
||||||
// // Handle OK button click
|
|
||||||
// dialog.dismiss(); // Dismiss the dialog
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// .setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
|
|
||||||
// @Override
|
|
||||||
// public void onClick(DialogInterface dialog, int which) {
|
|
||||||
// // Handle Cancel button click
|
|
||||||
// dialog.dismiss(); // Dismiss the dialog
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// AlertDialog dialog = builder.create();
|
|
||||||
//// dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
|
|
||||||
//// dialog.show();
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }catch (Exception e){
|
|
||||||
// e.printStackTrace();
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
return START_NOT_STICKY;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate() {
|
|
||||||
super.onCreate();
|
|
||||||
handler = new Handler();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public IBinder onBind(Intent intent) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onUnbind(Intent intent) {
|
|
||||||
return super.onUnbind(intent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,17 +1,23 @@
|
|||||||
package com.utsmm.kbz.ui;
|
package com.utsmm.kbz.ui;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.lifecycle.Observer;
|
import androidx.lifecycle.Observer;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
|
||||||
import androidx.navigation.Navigation;
|
import androidx.navigation.Navigation;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.stream.MalformedJsonException;
|
import com.google.gson.stream.MalformedJsonException;
|
||||||
|
import com.nexgo.downloadkey.downloadflow.DownloadFEntity;
|
||||||
|
import com.nexgo.downloadkey.downloadflow.DownloadFlow;
|
||||||
|
import com.nexgo.downloadkey.downloadflow.DownloadFlowProcessListener;
|
||||||
|
import com.nexgo.downloadkey.downloadflow.DownloadFlowResultEntity;
|
||||||
|
import com.nexgo.downloadkey.downloadflow.DownloadResult;
|
||||||
import com.utsmyanmar.baselib.emv.EmvParamOperation;
|
import com.utsmyanmar.baselib.emv.EmvParamOperation;
|
||||||
import com.utsmyanmar.baselib.fragment.DataBindingFragment;
|
import com.utsmyanmar.baselib.fragment.DataBindingFragment;
|
||||||
import com.utsmyanmar.baselib.network.model.sirius.SiriusError;
|
import com.utsmyanmar.baselib.network.model.sirius.SiriusError;
|
||||||
@ -144,35 +150,34 @@ public class SettingsFragment extends DataBindingFragment {
|
|||||||
|
|
||||||
private void updateDemoSettings() {
|
private void updateDemoSettings() {
|
||||||
boolean isDemo = SystemParamsOperation.getInstance().getDemoStatus();
|
boolean isDemo = SystemParamsOperation.getInstance().getDemoStatus();
|
||||||
binding.demoSwitch.setChecked(isDemo);
|
// binding.demoSwitch.setChecked(isDemo);
|
||||||
binding.demoSummary.setText(isDemo ?
|
// binding.demoSummary.setText(isDemo ?
|
||||||
"Demo mode active - Test transactions without real processing" :
|
// "Demo mode active - Test transactions without real processing" :
|
||||||
"Simulator mode active - Real transaction processing");
|
// "Simulator mode active - Real transaction processing");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateAlertSoundSettings() {
|
private void updateAlertSoundSettings() {
|
||||||
boolean isEnabled = SystemParamsOperation.getInstance().isAlertSound();
|
boolean isEnabled = SystemParamsOperation.getInstance().isAlertSound();
|
||||||
binding.alertSoundSwitch.setChecked(isEnabled);
|
// binding.alertSoundSwitch.setChecked(isEnabled);
|
||||||
binding.alertSoundSummary.setText(isEnabled ?
|
// binding.alertSoundSummary.setText(isEnabled ?
|
||||||
"Sound alerts enabled for notifications" :
|
// "Sound alerts enabled for notifications" :
|
||||||
"Sound alerts disabled - Silent mode");
|
// "Sound alerts disabled - Silent mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void updateReversalSettings() {
|
private void updateReversalSettings() {
|
||||||
boolean isEnabled = SystemParamsOperation.getInstance().isReversalOn();
|
boolean isEnabled = SystemParamsOperation.getInstance().isReversalOn();
|
||||||
binding.reversalSwitch.setChecked(isEnabled);
|
// binding.reversalSwitch.setChecked(isEnabled);
|
||||||
binding.reversalSummary.setText(isEnabled ?
|
// binding.reversalSummary.setText(isEnabled ?
|
||||||
"Automatic reversal enabled for failed transactions" :
|
// "Automatic reversal enabled for failed transactions" :
|
||||||
"Automatic reversal disabled - Manual reversal only");
|
// "Automatic reversal disabled - Manual reversal only");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateMultiHostSettings() {
|
private void updateMultiHostSettings() {
|
||||||
boolean isEnabled = SystemParamsOperation.getInstance().isMultiHost();
|
boolean isEnabled = SystemParamsOperation.getInstance().isMultiHost();
|
||||||
binding.multiHostSwitch.setChecked(isEnabled);
|
// binding.multiHostSwitch.setChecked(isEnabled);
|
||||||
binding.multiHostSummary.setText(isEnabled ?
|
// binding.multiHostSummary.setText(isEnabled ?
|
||||||
"Multiple host support enabled" :
|
// "Multiple host support enabled" :
|
||||||
"Single host mode - Primary host only");
|
// "Single host mode - Primary host only");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateTmsAddressSettings() {
|
private void updateTmsAddressSettings() {
|
||||||
@ -197,6 +202,16 @@ public class SettingsFragment extends DataBindingFragment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onInjectKeyClick() {
|
||||||
|
try {
|
||||||
|
LogUtil.d(TAG, "Inject Key clicked");
|
||||||
|
Navigation.findNavController(requireActivity(), R.id.nav_host_fragment)
|
||||||
|
.navigate(R.id.action_nav_settings_to_injectKeyFragment);
|
||||||
|
} catch (Exception e) {
|
||||||
|
LogUtil.e(TAG, "Error navigating to inject key: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void onDemoClick() {
|
public void onDemoClick() {
|
||||||
try {
|
try {
|
||||||
boolean newValue = !SystemParamsOperation.getInstance().getDemoStatus();
|
boolean newValue = !SystemParamsOperation.getInstance().getDemoStatus();
|
||||||
|
|||||||
@ -0,0 +1,76 @@
|
|||||||
|
package com.utsmm.kbz.ui.adapters;
|
||||||
|
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.utsmm.kbz.R;
|
||||||
|
import com.utsmm.kbz.databinding.ItemQrPayButtonBinding;
|
||||||
|
import com.utsmm.kbz.ui.qr_pay.QRPayItem;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class QRPayAdapter extends RecyclerView.Adapter<QRPayAdapter.ViewHolder> {
|
||||||
|
|
||||||
|
public interface OnItemClickListener {
|
||||||
|
void onItemClick(int position);
|
||||||
|
}
|
||||||
|
|
||||||
|
private final List<QRPayItem> items;
|
||||||
|
private final OnItemClickListener listener;
|
||||||
|
|
||||||
|
public QRPayAdapter(List<QRPayItem> item, OnItemClickListener listener) {
|
||||||
|
this.items = item;
|
||||||
|
this.listener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
ItemQrPayButtonBinding binding = DataBindingUtil.inflate(
|
||||||
|
LayoutInflater.from(parent.getContext()),
|
||||||
|
R.layout.item_qr_pay_button,
|
||||||
|
parent,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
return new ViewHolder(binding);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private final int[] colors = new int[]{
|
||||||
|
R.color.colorPrimary,
|
||||||
|
R.color.amber,
|
||||||
|
R.color.forestGreen
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||||
|
QRPayItem item = items.get(position);
|
||||||
|
holder.binding.setText(item.title);
|
||||||
|
holder.binding.setIcon(item.icon);
|
||||||
|
holder.binding.btnItem.setOnClickListener(v -> {
|
||||||
|
if(listener != null){
|
||||||
|
listener.onItemClick(position);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return items == null ? 0 : items.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
final ItemQrPayButtonBinding binding;
|
||||||
|
public ViewHolder(@NonNull ItemQrPayButtonBinding binding) {
|
||||||
|
super(binding.getRoot());
|
||||||
|
this.binding = binding;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -106,11 +106,15 @@ public class CardWaitingFragment extends DataBindingFragment implements DataBind
|
|||||||
|
|
||||||
public void onClickManualEntry() {
|
public void onClickManualEntry() {
|
||||||
|
|
||||||
// showSingleInfoDialogAutoHide("Coming Soon!");
|
|
||||||
|
|
||||||
routeId = R.id.action_cardWaitingFragment_to_manualEntryFragment;
|
routeId = R.id.action_cardWaitingFragment_to_manualEntryFragment;
|
||||||
safeNavigateToRouteId();
|
safeNavigateToRouteId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onClickTap() {
|
||||||
|
cardReadViewModel.setCardTransactionType(CardTransactionType.MOCK);
|
||||||
|
routeId = R.id.action_cardWaitingFragment_to_processingCardFragment;
|
||||||
|
safeNavigateToRouteId();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -142,6 +142,10 @@ public class InputPasswordFragment extends DataBindingFragment implements DataBi
|
|||||||
|
|
||||||
private void checkRoute() {
|
private void checkRoute() {
|
||||||
switch (Objects.requireNonNull(sharedViewModel.transactionsType.getValue())) {
|
switch (Objects.requireNonNull(sharedViewModel.transactionsType.getValue())) {
|
||||||
|
case MMQR_REFUND:
|
||||||
|
inputPasswordViewModel.passwordType.setValue(InputPasswordType.SYSTEM);
|
||||||
|
routeId = R.id.action_inputPasswordFragment_to_QRRefundProcessFragment;
|
||||||
|
break;
|
||||||
case PRE_AUTH_COMPLETE_VOID:
|
case PRE_AUTH_COMPLETE_VOID:
|
||||||
inputPasswordViewModel.passwordType.setValue(InputPasswordType.SYSTEM);
|
inputPasswordViewModel.passwordType.setValue(InputPasswordType.SYSTEM);
|
||||||
sharedViewModel.transactionName.postValue(getResourceString(R.string.title_pre_auth_complete));
|
sharedViewModel.transactionName.postValue(getResourceString(R.string.title_pre_auth_complete));
|
||||||
|
|||||||
@ -220,11 +220,13 @@ public class InputRRNFragment extends DataBindingFragment {
|
|||||||
newPay = transProcessViewModel.getPayDetail();
|
newPay = transProcessViewModel.getPayDetail();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
newPay.setReferNo(rrnNo);
|
newPay.setReferNo(rrnNo);
|
||||||
if(sharedViewModel.getTransMenu().getValue() == TransMenu.PRE_AUTH_FULL_VOID) {
|
if(sharedViewModel.getTransMenu().getValue() == TransMenu.PRE_AUTH_FULL_VOID) {
|
||||||
newPay.setAmount(payDetail.getAmount());
|
newPay.setAmount(payDetail.getAmount());
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
sharedViewModel.setAmount(POSUtil.getInstance().getDecimalAmountFormat(payDetail.getAmount()));
|
||||||
newPay.setTradeDateTime(payDetail.getTradeDateTime());
|
newPay.setTradeDateTime(payDetail.getTradeDateTime());
|
||||||
|
|
||||||
if(isEmvTrans()) {
|
if(isEmvTrans()) {
|
||||||
@ -311,7 +313,9 @@ public class InputRRNFragment extends DataBindingFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
newPay.setReferNo(rrnNo);
|
newPay.setReferNo(rrnNo);
|
||||||
|
newPay.setApprovalCode(payDetail.getApprovalCode());
|
||||||
|
newPay.setTradeTime(payDetail.getTradeTime());
|
||||||
|
newPay.setTradeDate(payDetail.getTradeDate());
|
||||||
if(newPay.getAmount() > payDetail.getAmount()) {
|
if(newPay.getAmount() > payDetail.getAmount()) {
|
||||||
newPay.setTradeAnswerCode("C1"); // ---> refer to BaseErrorCode class// ,
|
newPay.setTradeAnswerCode("C1"); // ---> refer to BaseErrorCode class// ,
|
||||||
newPay.setTransType(sharedViewModel.transactionsType.getValue().name);
|
newPay.setTransType(sharedViewModel.transactionsType.getValue().name);
|
||||||
|
|||||||
@ -299,7 +299,7 @@ public class InputTraceNoFragment extends DataBindingFragment {
|
|||||||
|
|
||||||
if(sharedViewModel.hostType.getValue() == HostType.MPU) {
|
if(sharedViewModel.hostType.getValue() == HostType.MPU) {
|
||||||
sharedViewModel.isEmv.setValue(false);
|
sharedViewModel.isEmv.setValue(false);
|
||||||
transProcessViewModel.transType.postValue(sharedViewModel.transactionsType.getValue());
|
transProcessViewModel.transType.setValue(sharedViewModel.transactionsType.getValue());
|
||||||
transProcessViewModel.setOldTransPayDetail(payDetail);
|
transProcessViewModel.setOldTransPayDetail(payDetail);
|
||||||
transProcessViewModel.setPayDetail(payDetail);
|
transProcessViewModel.setPayDetail(payDetail);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import android.view.View;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.utsmm.kbz.util.MockData;
|
||||||
import com.utsmyanmar.baselib.fragment.DataBindingFragment;
|
import com.utsmyanmar.baselib.fragment.DataBindingFragment;
|
||||||
import com.utsmyanmar.baselib.util.DataBindingConfig;
|
import com.utsmyanmar.baselib.util.DataBindingConfig;
|
||||||
import com.utsmyanmar.checkxread.model.CardDataX;
|
import com.utsmyanmar.checkxread.model.CardDataX;
|
||||||
@ -41,6 +42,8 @@ public class ProcessingCardFragment extends DataBindingFragment {
|
|||||||
private TransProcessViewModel transProcessViewModel;
|
private TransProcessViewModel transProcessViewModel;
|
||||||
private PinPadViewModel pinPadViewModel;
|
private PinPadViewModel pinPadViewModel;
|
||||||
private EmvTransactionProcessViewModel emvTransactionViewModel;
|
private EmvTransactionProcessViewModel emvTransactionViewModel;
|
||||||
|
|
||||||
|
|
||||||
private int routeId;
|
private int routeId;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -102,9 +105,24 @@ public class ProcessingCardFragment extends DataBindingFragment {
|
|||||||
break;
|
break;
|
||||||
case MAG: readMAGStripe(false,true);
|
case MAG: readMAGStripe(false,true);
|
||||||
break;
|
break;
|
||||||
|
case MOCK: mockMPUCard();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private void mockMPUCard() {
|
||||||
|
LogUtil.d(TAG,"initialize mock card data...");
|
||||||
|
routeId = R.id.action_processingCardFragment_to_pinPadFragment;
|
||||||
|
transProcessViewModel.transType.setValue(sharedViewModel.transactionsType.getValue());
|
||||||
|
pinPadViewModel.transType.setValue(sharedViewModel.transactionsType.getValue());
|
||||||
|
|
||||||
|
CardDataX cardDataX = MockData.getInstance().generateMPUCard();
|
||||||
|
|
||||||
|
TradeData tradeData = TransactionUtil.getInstance().initMPUTransaction(cardDataX, CardTypeX.IC);
|
||||||
|
transProcessViewModel.setTradeData(tradeData);
|
||||||
|
pinPadViewModel.setTradeData(tradeData);
|
||||||
|
sharedViewModel.setCardDataExist(true);
|
||||||
|
safeNavigateToRouteId();
|
||||||
|
}
|
||||||
|
|
||||||
private void readMPUCard() {
|
private void readMPUCard() {
|
||||||
cardReadViewModel.startReadXProcess(MPUXReadCard.getInstance(), new ReadCardResultX() {
|
cardReadViewModel.startReadXProcess(MPUXReadCard.getInstance(), new ReadCardResultX() {
|
||||||
@ -112,18 +130,19 @@ public class ProcessingCardFragment extends DataBindingFragment {
|
|||||||
public void onSuccess(CardDataX cardDataX) {
|
public void onSuccess(CardDataX cardDataX) {
|
||||||
|
|
||||||
routeId = R.id.action_processingCardFragment_to_pinPadFragment;
|
routeId = R.id.action_processingCardFragment_to_pinPadFragment;
|
||||||
transProcessViewModel.transType.postValue(sharedViewModel.transactionsType.getValue());
|
transProcessViewModel.transType.setValue(sharedViewModel.transactionsType.getValue());
|
||||||
pinPadViewModel.transType.postValue(sharedViewModel.transactionsType.getValue());
|
pinPadViewModel.transType.setValue(sharedViewModel.transactionsType.getValue());
|
||||||
|
|
||||||
TradeData tradeData = TransactionUtil.getInstance().initMPUTransaction(cardDataX, CardTypeX.IC);
|
TradeData tradeData = TransactionUtil.getInstance().initMPUTransaction(cardDataX, CardTypeX.IC);
|
||||||
transProcessViewModel.setTradeData(tradeData);
|
transProcessViewModel.setTradeData(tradeData);
|
||||||
pinPadViewModel.setTradeData(tradeData);
|
pinPadViewModel.setTradeData(tradeData);
|
||||||
|
|
||||||
if(sharedViewModel.getTransMenu().getValue() == TransMenu.PRE_AUTH_PARTIAL_VOID ) {
|
if(sharedViewModel.getTransactionsType().getValue() == TransactionsType.PRE_AUTH_VOID ) {
|
||||||
|
|
||||||
sharedViewModel.set_errorFragmentMsg(getResourceString(R.string.txt_function_not_supported));
|
sharedViewModel.set_errorFragmentMsg(getResourceString(R.string.txt_alert_pre_auth_cancel));
|
||||||
routeId = R.id.action_processingCardFragment_to_errorFragment;
|
routeId = R.id.action_processingCardFragment_to_errorFragment;
|
||||||
|
safeNavigateToRouteId();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
// else if(sharedViewModel.transactionsType.getValue() == TransactionsType.REFUND) {
|
// else if(sharedViewModel.transactionsType.getValue() == TransactionsType.REFUND) {
|
||||||
// sharedViewModel.set_errorFragmentMsg(getResourceString(R.string.txt_card_not_supported));
|
// sharedViewModel.set_errorFragmentMsg(getResourceString(R.string.txt_card_not_supported));
|
||||||
@ -164,7 +183,7 @@ public class ProcessingCardFragment extends DataBindingFragment {
|
|||||||
// pin required scenario
|
// pin required scenario
|
||||||
|
|
||||||
routeId = R.id.action_processingCardFragment_to_pinPadFragment;
|
routeId = R.id.action_processingCardFragment_to_pinPadFragment;
|
||||||
transProcessViewModel.transType.postValue(sharedViewModel.transactionsType.getValue());
|
transProcessViewModel.transType.setValue(sharedViewModel.transactionsType.getValue());
|
||||||
pinPadViewModel.transType.postValue(sharedViewModel.transactionsType.getValue());
|
pinPadViewModel.transType.postValue(sharedViewModel.transactionsType.getValue());
|
||||||
|
|
||||||
/* need to check card scheme according to card number --!^--- check below function*/
|
/* need to check card scheme according to card number --!^--- check below function*/
|
||||||
@ -189,10 +208,11 @@ public class ProcessingCardFragment extends DataBindingFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(sharedViewModel.getTransMenu().getValue() == TransMenu.PRE_AUTH_PARTIAL_VOID ) {
|
if(sharedViewModel.getTransactionsType().getValue() == TransactionsType.PRE_AUTH_VOID ) {
|
||||||
// sharedViewModel.transMenu.postValue(null);
|
|
||||||
sharedViewModel.setTransMenu(null);
|
sharedViewModel.set_errorFragmentMsg(getResourceString(R.string.txt_alert_pre_auth_cancel));
|
||||||
routeId = R.id.action_processingCardFragment_to_errorFragment;
|
routeId = R.id.action_processingCardFragment_to_errorFragment;
|
||||||
|
|
||||||
}
|
}
|
||||||
// else if(sharedViewModel.transactionsType.getValue() == TransactionsType.REFUND) {
|
// else if(sharedViewModel.transactionsType.getValue() == TransactionsType.REFUND) {
|
||||||
// routeId = R.id.action_processingCardFragment_to_errorFragment;
|
// routeId = R.id.action_processingCardFragment_to_errorFragment;
|
||||||
|
|||||||
@ -9,7 +9,9 @@ import androidx.annotation.Nullable;
|
|||||||
import androidx.navigation.NavController;
|
import androidx.navigation.NavController;
|
||||||
import androidx.navigation.NavDestination;
|
import androidx.navigation.NavDestination;
|
||||||
|
|
||||||
|
import com.utsmm.kbz.util.EReceiptUtil;
|
||||||
import com.utsmyanmar.baselib.fragment.DataBindingFragment;
|
import com.utsmyanmar.baselib.fragment.DataBindingFragment;
|
||||||
|
import com.utsmyanmar.baselib.network.model.e_receipt.EReceiptRequest;
|
||||||
import com.utsmyanmar.baselib.util.DataBindingConfig;
|
import com.utsmyanmar.baselib.util.DataBindingConfig;
|
||||||
import com.utsmyanmar.baselib.util.TimeoutCallback;
|
import com.utsmyanmar.baselib.util.TimeoutCallback;
|
||||||
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation;
|
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation;
|
||||||
@ -168,14 +170,17 @@ public class ProcessingFragment extends DataBindingFragment {
|
|||||||
} else {
|
} else {
|
||||||
LogUtil.d(TAG,"Updated sharedViewmodel payDetail for non emv");
|
LogUtil.d(TAG,"Updated sharedViewmodel payDetail for non emv");
|
||||||
sharedViewModel.payDetail.setValue(transProcessViewModel.payDetailResult.getValue());
|
sharedViewModel.payDetail.setValue(transProcessViewModel.payDetailResult.getValue());
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EReceiptRequest request = EReceiptUtil.getInstance().generateMPUReceipt(sharedViewModel.payDetail.getValue());
|
||||||
|
sharedViewModel.pushReceipt(request);
|
||||||
// transProcessViewModel.payDetailResult.observe(getViewLifecycleOwner(), payDetail -> sharedViewModel.payDetail.postValue(payDetail));
|
// transProcessViewModel.payDetailResult.observe(getViewLifecycleOwner(), payDetail -> sharedViewModel.payDetail.postValue(payDetail));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void callNextScreen(){
|
private void callNextScreen(){
|
||||||
updateData();
|
// updateData();
|
||||||
if (requiresSignature()) {
|
if (requiresSignature()) {
|
||||||
routeId = R.id.action_processingFragment_to_signatureFragment;
|
routeId = R.id.action_processingFragment_to_signatureFragment;
|
||||||
} else {
|
} else {
|
||||||
@ -203,7 +208,7 @@ public class ProcessingFragment extends DataBindingFragment {
|
|||||||
LogUtil.d(TAG,"tradeAnswerCode: "+payDetail.getTradeAnswerCode());
|
LogUtil.d(TAG,"tradeAnswerCode: "+payDetail.getTradeAnswerCode());
|
||||||
|
|
||||||
// For now, let's check if it's a card transaction and successful
|
// For now, let's check if it's a card transaction and successful
|
||||||
boolean isSuccessful = "00".equals(payDetail.getTradeAnswerCode());
|
boolean isSuccessful = "00".equals(payDetail.getTradeAnswerCode()) || "000".equals(payDetail.getTradeAnswerCode());
|
||||||
|
|
||||||
// You can customize this logic based on your business requirements
|
// You can customize this logic based on your business requirements
|
||||||
return isSuccessful && !isEmvTrans(); // Require signature for successful non-EMV transactions
|
return isSuccessful && !isEmvTrans(); // Require signature for successful non-EMV transactions
|
||||||
@ -254,7 +259,6 @@ public class ProcessingFragment extends DataBindingFragment {
|
|||||||
case FAIL:
|
case FAIL:
|
||||||
case SUCCESS:
|
case SUCCESS:
|
||||||
case OFFLINE_SUCCESS:
|
case OFFLINE_SUCCESS:
|
||||||
LogUtil.d(TAG,"This was called!");
|
|
||||||
if(SystemParamsOperation.getInstance().getDemoStatus()) {
|
if(SystemParamsOperation.getInstance().getDemoStatus()) {
|
||||||
delayFunctionCall(()->{
|
delayFunctionCall(()->{
|
||||||
// updateData();
|
// updateData();
|
||||||
@ -263,6 +267,7 @@ public class ProcessingFragment extends DataBindingFragment {
|
|||||||
},1500);
|
},1500);
|
||||||
} else {
|
} else {
|
||||||
// updateData();
|
// updateData();
|
||||||
|
|
||||||
sharedViewModel.dismissLoadingMsg();
|
sharedViewModel.dismissLoadingMsg();
|
||||||
callNextScreen();
|
callNextScreen();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,7 +16,11 @@ import com.utsmm.kbz.R;
|
|||||||
import com.utsmm.kbz.config.Constants;
|
import com.utsmm.kbz.config.Constants;
|
||||||
import com.utsmm.kbz.ui.core_viewmodel.SharedViewModel;
|
import com.utsmm.kbz.ui.core_viewmodel.SharedViewModel;
|
||||||
|
|
||||||
|
import com.utsmyanmar.paylibs.model.PayDetail;
|
||||||
|
import com.utsmyanmar.paylibs.print.printx.PrintX;
|
||||||
|
import com.utsmyanmar.paylibs.print.printx.PrintXReceipt;
|
||||||
import com.utsmyanmar.paylibs.utils.LogUtil;
|
import com.utsmyanmar.paylibs.utils.LogUtil;
|
||||||
|
import com.utsmyanmar.paylibs.utils.print_utils.BitmapUtils;
|
||||||
|
|
||||||
public class SignatureFragment extends DataBindingFragment {
|
public class SignatureFragment extends DataBindingFragment {
|
||||||
|
|
||||||
@ -130,6 +134,12 @@ public class SignatureFragment extends DataBindingFragment {
|
|||||||
safeNavigateToRouteId();
|
safeNavigateToRouteId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateData() {
|
||||||
|
PayDetail payDetail = sharedViewModel.payDetail.getValue();
|
||||||
|
payDetail.setESignHexData(BitmapUtils.bitmapToHexString(mSignaturePad.getSignatureBitmap()));
|
||||||
|
sharedViewModel.payDetail.setValue(payDetail);
|
||||||
|
}
|
||||||
|
|
||||||
public class ClickEvent {
|
public class ClickEvent {
|
||||||
|
|
||||||
|
|
||||||
@ -138,6 +148,8 @@ public class SignatureFragment extends DataBindingFragment {
|
|||||||
// Handle digital signature
|
// Handle digital signature
|
||||||
if (isSigned) {
|
if (isSigned) {
|
||||||
sharedViewModel.signBitmap = mSignaturePad.getSignatureBitmap();
|
sharedViewModel.signBitmap = mSignaturePad.getSignatureBitmap();
|
||||||
|
|
||||||
|
updateData();
|
||||||
LogUtil.d(TAG, "Digital signature confirmed and stored");
|
LogUtil.d(TAG, "Digital signature confirmed and stored");
|
||||||
callNextScreen();
|
callNextScreen();
|
||||||
} else {
|
} else {
|
||||||
@ -147,7 +159,6 @@ public class SignatureFragment extends DataBindingFragment {
|
|||||||
// Handle manual signature on paper
|
// Handle manual signature on paper
|
||||||
sharedViewModel.signBitmap = null; // No digital signature
|
sharedViewModel.signBitmap = null; // No digital signature
|
||||||
LogUtil.d(TAG, "Manual signature on paper selected - no digital signature stored");
|
LogUtil.d(TAG, "Manual signature on paper selected - no digital signature stored");
|
||||||
showSingleInfoDialog("Please sign on the printed receipt manually and proceed.");
|
|
||||||
callNextScreen();
|
callNextScreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import androidx.appcompat.app.AlertDialog;
|
|||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonSyntaxException;
|
||||||
import com.google.gson.stream.MalformedJsonException;
|
import com.google.gson.stream.MalformedJsonException;
|
||||||
import com.utsmyanmar.baselib.emv.EmvParamOperation;
|
import com.utsmyanmar.baselib.emv.EmvParamOperation;
|
||||||
import com.utsmyanmar.baselib.fragment.DataBindingFragment;
|
import com.utsmyanmar.baselib.fragment.DataBindingFragment;
|
||||||
@ -42,12 +43,13 @@ import java.io.IOException;
|
|||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import dagger.hilt.android.AndroidEntryPoint;
|
||||||
import retrofit2.HttpException;
|
import retrofit2.HttpException;
|
||||||
import com.utsmyanmar.paylibs.utils.LogUtil;
|
import com.utsmyanmar.paylibs.utils.LogUtil;
|
||||||
|
|
||||||
|
|
||||||
// Temporarily disabled Hilt
|
// Temporarily disabled Hilt
|
||||||
// @AndroidEntryPoint
|
@AndroidEntryPoint
|
||||||
public class TransactionResultFragment extends DataBindingFragment implements DataBindingFragment.BackPressCallback {
|
public class TransactionResultFragment extends DataBindingFragment implements DataBindingFragment.BackPressCallback {
|
||||||
|
|
||||||
private static final String TAG = TransactionResultFragment.class.getSimpleName();
|
private static final String TAG = TransactionResultFragment.class.getSimpleName();
|
||||||
@ -146,6 +148,8 @@ public class TransactionResultFragment extends DataBindingFragment implements Da
|
|||||||
|
|
||||||
PayDetail payDetail = sharedViewModel.payDetail.getValue();
|
PayDetail payDetail = sharedViewModel.payDetail.getValue();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (payDetail == null) {
|
if (payDetail == null) {
|
||||||
navigateToMainScreen();
|
navigateToMainScreen();
|
||||||
return;
|
return;
|
||||||
@ -165,7 +169,8 @@ public class TransactionResultFragment extends DataBindingFragment implements Da
|
|||||||
} else if (transactionType == TransactionsType.SETTLEMENT) {
|
} else if (transactionType == TransactionsType.SETTLEMENT) {
|
||||||
handleSettlementTransaction(siriusReq);
|
handleSettlementTransaction(siriusReq);
|
||||||
} else if (isWavePayNonSuccessTransaction(transactionType, payDetail)) {
|
} else if (isWavePayNonSuccessTransaction(transactionType, payDetail)) {
|
||||||
startPrintProcess(false);
|
// startPrintProcess(false);
|
||||||
|
showDeclineDialog("QR Payment Failed!");
|
||||||
navigateToMainScreen();
|
navigateToMainScreen();
|
||||||
} else if (isWavePaySuccessTransaction(transactionType, payDetail)) {
|
} else if (isWavePaySuccessTransaction(transactionType, payDetail)) {
|
||||||
handleWavePaySuccessTransaction(payDetail, siriusReq);
|
handleWavePaySuccessTransaction(payDetail, siriusReq);
|
||||||
@ -238,7 +243,7 @@ public class TransactionResultFragment extends DataBindingFragment implements Da
|
|||||||
try {
|
try {
|
||||||
SiriusError siriusError = new Gson().fromJson(error.response().errorBody().string(), SiriusError.class);
|
SiriusError siriusError = new Gson().fromJson(error.response().errorBody().string(), SiriusError.class);
|
||||||
LogUtil.d(TAG,siriusError.getMessage());
|
LogUtil.d(TAG,siriusError.getMessage());
|
||||||
} catch (IOException ex) {
|
} catch (IOException | JsonSyntaxException ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -25,6 +25,8 @@ import java.util.HashSet;
|
|||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import io.reactivex.rxjava3.core.Single;
|
||||||
|
|
||||||
|
|
||||||
public class CardReadViewModel extends ViewModel {
|
public class CardReadViewModel extends ViewModel {
|
||||||
|
|
||||||
@ -46,7 +48,6 @@ public class CardReadViewModel extends ViewModel {
|
|||||||
public SingleLiveEvent<Integer> cardTypeData = new SingleLiveEvent<>();
|
public SingleLiveEvent<Integer> cardTypeData = new SingleLiveEvent<>();
|
||||||
public SingleLiveEvent<PayDetail> payDetail = new SingleLiveEvent<>();
|
public SingleLiveEvent<PayDetail> payDetail = new SingleLiveEvent<>();
|
||||||
|
|
||||||
public SingleLiveEvent<CardReadStatus> readStatus = new SingleLiveEvent<>();
|
|
||||||
|
|
||||||
public SingleLiveEvent<String> checkCardAlertMsg = new SingleLiveEvent<>();
|
public SingleLiveEvent<String> checkCardAlertMsg = new SingleLiveEvent<>();
|
||||||
|
|
||||||
@ -95,96 +96,6 @@ public class CardReadViewModel extends ViewModel {
|
|||||||
checkCardAlertMsg.setValue(null);
|
checkCardAlertMsg.setValue(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// public void initCardReadProcess(int allType, int timeOutInSec, ReadCardResult readCardResult) {
|
|
||||||
// ReadCardProcess.getInstance().startReadCard(allType,"",timeOutInSec,false).onStartReadCardProcess(new CheckCardListener() {
|
|
||||||
// @Override
|
|
||||||
// public void onCheckCardSuccess(int cardType, MPUCardData mpuCardData, CardScheme cardScheme) {
|
|
||||||
//
|
|
||||||
// cardData.postValue(mpuCardData);
|
|
||||||
// cardSchemeData.postValue(cardScheme);
|
|
||||||
// cardTypeData.postValue(cardType);
|
|
||||||
// PayDetail payDetailData = new PayDetail();
|
|
||||||
// payDetailData.setCardNo(mpuCardData.getPan());
|
|
||||||
// payDetailData.setEXPDate(mpuCardData.getExp());
|
|
||||||
// payDetailData.setAccountType(cardScheme.name());
|
|
||||||
// payDetailData.setCardType(cardType);
|
|
||||||
// payDetailData.setCardHolderName(mpuCardData.getCardHolderName());
|
|
||||||
// CardInfo cardInfo = new CardInfo();
|
|
||||||
// MAGCardInfo magCardInfo = new MAGCardInfo();
|
|
||||||
// LogUtil.d(TAG,"track 2 : "+mpuCardData.getTrack2());
|
|
||||||
// magCardInfo.setTrack2Cipher(mpuCardData.getTrack2());
|
|
||||||
// cardInfo.setMAGCardInfo(magCardInfo);
|
|
||||||
// payDetailData.setCardInfo(cardInfo);
|
|
||||||
//
|
|
||||||
// payDetail.postValue(payDetailData);
|
|
||||||
//
|
|
||||||
// mainThreadHandler.post(readCardResult::onSuccess);
|
|
||||||
//// readCardResult.onSuccess();
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onCheckCardFail(int code, String message) {
|
|
||||||
//
|
|
||||||
// if(code == -2801) {
|
|
||||||
// mainThreadHandler.post(readCardResult::onCommunicationError);
|
|
||||||
//// readCardResult.onCommunicationError();
|
|
||||||
// } else {
|
|
||||||
// mainThreadHandler.post(() -> readCardResult.onError(code,message));
|
|
||||||
//// readCardResult.onError(code,message);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public SingleLiveEvent<CardReadStatus> startReadProcess(int allType,int timeOutInSec){
|
|
||||||
//
|
|
||||||
// ReadCardProcess.getInstance().startReadCard(allType,"",timeOutInSec,false).onStartReadCardProcess(new CheckCardListener() {
|
|
||||||
// @Override
|
|
||||||
// public void onCheckCardSuccess(int cardType, MPUCardData mpuCardData, CardScheme cardScheme) {
|
|
||||||
// flag.postValue(true);
|
|
||||||
// cardData.postValue(mpuCardData);
|
|
||||||
// cardSchemeData.postValue(cardScheme);
|
|
||||||
// cardTypeData.postValue(cardType);
|
|
||||||
// PayDetail payDetailData = new PayDetail();
|
|
||||||
// payDetailData.setCardNo(mpuCardData.getPan());
|
|
||||||
// payDetailData.setEXPDate(mpuCardData.getExp());
|
|
||||||
// payDetailData.setAccountType(cardScheme.name());
|
|
||||||
// payDetailData.setCardType(cardType);
|
|
||||||
// payDetailData.setCardHolderName(mpuCardData.getCardHolderName());
|
|
||||||
// CardInfo cardInfo = new CardInfo();
|
|
||||||
// MAGCardInfo magCardInfo = new MAGCardInfo();
|
|
||||||
// LogUtil.d(TAG,"track 2 : "+mpuCardData.getTrack2());
|
|
||||||
// magCardInfo.setTrack2Cipher(mpuCardData.getTrack2());
|
|
||||||
// cardInfo.setMAGCardInfo(magCardInfo);
|
|
||||||
// payDetailData.setCardInfo(cardInfo);
|
|
||||||
//
|
|
||||||
// payDetail.postValue(payDetailData);
|
|
||||||
//
|
|
||||||
// readStatus.postValue(CardReadStatus.SUCCESS);
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onCheckCardFail(int code, String message) {
|
|
||||||
//
|
|
||||||
// readStatus.postValue(CardReadStatus.FAIL);
|
|
||||||
// // this action just need to do once because there's too many reason to get fail
|
|
||||||
// if(!oneTimeFlag){
|
|
||||||
// errorCode.postValue(code+":"+message);
|
|
||||||
// flag.postValue(false);
|
|
||||||
// cardSchemeData.postValue(CardScheme.UNK);
|
|
||||||
// oneTimeFlag = true;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// return readStatus;
|
|
||||||
// }
|
|
||||||
|
|
||||||
public void resetOneTimeFlag(){
|
public void resetOneTimeFlag(){
|
||||||
oneTimeFlag = false;
|
oneTimeFlag = false;
|
||||||
}
|
}
|
||||||
@ -193,19 +104,4 @@ public class CardReadViewModel extends ViewModel {
|
|||||||
NexGoSDK.getInstance().cancelCheckCard();
|
NexGoSDK.getInstance().cancelCheckCard();
|
||||||
}
|
}
|
||||||
|
|
||||||
// public void checkCard(){
|
|
||||||
// int allType = AidlConstants.CardType.NFC.getValue() | AidlConstants.CardType.IC.getValue() | AidlConstants.CardType.MAGNETIC.getValue();
|
|
||||||
// ReadCardProcess.getInstance().startReadCard(allType,"",60,false).onStartReadCardProcess(new CheckCardListener() {
|
|
||||||
// @Override
|
|
||||||
// public void onCheckCardSuccess(int cardType, MPUCardData mpuCardData, CardScheme cardScheme) {
|
|
||||||
// System.out.println("Success");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onCheckCardFail(int code, String message) {
|
|
||||||
//
|
|
||||||
// System.out.println("Failed");
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -492,9 +492,9 @@ public class EmvTransactionProcessViewModel extends EmvBaseViewModel implements
|
|||||||
private void handleTransactionProcess() {
|
private void handleTransactionProcess() {
|
||||||
|
|
||||||
String cardNo = mPayDetail.getCardNo();
|
String cardNo = mPayDetail.getCardNo();
|
||||||
if (cardNo == null || TextUtils.equals(cardNo, "")) {
|
// if (cardNo == null || TextUtils.equals(cardNo, "")) {
|
||||||
getCardInfo();
|
getCardInfo();
|
||||||
}
|
// }
|
||||||
getPayWaveData();
|
getPayWaveData();
|
||||||
getF055Data();
|
getF055Data();
|
||||||
if(transType.getValue() == TransactionsType.PRE_AUTH_COMPLETE || transType.getValue() == TransactionsType.PRE_AUTH_VOID || transType.getValue() == TransactionsType.REFUND ) {
|
if(transType.getValue() == TransactionsType.PRE_AUTH_COMPLETE || transType.getValue() == TransactionsType.PRE_AUTH_VOID || transType.getValue() == TransactionsType.REFUND ) {
|
||||||
|
|||||||
@ -1,12 +1,15 @@
|
|||||||
package com.utsmm.kbz.ui.core_viewmodel;
|
package com.utsmm.kbz.ui.core_viewmodel;
|
||||||
|
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import dagger.hilt.android.lifecycle.HiltViewModel;
|
import dagger.hilt.android.lifecycle.HiltViewModel;
|
||||||
import androidx.lifecycle.LiveData;
|
import androidx.lifecycle.LiveData;
|
||||||
import androidx.lifecycle.MutableLiveData;
|
import androidx.lifecycle.MutableLiveData;
|
||||||
import androidx.lifecycle.ViewModel;
|
import androidx.lifecycle.ViewModel;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.utsmyanmar.baselib.network.model.e_receipt.EReceiptResponse;
|
||||||
import com.utsmyanmar.baselib.network.model.sirius.SiriusRequest;
|
import com.utsmyanmar.baselib.network.model.sirius.SiriusRequest;
|
||||||
import com.utsmyanmar.baselib.network.model.sirius.SiriusResponse;
|
import com.utsmyanmar.baselib.network.model.sirius.SiriusResponse;
|
||||||
import com.utsmyanmar.baselib.repo.Repository;
|
import com.utsmyanmar.baselib.repo.Repository;
|
||||||
@ -26,9 +29,15 @@ import com.utsmyanmar.paylibs.utils.enums.HostType;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||||
import io.reactivex.rxjava3.core.Observable;
|
import io.reactivex.rxjava3.core.Observable;
|
||||||
|
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||||
|
import retrofit2.HttpException;
|
||||||
|
|
||||||
import com.utsmyanmar.paylibs.utils.LogUtil;
|
import com.utsmyanmar.paylibs.utils.LogUtil;
|
||||||
|
|
||||||
|
import javax.crypto.Mac;
|
||||||
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
@HiltViewModel
|
@HiltViewModel
|
||||||
@ -185,6 +194,23 @@ public class SharedViewModel extends ViewModel {
|
|||||||
printReceiptButtons.postValue(value);
|
printReceiptButtons.postValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setTransactionsType(TransactionsType transactionsType) {
|
||||||
|
this.transactionsType.setValue(transactionsType);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SingleLiveEvent<TransactionsType> getTransactionsType() {
|
||||||
|
return transactionsType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAmount(String amount) {
|
||||||
|
this.amount.setValue(amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SingleLiveEvent<String> getAmount() {
|
||||||
|
return amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrintReceiptMsg(String msg) { this.printReceiptMsg.setValue(msg);}
|
||||||
public void postPrintReceiptMsg(String msg) { this.printReceiptMsg.postValue(msg);}
|
public void postPrintReceiptMsg(String msg) { this.printReceiptMsg.postValue(msg);}
|
||||||
public void setPrintStatus(PrintStatus printStatus) { this.printStatus.setValue(printStatus); }
|
public void setPrintStatus(PrintStatus printStatus) { this.printStatus.setValue(printStatus); }
|
||||||
public void postPrintStatus(PrintStatus printStatus) { this.printStatus.postValue(printStatus); }
|
public void postPrintStatus(PrintStatus printStatus) { this.printStatus.postValue(printStatus); }
|
||||||
@ -281,6 +307,7 @@ public class SharedViewModel extends ViewModel {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void startPrintReceipt(boolean isFirstPrint) {
|
public void startPrintReceipt(boolean isFirstPrint) {
|
||||||
/*
|
/*
|
||||||
* First Print is Merchant Copy..
|
* First Print is Merchant Copy..
|
||||||
@ -406,4 +433,33 @@ public class SharedViewModel extends ViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void pushReceipt(Object body){
|
||||||
|
repository.sendReceipt(body)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(
|
||||||
|
response -> Log.d("E-Receipt", "Success =>"+ response.getMessage()),
|
||||||
|
error -> {
|
||||||
|
if (error instanceof HttpException) {
|
||||||
|
HttpException httpEx = (HttpException) error;
|
||||||
|
|
||||||
|
try {
|
||||||
|
String errorJson = httpEx.response().errorBody().string();
|
||||||
|
Log.e("E-Receipt", "Raw error JSON => " + errorJson);
|
||||||
|
|
||||||
|
// Parse JSON to model
|
||||||
|
EReceiptResponse res = new Gson().fromJson(errorJson, EReceiptResponse.class);
|
||||||
|
Log.e("E-Receipt", "Parsed Error => " + res.getMessage());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.e("E-Receipt", "Unexpected error => " + error.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -135,7 +135,7 @@ public class DashboardTransFragment extends DataBindingFragment {
|
|||||||
} else if (checkTid()) {
|
} else if (checkTid()) {
|
||||||
showDeclineDialog("Please Download Config!");
|
showDeclineDialog("Please Download Config!");
|
||||||
} else {
|
} else {
|
||||||
sharedViewModel.transactionsType.setValue(TransactionsType.VOID);
|
sharedViewModel.setTransactionsType(TransactionsType.VOID);
|
||||||
// sharedViewModel.transMenu.postValue(TransMenu.TRANSACTIONS);
|
// sharedViewModel.transMenu.postValue(TransMenu.TRANSACTIONS);
|
||||||
sharedViewModel.setTransMenu(TransMenu.TRANSACTIONS);
|
sharedViewModel.setTransMenu(TransMenu.TRANSACTIONS);
|
||||||
|
|
||||||
@ -147,16 +147,15 @@ public class DashboardTransFragment extends DataBindingFragment {
|
|||||||
|
|
||||||
public void onClickSettlement() {
|
public void onClickSettlement() {
|
||||||
sharedViewModel.settlementType.setValue(SettlementType.NORMAL);
|
sharedViewModel.settlementType.setValue(SettlementType.NORMAL);
|
||||||
sharedViewModel.transactionsType.setValue(TransactionsType.SETTLEMENT);
|
|
||||||
sharedViewModel.setTransMenu(TransMenu.SETTLEMENT);
|
sharedViewModel.setTransMenu(TransMenu.SETTLEMENT);
|
||||||
|
sharedViewModel.setTransactionsType(TransactionsType.SETTLEMENT);
|
||||||
|
|
||||||
routeId = R.id.action_dashboardTransFragment_to_inputPasswordFragment;
|
routeId = R.id.action_dashboardTransFragment_to_inputPasswordFragment;
|
||||||
safeRouteTo(currentId,routeId,hostId);
|
safeRouteTo(currentId,routeId,hostId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClickRefund() {
|
public void onClickRefund() {
|
||||||
sharedViewModel.transactionsType.setValue(TransactionsType.REFUND);
|
sharedViewModel.setTransactionsType(TransactionsType.REFUND);
|
||||||
|
|
||||||
routeId = R.id.action_dashboardTransFragment_to_inputPasswordFragment;
|
routeId = R.id.action_dashboardTransFragment_to_inputPasswordFragment;
|
||||||
safeRouteTo(currentId,routeId,hostId);
|
safeRouteTo(currentId,routeId,hostId);
|
||||||
}
|
}
|
||||||
@ -167,8 +166,7 @@ public class DashboardTransFragment extends DataBindingFragment {
|
|||||||
} else if (checkTid()) {
|
} else if (checkTid()) {
|
||||||
showDeclineDialog("Please Download Config!");
|
showDeclineDialog("Please Download Config!");
|
||||||
} else {
|
} else {
|
||||||
sharedViewModel.transactionsType.setValue(TransactionsType.PRE_AUTH_SALE);
|
sharedViewModel.setTransactionsType(TransactionsType.PRE_AUTH_SALE);
|
||||||
|
|
||||||
routeId = R.id.action_dashboardTransFragment_to_inputAmountFragment;
|
routeId = R.id.action_dashboardTransFragment_to_inputAmountFragment;
|
||||||
safeRouteTo(currentId,routeId,hostId);
|
safeRouteTo(currentId,routeId,hostId);
|
||||||
}
|
}
|
||||||
@ -176,7 +174,7 @@ public class DashboardTransFragment extends DataBindingFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onClickPreAuthCancel () {
|
public void onClickPreAuthCancel () {
|
||||||
sharedViewModel.transactionsType.setValue(TransactionsType.PRE_AUTH_VOID);
|
sharedViewModel.setTransactionsType(TransactionsType.PRE_AUTH_VOID);
|
||||||
sharedViewModel.setTransMenu(TransMenu.PRE_AUTH_FULL_VOID);
|
sharedViewModel.setTransMenu(TransMenu.PRE_AUTH_FULL_VOID);
|
||||||
sharedViewModel.amount.postValue(null);
|
sharedViewModel.amount.postValue(null);
|
||||||
routeId = R.id.action_dashboardTransFragment_to_inputPasswordFragment;
|
routeId = R.id.action_dashboardTransFragment_to_inputPasswordFragment;
|
||||||
@ -185,14 +183,14 @@ public class DashboardTransFragment extends DataBindingFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onClickPreAuthComp () {
|
public void onClickPreAuthComp () {
|
||||||
sharedViewModel.transactionsType.setValue(TransactionsType.PRE_AUTH_COMPLETE);
|
sharedViewModel.setTransactionsType(TransactionsType.PRE_AUTH_COMPLETE);
|
||||||
routeId = R.id.action_dashboardTransFragment_to_inputPasswordFragment;
|
routeId = R.id.action_dashboardTransFragment_to_inputPasswordFragment;
|
||||||
safeRouteTo(currentId,routeId,hostId);
|
safeRouteTo(currentId,routeId,hostId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClickPreAuthCompCancel () {
|
public void onClickPreAuthCompCancel () {
|
||||||
sharedViewModel.transactionsType.setValue(TransactionsType.PRE_AUTH_COMPLETE_VOID);
|
sharedViewModel.setTransactionsType(TransactionsType.PRE_AUTH_COMPLETE_VOID);
|
||||||
routeId = R.id.action_dashboardTransFragment_to_inputPasswordFragment;
|
routeId = R.id.action_dashboardTransFragment_to_inputPasswordFragment;
|
||||||
safeRouteTo(currentId,routeId,hostId);
|
safeRouteTo(currentId,routeId,hostId);
|
||||||
|
|
||||||
@ -200,7 +198,8 @@ public class DashboardTransFragment extends DataBindingFragment {
|
|||||||
|
|
||||||
|
|
||||||
public void onClickCashAdvance() {
|
public void onClickCashAdvance() {
|
||||||
sharedViewModel.transactionsType.setValue(TransactionsType.CASH_OUT);
|
sharedViewModel.setTransactionsType(TransactionsType.CASH_OUT);
|
||||||
|
sharedViewModel.setTransMenu(TransMenu.CASH_OUT);
|
||||||
routeId = R.id.action_dashboardTransFragment_to_inputAmountFragment;
|
routeId = R.id.action_dashboardTransFragment_to_inputAmountFragment;
|
||||||
safeRouteTo(currentId,routeId,hostId);
|
safeRouteTo(currentId,routeId,hostId);
|
||||||
|
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import androidx.lifecycle.MutableLiveData;
|
|||||||
import androidx.lifecycle.ViewModel;
|
import androidx.lifecycle.ViewModel;
|
||||||
|
|
||||||
import com.kizzy.xpay.util.Sign;
|
import com.kizzy.xpay.util.Sign;
|
||||||
|
import com.utsmm.kbz.ui.qr_pay.QRRefund;
|
||||||
import com.utsmyanmar.baselib.network.model.DemoQRRequest;
|
import com.utsmyanmar.baselib.network.model.DemoQRRequest;
|
||||||
import com.utsmyanmar.baselib.network.model.DemoQRResponse;
|
import com.utsmyanmar.baselib.network.model.DemoQRResponse;
|
||||||
import com.utsmyanmar.baselib.network.model.DemoQRReturnRequest;
|
import com.utsmyanmar.baselib.network.model.DemoQRReturnRequest;
|
||||||
@ -36,6 +37,7 @@ import com.utsmyanmar.paylibs.model.TradeData;
|
|||||||
import com.utsmyanmar.paylibs.system.SingleLiveEvent;
|
import com.utsmyanmar.paylibs.system.SingleLiveEvent;
|
||||||
import com.utsmyanmar.paylibs.utils.LogUtil;
|
import com.utsmyanmar.paylibs.utils.LogUtil;
|
||||||
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation;
|
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation;
|
||||||
|
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsSettings;
|
||||||
|
|
||||||
import java.security.SecureRandom;
|
import java.security.SecureRandom;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -52,7 +54,11 @@ public class KPayViewModel extends ViewModel {
|
|||||||
|
|
||||||
private final Repository repository;
|
private final Repository repository;
|
||||||
|
|
||||||
private final String appKey = "UTSMMuat@2025";
|
private final String appKey = SystemParamsOperation.getInstance().getAppKey();
|
||||||
|
// private final String appKey = "UTSMMuat@2025";
|
||||||
|
|
||||||
|
private final String appId = SystemParamsOperation.getInstance().getAppId();
|
||||||
|
// private final String appId = "kp9b0794b349ae85b00c51e0677484c7";
|
||||||
|
|
||||||
private final ExecutorService executor = Executors.newSingleThreadExecutor();
|
private final ExecutorService executor = Executors.newSingleThreadExecutor();
|
||||||
private final Handler mainHandler = new Handler(Looper.getMainLooper());
|
private final Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||||
@ -114,7 +120,7 @@ public class KPayViewModel extends ViewModel {
|
|||||||
bizContent.put("refund_request_no", refundOrderId);
|
bizContent.put("refund_request_no", refundOrderId);
|
||||||
bizContent.put("merch_order_id", origOrderId);
|
bizContent.put("merch_order_id", origOrderId);
|
||||||
bizContent.put("merch_code", mid);
|
bizContent.put("merch_code", mid);
|
||||||
bizContent.put("appid", "kp9b0794b349ae85b00c51e0677484c7");
|
bizContent.put("appid", appId);
|
||||||
if(!refundAmount.equals("0")) {
|
if(!refundAmount.equals("0")) {
|
||||||
bizContent.put("refund_amount", refundAmount);
|
bizContent.put("refund_amount", refundAmount);
|
||||||
}
|
}
|
||||||
@ -138,7 +144,7 @@ public class KPayViewModel extends ViewModel {
|
|||||||
|
|
||||||
KPayRefund.RefundRequest.RequestBody.BizContent biz =
|
KPayRefund.RefundRequest.RequestBody.BizContent biz =
|
||||||
new KPayRefund.RefundRequest.RequestBody.BizContent(
|
new KPayRefund.RefundRequest.RequestBody.BizContent(
|
||||||
"kp9b0794b349ae85b00c51e0677484c7",
|
appId,
|
||||||
mid,
|
mid,
|
||||||
origOrderId,
|
origOrderId,
|
||||||
refundAmount, // This can be null for original refunds
|
refundAmount, // This can be null for original refunds
|
||||||
@ -160,7 +166,7 @@ public class KPayViewModel extends ViewModel {
|
|||||||
} else {
|
} else {
|
||||||
KPayRefund.RefundRequest.RequestBody.BizContent biz =
|
KPayRefund.RefundRequest.RequestBody.BizContent biz =
|
||||||
new KPayRefund.RefundRequest.RequestBody.BizContent(
|
new KPayRefund.RefundRequest.RequestBody.BizContent(
|
||||||
"kp9b0794b349ae85b00c51e0677484c7",
|
appId,
|
||||||
mid,
|
mid,
|
||||||
origOrderId,
|
origOrderId,
|
||||||
refundOrderId,
|
refundOrderId,
|
||||||
@ -195,7 +201,7 @@ public class KPayViewModel extends ViewModel {
|
|||||||
Map<String, Object> bizContent = new HashMap<>();
|
Map<String, Object> bizContent = new HashMap<>();
|
||||||
bizContent.put("merch_order_id", merchOrderId);
|
bizContent.put("merch_order_id", merchOrderId);
|
||||||
bizContent.put("merch_code", mid);
|
bizContent.put("merch_code", mid);
|
||||||
bizContent.put("appid", "kp9b0794b349ae85b00c51e0677484c7");
|
bizContent.put("appid", appId);
|
||||||
bizContent.put("trade_type", "PAY_BY_QRCODE");
|
bizContent.put("trade_type", "PAY_BY_QRCODE");
|
||||||
bizContent.put("total_amount", amount);
|
bizContent.put("total_amount", amount);
|
||||||
bizContent.put("title", "testing");
|
bizContent.put("title", "testing");
|
||||||
@ -216,7 +222,7 @@ public class KPayViewModel extends ViewModel {
|
|||||||
String sign = Sign.INSTANCE.generateSign(requestMap, appKey);
|
String sign = Sign.INSTANCE.generateSign(requestMap, appKey);
|
||||||
|
|
||||||
KPayQRRequest.QrRequest.RequestBody.BizContent biz = new KPayQRRequest.QrRequest.RequestBody.BizContent(
|
KPayQRRequest.QrRequest.RequestBody.BizContent biz = new KPayQRRequest.QrRequest.RequestBody.BizContent(
|
||||||
"kp9b0794b349ae85b00c51e0677484c7",
|
appId,
|
||||||
mid,
|
mid,
|
||||||
merchOrderId,
|
merchOrderId,
|
||||||
"PAY_BY_QRCODE",
|
"PAY_BY_QRCODE",
|
||||||
@ -252,7 +258,7 @@ public class KPayViewModel extends ViewModel {
|
|||||||
Map<String, Object> bizContentMap = new HashMap<>();
|
Map<String, Object> bizContentMap = new HashMap<>();
|
||||||
bizContentMap.put("merch_order_id", merchOrderId);
|
bizContentMap.put("merch_order_id", merchOrderId);
|
||||||
bizContentMap.put("merch_code", mid);
|
bizContentMap.put("merch_code", mid);
|
||||||
bizContentMap.put("appid", "kp9b0794b349ae85b00c51e0677484c7");
|
bizContentMap.put("appid", appId);
|
||||||
|
|
||||||
Map<String, Object> requestMap = new HashMap<>();
|
Map<String, Object> requestMap = new HashMap<>();
|
||||||
requestMap.put("timestamp", currentTime);
|
requestMap.put("timestamp", currentTime);
|
||||||
@ -264,7 +270,7 @@ public class KPayViewModel extends ViewModel {
|
|||||||
String sign = Sign.INSTANCE.generateSign(requestMap, appKey);
|
String sign = Sign.INSTANCE.generateSign(requestMap, appKey);
|
||||||
|
|
||||||
KPayQRQueryRequest.QRQueryRequest.Request.BizContent bizContent = new KPayQRQueryRequest.QRQueryRequest.Request.BizContent(
|
KPayQRQueryRequest.QRQueryRequest.Request.BizContent bizContent = new KPayQRQueryRequest.QRQueryRequest.Request.BizContent(
|
||||||
"kp9b0794b349ae85b00c51e0677484c7",
|
appId,
|
||||||
mid,
|
mid,
|
||||||
merchOrderId
|
merchOrderId
|
||||||
);
|
);
|
||||||
@ -291,6 +297,7 @@ public class KPayViewModel extends ViewModel {
|
|||||||
|
|
||||||
private TradeData tradeData;
|
private TradeData tradeData;
|
||||||
private PayDetail payDetail;
|
private PayDetail payDetail;
|
||||||
|
private QRRefund qrRefund;
|
||||||
|
|
||||||
public void setTradeData(TradeData tradeData){
|
public void setTradeData(TradeData tradeData){
|
||||||
this.tradeData = tradeData;
|
this.tradeData = tradeData;
|
||||||
@ -304,6 +311,12 @@ public class KPayViewModel extends ViewModel {
|
|||||||
public void setPayDetail(PayDetail payDetail) {
|
public void setPayDetail(PayDetail payDetail) {
|
||||||
this.payDetail = payDetail;
|
this.payDetail = payDetail;
|
||||||
}
|
}
|
||||||
|
public void setQrRefund(QRRefund qrRefund) {
|
||||||
|
this.qrRefund = qrRefund;
|
||||||
|
}
|
||||||
|
public QRRefund getQrRefund() {
|
||||||
|
return qrRefund;
|
||||||
|
}
|
||||||
|
|
||||||
public PayDetail getPayDetail() { return payDetail; }
|
public PayDetail getPayDetail() { return payDetail; }
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package com.utsmm.kbz.ui.kpay;
|
|||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
@ -10,9 +9,11 @@ import androidx.annotation.NonNull;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
|
||||||
|
import com.utsmm.kbz.util.EReceiptUtil;
|
||||||
|
import com.utsmm.kbz.util.enums.TransResultStatus;
|
||||||
import com.utsmyanmar.baselib.fragment.DataBindingFragment;
|
import com.utsmyanmar.baselib.fragment.DataBindingFragment;
|
||||||
import com.utsmyanmar.baselib.network.model.DemoQRStatusRequest;
|
|
||||||
import com.utsmyanmar.baselib.network.model.KPayQRQueryRequest;
|
import com.utsmyanmar.baselib.network.model.KPayQRQueryRequest;
|
||||||
|
import com.utsmyanmar.baselib.network.model.e_receipt.EReceiptRequest;
|
||||||
import com.utsmyanmar.baselib.util.DataBindingConfig;
|
import com.utsmyanmar.baselib.util.DataBindingConfig;
|
||||||
import com.utsmyanmar.baselib.util.TimeoutCallback;
|
import com.utsmyanmar.baselib.util.TimeoutCallback;
|
||||||
import com.utsmyanmar.ecr.ECRHelper;
|
import com.utsmyanmar.ecr.ECRHelper;
|
||||||
@ -123,6 +124,7 @@ public class QRTransactionFragment extends DataBindingFragment implements DataBi
|
|||||||
terminalId = TransactionUtil.getInstance().getQRTerminalId();
|
terminalId = TransactionUtil.getInstance().getQRTerminalId();
|
||||||
merchantId = TransactionUtil.getInstance().getQRMerchantId();
|
merchantId = TransactionUtil.getInstance().getQRMerchantId();
|
||||||
|
|
||||||
|
|
||||||
refLabel = sharedViewModel.qrRefNum.getValue();
|
refLabel = sharedViewModel.qrRefNum.getValue();
|
||||||
|
|
||||||
// tradeData = waveViewModel.getTradeData();
|
// tradeData = waveViewModel.getTradeData();
|
||||||
@ -132,6 +134,7 @@ public class QRTransactionFragment extends DataBindingFragment implements DataBi
|
|||||||
|
|
||||||
sharedViewModel.insertPayDetail(payDetail);
|
sharedViewModel.insertPayDetail(payDetail);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -184,6 +187,8 @@ public class QRTransactionFragment extends DataBindingFragment implements DataBi
|
|||||||
setUpCountDown();
|
setUpCountDown();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpCountDown() {
|
private void setUpCountDown() {
|
||||||
@ -308,6 +313,9 @@ public class QRTransactionFragment extends DataBindingFragment implements DataBi
|
|||||||
|
|
||||||
retrievedUpdatePayDetail(refLabel, payDetail,false);
|
retrievedUpdatePayDetail(refLabel, payDetail,false);
|
||||||
|
|
||||||
|
EReceiptRequest request = EReceiptUtil.getInstance().generateQRReceipt(payDetail, TransResultStatus.SUCCESS);
|
||||||
|
sharedViewModel.pushReceipt(request);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -317,6 +325,9 @@ public class QRTransactionFragment extends DataBindingFragment implements DataBi
|
|||||||
payDetail.setQrTransStatus(2);
|
payDetail.setQrTransStatus(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EReceiptRequest request = EReceiptUtil.getInstance().generateQRReceipt(payDetail, TransResultStatus.FAIL);
|
||||||
|
sharedViewModel.pushReceipt(request);
|
||||||
|
|
||||||
sharedViewModel.payDetail.postValue(payDetail);
|
sharedViewModel.payDetail.postValue(payDetail);
|
||||||
safeNavigateToRouteId();
|
safeNavigateToRouteId();
|
||||||
|
|
||||||
@ -325,6 +336,9 @@ public class QRTransactionFragment extends DataBindingFragment implements DataBi
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LogUtil.d(TAG, "On Exception::");
|
LogUtil.d(TAG, "On Exception::");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
EReceiptRequest request = EReceiptUtil.getInstance().generateQRReceipt(payDetail, TransResultStatus.TIME_OUT);
|
||||||
|
sharedViewModel.pushReceipt(request);
|
||||||
|
|
||||||
if (count == totalCount) {
|
if (count == totalCount) {
|
||||||
if(payDetail.getQrTransStatus() != -1) {
|
if(payDetail.getQrTransStatus() != -1) {
|
||||||
payDetail.setQrTransStatus(2);
|
payDetail.setQrTransStatus(2);
|
||||||
@ -332,8 +346,6 @@ public class QRTransactionFragment extends DataBindingFragment implements DataBi
|
|||||||
|
|
||||||
sharedViewModel.payDetail.postValue(payDetail);
|
sharedViewModel.payDetail.postValue(payDetail);
|
||||||
safeNavigateToRouteId();
|
safeNavigateToRouteId();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -166,7 +166,7 @@ public class ManualEntryFragment extends DataBindingFragment {
|
|||||||
|
|
||||||
public void onConfirm() {
|
public void onConfirm() {
|
||||||
if(manualEntryViewModel.validateData()) {
|
if(manualEntryViewModel.validateData()) {
|
||||||
if(sharedViewModel.transactionsType.getValue() == TransactionsType.REFUND || sharedViewModel.transactionsType.getValue() == TransactionsType.PRE_AUTH_SALE || sharedViewModel.transactionsType.getValue() == TransactionsType.SALE || sharedViewModel.transactionsType.getValue() == TransactionsType.PRE_AUTH_VOID) {
|
if(sharedViewModel.transactionsType.getValue() == TransactionsType.REFUND || sharedViewModel.transactionsType.getValue() == TransactionsType.PRE_AUTH_SALE || sharedViewModel.transactionsType.getValue() == TransactionsType.SALE || sharedViewModel.transactionsType.getValue() == TransactionsType.PRE_AUTH_VOID || sharedViewModel.transactionsType.getValue() == TransactionsType.PRE_AUTH_COMPLETE) {
|
||||||
|
|
||||||
if(manualEntryViewModel.get_cardScheme().getValue() != null && manualEntryViewModel.get_cardScheme().getValue() == CardScheme.MPU) {
|
if(manualEntryViewModel.get_cardScheme().getValue() != null && manualEntryViewModel.get_cardScheme().getValue() == CardScheme.MPU) {
|
||||||
processMPUCard();
|
processMPUCard();
|
||||||
|
|||||||
@ -6,6 +6,8 @@ import android.view.View;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.nexgo.oaf.apiv3.DeviceEngine;
|
||||||
|
import com.nexgo.oaf.apiv3.DeviceInfo;
|
||||||
import com.utsmyanmar.baselib.fragment.DataBindingFragment;
|
import com.utsmyanmar.baselib.fragment.DataBindingFragment;
|
||||||
import com.utsmyanmar.baselib.util.DataBindingConfig;
|
import com.utsmyanmar.baselib.util.DataBindingConfig;
|
||||||
import com.utsmm.kbz.BR;
|
import com.utsmm.kbz.BR;
|
||||||
@ -32,6 +34,7 @@ public class VersionFragment extends DataBindingFragment {
|
|||||||
|
|
||||||
setToolBarTitleWithBackIcon(getString(R.string.title_version));
|
setToolBarTitleWithBackIcon(getString(R.string.title_version));
|
||||||
fetchVersions();
|
fetchVersions();
|
||||||
|
versionViewModel.loadDeviceInfo(requireContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -75,5 +78,4 @@ public class VersionFragment extends DataBindingFragment {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,13 @@
|
|||||||
package com.utsmm.kbz.ui.navigation;
|
package com.utsmm.kbz.ui.navigation;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
|
|
||||||
import androidx.lifecycle.ViewModel;
|
import androidx.lifecycle.ViewModel;
|
||||||
|
|
||||||
|
import com.nexgo.oaf.apiv3.APIProxy;
|
||||||
|
import com.nexgo.oaf.apiv3.DeviceEngine;
|
||||||
|
import com.nexgo.oaf.apiv3.DeviceInfo;
|
||||||
import com.sunmi.pay.hardware.aidl.AidlConstants;
|
import com.sunmi.pay.hardware.aidl.AidlConstants;
|
||||||
import com.utsmyanmar.paylibs.system.SingleLiveEvent;
|
import com.utsmyanmar.paylibs.system.SingleLiveEvent;
|
||||||
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation;
|
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation;
|
||||||
@ -28,7 +32,8 @@ public class VersionViewModel extends ViewModel {
|
|||||||
|
|
||||||
|
|
||||||
public VersionViewModel() {
|
public VersionViewModel() {
|
||||||
initData();
|
// initData();
|
||||||
|
// loadDeviceInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initData() {
|
private void initData() {
|
||||||
@ -55,5 +60,21 @@ public class VersionViewModel extends ViewModel {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void loadDeviceInfo(Context context){
|
||||||
|
try{
|
||||||
|
DeviceEngine deviceEngine = APIProxy.getDeviceEngine(context);
|
||||||
|
DeviceInfo deviceInfo = deviceEngine.getDeviceInfo();
|
||||||
|
serialNumber.setValue(deviceInfo.getSn());
|
||||||
|
deviceModel.setValue(deviceInfo.getModel());
|
||||||
|
hardwareVersion.setValue(deviceInfo.getKernelVer());
|
||||||
|
firmwareVersion.setValue(deviceInfo.getFirmWareVer());
|
||||||
|
swFinalVersion.setValue(deviceInfo.getFirmWareFullVersion());
|
||||||
|
payHardwareVersion.setValue(deviceInfo.getSpCoreVersion());
|
||||||
|
romVersion.setValue(deviceInfo.getOsVer());
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import com.nexgo.oaf.apiv3.SdkResult;
|
|||||||
import com.nexgo.oaf.apiv3.device.pinpad.AlgorithmModeEnum;
|
import com.nexgo.oaf.apiv3.device.pinpad.AlgorithmModeEnum;
|
||||||
import com.nexgo.oaf.apiv3.device.pinpad.OnPinPadInputListener;
|
import com.nexgo.oaf.apiv3.device.pinpad.OnPinPadInputListener;
|
||||||
import com.nexgo.oaf.apiv3.device.pinpad.PinAlgorithmModeEnum;
|
import com.nexgo.oaf.apiv3.device.pinpad.PinAlgorithmModeEnum;
|
||||||
|
import com.nexgo.oaf.apiv3.device.pinpad.PinKeyboardModeEnum;
|
||||||
import com.nexgo.oaf.apiv3.device.pinpad.PinKeyboardViewModeEnum;
|
import com.nexgo.oaf.apiv3.device.pinpad.PinKeyboardViewModeEnum;
|
||||||
import com.nexgo.oaf.apiv3.device.pinpad.PinPad;
|
import com.nexgo.oaf.apiv3.device.pinpad.PinPad;
|
||||||
import com.nexgo.oaf.apiv3.device.pinpad.PinPadKeyCode;
|
import com.nexgo.oaf.apiv3.device.pinpad.PinPadKeyCode;
|
||||||
@ -119,7 +120,12 @@ public class PinPadViewModel extends ViewModel {
|
|||||||
case ON_CONFIRM_CLICK:
|
case ON_CONFIRM_CLICK:
|
||||||
LogUtil.d(TAG, "ON CLICK CONFIRM");
|
LogUtil.d(TAG, "ON CLICK CONFIRM");
|
||||||
// increasedKSN();
|
// increasedKSN();
|
||||||
pinStatus.postValue(PinPadStatus.ON_CONFIRM);
|
if(transType.getValue() == TransactionsType.PRE_AUTH_COMPLETE || transType.getValue() == TransactionsType.PRE_AUTH_VOID || transType.getValue() == TransactionsType.REFUND ) {
|
||||||
|
pinStatus.postValue(PinPadStatus.ON_NEXT_SCREEN);
|
||||||
|
} else {
|
||||||
|
pinStatus.postValue(PinPadStatus.ON_CONFIRM);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case ON_CANCEL_CLICK:
|
case ON_CANCEL_CLICK:
|
||||||
LogUtil.d(TAG, "ON CLICK CANCEL");
|
LogUtil.d(TAG, "ON CLICK CANCEL");
|
||||||
@ -317,6 +323,8 @@ public class PinPadViewModel extends ViewModel {
|
|||||||
r.bottom = customPinPadKeyboard.getKey_ok().getHeight() + r.top;
|
r.bottom = customPinPadKeyboard.getKey_ok().getHeight() + r.top;
|
||||||
pinpadLayout.setKeyConfirm(r);
|
pinpadLayout.setKeyConfirm(r);
|
||||||
|
|
||||||
|
|
||||||
|
pinPad.setPinKeyboardMode(PinKeyboardModeEnum.FIXED);
|
||||||
byte[] number = pinPad.setPinpadLayout(pinpadLayout);
|
byte[] number = pinPad.setPinpadLayout(pinpadLayout);
|
||||||
|
|
||||||
if(number != null) {
|
if(number != null) {
|
||||||
@ -331,6 +339,8 @@ public class PinPadViewModel extends ViewModel {
|
|||||||
byte[] panBytes = pan.substring(length - 13).getBytes(StandardCharsets.US_ASCII);
|
byte[] panBytes = pan.substring(length - 13).getBytes(StandardCharsets.US_ASCII);
|
||||||
// byte[] panBytes = pan.substring(length - 13, length - 1).getBytes(StandardCharsets.US_ASCII);
|
// byte[] panBytes = pan.substring(length - 13, length - 1).getBytes(StandardCharsets.US_ASCII);
|
||||||
pinPad.setPinKeyboardViewMode(PinKeyboardViewModeEnum.DEFAULT);
|
pinPad.setPinKeyboardViewMode(PinKeyboardViewModeEnum.DEFAULT);
|
||||||
|
pinPad.setPinKeyboardMode(PinKeyboardModeEnum.FIXED);
|
||||||
|
|
||||||
// pinPad.setAlgorithmMode(AlgorithmModeEnum.DES);
|
// pinPad.setAlgorithmMode(AlgorithmModeEnum.DES);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,9 @@ import com.utsmyanmar.paylibs.model.PayDetail;
|
|||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import dagger.hilt.android.lifecycle.HiltViewModel;
|
||||||
|
|
||||||
|
@HiltViewModel
|
||||||
public class PreAuthVoidViewModel extends ViewModel {
|
public class PreAuthVoidViewModel extends ViewModel {
|
||||||
|
|
||||||
private Repository repository;
|
private Repository repository;
|
||||||
|
|||||||
@ -0,0 +1,61 @@
|
|||||||
|
package com.utsmm.kbz.ui.qr_pay;
|
||||||
|
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.utsmm.kbz.R;
|
||||||
|
import com.utsmm.kbz.databinding.ItemQrHistoryBinding;
|
||||||
|
import com.utsmyanmar.paylibs.model.PayDetail;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class QRHistoryAdapter extends RecyclerView.Adapter<QRHistoryAdapter.ViewHolder> {
|
||||||
|
|
||||||
|
private List<PayDetail> items = new ArrayList<>();
|
||||||
|
|
||||||
|
public void setItems(List<PayDetail> data){
|
||||||
|
items = data;
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
ItemQrHistoryBinding binding = DataBindingUtil.inflate(
|
||||||
|
LayoutInflater.from(parent.getContext()),
|
||||||
|
R.layout.item_qr_history,
|
||||||
|
parent,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
return new ViewHolder(binding);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||||
|
holder.bind(items.get(position));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return items.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
private final ItemQrHistoryBinding binding;
|
||||||
|
|
||||||
|
public ViewHolder(@NonNull ItemQrHistoryBinding binding){
|
||||||
|
super(binding.getRoot());
|
||||||
|
this.binding = binding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void bind(PayDetail item){
|
||||||
|
binding.setPayDetail(item);
|
||||||
|
binding.executePendingBindings();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,78 @@
|
|||||||
|
package com.utsmm.kbz.ui.qr_pay;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.utsmm.kbz.BR;
|
||||||
|
import com.utsmm.kbz.R;
|
||||||
|
import com.utsmyanmar.baselib.fragment.DataBindingFragment;
|
||||||
|
import com.utsmyanmar.baselib.util.DataBindingConfig;
|
||||||
|
|
||||||
|
import dagger.hilt.android.AndroidEntryPoint;
|
||||||
|
|
||||||
|
@AndroidEntryPoint
|
||||||
|
public class QRHistoryFragment extends DataBindingFragment {
|
||||||
|
|
||||||
|
private QRHistoryAdapter adapter;
|
||||||
|
private QRHistoryViewModel viewModel;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initViewModel() {
|
||||||
|
viewModel = new ViewModelProvider(this).get(QRHistoryViewModel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected DataBindingConfig getDataBindingConfig() {
|
||||||
|
DataBindingConfig bindingConfig = new DataBindingConfig(R.layout.fragment_qr_history, BR.viewModel, viewModel);
|
||||||
|
bindingConfig.addBindingParam(BR.adapter, adapter);
|
||||||
|
return bindingConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int currentId() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int hostId() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int routeId() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume(){
|
||||||
|
super.onResume();
|
||||||
|
setToolBarTitleWithBackIcon("History");
|
||||||
|
observeData();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstance){
|
||||||
|
super.onViewCreated(view, savedInstance);
|
||||||
|
|
||||||
|
RecyclerView rvHistory = view.findViewById(R.id.qrRvHistory);
|
||||||
|
rvHistory.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
|
adapter = new QRHistoryAdapter();
|
||||||
|
rvHistory.setAdapter(adapter);
|
||||||
|
observeData();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void observeData(){
|
||||||
|
viewModel.getAllQrHistory().observe(getViewLifecycleOwner(), list -> {
|
||||||
|
adapter.setItems(list);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
package com.utsmm.kbz.ui.qr_pay;
|
||||||
|
|
||||||
|
import androidx.lifecycle.LiveData;
|
||||||
|
import androidx.lifecycle.ViewModel;
|
||||||
|
|
||||||
|
import com.utsmyanmar.baselib.repo.Repository;
|
||||||
|
import com.utsmyanmar.paylibs.model.PayDetail;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import dagger.hilt.android.lifecycle.HiltViewModel;
|
||||||
|
|
||||||
|
@HiltViewModel
|
||||||
|
public class QRHistoryViewModel extends ViewModel {
|
||||||
|
private final Repository repository;
|
||||||
|
private final LiveData<List<PayDetail>> history;
|
||||||
|
private final LiveData<List<PayDetail>> refundList;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public QRHistoryViewModel(Repository repository){
|
||||||
|
this.repository = repository;
|
||||||
|
this.history = repository.getAllQRHistory();
|
||||||
|
this.refundList = repository.getRefundableQRHistory();
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveData<List<PayDetail>> getAllQrHistory(){
|
||||||
|
return history;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveData<List<PayDetail>> getRefundableQrHistory(){
|
||||||
|
return refundList;
|
||||||
|
}
|
||||||
|
}
|
||||||
400
app/src/main/java/com/utsmm/kbz/ui/qr_pay/QRPayFragment.java
Normal file
400
app/src/main/java/com/utsmm/kbz/ui/qr_pay/QRPayFragment.java
Normal file
@ -0,0 +1,400 @@
|
|||||||
|
package com.utsmm.kbz.ui.qr_pay;
|
||||||
|
|
||||||
|
import androidx.lifecycle.Observer;
|
||||||
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
|
import androidx.navigation.fragment.NavHostFragment;
|
||||||
|
|
||||||
|
import com.utsmm.kbz.BR;
|
||||||
|
import com.utsmm.kbz.MainViewModel;
|
||||||
|
import com.utsmm.kbz.R;
|
||||||
|
import com.utsmm.kbz.config.Constants;
|
||||||
|
import com.utsmm.kbz.ui.adapters.QRPayAdapter;
|
||||||
|
import com.utsmm.kbz.ui.core_viewmodel.SharedViewModel;
|
||||||
|
import com.utsmm.kbz.ui.management.ManagementViewModel;
|
||||||
|
import com.utsmm.kbz.ui.settlement.SettlementViewModel;
|
||||||
|
import com.utsmm.kbz.util.Connectivity;
|
||||||
|
import com.utsmm.kbz.util.tms.TMSUtil;
|
||||||
|
import com.utsmyanmar.baselib.util.DataBindingConfig;
|
||||||
|
import com.utsmyanmar.baselib.fragment.DataBindingFragment;
|
||||||
|
import com.utsmyanmar.paylibs.model.PayDetail;
|
||||||
|
import com.utsmyanmar.paylibs.utils.POSUtil;
|
||||||
|
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation;
|
||||||
|
import com.utsmyanmar.paylibs.utils.enums.CurrencyType;
|
||||||
|
import com.utsmyanmar.paylibs.utils.enums.HostType;
|
||||||
|
import com.utsmyanmar.paylibs.utils.iso_utils.TransactionsType;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class QRPayFragment extends DataBindingFragment {
|
||||||
|
|
||||||
|
private MainViewModel mainViewModel;
|
||||||
|
private SharedViewModel sharedViewModel;
|
||||||
|
private static final int hostId = Constants.NAV_HOST_ID;
|
||||||
|
private int routeId;
|
||||||
|
private static final int currentId = R.id.qrFragment;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private Observer<PayDetail> observeLastTrans;
|
||||||
|
private PayDetail lastPay;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
setToolBarTitleWithBackIcon("MMQR PAY");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initViewModel() {
|
||||||
|
mainViewModel = new ViewModelProvider(requireActivity()).get(MainViewModel.class);
|
||||||
|
// sharedViewModel = new ViewModelProvider(requireActivity()).get(SharedViewModel.class);
|
||||||
|
sharedViewModel = getFragmentScopeViewModel(SharedViewModel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected DataBindingConfig getDataBindingConfig() {
|
||||||
|
|
||||||
|
List<QRPayItem> features = List.of(
|
||||||
|
new QRPayItem("Sale", R.drawable.ic_qr_pay),
|
||||||
|
new QRPayItem("Refund", R.drawable.ic_refund),
|
||||||
|
new QRPayItem("History", R.drawable.ic_history)
|
||||||
|
);
|
||||||
|
|
||||||
|
QRPayAdapter adapter = new QRPayAdapter(features, position -> {
|
||||||
|
QRPayItem selectedBtn = features.get(position);
|
||||||
|
switch (selectedBtn.title){
|
||||||
|
case "Sale":
|
||||||
|
onClickQRPay();
|
||||||
|
break;
|
||||||
|
case "Refund":
|
||||||
|
onClickRefund();
|
||||||
|
break;
|
||||||
|
case "History":
|
||||||
|
onClickHistory();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
DataBindingConfig config = new DataBindingConfig(R.layout.fragment_qr_pay, BR.mainViewModel, mainViewModel);
|
||||||
|
config.addBindingParam(BR.sharedViewModel,sharedViewModel);
|
||||||
|
config.addBindingParam(BR.adapter, adapter);
|
||||||
|
return config;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int currentId() {
|
||||||
|
return currentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int hostId() {
|
||||||
|
return hostId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int routeId() {
|
||||||
|
return routeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClickQRPay() {
|
||||||
|
|
||||||
|
String mmqrIp = SystemParamsOperation.getInstance().getSecHostIpAddress();
|
||||||
|
|
||||||
|
if (mainViewModel.payDetailSingle.getValue() != null) {
|
||||||
|
mainViewModel.startReversal(mainViewModel.payDetailSingle.getValue());
|
||||||
|
}
|
||||||
|
// else if (TMSUtil.getInstance().checkSecHostParams().isStatus() == ValidityStatus.FAILURE) {
|
||||||
|
// showDeclineDialog(getResourceString(R.string.txt_please_download_config)+"\n"+TMSUtil.getInstance().checkSecHostParams().getMessage());
|
||||||
|
// }
|
||||||
|
else if (!Connectivity.isConnectedWifi(getContext()) && !Connectivity.isConnectedMobile(getContext())) {
|
||||||
|
showSingleInfoDialog(getResourceString(R.string.txt_please_enable_internet));
|
||||||
|
}
|
||||||
|
// else if (!isValidDomain(mmqrIp)) {
|
||||||
|
// showDeclineDialog(getResourceString(R.string.txt_please_check_mmqr_ip));
|
||||||
|
// }
|
||||||
|
else {
|
||||||
|
CurrencyType currencyType = TMSUtil.getInstance().currencyTextToCurrencyType(SystemParamsOperation.getInstance().getSecHostCurrency());
|
||||||
|
sharedViewModel.set_currencyText(currencyType.name);
|
||||||
|
processBatch();
|
||||||
|
sharedViewModel.transactionsType.setValue(TransactionsType.MMQR);
|
||||||
|
navigateToAmount();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onClickHistory(){
|
||||||
|
sharedViewModel.hostType.setValue(HostType.QR);
|
||||||
|
routeId = R.id.action_qrFragment_to_qrHistory;
|
||||||
|
safeNavigateToRouteId();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onClickRefund(){
|
||||||
|
// sharedViewModel.setTransactionsType(TransactionsType.MMQR_REFUND);
|
||||||
|
routeId = R.id.action_qrFragment_to_qr_refund_list;
|
||||||
|
// routeId = R.id.action_qrFragment_to_inputPasswordFragment;
|
||||||
|
safeNavigateToRouteId();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void navigateToAmount() {
|
||||||
|
routeId = R.id.action_qrFragment_to_inputAmountFragment;
|
||||||
|
safeNavigateToRouteId();
|
||||||
|
}
|
||||||
|
private void processBatch() {
|
||||||
|
calculateLastTransaction();
|
||||||
|
mainViewModel.observeSettlementPOS();
|
||||||
|
observeLastTrans = payDetail -> {
|
||||||
|
|
||||||
|
if(payDetail == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// SystemParamsOperation.getInstance().saveSerialNumber(payDetail.getVoucherNo());
|
||||||
|
// SystemParamsOperation.getInstance().saveInvoiceNumber(payDetail.getInvoiceNo());
|
||||||
|
|
||||||
|
if(lastPay != null) {
|
||||||
|
Date lastPayDate = POSUtil.getInstance().getDateByString(lastPay.getTransDate());
|
||||||
|
Date observePayDate = POSUtil.getInstance().getDateByString(payDetail.getTransDate());
|
||||||
|
|
||||||
|
if(lastPayDate.compareTo(observePayDate) < 0) {
|
||||||
|
payDetail = lastPay;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// LogUtil.d(TAG,"TransDetail :"+payDetail.getTransType() + "- Trans Time :"+payDetail.getTransDate());
|
||||||
|
|
||||||
|
if(payDetail.getTransactionType() == TransactionsType.SETTLEMENT.value){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* saving for api post request, to send in next time.
|
||||||
|
* */
|
||||||
|
SystemParamsOperation.getInstance().setLastTransTime(String.valueOf(payDetail.getTransNum()));
|
||||||
|
SystemParamsOperation.getInstance().setLastTransName(payDetail.getTransType());
|
||||||
|
|
||||||
|
|
||||||
|
String lastTransDate = payDetail.getTransDate();
|
||||||
|
String lastTransTime = payDetail.getTransTime();
|
||||||
|
|
||||||
|
Date today = POSUtil.getInstance().getCurrentDate();
|
||||||
|
Date transDate;
|
||||||
|
Date current = new Date(System.currentTimeMillis());
|
||||||
|
String configTimer = SystemParamsOperation.getInstance().getClearBatchTime();
|
||||||
|
// LogUtil.d(TAG,"Config Time :" + configTimer);
|
||||||
|
String configTime = "23:00";
|
||||||
|
int configDay = 10;
|
||||||
|
|
||||||
|
String configRawDay = SystemParamsOperation.getInstance().getClearBatchDay();
|
||||||
|
|
||||||
|
if(configRawDay != null && !configRawDay.trim().isEmpty()) {
|
||||||
|
try {
|
||||||
|
configDay = Integer.parseInt(configRawDay);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(configTimer != null && !configTimer.trim().isEmpty() && checkValidTime(configTimer.trim())) {
|
||||||
|
configTime = configTimer.trim();
|
||||||
|
}
|
||||||
|
Date configDateTime = POSUtil.getInstance().getDateTime(configTime);
|
||||||
|
Date yesterdayConfigDateTime = POSUtil.getInstance().getYesterdayConfigDateTime(configTime);
|
||||||
|
|
||||||
|
transDate = POSUtil.getInstance().getDateByString(lastTransDate);
|
||||||
|
|
||||||
|
Date yesterdayDate = POSUtil.getInstance().getYesterdayDate();
|
||||||
|
|
||||||
|
if(today.compareTo(transDate) == 0) {
|
||||||
|
|
||||||
|
// LogUtil.d(TAG,"Last Trans is Today!");
|
||||||
|
// LogUtil.d(TAG,"date current :!"+current);
|
||||||
|
// LogUtil.d(TAG,"date config :!"+configDateTime);
|
||||||
|
|
||||||
|
// Today
|
||||||
|
if(current.compareTo(configDateTime) > 0) {
|
||||||
|
// clear batch and force update param
|
||||||
|
|
||||||
|
// LogUtil.d(TAG,"Last Trans is Today! Config time is passed!");
|
||||||
|
// if (!SystemParamsOperation.getInstance().isClearBatch()) {
|
||||||
|
if (checkSyncTrans() || !SystemParamsOperation.getInstance().isClearBatch() ) {
|
||||||
|
// LogUtil.d(TAG,"Clearing....");
|
||||||
|
if(!SystemParamsOperation.getInstance().getSettlementStatus()) {
|
||||||
|
clearBatchAndDownload(configDay,payDetail);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// LogUtil.d(TAG,"Last Trans is Today! Config time is not passed yet.....");
|
||||||
|
SystemParamsOperation.getInstance().setClearBatch(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// LogUtil.d(TAG,"Last Trans is Before Today!");
|
||||||
|
Date yest;
|
||||||
|
if(configTime.equals("00:00")) {
|
||||||
|
yest = configDateTime;
|
||||||
|
} else {
|
||||||
|
yest = yesterdayConfigDateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Date lastTransDateTime = POSUtil.getInstance().getDateByTransDateTime(lastTransDate,lastTransTime);
|
||||||
|
// LogUtil.d(TAG,"Compare Result : "+lastTransDateTime.compareTo(yest));
|
||||||
|
|
||||||
|
if(yest.compareTo(lastTransDateTime) < 0) {
|
||||||
|
// LogUtil.d(TAG,"Trans is yesterday, but after config time, no action!");
|
||||||
|
} else {
|
||||||
|
// LogUtil.d(TAG,"Trans is yesterday, before config time,");
|
||||||
|
// if(!checkSyncTrans()) {
|
||||||
|
// LogUtil.d(TAG,"Clearing....");
|
||||||
|
if(!SystemParamsOperation.getInstance().getSettlementStatus()) {
|
||||||
|
clearBatchAndDownload(configDay,payDetail);
|
||||||
|
}
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if(mainViewModel.lastTrans.hasActiveObservers()) {
|
||||||
|
mainViewModel.lastTrans.removeObserver(observeLastTrans);
|
||||||
|
}
|
||||||
|
mainViewModel.lastTrans.observe(getViewLifecycleOwner(),observeLastTrans);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void calculateLastTransaction() {
|
||||||
|
mainViewModel.allTrans.observe(getViewLifecycleOwner(), new Observer<List<PayDetail>>() {
|
||||||
|
@Override
|
||||||
|
public void onChanged(List<PayDetail> payDetails) {
|
||||||
|
if(payDetails == null || payDetails.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
PayDetail tempPay = payDetails.get(0);
|
||||||
|
for (int i = 0; i < payDetails.size() ; i++) {
|
||||||
|
|
||||||
|
Date tempDate = POSUtil.getInstance().getDateByString(tempPay.getTransDate());
|
||||||
|
Date indexDate = POSUtil.getInstance().getDateByString(payDetails.get(i).getTransDate());
|
||||||
|
|
||||||
|
if(tempDate.compareTo(indexDate) > 0) {
|
||||||
|
// if before
|
||||||
|
tempPay = payDetails.get(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lastPay = tempPay;
|
||||||
|
|
||||||
|
// LogUtil.d(TAG,"Transaction Name : "+tempPay.getTransType());
|
||||||
|
// LogUtil.d(TAG,"Transaction Type : "+tempPay.getTransactionType());
|
||||||
|
// LogUtil.d(TAG,"Transaction Amount : "+tempPay.getAmount());
|
||||||
|
// LogUtil.d(TAG,"Transaction Date/Time : "+tempPay.getTransDate()+"/"+tempPay.getTransTime());
|
||||||
|
// LogUtil.d(TAG,"RRN/Trace : "+tempPay.getReferNo()+"/"+tempPay.getVoucherNo());
|
||||||
|
// LogUtil.d(TAG,"Transaction is canceled : "+tempPay.isCanceled());
|
||||||
|
// LogUtil.d(TAG,"Transaction settlement config : "+tempPay.isSettlementEnabled());
|
||||||
|
// LogUtil.d(TAG,"----------------------------------------------------------");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean checkSyncTrans() {
|
||||||
|
String transDateString = SystemParamsOperation.getInstance().getSyncTransDate();
|
||||||
|
Date today = POSUtil.getInstance().getCurrentDate();
|
||||||
|
if(transDateString == null || transDateString.isEmpty()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
Date transDate = POSUtil.getInstance().getDateByString(transDateString);
|
||||||
|
return today.compareTo(transDate) == 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void clearBatchAndDownload(int configDay,PayDetail payDetail) {
|
||||||
|
|
||||||
|
|
||||||
|
Date yesterday = POSUtil.getInstance().getYesterdayDate();
|
||||||
|
Date lastInputDay = POSUtil.getInstance().getLastInputDay(configDay);
|
||||||
|
mainViewModel.settlementPOS.observe(getViewLifecycleOwner(), list -> {
|
||||||
|
|
||||||
|
Date transDate;
|
||||||
|
|
||||||
|
if(list == null || list.size() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (PayDetail pay:list) {
|
||||||
|
/*
|
||||||
|
* To Hold One day transaction!
|
||||||
|
* */
|
||||||
|
|
||||||
|
transDate = POSUtil.getInstance().getDateByString(pay.getTransDate());
|
||||||
|
|
||||||
|
if (pay.getTransactionType() == TransactionsType.SALE.value) {
|
||||||
|
if(lastInputDay.compareTo(transDate) > 0) {
|
||||||
|
mainViewModel.deletePayDetail(pay);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(yesterday.compareTo(transDate) > 0 ) {
|
||||||
|
mainViewModel.deletePayDetail(pay);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
mainViewModel.deleteTrans.observe(getViewLifecycleOwner(), lists -> {
|
||||||
|
Date transDate;
|
||||||
|
if(lists == null || lists.size() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (PayDetail pay:lists) {
|
||||||
|
/*
|
||||||
|
* To Hold One day transaction!
|
||||||
|
* */
|
||||||
|
|
||||||
|
transDate = POSUtil.getInstance().getDateByString(pay.getTransDate());
|
||||||
|
// LogUtil.d(TAG,"Trans Type : "+pay.getTransType()+"<=====> Trans Date :"+pay.getTransDate());
|
||||||
|
// LogUtil.d(TAG,"Yesterday Date: "+yesterday.toString());
|
||||||
|
// LogUtil.d(TAG,"Compare result :"+yesterday.compareTo(transDate));
|
||||||
|
|
||||||
|
if(yesterday.compareTo(transDate) > 0) {
|
||||||
|
mainViewModel.deletePayDetail(pay);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
mainViewModel.preAuthTrans.observe(getViewLifecycleOwner(), lists -> {
|
||||||
|
Date transDate;
|
||||||
|
if(lists == null || lists.size() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (PayDetail pay:lists) {
|
||||||
|
|
||||||
|
transDate = POSUtil.getInstance().getDateByString(pay.getTransDate());
|
||||||
|
|
||||||
|
if (lastInputDay.compareTo(transDate) > 0) {
|
||||||
|
mainViewModel.deletePayDetail(pay);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* Need to think about his problem .... Nov 7, 2024
|
||||||
|
* */
|
||||||
|
if(!SystemParamsOperation.getInstance().isClearBatch()) {
|
||||||
|
// downloadParams(payDetail.getTransType(),String.valueOf(payDetail.getTransNum()),TMSUpdate.UPDATE,false);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
11
app/src/main/java/com/utsmm/kbz/ui/qr_pay/QRPayItem.java
Normal file
11
app/src/main/java/com/utsmm/kbz/ui/qr_pay/QRPayItem.java
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package com.utsmm.kbz.ui.qr_pay;
|
||||||
|
|
||||||
|
public class QRPayItem {
|
||||||
|
public String title;
|
||||||
|
public int icon;
|
||||||
|
|
||||||
|
public QRPayItem(String title, int icon) {
|
||||||
|
this.title = title;
|
||||||
|
this.icon = icon;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
package com.utsmm.kbz.ui.qr_pay;
|
||||||
|
|
||||||
|
import androidx.lifecycle.LiveData;
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
import androidx.lifecycle.ViewModel;
|
||||||
|
|
||||||
|
import com.utsmyanmar.baselib.repo.Repository;
|
||||||
|
import com.utsmyanmar.paylibs.model.PayDetail;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import dagger.hilt.android.lifecycle.HiltViewModel;
|
||||||
|
|
||||||
|
@HiltViewModel
|
||||||
|
public class QRPayViewModel extends ViewModel {
|
||||||
|
|
||||||
|
private final Repository repository;
|
||||||
|
private final LiveData<List<PayDetail>> refundableHistory;
|
||||||
|
|
||||||
|
private final MutableLiveData<PayDetail> _payDetail = new MutableLiveData<>();
|
||||||
|
public LiveData<PayDetail> payDetail = _payDetail;
|
||||||
|
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public QRPayViewModel(Repository repository){
|
||||||
|
this.repository = repository;
|
||||||
|
this.refundableHistory = repository.getRefundableQRHistory();
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveData<List<PayDetail>> getRefundableQrHistory(){
|
||||||
|
return refundableHistory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPayDetail(PayDetail payDetail){
|
||||||
|
_payDetail.setValue(payDetail);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Runnable onCancel;
|
||||||
|
public Runnable onConfirm;
|
||||||
|
}
|
||||||
49
app/src/main/java/com/utsmm/kbz/ui/qr_pay/QRRefund.java
Normal file
49
app/src/main/java/com/utsmm/kbz/ui/qr_pay/QRRefund.java
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
package com.utsmm.kbz.ui.qr_pay;
|
||||||
|
|
||||||
|
public class QRRefund {
|
||||||
|
|
||||||
|
private String referenceNo;
|
||||||
|
private String refundAmount;
|
||||||
|
private String originalAmount;
|
||||||
|
private String reason;
|
||||||
|
|
||||||
|
public QRRefund(String referenceNo, String refundAmount, String originalAmount, String reason) {
|
||||||
|
this.referenceNo = referenceNo;
|
||||||
|
this.refundAmount = refundAmount;
|
||||||
|
this.originalAmount = originalAmount;
|
||||||
|
this.reason = reason;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReferenceNo() {
|
||||||
|
return referenceNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReferenceNo(String referenceNo) {
|
||||||
|
this.referenceNo = referenceNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRefundAmount() {
|
||||||
|
return refundAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRefundAmount(String refundAmount) {
|
||||||
|
this.refundAmount = refundAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOriginalAmount() {
|
||||||
|
return originalAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOriginalAmount(String originalAmount) {
|
||||||
|
this.originalAmount = originalAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReason() {
|
||||||
|
return reason;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReason(String reason) {
|
||||||
|
this.reason = reason;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,221 @@
|
|||||||
|
package com.utsmm.kbz.ui.qr_pay;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.text.InputFilter;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.RadioButton;
|
||||||
|
import android.widget.RadioGroup;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.utsmm.kbz.ui.kpay.KPayViewModel;
|
||||||
|
import com.utsmyanmar.baselib.fragment.DataBindingFragment;
|
||||||
|
import com.utsmyanmar.baselib.util.DataBindingConfig;
|
||||||
|
import com.utsmyanmar.paylibs.model.PayDetail;
|
||||||
|
import com.utsmyanmar.paylibs.model.TradeData;
|
||||||
|
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation;
|
||||||
|
import com.utsmyanmar.paylibs.utils.iso_utils.TransactionsType;
|
||||||
|
import com.utsmm.kbz.BR;
|
||||||
|
import com.utsmm.kbz.R;
|
||||||
|
import com.utsmm.kbz.config.Constants;
|
||||||
|
import com.utsmm.kbz.ui.core_viewmodel.SharedViewModel;
|
||||||
|
import com.utsmm.kbz.util.DecimalDigitsInputFilter;
|
||||||
|
import com.utsmm.kbz.util.TransactionUtil;
|
||||||
|
|
||||||
|
|
||||||
|
public class QRRefundDetailFragment extends DataBindingFragment {
|
||||||
|
|
||||||
|
private SharedViewModel sharedViewModel;
|
||||||
|
private KPayViewModel kPayViewModel;
|
||||||
|
private int routeId;
|
||||||
|
|
||||||
|
|
||||||
|
private TradeData tradeData;
|
||||||
|
private PayDetail payDetail;
|
||||||
|
|
||||||
|
// UI Elements
|
||||||
|
private RadioGroup radioGroupRefundType;
|
||||||
|
private RadioButton radioOriginal, radioPartial;
|
||||||
|
private EditText etReferenceNo, etOriginalAmount, etRefundAmount, etRefundReason;
|
||||||
|
private LinearLayout originalAmountLayout, refundAmountLayout;
|
||||||
|
|
||||||
|
private boolean isPartialRefund = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private static final String TAG = com.utsmm.kbz.ui.kpay.QRRefundFragment.class.getSimpleName();
|
||||||
|
|
||||||
|
private static final int hostId = Constants.NAV_HOST_ID;
|
||||||
|
private static final int currentId = R.id.qrRefundDetail;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initViewModel() {
|
||||||
|
sharedViewModel = getFragmentScopeViewModel(SharedViewModel.class);
|
||||||
|
kPayViewModel = getFragmentScopeViewModel(KPayViewModel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected DataBindingConfig getDataBindingConfig() {
|
||||||
|
return new DataBindingConfig(R.layout.fragment_qr_refund_detail, BR.sharedViewModel, sharedViewModel)
|
||||||
|
.addBindingParam(BR.kPayViewModel, kPayViewModel)
|
||||||
|
.addBindingParam(BR.click, new ClickEvent());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int currentId() {
|
||||||
|
return currentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int hostId() {
|
||||||
|
return hostId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int routeId() {
|
||||||
|
return routeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(@Nullable Bundle savedInstanceState){
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
if(getArguments() != null){
|
||||||
|
payDetail = (PayDetail) getArguments().getSerializable("payDetail");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
setToolBarTitleWithBackIcon("QR Refund");
|
||||||
|
kPayViewModel.invalidAmountMsg.setValue("");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
|
initViews();
|
||||||
|
initData();
|
||||||
|
setupRadioGroupListener();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initViews() {
|
||||||
|
radioGroupRefundType = mBinding.getRoot().findViewById(R.id.radio_group_refund_type);
|
||||||
|
radioOriginal = mBinding.getRoot().findViewById(R.id.radio_original);
|
||||||
|
radioPartial = mBinding.getRoot().findViewById(R.id.radio_partial);
|
||||||
|
etReferenceNo = mBinding.getRoot().findViewById(R.id.et_reference_no);
|
||||||
|
etOriginalAmount = mBinding.getRoot().findViewById(R.id.et_original_amount);
|
||||||
|
etRefundAmount = mBinding.getRoot().findViewById(R.id.et_refund_amount);
|
||||||
|
etRefundReason = mBinding.getRoot().findViewById(R.id.et_refund_reason);
|
||||||
|
originalAmountLayout = mBinding.getRoot().findViewById(R.id.original_amount_layout);
|
||||||
|
refundAmountLayout = mBinding.getRoot().findViewById(R.id.refund_amount_layout);
|
||||||
|
|
||||||
|
// Set input filters for amount fields
|
||||||
|
etOriginalAmount.setFilters(new InputFilter[]{new DecimalDigitsInputFilter(11, 2)});
|
||||||
|
etRefundAmount.setFilters(new InputFilter[]{new DecimalDigitsInputFilter(11, 2)});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initData() {
|
||||||
|
payDetail = TransactionUtil.getInstance().initWalletTransaction(TransactionsType.MMQR_REFUND);
|
||||||
|
payDetail.setInvoiceNo(SystemParamsOperation.getInstance().getIncrementInvoiceNum());
|
||||||
|
|
||||||
|
if(getArguments() != null){
|
||||||
|
PayDetail passData = (PayDetail) getArguments().getSerializable("payDetail");
|
||||||
|
if(passData != null && passData.getReferNo() != null){
|
||||||
|
etReferenceNo.setText(passData.getReferNo());
|
||||||
|
etReferenceNo.setEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupRadioGroupListener() {
|
||||||
|
radioGroupRefundType.setOnCheckedChangeListener((group, checkedId) -> {
|
||||||
|
if (checkedId == R.id.radio_partial) {
|
||||||
|
// Show both amount fields for partial refund
|
||||||
|
isPartialRefund = true;
|
||||||
|
originalAmountLayout.setVisibility(View.VISIBLE);
|
||||||
|
refundAmountLayout.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
// Hide amount fields for original refund
|
||||||
|
isPartialRefund = false;
|
||||||
|
originalAmountLayout.setVisibility(View.GONE);
|
||||||
|
refundAmountLayout.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class ClickEvent {
|
||||||
|
|
||||||
|
public void onCancel() {
|
||||||
|
safePopBackStack();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onConfirm() {
|
||||||
|
kPayViewModel.invalidAmountMsg.setValue("");
|
||||||
|
|
||||||
|
String referenceNo = etReferenceNo.getText().toString().trim();
|
||||||
|
String refundReason = etRefundReason.getText().toString().trim();
|
||||||
|
|
||||||
|
// Validate reference number
|
||||||
|
if (referenceNo.isEmpty()) {
|
||||||
|
kPayViewModel.invalidAmountMsg.setValue("Enter reference number");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isPartialRefund) {
|
||||||
|
// Partial refund validation
|
||||||
|
String originalAmountStr = etOriginalAmount.getText().toString().trim();
|
||||||
|
String refundAmountStr = etRefundAmount.getText().toString().trim();
|
||||||
|
|
||||||
|
if (originalAmountStr.isEmpty()) {
|
||||||
|
kPayViewModel.invalidAmountMsg.setValue("Enter original amount");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (refundAmountStr.isEmpty()) {
|
||||||
|
kPayViewModel.invalidAmountMsg.setValue("Enter refund amount");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
double originalAmount = Double.parseDouble(originalAmountStr);
|
||||||
|
double refundAmount = Double.parseDouble(refundAmountStr);
|
||||||
|
|
||||||
|
if (originalAmount <= 0) {
|
||||||
|
kPayViewModel.invalidAmountMsg.setValue("Enter valid original amount");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (refundAmount <= 0) {
|
||||||
|
kPayViewModel.invalidAmountMsg.setValue("Enter valid refund amount");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (refundAmount > originalAmount) {
|
||||||
|
kPayViewModel.invalidAmountMsg.setValue("Refund amount cannot exceed original amount");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QRRefund qrRefund = new QRRefund(referenceNo, refundAmountStr, originalAmountStr, refundReason);
|
||||||
|
|
||||||
|
kPayViewModel.setQrRefund(qrRefund);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
QRRefund qrRefund = new QRRefund(referenceNo, "0", etOriginalAmount.getText().toString().trim(), refundReason);
|
||||||
|
|
||||||
|
kPayViewModel.setQrRefund(qrRefund);
|
||||||
|
}
|
||||||
|
sharedViewModel.transactionsType.setValue(TransactionsType.MMQR_REFUND);
|
||||||
|
kPayViewModel.setPayDetail(payDetail);
|
||||||
|
routeId = R.id.action_qrRefundDetail_inputPasswordFragment;
|
||||||
|
safeNavigateToRouteId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
142
app/src/main/java/com/utsmm/kbz/ui/qr_pay/QRRefundFragment.java
Normal file
142
app/src/main/java/com/utsmm/kbz/ui/qr_pay/QRRefundFragment.java
Normal file
@ -0,0 +1,142 @@
|
|||||||
|
package com.utsmm.kbz.ui.qr_pay;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.RadioGroup;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
|
import androidx.navigation.fragment.NavHostFragment;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.utsmm.kbz.BR;
|
||||||
|
import com.utsmm.kbz.R;
|
||||||
|
import com.utsmm.kbz.config.Constants;
|
||||||
|
import com.utsmm.kbz.ui.core_viewmodel.SharedViewModel;
|
||||||
|
import com.utsmm.kbz.ui.kpay.KPayViewModel;
|
||||||
|
import com.utsmyanmar.baselib.fragment.DataBindingFragment;
|
||||||
|
import com.utsmyanmar.baselib.util.DataBindingConfig;
|
||||||
|
import com.utsmyanmar.paylibs.model.PayDetail;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
public class QRRefundFragment extends DataBindingFragment {
|
||||||
|
|
||||||
|
private static final int hostId = Constants.NAV_HOST_ID;
|
||||||
|
private int routeId;
|
||||||
|
private static final int currentId = R.id.qrRefundList;
|
||||||
|
private QRPayViewModel qrPayViewModel;
|
||||||
|
private SharedViewModel sharedViewModel;
|
||||||
|
private QRRefundViewAdapter adapter;
|
||||||
|
private LinearLayout emptyStateView;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int currentId() {
|
||||||
|
return currentId;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected int hostId() {return hostId;}
|
||||||
|
@Override
|
||||||
|
protected int routeId() {return routeId;}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initViewModel() {
|
||||||
|
sharedViewModel = new ViewModelProvider(requireActivity()).get(SharedViewModel.class);
|
||||||
|
qrPayViewModel = new ViewModelProvider(requireActivity()).get(QRPayViewModel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected DataBindingConfig getDataBindingConfig() {
|
||||||
|
adapter = new QRRefundViewAdapter(this::onRefundItemClicked);
|
||||||
|
return new DataBindingConfig(R.layout.fragment_qr_refund, BR.sharedViewModel, sharedViewModel)
|
||||||
|
.addBindingParam(BR.adapter, adapter)
|
||||||
|
.addBindingParam(BR.click, new ClickEvent());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume(){
|
||||||
|
super.onResume();
|
||||||
|
setToolBarTitleWithBackIcon("QR Refund");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(@Nullable Bundle savedInstance){
|
||||||
|
super.onCreate(savedInstance);
|
||||||
|
adapter = new QRRefundViewAdapter(this::onRefundItemClicked);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState){
|
||||||
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
|
RecyclerView recyclerView = view.findViewById(R.id.qrRefundHistory);
|
||||||
|
recyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));
|
||||||
|
recyclerView.setAdapter(adapter);
|
||||||
|
emptyStateView = view.findViewById(R.id.emptyStateSectionRefund);
|
||||||
|
observeData();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void observeData(){
|
||||||
|
qrPayViewModel.getRefundableQrHistory().observe(getViewLifecycleOwner(), this::updateList);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateList(List<PayDetail> list){
|
||||||
|
if (adapter == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(list == null || list.isEmpty()){
|
||||||
|
emptyStateView.setVisibility(View.VISIBLE);
|
||||||
|
getView().findViewById(R.id.qrRefundHistory).setVisibility(View.GONE);
|
||||||
|
}else{
|
||||||
|
emptyStateView.setVisibility(View.GONE);
|
||||||
|
getView().findViewById(R.id.qrRefundHistory).setVisibility(View.VISIBLE);
|
||||||
|
adapter.setData(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ClickEvent {
|
||||||
|
public void onCancel(){
|
||||||
|
safeNavigateToRouteId();
|
||||||
|
}
|
||||||
|
public void onSearch(){
|
||||||
|
searchById();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onRefundItemClicked(PayDetail payDetail) {
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putSerializable("payDetail", payDetail);
|
||||||
|
routeId = R.id.action_qrRefundList_to_qrRefundDetail;
|
||||||
|
NavHostFragment.findNavController(this).navigate(routeId, bundle);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void searchById(){
|
||||||
|
EditText editText = getView().findViewById(R.id.rnn_trace_id);
|
||||||
|
String keyword = editText.getText().toString().trim();
|
||||||
|
|
||||||
|
if(keyword.isEmpty()){
|
||||||
|
updateList(qrPayViewModel.getRefundableQrHistory().getValue());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<PayDetail> originalList = qrPayViewModel.getRefundableQrHistory().getValue();
|
||||||
|
if(originalList == null) return;
|
||||||
|
|
||||||
|
List<PayDetail> filteredList = new ArrayList<>();
|
||||||
|
for(PayDetail item: originalList){
|
||||||
|
if(item.getReferNo() != null && item.getReferNo().contains(keyword)){
|
||||||
|
filteredList.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
updateList(filteredList);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,215 @@
|
|||||||
|
package com.utsmm.kbz.ui.qr_pay;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.utsmm.kbz.BR;
|
||||||
|
import com.utsmm.kbz.R;
|
||||||
|
import com.utsmm.kbz.config.Constants;
|
||||||
|
import com.utsmm.kbz.ui.core_viewmodel.SharedViewModel;
|
||||||
|
import com.utsmm.kbz.ui.kpay.KPayViewModel;
|
||||||
|
import com.utsmm.kbz.ui.kpay.QRRefundFragment;
|
||||||
|
import com.utsmm.kbz.util.TransactionUtil;
|
||||||
|
import com.utsmm.kbz.util.ecr.CoreUtils;
|
||||||
|
import com.utsmyanmar.baselib.fragment.DataBindingFragment;
|
||||||
|
import com.utsmyanmar.baselib.network.model.KPayRefund;
|
||||||
|
import com.utsmyanmar.baselib.util.DataBindingConfig;
|
||||||
|
import com.utsmyanmar.paylibs.model.PayDetail;
|
||||||
|
import com.utsmyanmar.paylibs.system.SystemDateTime;
|
||||||
|
import com.utsmyanmar.paylibs.utils.LogUtil;
|
||||||
|
import com.utsmyanmar.paylibs.utils.POSUtil;
|
||||||
|
|
||||||
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.rxjava3.disposables.CompositeDisposable;
|
||||||
|
import io.reactivex.rxjava3.disposables.Disposable;
|
||||||
|
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||||
|
|
||||||
|
public class QRRefundProcessFragment extends DataBindingFragment {
|
||||||
|
|
||||||
|
private static final String TAG = QRRefundProcessFragment.class.getSimpleName();
|
||||||
|
private SharedViewModel sharedViewModel;
|
||||||
|
private KPayViewModel kPayViewModel;
|
||||||
|
|
||||||
|
private PayDetail payDetail;
|
||||||
|
|
||||||
|
private QRRefund qrRefund;
|
||||||
|
private static final int hostId = Constants.NAV_HOST_ID;
|
||||||
|
private int routeId;
|
||||||
|
private static final int currentId = R.id.QRRefundProcessFragment;
|
||||||
|
|
||||||
|
CompositeDisposable retrieveUpdateDisposable = new CompositeDisposable();
|
||||||
|
CompositeDisposable refundDisposable = new CompositeDisposable();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initViewModel() {
|
||||||
|
sharedViewModel = getFragmentScopeViewModel(SharedViewModel.class);
|
||||||
|
kPayViewModel = getFragmentScopeViewModel(KPayViewModel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected DataBindingConfig getDataBindingConfig() {
|
||||||
|
return new DataBindingConfig(R.layout.fragment_qr_refund_process, BR.sharedViewModel, sharedViewModel)
|
||||||
|
.addBindingParam(BR.kPayViewModel, kPayViewModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroyView() {
|
||||||
|
super.onDestroyView();
|
||||||
|
retrieveUpdateDisposable.dispose();
|
||||||
|
refundDisposable.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int currentId() {
|
||||||
|
return currentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int hostId() {
|
||||||
|
return hostId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int routeId() {
|
||||||
|
return routeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
|
initData();
|
||||||
|
|
||||||
|
processKPayRefund(qrRefund.getReferenceNo(), qrRefund.getRefundAmount(), qrRefund.getOriginalAmount(), qrRefund.getReason());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initData() {
|
||||||
|
payDetail = kPayViewModel.getPayDetail();
|
||||||
|
qrRefund = kPayViewModel.getQrRefund();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void processKPayRefund(String referenceNo, String refundAmount, String originalAmount, String reason) {
|
||||||
|
String merchantId = TransactionUtil.getInstance().getQRMerchantId();
|
||||||
|
|
||||||
|
// Generate unique refund request ID
|
||||||
|
String refundRequestId = referenceNo + "R";
|
||||||
|
|
||||||
|
|
||||||
|
// Create KPay refund request
|
||||||
|
KPayRefund.RefundRequest refundRequest = kPayViewModel.createRefundRequest(
|
||||||
|
refundRequestId,
|
||||||
|
referenceNo,
|
||||||
|
merchantId,
|
||||||
|
refundAmount,
|
||||||
|
reason != null ? reason : "Refund request"
|
||||||
|
);
|
||||||
|
|
||||||
|
Disposable refundDi = kPayViewModel.kPayRefund(refundRequest)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(
|
||||||
|
response -> {
|
||||||
|
handleRefundResponse(response, referenceNo);
|
||||||
|
},
|
||||||
|
throwable -> {
|
||||||
|
LogUtil.e(TAG, "Refund error: " + throwable.getMessage());
|
||||||
|
showDeclineDialog("Refund failed!\nCommunication Error!");
|
||||||
|
ecrActionCancel("Refund failed");
|
||||||
|
navigateToMain();
|
||||||
|
},
|
||||||
|
() -> LogUtil.d(TAG, "Refund request completed")
|
||||||
|
);
|
||||||
|
|
||||||
|
refundDisposable.add(refundDi);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleRefundResponse(KPayRefund.RefundResponse response, String referenceNo) {
|
||||||
|
if (response != null && response.getResponse() != null && "REFUND_SUCCESS".equalsIgnoreCase(response.getResponse().getRefundStatus())) {
|
||||||
|
LogUtil.d(TAG, "Refund successful!");
|
||||||
|
|
||||||
|
String refundAmount = response.getResponse().getRefundAmount();
|
||||||
|
|
||||||
|
String dateTime = SystemDateTime.getTodayDateFormat() + " " + SystemDateTime.getTodayTimeFormat();
|
||||||
|
payDetail.setAmount(refundAmount == null ? 0 : POSUtil.getInstance().convertAmount(refundAmount));
|
||||||
|
payDetail.setOriginalTransDate(dateTime);
|
||||||
|
payDetail.setQrTransStatus(1);
|
||||||
|
payDetail.setQrReferNo(referenceNo);
|
||||||
|
payDetail.setReferNo(referenceNo);
|
||||||
|
payDetail.setIsCanceled(true);
|
||||||
|
|
||||||
|
retrievedUpdatePayDetail(referenceNo);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
LogUtil.d(TAG, "Refund failed!");
|
||||||
|
payDetail.setQrTransStatus(-1);
|
||||||
|
payDetail.setQrReferNo(referenceNo);
|
||||||
|
payDetail.setReferNo(referenceNo);
|
||||||
|
|
||||||
|
String errorMsg = "Refund failed";
|
||||||
|
if (response != null && response.getResponse() != null && response.getResponse().getMsg() != null) {
|
||||||
|
errorMsg = response.getResponse().getMsg();
|
||||||
|
}
|
||||||
|
payDetail.setTradeResultDes(errorMsg);
|
||||||
|
|
||||||
|
sharedViewModel.payDetail.setValue(payDetail);
|
||||||
|
navigateToNext();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void retrievedUpdatePayDetail(String refNum) {
|
||||||
|
LogUtil.d(TAG, "Trying to update Database!");
|
||||||
|
retrieveUpdateDisposable.add(kPayViewModel.searchPayByRefNum(refNum)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(oldPay -> {
|
||||||
|
LogUtil.d(TAG, "Inside the subscribe!");
|
||||||
|
if (oldPay != null) {
|
||||||
|
oldPay.setIsCanceled(true);
|
||||||
|
payDetail.setQrTransId(oldPay.getQrTransId());
|
||||||
|
payDetail.setCustomerMobile(oldPay.getCustomerMobile());
|
||||||
|
sharedViewModel.updatePayDetail(oldPay);
|
||||||
|
}
|
||||||
|
updateData();
|
||||||
|
navigateToNext();
|
||||||
|
},
|
||||||
|
onError -> {
|
||||||
|
LogUtil.d(TAG, "On error Unable to retrieve PayDetail");
|
||||||
|
updateData();
|
||||||
|
navigateToNext();
|
||||||
|
},
|
||||||
|
() -> {
|
||||||
|
LogUtil.d(TAG, "No data found! navigating to Result Page!");
|
||||||
|
updateData();
|
||||||
|
navigateToNext();
|
||||||
|
}
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateData() {
|
||||||
|
kPayViewModel.insertPayDetail(payDetail);
|
||||||
|
sharedViewModel.payDetail.postValue(payDetail);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void navigateToNext() {
|
||||||
|
routeId = R.id.action_QRRefundProcessFragment_to_transactionResultFragment;
|
||||||
|
safeNavigateToRouteId();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void navigateToMain() {
|
||||||
|
routeId = R.id.action_QRRefundProcessFragment_to_nav_main;
|
||||||
|
safeNavigateToRouteId();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ecrActionCancel(String msg) {
|
||||||
|
if (sharedViewModel.isEcr.getValue() != null) {
|
||||||
|
if (sharedViewModel.isEcr.getValue()) {
|
||||||
|
sharedViewModel.isEcr.postValue(false);
|
||||||
|
CoreUtils.getInstance(sharedViewModel).responseRejectMsg(msg);
|
||||||
|
sharedViewModel.isEcrFinished.postValue(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,84 @@
|
|||||||
|
package com.utsmm.kbz.ui.qr_pay;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import com.utsmm.kbz.BR;
|
||||||
|
import com.utsmm.kbz.R;
|
||||||
|
import com.utsmm.kbz.databinding.ItemQrRefundBinding;
|
||||||
|
import com.utsmm.kbz.ui.adapters.QRPayAdapter;
|
||||||
|
import com.utsmyanmar.paylibs.model.PayDetail;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
public class QRRefundViewAdapter extends RecyclerView.Adapter<QRRefundViewAdapter.ViewHolder> {
|
||||||
|
|
||||||
|
private List<PayDetail> payDetailList = new ArrayList<>();
|
||||||
|
private final OnRefundItemClick listener;
|
||||||
|
|
||||||
|
public interface OnRefundItemClick {
|
||||||
|
void onClick(PayDetail payDetail);
|
||||||
|
}
|
||||||
|
|
||||||
|
public QRRefundViewAdapter(OnRefundItemClick listener){
|
||||||
|
this.listener = listener;
|
||||||
|
}
|
||||||
|
// public QRRefundViewAdapter(List<PayDetail> payDetailList, OnRefundItemClick listener){
|
||||||
|
// this.payDetailList = payDetailList;
|
||||||
|
// this.listener = listener;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
public void setData(List<PayDetail> data){
|
||||||
|
this.payDetailList = data != null ? data : new ArrayList<>();
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
ItemQrRefundBinding binding = DataBindingUtil.inflate(
|
||||||
|
LayoutInflater.from(parent.getContext()),
|
||||||
|
R.layout.item_qr_refund,
|
||||||
|
parent,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
return new ViewHolder(binding);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||||
|
PayDetail payDetail = payDetailList.get(position);
|
||||||
|
holder.bind(payDetail, listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return payDetailList == null ? 0 : payDetailList.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
private final ItemQrRefundBinding binding;
|
||||||
|
|
||||||
|
public ViewHolder(ItemQrRefundBinding binding){
|
||||||
|
super(binding.getRoot());
|
||||||
|
this.binding = binding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void bind(PayDetail payDetail, OnRefundItemClick listener){
|
||||||
|
binding.setVariable(BR.payDetail, payDetail);
|
||||||
|
binding.executePendingBindings();
|
||||||
|
binding.getRoot().setOnClickListener( v -> {
|
||||||
|
if(listener != null) listener.onClick(payDetail);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,193 @@
|
|||||||
|
package com.utsmm.kbz.ui.settings;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.nexgo.downloadkey.downloadflow.DownloadFEntity;
|
||||||
|
import com.nexgo.downloadkey.downloadflow.DownloadFlow;
|
||||||
|
import com.nexgo.downloadkey.downloadflow.DownloadFlowProcessListener;
|
||||||
|
import com.nexgo.downloadkey.downloadflow.DownloadFlowResultEntity;
|
||||||
|
import com.nexgo.downloadkey.downloadflow.DownloadResult;
|
||||||
|
import com.utsmyanmar.baselib.fragment.DataBindingFragment;
|
||||||
|
import com.utsmyanmar.baselib.util.DataBindingConfig;
|
||||||
|
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation;
|
||||||
|
import com.utsmm.kbz.BR;
|
||||||
|
import com.utsmm.kbz.R;
|
||||||
|
import com.utsmm.kbz.databinding.FragmentInjectKeyBinding;
|
||||||
|
import com.utsmyanmar.paylibs.utils.LogUtil;
|
||||||
|
import com.utsmm.kbz.util.tms.TMSUtil;
|
||||||
|
|
||||||
|
public class InjectKeyFragment extends DataBindingFragment {
|
||||||
|
|
||||||
|
private static final String TAG = InjectKeyFragment.class.getSimpleName();
|
||||||
|
|
||||||
|
// Data binding will handle view access automatically
|
||||||
|
private FragmentInjectKeyBinding binding;
|
||||||
|
|
||||||
|
// Key injection variables
|
||||||
|
private DownloadFlow mDownloadFlow;
|
||||||
|
private int keyIndexTmp = 8; // Default key index
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initViewModel() {
|
||||||
|
// No specific viewmodels needed for this fragment
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected DataBindingConfig getDataBindingConfig() {
|
||||||
|
// This is the key method that links the XML and fragment properly
|
||||||
|
return new DataBindingConfig(R.layout.fragment_inject_key, 0, null)
|
||||||
|
.addBindingParam(BR.click, new ClickEvent());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int currentId() {
|
||||||
|
return R.id.injectKeyFragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int hostId() {
|
||||||
|
return R.id.nav_host_fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int routeId() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
try {
|
||||||
|
|
||||||
|
// Get the binding from the base class - this is automatically created
|
||||||
|
binding = (FragmentInjectKeyBinding) mBinding;
|
||||||
|
|
||||||
|
updateConfigurationInfo();
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
|
||||||
|
setToolBarTitleWithBackIcon("Inject Key");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateConfigurationInfo() {
|
||||||
|
|
||||||
|
String terminalId = SystemParamsOperation.getInstance().getTerminalId();
|
||||||
|
binding.terminalIdValue.setText(terminalId != null && !terminalId.isEmpty() ?
|
||||||
|
terminalId : "Not configured");
|
||||||
|
|
||||||
|
// Update Merchant ID
|
||||||
|
String merchantId = SystemParamsOperation.getInstance().getMerchantId();
|
||||||
|
binding.merchantIdValue.setText(merchantId != null && !merchantId.isEmpty() ?
|
||||||
|
merchantId : "Not configured");
|
||||||
|
|
||||||
|
// Update Serial Number
|
||||||
|
String serialNo = TMSUtil.getInstance().getSerialNumber();
|
||||||
|
binding.serialNumberValue.setText(serialNo != null && !serialNo.isEmpty() ?
|
||||||
|
serialNo : "Not configured");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadKeyFromKeyPOS() {
|
||||||
|
try {
|
||||||
|
if (TextUtils.isEmpty(binding.etKeyIndex.getText())) {
|
||||||
|
Toast.makeText(getContext(), "Please input key index", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String keyIndexText = binding.etKeyIndex.getText().toString().trim();
|
||||||
|
|
||||||
|
try {
|
||||||
|
keyIndexTmp = Integer.parseInt(keyIndexText);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
Toast.makeText(getContext(), "Invalid key index format", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
showLoadingDialog("Loading key...");
|
||||||
|
|
||||||
|
mDownloadFlow = DownloadFlow.getInstance();
|
||||||
|
|
||||||
|
String terminalId = SystemParamsOperation.getInstance().getTerminalId();
|
||||||
|
String merchantId = SystemParamsOperation.getInstance().getMerchantId();
|
||||||
|
String serialNo = TMSUtil.getInstance().getSerialNumber();
|
||||||
|
|
||||||
|
// Validate configuration
|
||||||
|
if (TextUtils.isEmpty(terminalId) || TextUtils.isEmpty(merchantId) || TextUtils.isEmpty(serialNo)) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
showDeclineDialog("Please configure Terminal ID, Merchant ID first in TMS Configuration");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final DownloadFEntity downloadFEntity = new DownloadFEntity();
|
||||||
|
downloadFEntity.setSn(serialNo.getBytes());
|
||||||
|
downloadFEntity.setMid(merchantId.getBytes());
|
||||||
|
downloadFEntity.setTid(terminalId.getBytes());
|
||||||
|
downloadFEntity.setTmkIndex(keyIndexTmp);
|
||||||
|
downloadFEntity.setPort(0);
|
||||||
|
downloadFEntity.setTimeOut(10);
|
||||||
|
|
||||||
|
int result = mDownloadFlow.startLoadKey(getActivity(), downloadFEntity, onDownloadFlowProcessListener);
|
||||||
|
if (result != DownloadResult.Success) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
showDeclineDialog("Failed to start key injection process");
|
||||||
|
LogUtil.e(TAG, "Failed to start key injection, result: " + result);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
LogUtil.e(TAG, "Error in key injection: " + e.getMessage());
|
||||||
|
showDeclineDialog("Error occurred during key injection: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private DownloadFlowProcessListener onDownloadFlowProcessListener = new DownloadFlowProcessListener() {
|
||||||
|
@Override
|
||||||
|
public void onFinish(int ret, DownloadFlowResultEntity downloadFlowResultEntity) {
|
||||||
|
try {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
|
||||||
|
if (ret == DownloadResult.Success) {
|
||||||
|
// Show success dialog with key index
|
||||||
|
showSuccessDialog("Key injection successful!\nKey Index: " + keyIndexTmp);
|
||||||
|
LogUtil.d(TAG, "Key injection successful for index: " + keyIndexTmp);
|
||||||
|
} else {
|
||||||
|
// Show decline dialog
|
||||||
|
showDeclineDialog("Key injection failed!\nError code: " + ret);
|
||||||
|
LogUtil.e(TAG, "Key injection failed with error code: " + ret);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
LogUtil.e(TAG, "Error handling injection result: " + e.getMessage());
|
||||||
|
showDeclineDialog("Error processing injection result");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// ClickEvent class for data binding - this is the proper pattern
|
||||||
|
public class ClickEvent {
|
||||||
|
|
||||||
|
public void onInjectKeyClick() {
|
||||||
|
try {
|
||||||
|
LogUtil.d(TAG, "Inject key button clicked");
|
||||||
|
loadKeyFromKeyPOS();
|
||||||
|
} catch (Exception e) {
|
||||||
|
LogUtil.e(TAG, "Error in inject key click: " + e.getMessage());
|
||||||
|
showDeclineDialog("Error occurred: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -8,7 +8,9 @@ import androidx.annotation.NonNull;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.lifecycle.Observer;
|
import androidx.lifecycle.Observer;
|
||||||
|
|
||||||
|
import com.utsmm.kbz.util.EReceiptUtil;
|
||||||
import com.utsmyanmar.baselib.fragment.DataBindingFragment;
|
import com.utsmyanmar.baselib.fragment.DataBindingFragment;
|
||||||
|
import com.utsmyanmar.baselib.network.model.e_receipt.EReceiptRequest;
|
||||||
import com.utsmyanmar.baselib.util.DataBindingConfig;
|
import com.utsmyanmar.baselib.util.DataBindingConfig;
|
||||||
import com.utsmyanmar.paylibs.model.PayDetail;
|
import com.utsmyanmar.paylibs.model.PayDetail;
|
||||||
import com.utsmyanmar.paylibs.model.TradeData;
|
import com.utsmyanmar.paylibs.model.TradeData;
|
||||||
@ -316,7 +318,9 @@ public class SettlementTransactionFragment extends DataBindingFragment implement
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
updateData();
|
updateData();
|
||||||
if (!SystemParamsOperation.getInstance().getDemoStatus()) {
|
if (!SystemParamsOperation.getInstance().getDemoStatus()) {
|
||||||
networkCutOver();
|
|
||||||
|
networkCutOver(); // bpc
|
||||||
|
navigateToNext();
|
||||||
} else {
|
} else {
|
||||||
navigateToNext();
|
navigateToNext();
|
||||||
}
|
}
|
||||||
@ -336,6 +340,10 @@ public class SettlementTransactionFragment extends DataBindingFragment implement
|
|||||||
|
|
||||||
private void updateData() {
|
private void updateData() {
|
||||||
sharedViewModel.payDetail.setValue(settlementViewModel.getPayDetail());
|
sharedViewModel.payDetail.setValue(settlementViewModel.getPayDetail());
|
||||||
|
|
||||||
|
EReceiptRequest request = EReceiptUtil.getInstance().generateMPUReceipt(sharedViewModel.payDetail.getValue());
|
||||||
|
|
||||||
|
sharedViewModel.pushReceipt(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -7,6 +7,8 @@ import androidx.lifecycle.LiveData;
|
|||||||
import androidx.lifecycle.MutableLiveData;
|
import androidx.lifecycle.MutableLiveData;
|
||||||
import androidx.lifecycle.ViewModel;
|
import androidx.lifecycle.ViewModel;
|
||||||
|
|
||||||
|
import com.utsmm.kbz.util.EReceiptUtil;
|
||||||
|
import com.utsmyanmar.baselib.network.model.e_receipt.EReceiptRequest;
|
||||||
import com.utsmyanmar.baselib.repo.Repository;
|
import com.utsmyanmar.baselib.repo.Repository;
|
||||||
import com.utsmyanmar.paylibs.Constant;
|
import com.utsmyanmar.paylibs.Constant;
|
||||||
import com.utsmyanmar.paylibs.batch_upload.BatchListener;
|
import com.utsmyanmar.paylibs.batch_upload.BatchListener;
|
||||||
@ -361,14 +363,26 @@ public class SettlementViewModel extends ViewModel {
|
|||||||
payDetail = tradeData.getPayDetail();
|
payDetail = tradeData.getPayDetail();
|
||||||
|
|
||||||
|
|
||||||
bitmap = BitmapConfig.BPC_SETTLEMENT;
|
//
|
||||||
|
if(hostName == HostName.BPC) {
|
||||||
|
bitmap = BitmapConfig.BPC_SETTLEMENT;
|
||||||
|
} else {
|
||||||
|
bitmap = BitmapConfig.MPU_NEW_SETTLE;
|
||||||
|
}
|
||||||
|
|
||||||
payDetail.setTransType(TransactionsType.SETTLEMENT.name);
|
payDetail.setTransType(TransactionsType.SETTLEMENT.name);
|
||||||
payDetail.setTransactionType(TransactionType.SETTLEMENT);
|
payDetail.setTransactionType(TransactionType.SETTLEMENT);
|
||||||
if (!flag) {
|
if (!flag) {
|
||||||
payDetail.setProcessCode(TransactionsType.SETTLEMENT.processCode);
|
payDetail.setProcessCode(TransactionsType.SETTLEMENT.processCode);
|
||||||
} else {
|
} else {
|
||||||
bitmap = BitmapConfig.BPC_SETTLEMENT_TRAILER;
|
if(hostName == HostName.BPC) {
|
||||||
payDetail.setProcessCode("910000");
|
bitmap = BitmapConfig.BPC_SETTLEMENT_TRAILER;
|
||||||
|
payDetail.setProcessCode("910000");
|
||||||
|
} else {
|
||||||
|
bitmap = BitmapConfig.MPU_NEW_SETTLE;
|
||||||
|
payDetail.setProcessCode("960000");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CA:CA - CD - FT
|
// CA:CA - CD - FT
|
||||||
@ -403,7 +417,8 @@ public class SettlementViewModel extends ViewModel {
|
|||||||
payDetail.setSettleData(settlementData);
|
payDetail.setSettleData(settlementData);
|
||||||
payDetail.setAmount(totalAmount);
|
payDetail.setAmount(totalAmount);
|
||||||
} else {
|
} else {
|
||||||
payDetail.setSettleData(totalSaleCount + totalSaleAmount + totalRefundCount + totalRefundAmount + totalDebitSaleCount + totalDebitSaleAmount + totalERefundCount + totalERefundAmount); //field 63
|
// payDetail.setSettleData(totalSaleCount + totalSaleAmount + totalRefundCount + totalRefundAmount + totalDebitSaleCount + totalDebitSaleAmount + totalERefundCount + totalERefundAmount); //field 63 BPC
|
||||||
|
payDetail.setSettleData(totalSaleCount + totalSaleAmount + totalRefundCount + totalRefundAmount + totalDebitSaleCount + totalDebitSaleAmount ); //field 63
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -486,8 +501,12 @@ public class SettlementViewModel extends ViewModel {
|
|||||||
// to leave data for testing
|
// to leave data for testing
|
||||||
// if (settlementType.getValue() == SettlementType.NORMAL) {
|
// if (settlementType.getValue() == SettlementType.NORMAL) {
|
||||||
updateDB();
|
updateDB();
|
||||||
|
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
insertPayDetail(payDetail);
|
insertPayDetail(payDetail);
|
||||||
|
|
||||||
if (errorFlag) {
|
if (errorFlag) {
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import androidx.annotation.Nullable;
|
|||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.stream.MalformedJsonException;
|
import com.google.gson.stream.MalformedJsonException;
|
||||||
|
import com.utsmm.kbz.service.AutoAlarmReceiver;
|
||||||
import com.utsmyanmar.baselib.fragment.DataBindingFragment;
|
import com.utsmyanmar.baselib.fragment.DataBindingFragment;
|
||||||
import com.utsmyanmar.baselib.network.model.sirius.SiriusError;
|
import com.utsmyanmar.baselib.network.model.sirius.SiriusError;
|
||||||
import com.utsmyanmar.baselib.network.model.sirius.SiriusRequest;
|
import com.utsmyanmar.baselib.network.model.sirius.SiriusRequest;
|
||||||
@ -213,6 +214,7 @@ public class TMSProcessFragment extends DataBindingFragment {
|
|||||||
CurrencyType currencyType = SystemParamsOperation.getInstance().getCurrencyType();
|
CurrencyType currencyType = SystemParamsOperation.getInstance().getCurrencyType();
|
||||||
sharedViewModel.set_currencyText(currencyType.name);
|
sharedViewModel.set_currencyText(currencyType.name);
|
||||||
// tmsProcessViewModel.loadEmvParameters();
|
// tmsProcessViewModel.loadEmvParameters();
|
||||||
|
// scheduleAutoSettlement();
|
||||||
navigateToMain();
|
navigateToMain();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -224,4 +226,48 @@ public class TMSProcessFragment extends DataBindingFragment {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void scheduleAutoSettlement() {
|
||||||
|
String timeStr = SystemParamsOperation.getInstance().getClearBatchTime();
|
||||||
|
if(timeStr == null || timeStr.trim().isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String[] parts = timeStr.trim().split(":");
|
||||||
|
if(parts.length != 2) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int hour;
|
||||||
|
int minute;
|
||||||
|
try {
|
||||||
|
hour = Integer.parseInt(parts[0]);
|
||||||
|
minute = Integer.parseInt(parts[1]);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
android.app.AlarmManager alarmManager = (android.app.AlarmManager) requireContext().getSystemService(android.content.Context.ALARM_SERVICE);
|
||||||
|
if(alarmManager == null) return;
|
||||||
|
|
||||||
|
java.util.Calendar calendar = java.util.Calendar.getInstance();
|
||||||
|
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||||
|
calendar.set(java.util.Calendar.HOUR_OF_DAY, hour);
|
||||||
|
calendar.set(java.util.Calendar.MINUTE, minute);
|
||||||
|
calendar.set(java.util.Calendar.SECOND, 0);
|
||||||
|
|
||||||
|
long triggerAtMillis = calendar.getTimeInMillis();
|
||||||
|
if(System.currentTimeMillis() > triggerAtMillis) {
|
||||||
|
calendar.add(java.util.Calendar.DAY_OF_YEAR, 1);
|
||||||
|
triggerAtMillis = calendar.getTimeInMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
android.content.Intent intent = new android.content.Intent(requireContext(), AutoAlarmReceiver.class);
|
||||||
|
android.app.PendingIntent pendingIntent = android.app.PendingIntent.getBroadcast(
|
||||||
|
requireContext(),
|
||||||
|
1001,
|
||||||
|
intent,
|
||||||
|
android.app.PendingIntent.FLAG_UPDATE_CURRENT
|
||||||
|
);
|
||||||
|
|
||||||
|
alarmManager.setRepeating(android.app.AlarmManager.RTC_WAKEUP, triggerAtMillis, android.app.AlarmManager.INTERVAL_DAY, pendingIntent);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
184
app/src/main/java/com/utsmm/kbz/util/EReceiptUtil.java
Normal file
184
app/src/main/java/com/utsmm/kbz/util/EReceiptUtil.java
Normal file
@ -0,0 +1,184 @@
|
|||||||
|
package com.utsmm.kbz.util;
|
||||||
|
|
||||||
|
import com.utsmm.kbz.BuildConfig;
|
||||||
|
import com.utsmm.kbz.util.enums.TransResultStatus;
|
||||||
|
import com.utsmm.kbz.util.tms.TMSUtil;
|
||||||
|
import com.utsmyanmar.baselib.network.model.e_receipt.EReceiptRequest;
|
||||||
|
import com.utsmyanmar.paylibs.model.PayDetail;
|
||||||
|
import com.utsmyanmar.paylibs.model.SettleData;
|
||||||
|
import com.utsmyanmar.paylibs.system.BaseErrorCode;
|
||||||
|
import com.utsmyanmar.paylibs.utils.POSUtil;
|
||||||
|
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation;
|
||||||
|
import com.utsmyanmar.paylibs.utils.iso_utils.TransactionsType;
|
||||||
|
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
|
||||||
|
public class EReceiptUtil {
|
||||||
|
|
||||||
|
private static EReceiptUtil instance;
|
||||||
|
|
||||||
|
|
||||||
|
public static EReceiptUtil getInstance(){
|
||||||
|
|
||||||
|
instance = new EReceiptUtil();
|
||||||
|
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private String terminalId;
|
||||||
|
private String merchantId;
|
||||||
|
private String traceNo;
|
||||||
|
private String invoiceNo;
|
||||||
|
private String serialNum;
|
||||||
|
private String batchNumber;
|
||||||
|
|
||||||
|
private String packageName;
|
||||||
|
private EReceiptUtil(){
|
||||||
|
terminalId = SystemParamsOperation.getInstance().getTerminalId();
|
||||||
|
merchantId = SystemParamsOperation.getInstance().getMerchantId();
|
||||||
|
traceNo = SystemParamsOperation.getInstance().getCurrentSerialNum();
|
||||||
|
invoiceNo = SystemParamsOperation.getInstance().getCurrentInvoiceNum();
|
||||||
|
batchNumber = SystemParamsOperation.getInstance().getCurrentBatchNum();
|
||||||
|
serialNum = TMSUtil.getInstance().getSerialNumber();
|
||||||
|
packageName = BuildConfig.APPLICATION_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EReceiptRequest generateQRReceipt(PayDetail payDetail, TransResultStatus status) {
|
||||||
|
|
||||||
|
double realAmount = payDetail.getAmount() / 100.0;
|
||||||
|
DecimalFormat df = new DecimalFormat("0.00");
|
||||||
|
String amount = df.format(realAmount);
|
||||||
|
|
||||||
|
String currentTimeStamp = new java.text.SimpleDateFormat("MMddHHmmss", java.util.Locale.getDefault())
|
||||||
|
.format(new java.util.Date());
|
||||||
|
EReceiptRequest request = new EReceiptRequest();
|
||||||
|
request.setDE3("QR");
|
||||||
|
|
||||||
|
request.setDE7(currentTimeStamp);
|
||||||
|
request.setDE37(payDetail.getReferNo());
|
||||||
|
|
||||||
|
request.setDE49("MMK");
|
||||||
|
request.setSerial(serialNum);
|
||||||
|
request.setAppId(packageName);
|
||||||
|
request.setDE41(terminalId);
|
||||||
|
request.setDE42(merchantId);
|
||||||
|
request.setInvoiceNumber(payDetail.getInvoiceNo());
|
||||||
|
request.setDE11(payDetail.getVoucherNo());
|
||||||
|
|
||||||
|
// need to add payment identifier field too
|
||||||
|
|
||||||
|
if(status == TransResultStatus.SUCCESS) {
|
||||||
|
request.setDE4(amount);
|
||||||
|
request.setDescription("qr pay success");
|
||||||
|
request.setDE39("A");
|
||||||
|
} else if(status == TransResultStatus.TIME_OUT) {
|
||||||
|
request.setDE4("0");
|
||||||
|
request.setDescription("qr timeout");
|
||||||
|
request.setDE39("D");
|
||||||
|
} else if(status == TransResultStatus.FAIL) {
|
||||||
|
request.setDE4("0");
|
||||||
|
request.setDescription("qr failed");
|
||||||
|
request.setDE39("E");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return request;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EReceiptRequest generateMPUReceipt(PayDetail payDetail) {
|
||||||
|
|
||||||
|
double realAmount = payDetail.getAmount() / 100.0;
|
||||||
|
DecimalFormat df = new DecimalFormat("0.00");
|
||||||
|
String amount = df.format(realAmount);
|
||||||
|
|
||||||
|
String currentTimeStamp = new java.text.SimpleDateFormat("MMddHHmmss", java.util.Locale.getDefault())
|
||||||
|
.format(new java.util.Date());
|
||||||
|
EReceiptRequest request = new EReceiptRequest();
|
||||||
|
|
||||||
|
request.setDE3(convertTransactionType(payDetail.getTransactionType()));
|
||||||
|
request.setDE7(currentTimeStamp);
|
||||||
|
request.setDE11(payDetail.getVoucherNo());
|
||||||
|
|
||||||
|
if(payDetail.getTransactionType() == TransactionsType.SETTLEMENT.value) {
|
||||||
|
SettleData settleData = payDetail.getSettleDataObj();
|
||||||
|
|
||||||
|
long totalAmt = settleData.getSaleAmount() + settleData.getRefundAmount() + settleData.getPreAuthCompAmount() + settleData.getCashAdvanceAmount();
|
||||||
|
double realTotalAmount = totalAmt / 100.0;
|
||||||
|
String totalAmount = df.format(realTotalAmount);
|
||||||
|
request.setDE4(totalAmount);
|
||||||
|
|
||||||
|
|
||||||
|
request.setDE63_01(settleData.getSaleCount()+"");
|
||||||
|
request.setDE63_02(settleData.getSaleAmount()+"");
|
||||||
|
request.setDE63_03(settleData.getRefundCount()+"");
|
||||||
|
request.setDE63_04(settleData.getRefundAmount()+"");
|
||||||
|
request.setDE63_05(settleData.getPreAuthCompCount()+"");
|
||||||
|
request.setDE63_06(settleData.getPreAuthCompAmount()+"");
|
||||||
|
request.setDE63_07(settleData.getCashAdvanceCount()+"");
|
||||||
|
request.setDE63_08(settleData.getCashAdvanceAmount()+"");
|
||||||
|
invoiceNo = SystemParamsOperation.getInstance().getIncrementInvoiceNum();
|
||||||
|
request.setBatchNumber(batchNumber);
|
||||||
|
request.setInvoiceNumber(invoiceNo);
|
||||||
|
request.setDescription("success");
|
||||||
|
request.setDE39("A");
|
||||||
|
request.setDE37("0000");
|
||||||
|
request.setDE49("MMK");
|
||||||
|
} else {
|
||||||
|
request.setDE2(POSUtil.getInstance().getCardNumMasking(payDetail.getCardNo()));
|
||||||
|
|
||||||
|
request.setDE4(amount);
|
||||||
|
|
||||||
|
|
||||||
|
request.setDE37(payDetail.getReferNo());
|
||||||
|
request.setDE38(payDetail.getApprovalCode());
|
||||||
|
// will check it later for currency code
|
||||||
|
request.setDE49("MMK");
|
||||||
|
request.setInvoiceNumber(payDetail.getInvoiceNo());
|
||||||
|
request.setCardLabel("MPU");
|
||||||
|
|
||||||
|
if(payDetail.getTradeAnswerCode().equals("000") || payDetail.getTradeAnswerCode().equals("00") ) {
|
||||||
|
|
||||||
|
request.setDescription("success");
|
||||||
|
request.setDE39("A");
|
||||||
|
} else {
|
||||||
|
request.setDescription(BaseErrorCode.getErrorMessage(payDetail.getTradeAnswerCode()));
|
||||||
|
request.setDE39("E");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
request.setDE41(terminalId);
|
||||||
|
request.setDE42(merchantId);
|
||||||
|
|
||||||
|
request.setSerial(serialNum);
|
||||||
|
request.setAppId(packageName);
|
||||||
|
|
||||||
|
return request;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String convertTransactionType(int transactionType) {
|
||||||
|
if(transactionType == TransactionsType.SALE.value) {
|
||||||
|
return "S";
|
||||||
|
} else if(transactionType == TransactionsType.VOID.value) {
|
||||||
|
return "V";
|
||||||
|
} else if(transactionType == TransactionsType.PRE_AUTH_SALE.value) {
|
||||||
|
return "P";
|
||||||
|
} else if(transactionType == TransactionsType.PRE_AUTH_VOID.value) {
|
||||||
|
return "PV";
|
||||||
|
} else if(transactionType == TransactionsType.PRE_AUTH_COMPLETE.value) {
|
||||||
|
return "PC";
|
||||||
|
} else if(transactionType == TransactionsType.PRE_AUTH_COMPLETE_VOID.value) {
|
||||||
|
return "PCV";
|
||||||
|
} else if(transactionType == TransactionsType.CASH_OUT.value) {
|
||||||
|
return "CAV";
|
||||||
|
} else if(transactionType == TransactionsType.REFUND.value) {
|
||||||
|
return "R";
|
||||||
|
} else if(transactionType == TransactionsType.SETTLEMENT.value) {
|
||||||
|
return "ST";
|
||||||
|
}
|
||||||
|
return "E";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1,6 +1,7 @@
|
|||||||
package com.utsmm.kbz.util;
|
package com.utsmm.kbz.util;
|
||||||
|
|
||||||
import com.sunmi.pay.hardware.aidlv2.AidlConstantsV2;
|
import com.sunmi.pay.hardware.aidlv2.AidlConstantsV2;
|
||||||
|
import com.utsmyanmar.checkxread.model.CardDataX;
|
||||||
import com.utsmyanmar.paylibs.model.CardInfo;
|
import com.utsmyanmar.paylibs.model.CardInfo;
|
||||||
import com.utsmyanmar.paylibs.model.ICCardInfo;
|
import com.utsmyanmar.paylibs.model.ICCardInfo;
|
||||||
import com.utsmyanmar.paylibs.model.MAGCardInfo;
|
import com.utsmyanmar.paylibs.model.MAGCardInfo;
|
||||||
@ -42,15 +43,42 @@ public class MockData {
|
|||||||
// .cardScheme("VISA")
|
// .cardScheme("VISA")
|
||||||
// .cardHolderName("U AYE")
|
// .cardHolderName("U AYE")
|
||||||
// .iccData("5F21BLAHBLAH")
|
// .iccData("5F21BLAHBLAH")
|
||||||
|
// .build();
|
||||||
|
|
||||||
|
// mockCardData = new MockCardData.Builder()
|
||||||
|
// .cardNo("9503051034047056")
|
||||||
|
// .expDate("3002")
|
||||||
|
// .cardScheme("MPU")
|
||||||
|
// .cardHolderName("KBZ Debit")
|
||||||
|
// .iccData("9503051034047056=30021015930000000000")
|
||||||
// .build();
|
// .build();
|
||||||
|
|
||||||
mockCardData = new MockCardData.Builder()
|
mockCardData = new MockCardData.Builder()
|
||||||
.cardNo("9503190006079422")
|
.cardNo("9505050161133125")
|
||||||
.expDate("0725")
|
.expDate("2701")
|
||||||
.cardScheme("MPU")
|
.cardScheme("MPU")
|
||||||
.cardHolderName("YOMA VALUED CUSTOMER")
|
.cardHolderName("KBZ Credit")
|
||||||
|
.iccData("9505050161133125=27011017250000000000")
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
// mockCardData = new MockCardData.Builder()
|
||||||
|
// .cardNo("9503712156912514")
|
||||||
|
// .expDate("2912")
|
||||||
|
// .cardScheme("MPU")
|
||||||
|
// .cardHolderName("Htin Kyaw Win")
|
||||||
|
// .iccData("9503712156912514=29121010000000000000")
|
||||||
|
// .build();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// mockCardData = new MockCardData.Builder()
|
||||||
|
// .cardNo("9503742975107251")
|
||||||
|
// .expDate("0629")
|
||||||
|
// .cardScheme("MPU")
|
||||||
|
// .cardHolderName("Bank Q")
|
||||||
|
// .iccData("9503742975107251=22081010000000000000")
|
||||||
|
// .build();
|
||||||
|
|
||||||
// mockCardData = new MockCardData.Builder()
|
// mockCardData = new MockCardData.Builder()
|
||||||
// .phoneNo("9794452506")
|
// .phoneNo("9794452506")
|
||||||
// .expDate("0425")
|
// .expDate("0425")
|
||||||
@ -74,6 +102,15 @@ public class MockData {
|
|||||||
return String.valueOf(randomNumber);
|
return String.valueOf(randomNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CardDataX generateMPUCard() {
|
||||||
|
CardDataX cardDataX = new CardDataX();
|
||||||
|
cardDataX.setPan(mockCardData.getCardNo());
|
||||||
|
cardDataX.setExp(mockCardData.getExpDate());
|
||||||
|
cardDataX.setCardHolderName(mockCardData.getCardHolderName());
|
||||||
|
cardDataX.setTrack2(mockCardData.getIccData());
|
||||||
|
return cardDataX;
|
||||||
|
}
|
||||||
|
|
||||||
public TradeData generateMockDataWithTime(TransactionsType transType,int cardInputType,String transDate,String transTime) {
|
public TradeData generateMockDataWithTime(TransactionsType transType,int cardInputType,String transDate,String transTime) {
|
||||||
String strDate = SystemDateTime.getMMDD();
|
String strDate = SystemDateTime.getMMDD();
|
||||||
String strTime = SystemDateTime.getHHmmss();
|
String strTime = SystemDateTime.getHHmmss();
|
||||||
|
|||||||
@ -26,6 +26,7 @@ public enum TransResultStatus {
|
|||||||
RETRY_AGAIN,
|
RETRY_AGAIN,
|
||||||
NEXT_SCREEN,
|
NEXT_SCREEN,
|
||||||
EMPTY_PIN,
|
EMPTY_PIN,
|
||||||
NETWORK_ERROR
|
NETWORK_ERROR,
|
||||||
|
TIME_OUT
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import com.utsmyanmar.baselib.network.model.sirius.SiriusMerchant;
|
|||||||
import com.utsmyanmar.baselib.network.model.sirius.SiriusProperty;
|
import com.utsmyanmar.baselib.network.model.sirius.SiriusProperty;
|
||||||
import com.utsmyanmar.baselib.network.model.sirius.SiriusResponse;
|
import com.utsmyanmar.baselib.network.model.sirius.SiriusResponse;
|
||||||
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation;
|
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation;
|
||||||
|
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsSettings;
|
||||||
import com.utsmyanmar.paylibs.utils.enums.CurrencyType;
|
import com.utsmyanmar.paylibs.utils.enums.CurrencyType;
|
||||||
|
|
||||||
import com.utsmm.kbz.BuildConfig;
|
import com.utsmm.kbz.BuildConfig;
|
||||||
@ -170,7 +171,7 @@ public class TMSSetupsImpl implements TMSSetups{
|
|||||||
|
|
||||||
for (SiriusHost siriusHost: siriusHosts) {
|
for (SiriusHost siriusHost: siriusHosts) {
|
||||||
|
|
||||||
if( siriusHost.getName().toLowerCase().contains("mmqr") || siriusHost.getName().toLowerCase().contains("kbzpay") || siriusHost.getDescription().toLowerCase().contains("mmqr") || siriusHost.getDescription().toLowerCase().contains("qr")) {
|
if( siriusHost.getName().toLowerCase().contains("mmqr") || siriusHost.getName().toLowerCase().contains("kbzpay") || siriusHost.getName().toLowerCase().contains("mmqr") || siriusHost.getName().toLowerCase().contains("qr")) {
|
||||||
|
|
||||||
SystemParamsOperation.getInstance().setSecHostName(siriusHost.getName());
|
SystemParamsOperation.getInstance().setSecHostName(siriusHost.getName());
|
||||||
SystemParamsOperation.getInstance().setSecHostTerminalId(siriusHost.getTid());
|
SystemParamsOperation.getInstance().setSecHostTerminalId(siriusHost.getTid());
|
||||||
@ -236,15 +237,21 @@ public class TMSSetupsImpl implements TMSSetups{
|
|||||||
} else if(siriusHost.getPrimaryIP().trim().isEmpty()) {
|
} else if(siriusHost.getPrimaryIP().trim().isEmpty()) {
|
||||||
SystemParamsOperation.getInstance().setIpAddress("");
|
SystemParamsOperation.getInstance().setIpAddress("");
|
||||||
}
|
}
|
||||||
|
String secondaryIp = siriusHost.getSecondaryIP();
|
||||||
if (siriusHost.getSecondaryIP().contains(":")) {
|
if(secondaryIp == null || secondaryIp.trim().isEmpty()){
|
||||||
|
|
||||||
SystemParamsOperation.getInstance().setSecIpAddress(siriusHost.getSecondaryIP().trim());
|
|
||||||
|
|
||||||
} else if(siriusHost.getSecondaryIP().trim().isEmpty()){
|
|
||||||
SystemParamsOperation.getInstance().setSecIpAddress("");
|
SystemParamsOperation.getInstance().setSecIpAddress("");
|
||||||
|
}else if(secondaryIp.contains(":")){
|
||||||
|
SystemParamsOperation.getInstance().setSecIpAddress(secondaryIp.trim());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if (siriusHost.getSecondaryIP().contains(":")) {
|
||||||
|
//
|
||||||
|
// SystemParamsOperation.getInstance().setSecIpAddress(siriusHost.getSecondaryIP().trim());
|
||||||
|
//
|
||||||
|
// } else if(siriusHost.getSecondaryIP().trim().isEmpty()){
|
||||||
|
// SystemParamsOperation.getInstance().setSecIpAddress("");
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
if (!siriusHost.getCurrency().isEmpty()) {
|
if (!siriusHost.getCurrency().isEmpty()) {
|
||||||
SystemParamsOperation.getInstance().setCurrencyType(currencyTextToCurrencyType(siriusHost.getCurrency()));
|
SystemParamsOperation.getInstance().setCurrencyType(currencyTextToCurrencyType(siriusHost.getCurrency()));
|
||||||
@ -412,15 +419,18 @@ public class TMSSetupsImpl implements TMSSetups{
|
|||||||
} else if (TextUtils.equals(name,"ssl_enable")) {
|
} else if (TextUtils.equals(name,"ssl_enable")) {
|
||||||
|
|
||||||
SystemParamsOperation.getInstance().setSslSwitchStatus(parseBoolean(data));
|
SystemParamsOperation.getInstance().setSslSwitchStatus(parseBoolean(data));
|
||||||
} else if (TextUtils.equals(name,"wave_pay_inquiry_status_enable")) {
|
} else if (TextUtils.equals(name,"qrpay_inquiry_status_enable")) {
|
||||||
|
|
||||||
SystemParamsOperation.getInstance().setWavePayInquiryStatus(parseBoolean(data));
|
SystemParamsOperation.getInstance().setQRPayInquiryStatus(parseBoolean(data));
|
||||||
} else if (TextUtils.equals(name,"tips_adjustment_enable")) {
|
} else if (TextUtils.equals(name,"tips_adjustment_enable")) {
|
||||||
|
|
||||||
SystemParamsOperation.getInstance().setTipsAdjustmentStatus(parseBoolean(data));
|
SystemParamsOperation.getInstance().setTipsAdjustmentStatus(parseBoolean(data));
|
||||||
} else if (TextUtils.equals(name,"wave_enable")) {
|
} else if (TextUtils.equals(name,"qrpay_enable")) {
|
||||||
|
|
||||||
SystemParamsOperation.getInstance().setWavePayStatus(parseBoolean(data));
|
SystemParamsOperation.getInstance().setQRPayStatus(parseBoolean(data));
|
||||||
|
} else if(TextUtils.equals(name, "mmqr_interval_waiting_time")){
|
||||||
|
|
||||||
|
SystemParamsOperation.getInstance().setWaveIntervalTime(data);
|
||||||
} else if (TextUtils.equals(name,"print_iso_enable")) {
|
} else if (TextUtils.equals(name,"print_iso_enable")) {
|
||||||
|
|
||||||
SystemParamsOperation.getInstance().setPrintISOStatus(parseBoolean(data));
|
SystemParamsOperation.getInstance().setPrintISOStatus(parseBoolean(data));
|
||||||
@ -582,11 +592,14 @@ public class TMSSetupsImpl implements TMSSetups{
|
|||||||
}
|
}
|
||||||
} else if (TextUtils.equals(name,"speedup_contactless_enable")) {
|
} else if (TextUtils.equals(name,"speedup_contactless_enable")) {
|
||||||
SystemParamsOperation.getInstance().setSpeedUpContactless(parseBoolean(data));
|
SystemParamsOperation.getInstance().setSpeedUpContactless(parseBoolean(data));
|
||||||
}
|
} else if (TextUtils.equals(name,"manual_entry_pin_enable")) {
|
||||||
else if (TextUtils.equals(name,"manual_entry_pin_enable")) {
|
|
||||||
SystemParamsOperation.getInstance().setManualEntryPinEnable(parseBoolean(data));
|
SystemParamsOperation.getInstance().setManualEntryPinEnable(parseBoolean(data));
|
||||||
} else if (TextUtils.equals(name,"decimal_enable")) {
|
} else if (TextUtils.equals(name,"decimal_enable")) {
|
||||||
SystemParamsOperation.getInstance().setDecimalEnable(parseBoolean(data));
|
SystemParamsOperation.getInstance().setDecimalEnable(parseBoolean(data));
|
||||||
|
} else if (TextUtils.equals(name,"app_key")) {
|
||||||
|
SystemParamsOperation.getInstance().setAppKey(data);
|
||||||
|
} else if (TextUtils.equals(name,"app_id")) {
|
||||||
|
SystemParamsOperation.getInstance().setAppId(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -683,8 +696,8 @@ public class TMSSetupsImpl implements TMSSetups{
|
|||||||
int value = Integer.parseInt(data);
|
int value = Integer.parseInt(data);
|
||||||
return value == 1;
|
return value == 1;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
// e.printStackTrace();
|
||||||
return false;
|
return Boolean.parseBoolean(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -147,7 +147,8 @@ public class TMSUtil {
|
|||||||
siriusRequest.setApplicationVersion(BuildConfig.VERSION_NAME);
|
siriusRequest.setApplicationVersion(BuildConfig.VERSION_NAME);
|
||||||
siriusRequest.setCurrentNetwork(getNetworkType(context));
|
siriusRequest.setCurrentNetwork(getNetworkType(context));
|
||||||
siriusRequest.setLastTransaction(lastTransName);
|
siriusRequest.setLastTransaction(lastTransName);
|
||||||
siriusRequest.setLastTranTime(lastTransTime);
|
siriusRequest.setLastTranTime(Long.parseLong(lastTransTime));
|
||||||
|
siriusRequest.setValue("YourValueHere");
|
||||||
|
|
||||||
return siriusRequest;
|
return siriusRequest;
|
||||||
}
|
}
|
||||||
@ -206,17 +207,16 @@ public class TMSUtil {
|
|||||||
voidStatus = SystemParamsOperation.getInstance().getVoidStatus();
|
voidStatus = SystemParamsOperation.getInstance().getVoidStatus();
|
||||||
cashAdvanceStatus = SystemParamsOperation.getInstance().getCashAdvanceStatus();
|
cashAdvanceStatus = SystemParamsOperation.getInstance().getCashAdvanceStatus();
|
||||||
refundStatus = SystemParamsOperation.getInstance().getRefundStatus();
|
refundStatus = SystemParamsOperation.getInstance().getRefundStatus();
|
||||||
wavePayInquiryStatus = SystemParamsOperation.getInstance().getWavePayInquiryStatus();
|
wavePayInquiryStatus = SystemParamsOperation.getInstance().getQRPayInquiryStatus();
|
||||||
tipAdjustmentStatus = SystemParamsOperation.getInstance().getTipsAdjustmentStatus();
|
tipAdjustmentStatus = SystemParamsOperation.getInstance().getTipsAdjustmentStatus();
|
||||||
settlementStatus = SystemParamsOperation.getInstance().getSettlementStatus();
|
settlementStatus = SystemParamsOperation.getInstance().getSettlementStatus();
|
||||||
|
|
||||||
featuresList.add(new Features(2, fragmentActivity.getString(R.string.menu_sale_void), R.drawable.ic_void_dash, FeaturesType.VOID, voidStatus));
|
featuresList.add(new Features(2, fragmentActivity.getString(R.string.menu_sale_void), R.drawable.ic_void_dash, FeaturesType.VOID, voidStatus));
|
||||||
featuresList.add(new Features(2, fragmentActivity.getString(R.string.menu_settlement), R.drawable.ic_settlement, FeaturesType.SETTLEMENT, settlementStatus));
|
// featuresList.add(new Features(2, fragmentActivity.getString(R.string.menu_settlement), R.drawable.ic_settlement, FeaturesType.SETTLEMENT, settlementStatus));
|
||||||
featuresList.add(new Features(4, fragmentActivity.getString(R.string.menu_refund), R.drawable.ic_refund, FeaturesType.REFUND, refundStatus));
|
featuresList.add(new Features(4, fragmentActivity.getString(R.string.menu_refund), R.drawable.ic_refund, FeaturesType.REFUND, refundStatus));
|
||||||
featuresList.add(new Features(3, fragmentActivity.getString(R.string.menu_preauth), R.drawable.ic_pre_auth_dash, FeaturesType.PRE_AUTH_SALE, preAuthStatus));
|
featuresList.add(new Features(3, fragmentActivity.getString(R.string.menu_preauth), R.drawable.ic_pre_auth_dash, FeaturesType.PRE_AUTH_SALE, preAuthStatus));
|
||||||
featuresList.add(new Features(6, fragmentActivity.getString(R.string.menu_preauth_cancellation), R.drawable.ic_pre_auth_dash, FeaturesType.PRE_AUTH_VOID, preAuthCancelStatus));
|
featuresList.add(new Features(6, fragmentActivity.getString(R.string.menu_preauth_cancellation), R.drawable.ic_pre_auth_dash, FeaturesType.PRE_AUTH_VOID, preAuthCancelStatus));
|
||||||
featuresList.add(new Features(6, fragmentActivity.getString(R.string.menu_preauth_completion), R.drawable.ic_pre_auth_dash, FeaturesType.PRE_AUTH_COMPLETE, preAuthCompleteStatus));
|
featuresList.add(new Features(6, fragmentActivity.getString(R.string.menu_preauth_completion), R.drawable.ic_pre_auth_dash, FeaturesType.PRE_AUTH_COMPLETE, preAuthCompleteStatus));
|
||||||
featuresList.add(new Features(6, fragmentActivity.getString(R.string.menu_preauth_comp_cancellation), R.drawable.ic_pre_auth_dash, FeaturesType.PRE_AUTH_COMPLETE_VOID, preAuthCompleteCancelStatus));
|
|
||||||
// featuresList.add(new Features(5, fragmentActivity.getString(R.string.menu_wavepay_inquiry), R.drawable.ic_wave_status_dash, FeaturesType.WAVE_PAY_INQUIRY, wavePayInquiryStatus));
|
// featuresList.add(new Features(5, fragmentActivity.getString(R.string.menu_wavepay_inquiry), R.drawable.ic_wave_status_dash, FeaturesType.WAVE_PAY_INQUIRY, wavePayInquiryStatus));
|
||||||
featuresList.add(new Features(1, fragmentActivity.getString(R.string.menu_cash_advance), R.drawable.ic_cash_advance, FeaturesType.CASH_ADVANCE, cashAdvanceStatus));
|
featuresList.add(new Features(1, fragmentActivity.getString(R.string.menu_cash_advance), R.drawable.ic_cash_advance, FeaturesType.CASH_ADVANCE, cashAdvanceStatus));
|
||||||
featuresList.add(new Features(9, fragmentActivity.getString(R.string.menu_history), R.drawable.ic_history, FeaturesType.HISTORY, true));
|
featuresList.add(new Features(9, fragmentActivity.getString(R.string.menu_history), R.drawable.ic_history, FeaturesType.HISTORY, true));
|
||||||
@ -232,7 +232,7 @@ public class TMSUtil {
|
|||||||
String secHostIp = SystemParamsOperation.getInstance().getSecIpAddress();
|
String secHostIp = SystemParamsOperation.getInstance().getSecIpAddress();
|
||||||
String keyIndex = SystemParamsOperation.getInstance().getTMKIndex();
|
String keyIndex = SystemParamsOperation.getInstance().getTMKIndex();
|
||||||
|
|
||||||
if(tid.length() == 8 && mid.length() == 15 && !hostIp.isEmpty() && !secHostIp.isEmpty() && !keyIndex.isEmpty()) {
|
if(tid.length() == 8 && mid.length() == 15 && !hostIp.isEmpty() && !keyIndex.isEmpty()) {
|
||||||
tmsValidity = new TMSValidity(ValidityStatus.SUCCESS,"Success");
|
tmsValidity = new TMSValidity(ValidityStatus.SUCCESS,"Success");
|
||||||
} else if(tid.length() != 8) {
|
} else if(tid.length() != 8) {
|
||||||
tmsValidity = new TMSValidity(ValidityStatus.FAILURE,"Tid is invalid!");
|
tmsValidity = new TMSValidity(ValidityStatus.FAILURE,"Tid is invalid!");
|
||||||
@ -240,9 +240,11 @@ public class TMSUtil {
|
|||||||
tmsValidity = new TMSValidity(ValidityStatus.FAILURE,"Mid is invalid!");
|
tmsValidity = new TMSValidity(ValidityStatus.FAILURE,"Mid is invalid!");
|
||||||
} else if(hostIp.isEmpty()) {
|
} else if(hostIp.isEmpty()) {
|
||||||
tmsValidity = new TMSValidity(ValidityStatus.FAILURE,"Pri-Ip is invalid!");
|
tmsValidity = new TMSValidity(ValidityStatus.FAILURE,"Pri-Ip is invalid!");
|
||||||
} else if(secHostIp.isEmpty()) {
|
}
|
||||||
tmsValidity = new TMSValidity(ValidityStatus.FAILURE,"Sec-Ip is invalid!");
|
// else if(secHostIp.isEmpty()) {
|
||||||
} else {
|
// tmsValidity = new TMSValidity(ValidityStatus.FAILURE,"Sec-Ip is invalid!");
|
||||||
|
// }
|
||||||
|
else {
|
||||||
tmsValidity = new TMSValidity(ValidityStatus.FAILURE,"KeyIndex is invalid!");
|
tmsValidity = new TMSValidity(ValidityStatus.FAILURE,"KeyIndex is invalid!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
22
app/src/main/res/drawable/btn_bottom_left.xml
Normal file
22
app/src/main/res/drawable/btn_bottom_left.xml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="200dp"
|
||||||
|
android:height="200dp"
|
||||||
|
android:viewportWidth="200"
|
||||||
|
android:viewportHeight="200">
|
||||||
|
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/colorPrimary"
|
||||||
|
android:strokeColor="@color/colorPrimary"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:pathData="
|
||||||
|
M 24 0
|
||||||
|
H 140
|
||||||
|
A 60 60 0 0 0 200 60
|
||||||
|
V 176
|
||||||
|
Q 200 200 176 200
|
||||||
|
H 24
|
||||||
|
Q 0 200 0 176
|
||||||
|
V 24
|
||||||
|
Q 0 0 24 0
|
||||||
|
Z" />
|
||||||
|
</vector>
|
||||||
23
app/src/main/res/drawable/btn_bottom_right.xml
Normal file
23
app/src/main/res/drawable/btn_bottom_right.xml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="200dp"
|
||||||
|
android:height="200dp"
|
||||||
|
android:viewportWidth="200"
|
||||||
|
android:viewportHeight="200">
|
||||||
|
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/colorPrimary"
|
||||||
|
android:strokeColor="@color/colorPrimary"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:pathData="
|
||||||
|
M 60 0
|
||||||
|
H 176
|
||||||
|
Q 200 0 200 24
|
||||||
|
V 176
|
||||||
|
Q 200 200 176 200
|
||||||
|
H 24
|
||||||
|
Q 0 200 0 176
|
||||||
|
V 60
|
||||||
|
A 60 60 0 0 1 60 0
|
||||||
|
Z" />
|
||||||
|
</vector>
|
||||||
23
app/src/main/res/drawable/btn_top_left.xml
Normal file
23
app/src/main/res/drawable/btn_top_left.xml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="200dp"
|
||||||
|
android:height="200dp"
|
||||||
|
android:viewportWidth="200"
|
||||||
|
android:viewportHeight="200">
|
||||||
|
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/colorPrimary"
|
||||||
|
android:strokeColor="@color/colorPrimary"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:pathData="
|
||||||
|
M 24 0
|
||||||
|
H 176
|
||||||
|
Q 200 0 200 24
|
||||||
|
V 176
|
||||||
|
Q 200 200 176 200
|
||||||
|
H 60
|
||||||
|
A 60 60 0 0 0 0 140
|
||||||
|
V 24
|
||||||
|
Q 0 0 24 0
|
||||||
|
Z" />
|
||||||
|
</vector>
|
||||||
22
app/src/main/res/drawable/btn_top_right.xml
Normal file
22
app/src/main/res/drawable/btn_top_right.xml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="200dp"
|
||||||
|
android:height="200dp"
|
||||||
|
android:viewportWidth="200"
|
||||||
|
android:viewportHeight="200">
|
||||||
|
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/colorPrimary"
|
||||||
|
android:strokeColor="@color/colorPrimary"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:pathData="
|
||||||
|
M 24 0
|
||||||
|
H 176
|
||||||
|
Q 200 0 200 24
|
||||||
|
V 140
|
||||||
|
A 60 60 0 0 0 140 200
|
||||||
|
H 24
|
||||||
|
Q 0 200 0 176
|
||||||
|
V 24
|
||||||
|
Q 0 0 24 0
|
||||||
|
Z" />
|
||||||
|
</vector>
|
||||||
11
app/src/main/res/drawable/ic_down_arrow.xml
Normal file
11
app/src/main/res/drawable/ic_down_arrow.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/colorPrimary"
|
||||||
|
android:pathData="M7.41,8.59L12,13.17l4.59,-4.58L18,10l-6,6 -6,-6z" />
|
||||||
|
</vector>
|
||||||
@ -149,6 +149,7 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
app:cardCornerRadius="12dp"
|
app:cardCornerRadius="12dp"
|
||||||
app:cardElevation="2dp"
|
app:cardElevation="2dp"
|
||||||
|
android:onClick="@{()->click.onClickTap()}"
|
||||||
android:backgroundTint="#fff"
|
android:backgroundTint="#fff"
|
||||||
android:foreground="?android:attr/selectableItemBackground"
|
android:foreground="?android:attr/selectableItemBackground"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
|
|||||||
@ -8,326 +8,283 @@
|
|||||||
<import type="android.view.View"/>
|
<import type="android.view.View"/>
|
||||||
<import type="com.utsmm.kbz.R"/>
|
<import type="com.utsmm.kbz.R"/>
|
||||||
<import type="com.utsmm.kbz.util.layout.LayoutDataUtil"/>
|
<import type="com.utsmm.kbz.util.layout.LayoutDataUtil"/>
|
||||||
<variable
|
|
||||||
name="shareViewModel"
|
<variable name="shareViewModel" type="com.utsmm.kbz.ui.core_viewmodel.SharedViewModel"/>
|
||||||
type="com.utsmm.kbz.ui.core_viewmodel.SharedViewModel" />
|
<variable name="mainViewModel" type="com.utsmm.kbz.MainViewModel"/>
|
||||||
<variable
|
<variable name="click" type="com.utsmm.kbz.MainFragment.ClickEvent"/>
|
||||||
name="mainViewModel"
|
<variable name="carouselAdapter" type="androidx.recyclerview.widget.RecyclerView.Adapter"/>
|
||||||
type="com.utsmm.kbz.MainViewModel" />
|
<variable name="myAdapter" type="com.utsmm.kbz.ui.adapters.MainAdapter"/>
|
||||||
<variable
|
|
||||||
name="click"
|
|
||||||
type="com.utsmm.kbz.MainFragment.ClickEvent" />
|
|
||||||
<variable
|
|
||||||
name="carouselAdapter"
|
|
||||||
type="androidx.recyclerview.widget.RecyclerView.Adapter" />
|
|
||||||
<variable
|
|
||||||
name="myAdapter"
|
|
||||||
type="com.utsmm.kbz.ui.adapters.MainAdapter" />
|
|
||||||
</data>
|
</data>
|
||||||
|
<!-- ======== ROOT ======== -->
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/colorBackground">
|
android:background="@color/colorPrimary"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<!-- ====================== BANNER ====================== -->
|
||||||
|
|
||||||
<!-- Banner Section (25% of screen) -->
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:id="@+id/bannerCard"
|
android:id="@+id/bannerCard"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_margin="16dp"
|
android:layout_margin="4dp"
|
||||||
|
app:cardElevation="6dp"
|
||||||
app:cardCornerRadius="16dp"
|
app:cardCornerRadius="16dp"
|
||||||
app:cardElevation="8dp"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHeight_percent="0.25">
|
app:layout_constraintDimensionRatio="16:6">
|
||||||
|
|
||||||
<RelativeLayout
|
<com.denzcoskun.imageslider.ImageSlider
|
||||||
|
android:id="@+id/image_slider"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
app:iss_auto_cycle="true"
|
||||||
<com.denzcoskun.imageslider.ImageSlider
|
app:iss_period="5000"
|
||||||
android:id="@+id/image_slider"
|
app:iss_delay="5000"
|
||||||
android:layout_width="match_parent"
|
app:iss_no_dots="true"
|
||||||
android:layout_height="match_parent"
|
app:iss_title_background="@color/transparent" />
|
||||||
app:iss_auto_cycle="true"
|
|
||||||
app:iss_period="5000"
|
|
||||||
app:iss_delay="5000"
|
|
||||||
app:iss_no_dots="true"
|
|
||||||
app:iss_title_background="@color/transparent" />
|
|
||||||
|
|
||||||
<!-- Gradient overlay for better text visibility -->
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@drawable/gradient_overlay" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<!-- Main Menu Grid (3+2 layout for 5 functions) -->
|
|
||||||
|
<!-- ====================== GRID AREA ====================== -->
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/menuGrid"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_margin="16dp"
|
app:layout_constraintTop_toBottomOf="@id/bannerCard"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/bannerCard"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent">
|
android:paddingTop="12dp">
|
||||||
|
|
||||||
<!-- First Row - 3 cards -->
|
|
||||||
<!-- Sale Card -->
|
<!-- ===== FULL WIDTH SALE BUTTON ===== -->
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:id="@+id/cardMenuCard"
|
android:id="@+id/cardMenuCard"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginEnd="4dp"
|
app:cardCornerRadius="18dp"
|
||||||
android:layout_marginBottom="8dp"
|
app:cardElevation="4dp"
|
||||||
app:cardCornerRadius="16dp"
|
android:layout_margin="6dp"
|
||||||
app:cardElevation="6dp"
|
android:foreground="?attr/selectableItemBackground"
|
||||||
android:foreground="?android:attr/selectableItemBackground"
|
|
||||||
android:clickable="true"
|
|
||||||
android:focusable="true"
|
|
||||||
android:onClick="@{() -> click.onClickCard()}"
|
android:onClick="@{() -> click.onClickCard()}"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/signOnMenuCard"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/qrPayMenuCard"
|
app:layout_constraintDimensionRatio="1:0.4">
|
||||||
app:layout_constraintWidth_percent="0.32"
|
|
||||||
app:layout_constraintHeight_percent="0.48">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:background="@drawable/primary_card_bg"
|
android:padding="20dp"
|
||||||
android:padding="12dp">
|
android:background="@color/white">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="40dp"
|
android:layout_width="56dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="56dp"
|
||||||
android:src="@drawable/ic_sale"
|
android:src="@drawable/ic_sale"
|
||||||
android:layout_marginBottom="6dp"
|
app:tint="@color/colorPrimary"
|
||||||
app:tint="@color/white" />
|
android:layout_marginBottom="6dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/menu_sale"
|
android:text="@string/menu_sale"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/colorPrimary"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:fontFamily="@font/rubik_medium"
|
android:fontFamily="@font/rubik_medium"
|
||||||
android:textAlignment="center" />
|
android:textAlignment="center" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<!-- Sign On Card -->
|
|
||||||
<androidx.cardview.widget.CardView
|
|
||||||
android:id="@+id/signOnMenuCard"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_marginStart="4dp"
|
|
||||||
android:layout_marginEnd="4dp"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
app:cardCornerRadius="16dp"
|
|
||||||
app:cardElevation="6dp"
|
|
||||||
android:foreground="?android:attr/selectableItemBackground"
|
|
||||||
android:clickable="true"
|
|
||||||
android:focusable="true"
|
|
||||||
android:onClick="@{() -> click.onClickSignOn()}"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/cardMenuCard"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/settlementMenuCard"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/otherFeaturesCard"
|
|
||||||
app:layout_constraintWidth_percent="0.32"
|
|
||||||
app:layout_constraintHeight_percent="0.48">
|
|
||||||
|
|
||||||
<LinearLayout
|
<!-- ===== ROW 1 ===== -->
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:gravity="center"
|
|
||||||
android:background="@drawable/primary_card_bg"
|
|
||||||
android:padding="12dp">
|
|
||||||
|
|
||||||
<ImageView
|
<!-- Settlement -->
|
||||||
android:layout_width="40dp"
|
|
||||||
android:layout_height="40dp"
|
|
||||||
android:src="@drawable/ic_signon"
|
|
||||||
android:layout_marginBottom="6dp"
|
|
||||||
app:tint="@color/white" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/menu_sign_on"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:fontFamily="@font/rubik_medium"
|
|
||||||
android:textAlignment="center" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
|
||||||
|
|
||||||
<!-- Settlement Card -->
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:id="@+id/settlementMenuCard"
|
android:id="@+id/settlementMenuCard"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginStart="4dp"
|
app:cardCornerRadius="18dp"
|
||||||
android:layout_marginBottom="8dp"
|
app:cardElevation="4dp"
|
||||||
app:cardCornerRadius="16dp"
|
android:layout_margin="6dp"
|
||||||
app:cardElevation="6dp"
|
android:foreground="?attr/selectableItemBackground"
|
||||||
android:foreground="?android:attr/selectableItemBackground"
|
|
||||||
android:clickable="true"
|
|
||||||
android:focusable="true"
|
|
||||||
android:onClick="@{() -> click.onClickSettlement()}"
|
android:onClick="@{() -> click.onClickSettlement()}"
|
||||||
app:disableBtn="@{mainViewModel.settlementStatus}"
|
app:disableBtn="@{mainViewModel.settlementStatus}"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toBottomOf="@id/cardMenuCard"
|
||||||
app:layout_constraintStart_toEndOf="@+id/signOnMenuCard"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toStartOf="@id/signOnMenuCard"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/otherFeaturesCard"
|
app:layout_constraintDimensionRatio="1:0.8">
|
||||||
app:layout_constraintWidth_percent="0.32"
|
|
||||||
app:layout_constraintHeight_percent="0.48">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:background="@color/white"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:background="@drawable/primary_card_bg"
|
android:orientation="vertical"
|
||||||
android:padding="12dp">
|
android:padding="18dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="40dp"
|
android:layout_width="46dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="46dp"
|
||||||
android:src="@drawable/ic_settlement"
|
|
||||||
android:layout_marginBottom="6dp"
|
android:layout_marginBottom="6dp"
|
||||||
app:tint="@color/white" />
|
android:src="@drawable/ic_settlement"
|
||||||
|
app:tint="@color/colorPrimary" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/menu_settlement"
|
android:text="@string/menu_settlement"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/colorPrimary"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:fontFamily="@font/rubik_medium"
|
android:fontFamily="@font/rubik_medium"
|
||||||
android:textAlignment="center" />
|
android:textAlignment="center" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<!-- Second Row - 2 cards centered -->
|
|
||||||
<!-- QR Pay Card -->
|
<!-- Sign On -->
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:id="@+id/qrPayMenuCard"
|
android:id="@+id/signOnMenuCard"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginEnd="8dp"
|
app:cardCornerRadius="18dp"
|
||||||
android:layout_marginTop="8dp"
|
app:cardElevation="4dp"
|
||||||
app:cardCornerRadius="16dp"
|
android:layout_margin="6dp"
|
||||||
app:cardElevation="6dp"
|
android:foreground="?attr/selectableItemBackground"
|
||||||
android:foreground="?android:attr/selectableItemBackground"
|
android:onClick="@{() -> click.onClickSignOn()}"
|
||||||
android:clickable="true"
|
app:layout_constraintTop_toBottomOf="@id/cardMenuCard"
|
||||||
android:focusable="true"
|
app:layout_constraintStart_toEndOf="@id/settlementMenuCard"
|
||||||
android:onClick="@{() -> click.onClickQRPay()}"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:disableBtn="@{mainViewModel.kPayStatus}"
|
app:layout_constraintDimensionRatio="1:0.8">
|
||||||
app:layout_constraintTop_toBottomOf="@+id/cardMenuCard"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/otherFeaturesCard"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintWidth_percent="0.48"
|
|
||||||
app:layout_constraintHeight_percent="0.48">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:background="@color/white"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:background="@drawable/primary_card_bg"
|
android:orientation="vertical"
|
||||||
android:padding="16dp">
|
android:padding="18dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="48dp"
|
android:layout_width="46dp"
|
||||||
android:layout_height="48dp"
|
android:layout_height="46dp"
|
||||||
android:src="@drawable/ic_qr_pay"
|
android:src="@drawable/ic_signon"
|
||||||
android:layout_marginBottom="8dp"
|
app:tint="@color/colorPrimary"
|
||||||
app:tint="@color/white" />
|
android:layout_marginBottom="6dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/menu_qrpay"
|
android:text="@string/menu_sign_on"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/colorPrimary"
|
||||||
android:textSize="16sp"
|
android:textSize="14sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:fontFamily="@font/rubik_medium"
|
android:fontFamily="@font/rubik_medium"
|
||||||
android:textAlignment="center" />
|
android:textAlignment="center" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<!-- Transactions Card -->
|
|
||||||
|
<!-- ===== ROW 2 ===== -->
|
||||||
|
|
||||||
|
<!-- Transactions -->
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:id="@+id/otherFeaturesCard"
|
android:id="@+id/otherFeaturesCard"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginStart="8dp"
|
app:cardCornerRadius="18dp"
|
||||||
android:layout_marginTop="8dp"
|
app:cardElevation="4dp"
|
||||||
app:cardCornerRadius="16dp"
|
android:layout_margin="6dp"
|
||||||
app:cardElevation="6dp"
|
android:foreground="?attr/selectableItemBackground"
|
||||||
android:foreground="?android:attr/selectableItemBackground"
|
|
||||||
android:clickable="true"
|
|
||||||
android:focusable="true"
|
|
||||||
android:onClick="@{() -> click.onClickTrans()}"
|
android:onClick="@{() -> click.onClickTrans()}"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/signOnMenuCard"
|
app:layout_constraintTop_toBottomOf="@id/settlementMenuCard"
|
||||||
app:layout_constraintStart_toEndOf="@+id/qrPayMenuCard"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toStartOf="@id/qrPayMenuCard"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintDimensionRatio="1:0.8">
|
||||||
app:layout_constraintWidth_percent="0.48"
|
|
||||||
app:layout_constraintHeight_percent="0.48">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:background="@drawable/primary_card_bg"
|
android:background="@color/white"
|
||||||
android:padding="16dp">
|
android:orientation="vertical"
|
||||||
|
android:padding="18dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="48dp"
|
android:layout_width="46dp"
|
||||||
android:layout_height="48dp"
|
android:layout_height="46dp"
|
||||||
android:src="@drawable/ic_other_features"
|
android:src="@drawable/ic_other_features"
|
||||||
android:layout_marginBottom="8dp"
|
app:tint="@color/colorPrimary"
|
||||||
app:tint="@color/white" />
|
android:layout_marginBottom="6dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/menu_transactions"
|
android:text="@string/menu_transactions"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/colorPrimary"
|
||||||
android:textSize="16sp"
|
android:textSize="14sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:fontFamily="@font/rubik_medium"
|
android:fontFamily="@font/rubik_medium"
|
||||||
android:textAlignment="center" />
|
android:textAlignment="center" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- QR Pay -->
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/qrPayMenuCard"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:cardCornerRadius="18dp"
|
||||||
|
app:cardElevation="4dp"
|
||||||
|
android:layout_margin="6dp"
|
||||||
|
android:foreground="?attr/selectableItemBackground"
|
||||||
|
android:onClick="@{() -> click.onClickQR()}"
|
||||||
|
app:disableBtn="@{mainViewModel.kPayStatus}"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/signOnMenuCard"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/otherFeaturesCard"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintDimensionRatio="1:0.8">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="18dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="46dp"
|
||||||
|
android:layout_height="46dp"
|
||||||
|
android:src="@drawable/ic_qr_pay"
|
||||||
|
app:tint="@color/colorPrimary"
|
||||||
|
android:layout_marginBottom="6dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/menu_qrpay"
|
||||||
|
android:textColor="@color/colorPrimary"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:fontFamily="@font/rubik_medium"
|
||||||
|
android:textAlignment="center" />
|
||||||
|
</LinearLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</layout>
|
|
||||||
|
|
||||||
|
</layout>
|
||||||
|
|||||||
333
app/src/main/res/layout/fragment_dashboard_screen_old.xml
Normal file
333
app/src/main/res/layout/fragment_dashboard_screen_old.xml
Normal file
@ -0,0 +1,333 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
<import type="com.utsmm.kbz.util.ecr.ECRConnectionStatus"/>
|
||||||
|
<import type="android.view.View"/>
|
||||||
|
<import type="com.utsmm.kbz.R"/>
|
||||||
|
<import type="com.utsmm.kbz.util.layout.LayoutDataUtil"/>
|
||||||
|
<variable
|
||||||
|
name="shareViewModel"
|
||||||
|
type="com.utsmm.kbz.ui.core_viewmodel.SharedViewModel" />
|
||||||
|
<variable
|
||||||
|
name="mainViewModel"
|
||||||
|
type="com.utsmm.kbz.MainViewModel" />
|
||||||
|
<variable
|
||||||
|
name="click"
|
||||||
|
type="com.utsmm.kbz.MainFragment.ClickEvent" />
|
||||||
|
<variable
|
||||||
|
name="carouselAdapter"
|
||||||
|
type="androidx.recyclerview.widget.RecyclerView.Adapter" />
|
||||||
|
<variable
|
||||||
|
name="myAdapter"
|
||||||
|
type="com.utsmm.kbz.ui.adapters.MainAdapter" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/colorBackground">
|
||||||
|
|
||||||
|
<!-- Banner Section (25% of screen) -->
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/bannerCard"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_margin="16dp"
|
||||||
|
app:cardCornerRadius="16dp"
|
||||||
|
app:cardElevation="8dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHeight_percent="0.25">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.denzcoskun.imageslider.ImageSlider
|
||||||
|
android:id="@+id/image_slider"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:iss_auto_cycle="true"
|
||||||
|
app:iss_period="5000"
|
||||||
|
app:iss_delay="5000"
|
||||||
|
app:iss_no_dots="true"
|
||||||
|
app:iss_title_background="@color/transparent" />
|
||||||
|
|
||||||
|
<!-- Gradient overlay for better text visibility -->
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<!-- Main Menu Grid (3+2 layout for 5 functions) -->
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_margin="16dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/bannerCard"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent">
|
||||||
|
|
||||||
|
<!-- First Row - 3 cards -->
|
||||||
|
<!-- Sale Card -->
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/cardMenuCard"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginEnd="4dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
app:cardCornerRadius="16dp"
|
||||||
|
app:cardElevation="6dp"
|
||||||
|
android:foreground="?android:attr/selectableItemBackground"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:onClick="@{() -> click.onClickCard()}"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/signOnMenuCard"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/qrPayMenuCard"
|
||||||
|
app:layout_constraintWidth_percent="0.32"
|
||||||
|
app:layout_constraintHeight_percent="0.48">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center"
|
||||||
|
android:background="@drawable/primary_card_bg"
|
||||||
|
android:padding="12dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@drawable/ic_sale"
|
||||||
|
android:layout_marginBottom="6dp"
|
||||||
|
app:tint="@color/white" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/menu_sale"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:fontFamily="@font/rubik_medium"
|
||||||
|
android:textAlignment="center" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<!-- Sign On Card -->
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/signOnMenuCard"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:layout_marginEnd="4dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
app:cardCornerRadius="16dp"
|
||||||
|
app:cardElevation="6dp"
|
||||||
|
android:foreground="?android:attr/selectableItemBackground"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:onClick="@{() -> click.onClickSignOn()}"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/cardMenuCard"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/settlementMenuCard"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/otherFeaturesCard"
|
||||||
|
app:layout_constraintWidth_percent="0.32"
|
||||||
|
app:layout_constraintHeight_percent="0.48">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center"
|
||||||
|
android:background="@drawable/primary_card_bg"
|
||||||
|
android:padding="12dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@drawable/ic_signon"
|
||||||
|
android:layout_marginBottom="6dp"
|
||||||
|
app:tint="@color/white" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/menu_sign_on"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:fontFamily="@font/rubik_medium"
|
||||||
|
android:textAlignment="center" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<!-- Settlement Card -->
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/settlementMenuCard"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
app:cardCornerRadius="16dp"
|
||||||
|
app:cardElevation="6dp"
|
||||||
|
android:foreground="?android:attr/selectableItemBackground"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:onClick="@{() -> click.onClickSettlement()}"
|
||||||
|
app:disableBtn="@{mainViewModel.settlementStatus}"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/signOnMenuCard"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/otherFeaturesCard"
|
||||||
|
app:layout_constraintWidth_percent="0.32"
|
||||||
|
app:layout_constraintHeight_percent="0.48">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center"
|
||||||
|
android:background="@drawable/primary_card_bg"
|
||||||
|
android:padding="12dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@drawable/ic_settlement"
|
||||||
|
android:layout_marginBottom="6dp"
|
||||||
|
app:tint="@color/white" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/menu_settlement"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:fontFamily="@font/rubik_medium"
|
||||||
|
android:textAlignment="center" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<!-- Second Row - 2 cards centered -->
|
||||||
|
<!-- QR Pay Card -->
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/qrPayMenuCard"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
app:cardCornerRadius="16dp"
|
||||||
|
app:cardElevation="6dp"
|
||||||
|
android:foreground="?android:attr/selectableItemBackground"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:onClick="@{() -> click.onClickQR()}"
|
||||||
|
app:disableBtn="@{mainViewModel.kPayStatus}"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/cardMenuCard"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/otherFeaturesCard"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintWidth_percent="0.48"
|
||||||
|
app:layout_constraintHeight_percent="0.48">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center"
|
||||||
|
android:background="@drawable/primary_card_bg"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:src="@drawable/ic_qr_pay"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
app:tint="@color/white" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/menu_qrpay"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:fontFamily="@font/rubik_medium"
|
||||||
|
android:textAlignment="center" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<!-- Transactions Card -->
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/otherFeaturesCard"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
app:cardCornerRadius="16dp"
|
||||||
|
app:cardElevation="6dp"
|
||||||
|
android:foreground="?android:attr/selectableItemBackground"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:onClick="@{() -> click.onClickTrans()}"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/signOnMenuCard"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/qrPayMenuCard"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintWidth_percent="0.48"
|
||||||
|
app:layout_constraintHeight_percent="0.48">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center"
|
||||||
|
android:background="@drawable/primary_card_bg"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:src="@drawable/ic_other_features"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
app:tint="@color/white" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/menu_transactions"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:fontFamily="@font/rubik_medium"
|
||||||
|
android:textAlignment="center" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</layout>
|
||||||
@ -41,7 +41,7 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:spanCount="2"
|
app:spanCount="3"
|
||||||
bind:setAdapter="@{adapter}"
|
bind:setAdapter="@{adapter}"
|
||||||
tools:itemCount="6"
|
tools:itemCount="6"
|
||||||
tools:listitem="@layout/item_view_dashboard" />
|
tools:listitem="@layout/item_view_dashboard" />
|
||||||
|
|||||||
352
app/src/main/res/layout/fragment_inject_key.xml
Normal file
352
app/src/main/res/layout/fragment_inject_key.xml
Normal file
@ -0,0 +1,352 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="click"
|
||||||
|
type="com.utsmm.kbz.ui.settings.InjectKeyFragment.ClickEvent" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/colorBackground">
|
||||||
|
|
||||||
|
<!-- Modern Header -->
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/headerContainer"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:elevation="8dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<!-- Main Content Scroll View -->
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:fillViewport="true"
|
||||||
|
android:paddingHorizontal="20dp"
|
||||||
|
android:paddingTop="20dp"
|
||||||
|
android:paddingBottom="20dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/headerContainer">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- Key Configuration Section -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:fontFamily="@font/rubik_medium"
|
||||||
|
android:text="Key Injection Configuration"
|
||||||
|
android:textColor="@color/colorTextTitle"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:fontFamily="sans-serif-medium" />
|
||||||
|
|
||||||
|
<!-- Key Index Input Card -->
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/keyIndexCard"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
app:cardBackgroundColor="@color/white"
|
||||||
|
app:cardCornerRadius="16dp"
|
||||||
|
app:cardElevation="2dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="20dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="@font/rubik_medium"
|
||||||
|
android:text="Key Index"
|
||||||
|
android:textColor="@color/colorTextTitle"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:fontFamily="sans-serif-medium" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:text="Enter the key index for injection"
|
||||||
|
android:textColor="@color/colorTextContent"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:fontFamily="sans-serif" />
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="Key Index"
|
||||||
|
app:boxBackgroundMode="outline"
|
||||||
|
app:boxCornerRadiusBottomEnd="8dp"
|
||||||
|
app:boxCornerRadiusBottomStart="8dp"
|
||||||
|
app:boxCornerRadiusTopEnd="8dp"
|
||||||
|
app:boxCornerRadiusTopStart="8dp"
|
||||||
|
app:boxStrokeColor="@color/colorPrimary">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:id="@+id/etKeyIndex"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:inputType="number"
|
||||||
|
android:maxLength="2"
|
||||||
|
android:textColor="@color/colorTextTitle"
|
||||||
|
android:textSize="16sp"
|
||||||
|
tools:fontFamily="sans-serif" />
|
||||||
|
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<!-- Current Configuration Info Card -->
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/configInfoCard"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
app:cardBackgroundColor="@color/white"
|
||||||
|
app:cardCornerRadius="16dp"
|
||||||
|
app:cardElevation="2dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="20dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="@font/rubik_medium"
|
||||||
|
android:text="Current Configuration"
|
||||||
|
android:textColor="@color/colorTextTitle"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:fontFamily="sans-serif-medium" />
|
||||||
|
|
||||||
|
<!-- Terminal ID -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:text="Terminal ID:"
|
||||||
|
android:textColor="@color/colorTextContent"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:fontFamily="sans-serif" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/terminalIdValue"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="@font/rubik_medium"
|
||||||
|
android:text="Not configured"
|
||||||
|
android:textColor="@color/colorTextTitle"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:fontFamily="sans-serif-medium" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Merchant ID -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:text="Merchant ID:"
|
||||||
|
android:textColor="@color/colorTextContent"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:fontFamily="sans-serif" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/merchantIdValue"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="@font/rubik_medium"
|
||||||
|
android:text="Not configured"
|
||||||
|
android:textColor="@color/colorTextTitle"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:fontFamily="sans-serif-medium" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Serial Number -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:text="Serial Number:"
|
||||||
|
android:textColor="@color/colorTextContent"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:fontFamily="sans-serif" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/serialNumberValue"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="@font/rubik_medium"
|
||||||
|
android:text="Not configured"
|
||||||
|
android:textColor="@color/colorTextTitle"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:fontFamily="sans-serif-medium" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Actions Section -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:fontFamily="@font/rubik_medium"
|
||||||
|
android:text="Actions"
|
||||||
|
android:textColor="@color/colorTextTitle"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:fontFamily="sans-serif-medium" />
|
||||||
|
|
||||||
|
<!-- Inject Key Button Card -->
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/injectKeyCard"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:clickable="true"
|
||||||
|
android:foreground="?android:attr/selectableItemBackground"
|
||||||
|
android:onClick="@{()->click.onInjectKeyClick()}"
|
||||||
|
app:cardBackgroundColor="@color/white"
|
||||||
|
app:cardCornerRadius="16dp"
|
||||||
|
app:cardElevation="2dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="20dp">
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
app:cardBackgroundColor="@color/colorPrimary"
|
||||||
|
app:cardCornerRadius="24dp"
|
||||||
|
app:cardElevation="0dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:src="@drawable/ic_lock"
|
||||||
|
app:tint="@color/white" />
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="@font/rubik_medium"
|
||||||
|
android:text="Start Key Injection"
|
||||||
|
android:textColor="@color/colorTextTitle"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:fontFamily="sans-serif-medium" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:text="Inject encryption key from KeyPOS"
|
||||||
|
android:textColor="@color/colorTextContent"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:fontFamily="sans-serif" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="20dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:src="@drawable/ic_right_arrow"
|
||||||
|
app:tint="@color/colorPrimary" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</layout>
|
||||||
@ -32,21 +32,21 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="16dp"
|
android:padding="10dp"
|
||||||
android:paddingTop="24dp"
|
android:paddingTop="14dp"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
<!-- Trace Number Icon -->
|
<!-- Trace Number Icon -->
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="48dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="48dp"
|
android:layout_height="36dp"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginBottom="12dp"
|
android:layout_marginBottom="8dp"
|
||||||
android:src="@drawable/ic_txn_history"
|
android:src="@drawable/ic_txn_history"
|
||||||
app:tint="@color/colorPrimary"
|
app:tint="@color/colorPrimary"
|
||||||
android:alpha="0.9"
|
android:alpha="0.88"
|
||||||
android:padding="8dp"
|
android:padding="6dp"
|
||||||
android:background="@drawable/bg_oval" />
|
android:background="@drawable/bg_oval" />
|
||||||
|
|
||||||
<!-- Compact Title -->
|
<!-- Compact Title -->
|
||||||
@ -56,10 +56,10 @@
|
|||||||
android:text="@string/enter_trace_text"
|
android:text="@string/enter_trace_text"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="@color/colorPrimary"
|
android:textColor="@color/colorPrimary"
|
||||||
android:textSize="22sp"
|
android:textSize="17sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:fontFamily="sans-serif-medium"
|
android:fontFamily="sans-serif-medium"
|
||||||
android:layout_marginBottom="4dp" />
|
android:layout_marginBottom="2dp" />
|
||||||
|
|
||||||
<!-- Compact Subtitle -->
|
<!-- Compact Subtitle -->
|
||||||
<TextView
|
<TextView
|
||||||
@ -68,18 +68,18 @@
|
|||||||
android:text="Enter the transaction trace number"
|
android:text="Enter the transaction trace number"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="@color/colorPrimary"
|
android:textColor="@color/colorPrimary"
|
||||||
android:textSize="14sp"
|
android:textSize="12sp"
|
||||||
android:alpha="0.75"
|
android:alpha="0.7"
|
||||||
android:fontFamily="sans-serif"
|
android:fontFamily="sans-serif"
|
||||||
android:layout_marginBottom="16dp" />
|
android:layout_marginBottom="10dp" />
|
||||||
|
|
||||||
<!-- Compact Trace Number Display Card -->
|
<!-- Compact Trace Number Display Card -->
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:id="@+id/traceCard"
|
android:id="@+id/traceCard"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="70dp"
|
android:layout_height="48dp"
|
||||||
android:layout_marginHorizontal="8dp"
|
android:layout_marginHorizontal="4dp"
|
||||||
app:cardCornerRadius="16dp"
|
app:cardCornerRadius="12dp"
|
||||||
app:cardElevation="0dp"
|
app:cardElevation="0dp"
|
||||||
app:cardBackgroundColor="@color/white">
|
app:cardBackgroundColor="@color/white">
|
||||||
|
|
||||||
@ -87,11 +87,11 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_margin="2dp"
|
android:layout_margin="1dp"
|
||||||
android:background="@drawable/bg_edittext_primary_border"
|
android:background="@drawable/bg_edittext_primary_border"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:padding="16dp">
|
android:padding="8dp">
|
||||||
|
|
||||||
<!-- Trace number display -->
|
<!-- Trace number display -->
|
||||||
<TextView
|
<TextView
|
||||||
@ -102,22 +102,22 @@
|
|||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@{inputTraceViewModel.invoiceNo}"
|
android:text="@{inputTraceViewModel.invoiceNo}"
|
||||||
android:textColor="@color/colorPrimary"
|
android:textColor="@color/colorPrimary"
|
||||||
android:textSize="28sp"
|
android:textSize="20sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:letterSpacing="0.1"
|
android:letterSpacing="0.07"
|
||||||
android:fontFamily="monospace"
|
android:fontFamily="monospace"
|
||||||
android:hint="000000"
|
android:hint="000000"
|
||||||
android:textColorHint="@color/colorPrimary"
|
android:textColorHint="@color/colorPrimary"
|
||||||
android:alpha="0.6"
|
android:alpha="0.5"
|
||||||
tools:text="123456" />
|
tools:text="123456" />
|
||||||
|
|
||||||
<!-- Transaction indicator -->
|
<!-- Transaction indicator -->
|
||||||
<View
|
<View
|
||||||
android:layout_width="6dp"
|
android:layout_width="5dp"
|
||||||
android:layout_height="6dp"
|
android:layout_height="5dp"
|
||||||
android:background="@drawable/bg_oval"
|
android:background="@drawable/bg_oval"
|
||||||
android:backgroundTint="@color/colorPrimary"
|
android:backgroundTint="@color/colorPrimary"
|
||||||
android:alpha="0.6" />
|
android:alpha="0.5" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@ -125,14 +125,14 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- Number Keyboard - guaranteed space -->
|
<!-- Number Keyboard - guaranteed space, more compact -->
|
||||||
<com.utsmyanmar.baselib.ui.NumberKeyboard
|
<com.utsmyanmar.baselib.ui.NumberKeyboard
|
||||||
android:id="@+id/passwordKeyboard"
|
android:id="@+id/passwordKeyboard"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginHorizontal="16dp"
|
android:layout_marginHorizontal="8dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="4dp"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="4dp"
|
||||||
app:KeyClickCallback="@{inputTraceViewModel.onKeyClick}"
|
app:KeyClickCallback="@{inputTraceViewModel.onKeyClick}"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/actionButtonsContainer"
|
app:layout_constraintBottom_toTopOf="@+id/actionButtonsContainer"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
@ -146,8 +146,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:padding="16dp"
|
android:padding="8dp"
|
||||||
android:paddingBottom="24dp"
|
android:paddingBottom="12dp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent">
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
|
|
||||||
@ -155,34 +155,34 @@
|
|||||||
<Button
|
<Button
|
||||||
android:id="@+id/btnCancel"
|
android:id="@+id/btnCancel"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="52dp"
|
android:layout_height="42dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="6dp"
|
||||||
android:text="@string/layout_cancel"
|
android:text="@string/layout_cancel"
|
||||||
android:textColor="@color/colorPrimary"
|
android:textColor="@color/colorPrimary"
|
||||||
android:textSize="15sp"
|
android:textSize="12sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:background="@drawable/bg_rounded_btn_cancel_cv"
|
android:background="@drawable/bg_rounded_btn_cancel_cv"
|
||||||
android:fontFamily="sans-serif-medium"
|
android:fontFamily="sans-serif-medium"
|
||||||
android:onClick="@{()->click.onCancel()}"
|
android:onClick="@{()->click.onCancel()}"
|
||||||
android:elevation="2dp"
|
android:elevation="1dp"
|
||||||
android:textAllCaps="false" />
|
android:textAllCaps="false" />
|
||||||
|
|
||||||
<!-- Confirm Button -->
|
<!-- Confirm Button -->
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btnConfirm"
|
android:id="@+id/btnConfirm"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="52dp"
|
android:layout_height="42dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="6dp"
|
||||||
android:text="@string/layout_confirm"
|
android:text="@string/layout_confirm"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="15sp"
|
android:textSize="12sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:background="@drawable/bg_rounded_btn_cv"
|
android:background="@drawable/bg_rounded_btn_cv"
|
||||||
android:fontFamily="sans-serif-medium"
|
android:fontFamily="sans-serif-medium"
|
||||||
android:onClick="@{()->click.onConfirm()}"
|
android:onClick="@{()->click.onConfirm()}"
|
||||||
android:elevation="8dp"
|
android:elevation="3dp"
|
||||||
android:textAllCaps="false" />
|
android:textAllCaps="false" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@ -446,55 +446,55 @@
|
|||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<!-- Manual Reversal -->
|
<!-- Manual Reversal -->
|
||||||
<androidx.cardview.widget.CardView
|
<!-- <androidx.cardview.widget.CardView-->
|
||||||
android:layout_width="match_parent"
|
<!-- android:layout_width="match_parent"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:layout_marginBottom="12dp"
|
<!-- android:layout_marginBottom="12dp"-->
|
||||||
app:cardCornerRadius="12dp"
|
<!-- app:cardCornerRadius="12dp"-->
|
||||||
app:cardElevation="0dp"
|
<!-- app:cardElevation="0dp"-->
|
||||||
app:cardBackgroundColor="@color/white"
|
<!-- app:cardBackgroundColor="@color/white"-->
|
||||||
android:clickable="true"
|
<!-- android:clickable="true"-->
|
||||||
android:focusable="true"
|
<!-- android:focusable="true"-->
|
||||||
android:foreground="?android:attr/selectableItemBackground"
|
<!-- android:foreground="?android:attr/selectableItemBackground"-->
|
||||||
android:onClick="@{()->click.onClickManualReversal()}">
|
<!-- android:onClick="@{()->click.onClickManualReversal()}">-->
|
||||||
|
|
||||||
<LinearLayout
|
<!-- <LinearLayout-->
|
||||||
android:layout_width="match_parent"
|
<!-- android:layout_width="match_parent"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:layout_margin="2dp"
|
<!-- android:layout_margin="2dp"-->
|
||||||
android:background="@drawable/bg_edittext_primary_border"
|
<!-- android:background="@drawable/bg_edittext_primary_border"-->
|
||||||
android:orientation="horizontal"
|
<!-- android:orientation="horizontal"-->
|
||||||
android:gravity="center_vertical"
|
<!-- android:gravity="center_vertical"-->
|
||||||
android:padding="16dp">
|
<!-- android:padding="16dp">-->
|
||||||
|
|
||||||
<ImageView
|
<!-- <ImageView-->
|
||||||
android:layout_width="20dp"
|
<!-- android:layout_width="20dp"-->
|
||||||
android:layout_height="20dp"
|
<!-- android:layout_height="20dp"-->
|
||||||
android:src="@drawable/ic_custom_pos"
|
<!-- android:src="@drawable/ic_custom_pos"-->
|
||||||
app:tint="@color/colorPrimary"
|
<!-- app:tint="@color/colorPrimary"-->
|
||||||
android:alpha="0.8"
|
<!-- android:alpha="0.8"-->
|
||||||
android:layout_marginEnd="12dp" />
|
<!-- android:layout_marginEnd="12dp" />-->
|
||||||
|
|
||||||
<TextView
|
<!-- <TextView-->
|
||||||
android:layout_width="0dp"
|
<!-- android:layout_width="0dp"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:layout_weight="1"
|
<!-- android:layout_weight="1"-->
|
||||||
android:text="@string/txt_subtitle_manual_reversal"
|
<!-- android:text="@string/txt_subtitle_manual_reversal"-->
|
||||||
android:textColor="@color/colorPrimary"
|
<!-- android:textColor="@color/colorPrimary"-->
|
||||||
android:textSize="15sp"
|
<!-- android:textSize="15sp"-->
|
||||||
android:textStyle="normal"
|
<!-- android:textStyle="normal"-->
|
||||||
android:fontFamily="sans-serif-medium" />
|
<!-- android:fontFamily="sans-serif-medium" />-->
|
||||||
|
|
||||||
<ImageView
|
<!-- <ImageView-->
|
||||||
android:layout_width="16dp"
|
<!-- android:layout_width="16dp"-->
|
||||||
android:layout_height="16dp"
|
<!-- android:layout_height="16dp"-->
|
||||||
android:src="@drawable/ic_right_arrow"
|
<!-- android:src="@drawable/ic_right_arrow"-->
|
||||||
app:tint="@color/colorPrimary"
|
<!-- app:tint="@color/colorPrimary"-->
|
||||||
android:alpha="0.6" />
|
<!-- android:alpha="0.6" />-->
|
||||||
|
|
||||||
</LinearLayout>
|
<!-- </LinearLayout>-->
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
<!-- </androidx.cardview.widget.CardView>-->
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
28
app/src/main/res/layout/fragment_qr_history.xml
Normal file
28
app/src/main/res/layout/fragment_qr_history.xml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<data>
|
||||||
|
<variable
|
||||||
|
name="vm"
|
||||||
|
type="com.utsmm.kbz.ui.qr_pay.QRHistoryViewModel" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/qrRvHistory"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
<!-- No Data Message -->
|
||||||
|
<!-- <TextView-->
|
||||||
|
<!-- android:id="@+id/tvNoData"-->
|
||||||
|
<!-- android:layout_width="match_parent"-->
|
||||||
|
<!-- android:layout_height="match_parent"-->
|
||||||
|
<!-- android:gravity="center"-->
|
||||||
|
<!-- android:text="No history available"-->
|
||||||
|
<!-- android:textSize="18sp"-->
|
||||||
|
<!-- android:padding="16dp"-->
|
||||||
|
<!-- android:visibility="@{vm.refundList.size() == 0 ? View.VISIBLE : View.GONE}" />-->
|
||||||
|
</FrameLayout>
|
||||||
|
</layout>
|
||||||
40
app/src/main/res/layout/fragment_qr_pay.xml
Normal file
40
app/src/main/res/layout/fragment_qr_pay.xml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
xmlns:bind="http://schemas.android.com/tools">
|
||||||
|
<data>
|
||||||
|
<variable
|
||||||
|
name="adapter"
|
||||||
|
type="androidx.recyclerview.widget.RecyclerView.Adapter" />
|
||||||
|
<variable
|
||||||
|
name="sharedViewModel"
|
||||||
|
type="com.utsmm.kbz.ui.core_viewmodel.SharedViewModel" />
|
||||||
|
</data>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/colorBackground">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerViewFeatures"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:nestedScrollingEnabled="false"
|
||||||
|
android:background="@color/transparent"
|
||||||
|
android:padding="16dp"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:spanCount="3"
|
||||||
|
bind:setAdapter="@{adapter}"
|
||||||
|
tools:itemCount="3"
|
||||||
|
tools:listitem="@layout/item_qr_pay_button" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</layout>
|
||||||
172
app/src/main/res/layout/fragment_qr_refund.xml
Normal file
172
app/src/main/res/layout/fragment_qr_refund.xml
Normal file
@ -0,0 +1,172 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
<variable
|
||||||
|
name="sharedViewModel"
|
||||||
|
type="com.utsmm.kbz.ui.core_viewmodel.SharedViewModel" />
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="adapter"
|
||||||
|
type="androidx.recyclerview.widget.RecyclerView.Adapter" />
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="manageViewModel"
|
||||||
|
type="com.utsmm.kbz.ui.management.ManagementViewModel" />
|
||||||
|
<variable
|
||||||
|
name="click"
|
||||||
|
type="com.utsmm.kbz.ui.qr_pay.QRRefundFragment.ClickEvent" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/white">
|
||||||
|
|
||||||
|
<!-- SEARCH SECTION -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/refundSearchSection"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:visibility="@{manageViewModel.reprintLayoutTopVisibility}"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent">
|
||||||
|
|
||||||
|
<!-- Search Card -->
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="56dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginEnd="12dp"
|
||||||
|
app:cardCornerRadius="16dp"
|
||||||
|
app:cardElevation="0dp"
|
||||||
|
app:cardBackgroundColor="@color/white">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_margin="2dp"
|
||||||
|
android:background="@drawable/bg_edittext_primary_border"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="20dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:src="@drawable/ic_txn_history"
|
||||||
|
app:tint="@color/colorPrimary"
|
||||||
|
android:alpha="0.6"/>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/rnn_trace_id"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@null"
|
||||||
|
android:hint="@string/txt_search_rrn_trace"
|
||||||
|
android:text="@={manageViewModel.txtRRNTrace}"
|
||||||
|
android:textColor="@color/colorPrimary"
|
||||||
|
android:textColorHint="@color/colorPrimary"
|
||||||
|
android:alpha="0.9"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:inputType="number"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:imeOptions="actionSearch" />
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<!-- SEARCH BUTTON -->
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/btnSearch"
|
||||||
|
android:onClick="@{() -> click.onSearch()}"
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="52dp"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
app:cardBackgroundColor="@color/colorPrimary"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardElevation="3dp"
|
||||||
|
android:foreground="?android:attr/selectableItemBackground">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Search"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- RECYCLER VIEW -->
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/qrRefundHistory"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:paddingTop="4dp"
|
||||||
|
app:adapter="@{adapter}"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/refundSearchSection"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
tools:listitem="@layout/item_qr_refund" />
|
||||||
|
|
||||||
|
<!-- Empty State Section -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/emptyStateSectionRefund"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="@{manageViewModel.reprintLayoutBtmVisibility}"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent">
|
||||||
|
|
||||||
|
<com.airbnb.lottie.LottieAnimationView
|
||||||
|
android:id="@+id/lav_no_trans"
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="200dp"
|
||||||
|
android:layout_marginBottom="24dp"
|
||||||
|
app:lottie_autoPlay="true"
|
||||||
|
app:lottie_fileName="lottie_no_trans.json"
|
||||||
|
app:lottie_loop="true"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/no_history"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="@color/colorPrimary"
|
||||||
|
android:layout_marginBottom="8dp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="No transactions found for the selected criteria"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textColor="@color/colorPrimary"
|
||||||
|
android:alpha="0.7"
|
||||||
|
android:paddingHorizontal="32dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</layout>
|
||||||
349
app/src/main/res/layout/fragment_qr_refund_detail.xml
Normal file
349
app/src/main/res/layout/fragment_qr_refund_detail.xml
Normal file
@ -0,0 +1,349 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
<variable
|
||||||
|
name="sharedViewModel"
|
||||||
|
type="com.utsmm.kbz.ui.core_viewmodel.SharedViewModel" />
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="kPayViewModel"
|
||||||
|
type="com.utsmm.kbz.ui.kpay.KPayViewModel" />
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="click"
|
||||||
|
type="com.utsmm.kbz.ui.qr_pay.QRRefundDetailFragment.ClickEvent" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<!-- Refund Type Selection -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/refund_type_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="start"
|
||||||
|
android:text="Refund Type"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<RadioGroup
|
||||||
|
android:id="@+id/radio_group_refund_type"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/radio_original"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:checked="true"
|
||||||
|
android:text="Original Amount"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/radio_partial"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="Partial Amount"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
</RadioGroup>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Reference Number Input -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/reference_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/refund_type_layout">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="start"
|
||||||
|
android:text="Reference Number *"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardElevation="4dp">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/et_reference_no"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@null"
|
||||||
|
android:hint="Enter reference number"
|
||||||
|
android:inputType="text"
|
||||||
|
android:maxLength="20"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="18sp"
|
||||||
|
tools:text="NEX000011" />
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Original Amount Input (for partial refunds) -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/original_amount_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/reference_layout">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="start"
|
||||||
|
android:text="Original Amount *"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/bg_amount_title"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/mmk"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardElevation="4dp">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/et_original_amount"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@null"
|
||||||
|
android:hint="0.00"
|
||||||
|
android:inputType="numberDecimal"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="1000.00" />
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Refund Amount Input (for partial refunds) -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/refund_amount_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/original_amount_layout">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="start"
|
||||||
|
android:text="Refund Amount *"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/bg_amount_title"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/mmk"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardElevation="4dp">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/et_refund_amount"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@null"
|
||||||
|
android:hint="0.00"
|
||||||
|
android:inputType="numberDecimal"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="400.00" />
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Refund Reason Input -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/refund_reason_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/refund_amount_layout">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="start"
|
||||||
|
android:text="Refund Reason"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardElevation="4dp">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/et_refund_reason"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@null"
|
||||||
|
android:hint="Enter refund reason (optional)"
|
||||||
|
android:inputType="textMultiLine"
|
||||||
|
android:lines="3"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="16sp"
|
||||||
|
tools:text="Customer requested refund" />
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Error Message -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/error_message"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:text="@{kPayViewModel.invalidAmountMsg}"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="@color/red"
|
||||||
|
android:textSize="14sp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/refund_reason_layout"
|
||||||
|
tools:text="Invalid amount entered" />
|
||||||
|
|
||||||
|
<!-- Action Buttons -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/button_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="32dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/error_message">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_cancel"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/bg_rounded_btn_cancel_cv"
|
||||||
|
android:onClick="@{()->click.onCancel()}"
|
||||||
|
android:text="@string/layout_cancel"
|
||||||
|
android:textColor="@color/colorPrimary"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_confirm"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/bg_rounded_btn_cv"
|
||||||
|
android:onClick="@{()->click.onConfirm()}"
|
||||||
|
android:text="Process Refund"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</ScrollView>
|
||||||
|
</layout>
|
||||||
44
app/src/main/res/layout/fragment_qr_refund_process.xml
Normal file
44
app/src/main/res/layout/fragment_qr_refund_process.xml
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
<variable
|
||||||
|
name="sharedViewModel"
|
||||||
|
type="com.utsmm.kbz.ui.core_viewmodel.SharedViewModel" />
|
||||||
|
<variable
|
||||||
|
name="kPayViewModel"
|
||||||
|
type="com.utsmm.kbz.ui.kpay.KPayViewModel" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:text="@string/txt_processing_refund"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="20sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/lav_thumbUp"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/lav_thumbUp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/lav_thumbUp" />
|
||||||
|
|
||||||
|
|
||||||
|
<com.airbnb.lottie.LottieAnimationView
|
||||||
|
android:id="@+id/lav_thumbUp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="300dp"
|
||||||
|
android:layout_margin="8dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:lottie_autoPlay="true"
|
||||||
|
app:lottie_fileName="lottie_processing_card.json"
|
||||||
|
app:lottie_loop="true" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</layout>
|
||||||
@ -235,15 +235,14 @@
|
|||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<!-- Demo Mode Card -->
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:id="@+id/demoCard"
|
android:id="@+id/injectKeyCard"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="12dp"
|
android:layout_marginBottom="12dp"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:foreground="?android:attr/selectableItemBackground"
|
android:foreground="?android:attr/selectableItemBackground"
|
||||||
android:onClick="@{()->click.onDemoClick()}"
|
android:onClick="@{()->click.onInjectKeyClick()}"
|
||||||
app:cardBackgroundColor="@color/white"
|
app:cardBackgroundColor="@color/white"
|
||||||
app:cardCornerRadius="16dp"
|
app:cardCornerRadius="16dp"
|
||||||
app:cardElevation="2dp">
|
app:cardElevation="2dp">
|
||||||
@ -267,7 +266,7 @@
|
|||||||
android:layout_width="24dp"
|
android:layout_width="24dp"
|
||||||
android:layout_height="24dp"
|
android:layout_height="24dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:src="@drawable/ic_swap"
|
android:src="@drawable/ic_key_index"
|
||||||
app:tint="@color/white" />
|
app:tint="@color/white" />
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
@ -282,143 +281,45 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fontFamily="@font/rubik_medium"
|
android:fontFamily="@font/rubik_medium"
|
||||||
android:text="Demo Mode"
|
android:text="Inject Key"
|
||||||
android:textColor="@color/colorTextTitle"
|
android:textColor="@color/colorTextTitle"
|
||||||
android:textSize="18sp"
|
android:textSize="18sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
tools:fontFamily="sans-serif-medium" />
|
tools:fontFamily="sans-serif-medium" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/demoSummary"
|
android:id="@+id/injectKeyText"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="2dp"
|
android:layout_marginTop="2dp"
|
||||||
android:fontFamily="@font/rubik_regular"
|
android:fontFamily="@font/rubik_regular"
|
||||||
android:text="Demo mode active - Test transactions"
|
android:text="Click to inject"
|
||||||
android:textColor="@color/colorTextContent"
|
android:textColor="@color/colorTextContent"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
tools:fontFamily="sans-serif" />
|
tools:fontFamily="sans-serif" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<Switch
|
<ImageView
|
||||||
android:id="@+id/demoSwitch"
|
android:layout_width="20dp"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="20dp"
|
||||||
android:layout_height="wrap_content"
|
android:src="@drawable/ic_right_arrow"
|
||||||
android:layout_marginStart="8dp"
|
app:tint="@color/colorPrimary" />
|
||||||
android:clickable="false"
|
|
||||||
android:focusable="false" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<!-- Sound Alerts Card -->
|
|
||||||
<androidx.cardview.widget.CardView
|
|
||||||
android:id="@+id/alertSoundCard"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="12dp"
|
|
||||||
android:clickable="true"
|
|
||||||
android:foreground="?android:attr/selectableItemBackground"
|
|
||||||
android:onClick="@{()->click.onAlertSoundClick()}"
|
|
||||||
app:cardBackgroundColor="@color/white"
|
|
||||||
app:cardCornerRadius="16dp"
|
|
||||||
app:cardElevation="2dp">
|
|
||||||
|
|
||||||
<LinearLayout
|
<!-- <!– Demo Mode Card –>-->
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:padding="20dp">
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
|
||||||
android:layout_width="48dp"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
app:cardBackgroundColor="@color/colorPrimary"
|
|
||||||
app:cardCornerRadius="24dp"
|
|
||||||
app:cardElevation="0dp">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="24dp"
|
|
||||||
android:layout_height="24dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:src="@drawable/ic_audio"
|
|
||||||
app:tint="@color/white" />
|
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:fontFamily="@font/rubik_medium"
|
|
||||||
android:text="Sound Alerts"
|
|
||||||
android:textColor="@color/colorTextTitle"
|
|
||||||
android:textSize="18sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
tools:fontFamily="sans-serif-medium" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/alertSoundSummary"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="2dp"
|
|
||||||
android:fontFamily="@font/rubik_regular"
|
|
||||||
android:text="Sound alerts enabled for notifications"
|
|
||||||
android:textColor="@color/colorTextContent"
|
|
||||||
android:textSize="14sp"
|
|
||||||
tools:fontFamily="sans-serif" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<Switch
|
|
||||||
android:id="@+id/alertSoundSwitch"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:clickable="false"
|
|
||||||
android:focusable="false" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- Transaction Settings Section -->
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="20dp"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="12dp"
|
|
||||||
android:fontFamily="@font/rubik_medium"
|
|
||||||
android:text="Transaction Settings"
|
|
||||||
android:textColor="@color/colorTextTitle"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
tools:fontFamily="sans-serif-medium" />
|
|
||||||
|
|
||||||
<!-- <!– Manual Entry Card –>-->
|
|
||||||
<!-- <androidx.cardview.widget.CardView-->
|
<!-- <androidx.cardview.widget.CardView-->
|
||||||
<!-- android:id="@+id/manualEntryCard"-->
|
<!-- android:id="@+id/demoCard"-->
|
||||||
<!-- android:layout_width="match_parent"-->
|
<!-- android:layout_width="match_parent"-->
|
||||||
<!-- android:layout_height="wrap_content"-->
|
<!-- android:layout_height="wrap_content"-->
|
||||||
<!-- android:layout_marginBottom="12dp"-->
|
<!-- android:layout_marginBottom="12dp"-->
|
||||||
<!-- android:clickable="true"-->
|
<!-- android:clickable="true"-->
|
||||||
<!-- android:foreground="?android:attr/selectableItemBackground"-->
|
<!-- android:foreground="?android:attr/selectableItemBackground"-->
|
||||||
|
<!-- android:onClick="@{()->click.onDemoClick()}"-->
|
||||||
<!-- app:cardBackgroundColor="@color/white"-->
|
<!-- app:cardBackgroundColor="@color/white"-->
|
||||||
<!-- app:cardCornerRadius="16dp"-->
|
<!-- app:cardCornerRadius="16dp"-->
|
||||||
<!-- app:cardElevation="2dp">-->
|
<!-- app:cardElevation="2dp">-->
|
||||||
@ -442,7 +343,7 @@
|
|||||||
<!-- android:layout_width="24dp"-->
|
<!-- android:layout_width="24dp"-->
|
||||||
<!-- android:layout_height="24dp"-->
|
<!-- android:layout_height="24dp"-->
|
||||||
<!-- android:layout_gravity="center"-->
|
<!-- android:layout_gravity="center"-->
|
||||||
<!-- android:src="@drawable/ic_blur"-->
|
<!-- android:src="@drawable/ic_swap"-->
|
||||||
<!-- app:tint="@color/white" />-->
|
<!-- app:tint="@color/white" />-->
|
||||||
|
|
||||||
<!-- </androidx.cardview.widget.CardView>-->
|
<!-- </androidx.cardview.widget.CardView>-->
|
||||||
@ -457,19 +358,19 @@
|
|||||||
<!-- android:layout_width="wrap_content"-->
|
<!-- android:layout_width="wrap_content"-->
|
||||||
<!-- android:layout_height="wrap_content"-->
|
<!-- android:layout_height="wrap_content"-->
|
||||||
<!-- android:fontFamily="@font/rubik_medium"-->
|
<!-- android:fontFamily="@font/rubik_medium"-->
|
||||||
<!-- android:text="Manual Card Entry"-->
|
<!-- android:text="Reversal On/Off"-->
|
||||||
<!-- android:textColor="@color/colorTextTitle"-->
|
<!-- android:textColor="@color/colorTextTitle"-->
|
||||||
<!-- android:textSize="18sp"-->
|
<!-- android:textSize="18sp"-->
|
||||||
<!-- android:textStyle="bold"-->
|
<!-- android:textStyle="bold"-->
|
||||||
<!-- tools:fontFamily="sans-serif-medium" />-->
|
<!-- tools:fontFamily="sans-serif-medium" />-->
|
||||||
|
|
||||||
<!-- <TextView-->
|
<!-- <TextView-->
|
||||||
<!-- android:id="@+id/manualEntrySummary"-->
|
<!-- android:id="@+id/reversalSwitch"-->
|
||||||
<!-- android:layout_width="wrap_content"-->
|
<!-- android:layout_width="wrap_content"-->
|
||||||
<!-- android:layout_height="wrap_content"-->
|
<!-- android:layout_height="wrap_content"-->
|
||||||
<!-- android:layout_marginTop="2dp"-->
|
<!-- android:layout_marginTop="2dp"-->
|
||||||
<!-- android:fontFamily="@font/rubik_regular"-->
|
<!-- android:fontFamily="@font/rubik_regular"-->
|
||||||
<!-- android:text="Manual card entry allowed for transactions"-->
|
<!-- android:text="Demo mode active - Test transactions"-->
|
||||||
<!-- android:textColor="@color/colorTextContent"-->
|
<!-- android:textColor="@color/colorTextContent"-->
|
||||||
<!-- android:textSize="14sp"-->
|
<!-- android:textSize="14sp"-->
|
||||||
<!-- tools:fontFamily="sans-serif" />-->
|
<!-- tools:fontFamily="sans-serif" />-->
|
||||||
@ -477,7 +378,7 @@
|
|||||||
<!-- </LinearLayout>-->
|
<!-- </LinearLayout>-->
|
||||||
|
|
||||||
<!-- <Switch-->
|
<!-- <Switch-->
|
||||||
<!-- android:id="@+id/manualEntrySwitch"-->
|
<!-- android:id="@+id/demoSwitch"-->
|
||||||
<!-- android:layout_width="wrap_content"-->
|
<!-- android:layout_width="wrap_content"-->
|
||||||
<!-- android:layout_height="wrap_content"-->
|
<!-- android:layout_height="wrap_content"-->
|
||||||
<!-- android:layout_marginStart="8dp"-->
|
<!-- android:layout_marginStart="8dp"-->
|
||||||
@ -488,164 +389,417 @@
|
|||||||
|
|
||||||
<!-- </androidx.cardview.widget.CardView>-->
|
<!-- </androidx.cardview.widget.CardView>-->
|
||||||
|
|
||||||
<!-- Automatic Reversal Card -->
|
<!-- Demo Mode Card -->
|
||||||
<androidx.cardview.widget.CardView
|
<!-- <androidx.cardview.widget.CardView-->
|
||||||
android:id="@+id/reversalCard"
|
<!-- android:id="@+id/demoCard"-->
|
||||||
android:layout_width="match_parent"
|
<!-- android:layout_width="match_parent"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:layout_marginBottom="12dp"
|
<!-- android:layout_marginBottom="12dp"-->
|
||||||
android:clickable="true"
|
<!-- android:clickable="true"-->
|
||||||
android:foreground="?android:attr/selectableItemBackground"
|
<!-- android:foreground="?android:attr/selectableItemBackground"-->
|
||||||
android:onClick="@{()->click.onReversalClick()}"
|
<!-- android:onClick="@{()->click.onDemoClick()}"-->
|
||||||
app:cardBackgroundColor="@color/white"
|
<!-- app:cardBackgroundColor="@color/white"-->
|
||||||
app:cardCornerRadius="16dp"
|
<!-- app:cardCornerRadius="16dp"-->
|
||||||
app:cardElevation="2dp">
|
<!-- app:cardElevation="2dp">-->
|
||||||
|
|
||||||
<LinearLayout
|
<!-- <LinearLayout-->
|
||||||
android:layout_width="match_parent"
|
<!-- android:layout_width="match_parent"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:gravity="center_vertical"
|
<!-- android:gravity="center_vertical"-->
|
||||||
android:orientation="horizontal"
|
<!-- android:orientation="horizontal"-->
|
||||||
android:padding="20dp">
|
<!-- android:padding="20dp">-->
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<!-- <androidx.cardview.widget.CardView-->
|
||||||
android:layout_width="48dp"
|
<!-- android:layout_width="48dp"-->
|
||||||
android:layout_height="48dp"
|
<!-- android:layout_height="48dp"-->
|
||||||
android:layout_marginEnd="16dp"
|
<!-- android:layout_marginEnd="16dp"-->
|
||||||
app:cardBackgroundColor="@color/colorPrimary"
|
<!-- app:cardBackgroundColor="@color/colorPrimary"-->
|
||||||
app:cardCornerRadius="24dp"
|
<!-- app:cardCornerRadius="24dp"-->
|
||||||
app:cardElevation="0dp">
|
<!-- app:cardElevation="0dp">-->
|
||||||
|
|
||||||
<ImageView
|
<!-- <ImageView-->
|
||||||
android:layout_width="24dp"
|
<!-- android:layout_width="24dp"-->
|
||||||
android:layout_height="24dp"
|
<!-- android:layout_height="24dp"-->
|
||||||
android:layout_gravity="center"
|
<!-- android:layout_gravity="center"-->
|
||||||
android:src="@drawable/ic_swap"
|
<!-- android:src="@drawable/ic_swap"-->
|
||||||
app:tint="@color/white" />
|
<!-- app:tint="@color/white" />-->
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
<!-- </androidx.cardview.widget.CardView>-->
|
||||||
|
|
||||||
<LinearLayout
|
<!-- <LinearLayout-->
|
||||||
android:layout_width="0dp"
|
<!-- android:layout_width="0dp"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:layout_weight="1"
|
<!-- android:layout_weight="1"-->
|
||||||
android:orientation="vertical">
|
<!-- android:orientation="vertical">-->
|
||||||
|
|
||||||
<TextView
|
<!-- <TextView-->
|
||||||
android:layout_width="wrap_content"
|
<!-- android:layout_width="wrap_content"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:fontFamily="@font/rubik_medium"
|
<!-- android:fontFamily="@font/rubik_medium"-->
|
||||||
android:text="Automatic Reversal"
|
<!-- android:text="Demo Mode"-->
|
||||||
android:textColor="@color/colorTextTitle"
|
<!-- android:textColor="@color/colorTextTitle"-->
|
||||||
android:textSize="18sp"
|
<!-- android:textSize="18sp"-->
|
||||||
android:textStyle="bold"
|
<!-- android:textStyle="bold"-->
|
||||||
tools:fontFamily="sans-serif-medium" />
|
<!-- tools:fontFamily="sans-serif-medium" />-->
|
||||||
|
|
||||||
<TextView
|
<!-- <TextView-->
|
||||||
android:id="@+id/reversalSummary"
|
<!-- android:id="@+id/demoSummary"-->
|
||||||
android:layout_width="wrap_content"
|
<!-- android:layout_width="wrap_content"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:layout_marginTop="2dp"
|
<!-- android:layout_marginTop="2dp"-->
|
||||||
android:fontFamily="@font/rubik_regular"
|
<!-- android:fontFamily="@font/rubik_regular"-->
|
||||||
android:text="Automatic reversal enabled for failed transactions"
|
<!-- android:text="Demo mode active - Test transactions"-->
|
||||||
android:textColor="@color/colorTextContent"
|
<!-- android:textColor="@color/colorTextContent"-->
|
||||||
android:textSize="14sp"
|
<!-- android:textSize="14sp"-->
|
||||||
tools:fontFamily="sans-serif" />
|
<!-- tools:fontFamily="sans-serif" />-->
|
||||||
|
|
||||||
</LinearLayout>
|
<!-- </LinearLayout>-->
|
||||||
|
|
||||||
<Switch
|
<!-- <Switch-->
|
||||||
android:id="@+id/reversalSwitch"
|
<!-- android:id="@+id/demoSwitch"-->
|
||||||
android:layout_width="wrap_content"
|
<!-- android:layout_width="wrap_content"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:layout_marginStart="8dp"
|
<!-- android:layout_marginStart="8dp"-->
|
||||||
android:clickable="false"
|
<!-- android:clickable="false"-->
|
||||||
android:focusable="false" />
|
<!-- android:focusable="false" />-->
|
||||||
|
|
||||||
</LinearLayout>
|
<!-- </LinearLayout>-->
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
<!-- </androidx.cardview.widget.CardView>-->
|
||||||
|
|
||||||
<!-- Multi-Host Support Card -->
|
<!-- Sound Alerts Card -->
|
||||||
<androidx.cardview.widget.CardView
|
<!-- <androidx.cardview.widget.CardView-->
|
||||||
android:id="@+id/multiHostCard"
|
<!-- android:id="@+id/alertSoundCard"-->
|
||||||
android:layout_width="match_parent"
|
<!-- android:layout_width="match_parent"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:layout_marginBottom="12dp"
|
<!-- android:layout_marginBottom="12dp"-->
|
||||||
android:clickable="true"
|
<!-- android:clickable="true"-->
|
||||||
android:foreground="?android:attr/selectableItemBackground"
|
<!-- android:foreground="?android:attr/selectableItemBackground"-->
|
||||||
android:onClick="@{()->click.onMultiHostClick()}"
|
<!-- android:onClick="@{()->click.onAlertSoundClick()}"-->
|
||||||
app:cardBackgroundColor="@color/white"
|
<!-- app:cardBackgroundColor="@color/white"-->
|
||||||
app:cardCornerRadius="16dp"
|
<!-- app:cardCornerRadius="16dp"-->
|
||||||
app:cardElevation="2dp">
|
<!-- app:cardElevation="2dp">-->
|
||||||
|
|
||||||
<LinearLayout
|
<!-- <LinearLayout-->
|
||||||
android:layout_width="match_parent"
|
<!-- android:layout_width="match_parent"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:gravity="center_vertical"
|
<!-- android:gravity="center_vertical"-->
|
||||||
android:orientation="horizontal"
|
<!-- android:orientation="horizontal"-->
|
||||||
android:padding="20dp">
|
<!-- android:padding="20dp">-->
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<!-- <androidx.cardview.widget.CardView-->
|
||||||
android:layout_width="48dp"
|
<!-- android:layout_width="48dp"-->
|
||||||
android:layout_height="48dp"
|
<!-- android:layout_height="48dp"-->
|
||||||
android:layout_marginEnd="16dp"
|
<!-- android:layout_marginEnd="16dp"-->
|
||||||
app:cardBackgroundColor="@color/colorPrimary"
|
<!-- app:cardBackgroundColor="@color/colorPrimary"-->
|
||||||
app:cardCornerRadius="24dp"
|
<!-- app:cardCornerRadius="24dp"-->
|
||||||
app:cardElevation="0dp">
|
<!-- app:cardElevation="0dp">-->
|
||||||
|
|
||||||
<ImageView
|
<!-- <ImageView-->
|
||||||
android:layout_width="24dp"
|
<!-- android:layout_width="24dp"-->
|
||||||
android:layout_height="24dp"
|
<!-- android:layout_height="24dp"-->
|
||||||
android:layout_gravity="center"
|
<!-- android:layout_gravity="center"-->
|
||||||
android:src="@drawable/ic_timeout"
|
<!-- android:src="@drawable/ic_audio"-->
|
||||||
app:tint="@color/white" />
|
<!-- app:tint="@color/white" />-->
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
<!-- </androidx.cardview.widget.CardView>-->
|
||||||
|
|
||||||
<LinearLayout
|
<!-- <LinearLayout-->
|
||||||
android:layout_width="0dp"
|
<!-- android:layout_width="0dp"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:layout_weight="1"
|
<!-- android:layout_weight="1"-->
|
||||||
android:orientation="vertical">
|
<!-- android:orientation="vertical">-->
|
||||||
|
|
||||||
<TextView
|
<!-- <TextView-->
|
||||||
android:layout_width="wrap_content"
|
<!-- android:layout_width="wrap_content"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:fontFamily="@font/rubik_medium"
|
<!-- android:fontFamily="@font/rubik_medium"-->
|
||||||
android:text="Multi-Host Support"
|
<!-- android:text="Sound Alerts"-->
|
||||||
android:textColor="@color/colorTextTitle"
|
<!-- android:textColor="@color/colorTextTitle"-->
|
||||||
android:textSize="18sp"
|
<!-- android:textSize="18sp"-->
|
||||||
android:textStyle="bold"
|
<!-- android:textStyle="bold"-->
|
||||||
tools:fontFamily="sans-serif-medium" />
|
<!-- tools:fontFamily="sans-serif-medium" />-->
|
||||||
|
|
||||||
<TextView
|
<!-- <TextView-->
|
||||||
android:id="@+id/multiHostSummary"
|
<!-- android:id="@+id/alertSoundSummary"-->
|
||||||
android:layout_width="wrap_content"
|
<!-- android:layout_width="wrap_content"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:layout_marginTop="2dp"
|
<!-- android:layout_marginTop="2dp"-->
|
||||||
android:fontFamily="@font/rubik_regular"
|
<!-- android:fontFamily="@font/rubik_regular"-->
|
||||||
android:text="Multiple host support enabled"
|
<!-- android:text="Sound alerts enabled for notifications"-->
|
||||||
android:textColor="@color/colorTextContent"
|
<!-- android:textColor="@color/colorTextContent"-->
|
||||||
android:textSize="14sp"
|
<!-- android:textSize="14sp"-->
|
||||||
tools:fontFamily="sans-serif" />
|
<!-- tools:fontFamily="sans-serif" />-->
|
||||||
|
|
||||||
</LinearLayout>
|
<!-- </LinearLayout>-->
|
||||||
|
|
||||||
<Switch
|
<!-- <Switch-->
|
||||||
android:id="@+id/multiHostSwitch"
|
<!-- android:id="@+id/alertSoundSwitch"-->
|
||||||
android:layout_width="wrap_content"
|
<!-- android:layout_width="wrap_content"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:layout_marginStart="8dp"
|
<!-- android:layout_marginStart="8dp"-->
|
||||||
android:clickable="false"
|
<!-- android:clickable="false"-->
|
||||||
android:focusable="false" />
|
<!-- android:focusable="false" />-->
|
||||||
|
|
||||||
</LinearLayout>
|
<!-- </LinearLayout>-->
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
<!-- </androidx.cardview.widget.CardView>-->
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Transaction Settings Section -->
|
||||||
|
<!-- <LinearLayout-->
|
||||||
|
<!-- android:layout_width="match_parent"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:layout_marginBottom="20dp"-->
|
||||||
|
<!-- android:orientation="vertical">-->
|
||||||
|
|
||||||
|
<!-- <TextView-->
|
||||||
|
<!-- android:layout_width="wrap_content"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:layout_marginBottom="12dp"-->
|
||||||
|
<!-- android:fontFamily="@font/rubik_medium"-->
|
||||||
|
<!-- android:text="Transaction Settings"-->
|
||||||
|
<!-- android:textColor="@color/colorTextTitle"-->
|
||||||
|
<!-- android:textSize="16sp"-->
|
||||||
|
<!-- android:textStyle="bold"-->
|
||||||
|
<!-- tools:fontFamily="sans-serif-medium" />-->
|
||||||
|
|
||||||
|
<!--<!– <!– Manual Entry Card –>–>-->
|
||||||
|
<!--<!– <androidx.cardview.widget.CardView–>-->
|
||||||
|
<!--<!– android:id="@+id/manualEntryCard"–>-->
|
||||||
|
<!--<!– android:layout_width="match_parent"–>-->
|
||||||
|
<!--<!– android:layout_height="wrap_content"–>-->
|
||||||
|
<!--<!– android:layout_marginBottom="12dp"–>-->
|
||||||
|
<!--<!– android:clickable="true"–>-->
|
||||||
|
<!--<!– android:foreground="?android:attr/selectableItemBackground"–>-->
|
||||||
|
<!--<!– app:cardBackgroundColor="@color/white"–>-->
|
||||||
|
<!--<!– app:cardCornerRadius="16dp"–>-->
|
||||||
|
<!--<!– app:cardElevation="2dp">–>-->
|
||||||
|
|
||||||
|
<!--<!– <LinearLayout–>-->
|
||||||
|
<!--<!– android:layout_width="match_parent"–>-->
|
||||||
|
<!--<!– android:layout_height="wrap_content"–>-->
|
||||||
|
<!--<!– android:gravity="center_vertical"–>-->
|
||||||
|
<!--<!– android:orientation="horizontal"–>-->
|
||||||
|
<!--<!– android:padding="20dp">–>-->
|
||||||
|
|
||||||
|
<!--<!– <androidx.cardview.widget.CardView–>-->
|
||||||
|
<!--<!– android:layout_width="48dp"–>-->
|
||||||
|
<!--<!– android:layout_height="48dp"–>-->
|
||||||
|
<!--<!– android:layout_marginEnd="16dp"–>-->
|
||||||
|
<!--<!– app:cardBackgroundColor="@color/colorPrimary"–>-->
|
||||||
|
<!--<!– app:cardCornerRadius="24dp"–>-->
|
||||||
|
<!--<!– app:cardElevation="0dp">–>-->
|
||||||
|
|
||||||
|
<!--<!– <ImageView–>-->
|
||||||
|
<!--<!– android:layout_width="24dp"–>-->
|
||||||
|
<!--<!– android:layout_height="24dp"–>-->
|
||||||
|
<!--<!– android:layout_gravity="center"–>-->
|
||||||
|
<!--<!– android:src="@drawable/ic_blur"–>-->
|
||||||
|
<!--<!– app:tint="@color/white" />–>-->
|
||||||
|
|
||||||
|
<!--<!– </androidx.cardview.widget.CardView>–>-->
|
||||||
|
|
||||||
|
<!--<!– <LinearLayout–>-->
|
||||||
|
<!--<!– android:layout_width="0dp"–>-->
|
||||||
|
<!--<!– android:layout_height="wrap_content"–>-->
|
||||||
|
<!--<!– android:layout_weight="1"–>-->
|
||||||
|
<!--<!– android:orientation="vertical">–>-->
|
||||||
|
|
||||||
|
<!--<!– <TextView–>-->
|
||||||
|
<!--<!– android:layout_width="wrap_content"–>-->
|
||||||
|
<!--<!– android:layout_height="wrap_content"–>-->
|
||||||
|
<!--<!– android:fontFamily="@font/rubik_medium"–>-->
|
||||||
|
<!--<!– android:text="Manual Card Entry"–>-->
|
||||||
|
<!--<!– android:textColor="@color/colorTextTitle"–>-->
|
||||||
|
<!--<!– android:textSize="18sp"–>-->
|
||||||
|
<!--<!– android:textStyle="bold"–>-->
|
||||||
|
<!--<!– tools:fontFamily="sans-serif-medium" />–>-->
|
||||||
|
|
||||||
|
<!--<!– <TextView–>-->
|
||||||
|
<!--<!– android:id="@+id/manualEntrySummary"–>-->
|
||||||
|
<!--<!– android:layout_width="wrap_content"–>-->
|
||||||
|
<!--<!– android:layout_height="wrap_content"–>-->
|
||||||
|
<!--<!– android:layout_marginTop="2dp"–>-->
|
||||||
|
<!--<!– android:fontFamily="@font/rubik_regular"–>-->
|
||||||
|
<!--<!– android:text="Manual card entry allowed for transactions"–>-->
|
||||||
|
<!--<!– android:textColor="@color/colorTextContent"–>-->
|
||||||
|
<!--<!– android:textSize="14sp"–>-->
|
||||||
|
<!--<!– tools:fontFamily="sans-serif" />–>-->
|
||||||
|
|
||||||
|
<!--<!– </LinearLayout>–>-->
|
||||||
|
|
||||||
|
<!--<!– <Switch–>-->
|
||||||
|
<!--<!– android:id="@+id/manualEntrySwitch"–>-->
|
||||||
|
<!--<!– android:layout_width="wrap_content"–>-->
|
||||||
|
<!--<!– android:layout_height="wrap_content"–>-->
|
||||||
|
<!--<!– android:layout_marginStart="8dp"–>-->
|
||||||
|
<!--<!– android:clickable="false"–>-->
|
||||||
|
<!--<!– android:focusable="false" />–>-->
|
||||||
|
|
||||||
|
<!--<!– </LinearLayout>–>-->
|
||||||
|
|
||||||
|
<!--<!– </androidx.cardview.widget.CardView>–>-->
|
||||||
|
|
||||||
|
<!-- <!– Automatic Reversal Card –>-->
|
||||||
|
<!-- <androidx.cardview.widget.CardView-->
|
||||||
|
<!-- android:id="@+id/reversalCard"-->
|
||||||
|
<!-- android:layout_width="match_parent"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:layout_marginBottom="12dp"-->
|
||||||
|
<!-- android:clickable="true"-->
|
||||||
|
<!-- android:foreground="?android:attr/selectableItemBackground"-->
|
||||||
|
<!-- android:onClick="@{()->click.onReversalClick()}"-->
|
||||||
|
<!-- app:cardBackgroundColor="@color/white"-->
|
||||||
|
<!-- app:cardCornerRadius="16dp"-->
|
||||||
|
<!-- app:cardElevation="2dp">-->
|
||||||
|
|
||||||
|
<!-- <LinearLayout-->
|
||||||
|
<!-- android:layout_width="match_parent"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:gravity="center_vertical"-->
|
||||||
|
<!-- android:orientation="horizontal"-->
|
||||||
|
<!-- android:padding="20dp">-->
|
||||||
|
|
||||||
|
<!-- <androidx.cardview.widget.CardView-->
|
||||||
|
<!-- android:layout_width="48dp"-->
|
||||||
|
<!-- android:layout_height="48dp"-->
|
||||||
|
<!-- android:layout_marginEnd="16dp"-->
|
||||||
|
<!-- app:cardBackgroundColor="@color/colorPrimary"-->
|
||||||
|
<!-- app:cardCornerRadius="24dp"-->
|
||||||
|
<!-- app:cardElevation="0dp">-->
|
||||||
|
|
||||||
|
<!-- <ImageView-->
|
||||||
|
<!-- android:layout_width="24dp"-->
|
||||||
|
<!-- android:layout_height="24dp"-->
|
||||||
|
<!-- android:layout_gravity="center"-->
|
||||||
|
<!-- android:src="@drawable/ic_swap"-->
|
||||||
|
<!-- app:tint="@color/white" />-->
|
||||||
|
|
||||||
|
<!-- </androidx.cardview.widget.CardView>-->
|
||||||
|
|
||||||
|
<!-- <LinearLayout-->
|
||||||
|
<!-- android:layout_width="0dp"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:layout_weight="1"-->
|
||||||
|
<!-- android:orientation="vertical">-->
|
||||||
|
|
||||||
|
<!-- <TextView-->
|
||||||
|
<!-- android:layout_width="wrap_content"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:fontFamily="@font/rubik_medium"-->
|
||||||
|
<!-- android:text="Automatic Reversal"-->
|
||||||
|
<!-- android:textColor="@color/colorTextTitle"-->
|
||||||
|
<!-- android:textSize="18sp"-->
|
||||||
|
<!-- android:textStyle="bold"-->
|
||||||
|
<!-- tools:fontFamily="sans-serif-medium" />-->
|
||||||
|
|
||||||
|
<!-- <TextView-->
|
||||||
|
<!-- android:id="@+id/reversalSummary"-->
|
||||||
|
<!-- android:layout_width="wrap_content"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:layout_marginTop="2dp"-->
|
||||||
|
<!-- android:fontFamily="@font/rubik_regular"-->
|
||||||
|
<!-- android:text="Automatic reversal enabled for failed transactions"-->
|
||||||
|
<!-- android:textColor="@color/colorTextContent"-->
|
||||||
|
<!-- android:textSize="14sp"-->
|
||||||
|
<!-- tools:fontFamily="sans-serif" />-->
|
||||||
|
|
||||||
|
<!-- </LinearLayout>-->
|
||||||
|
|
||||||
|
<!-- <Switch-->
|
||||||
|
<!-- android:id="@+id/reversalSwitch"-->
|
||||||
|
<!-- android:layout_width="wrap_content"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:layout_marginStart="8dp"-->
|
||||||
|
<!-- android:clickable="false"-->
|
||||||
|
<!-- android:focusable="false" />-->
|
||||||
|
|
||||||
|
<!-- </LinearLayout>-->
|
||||||
|
|
||||||
|
<!-- </androidx.cardview.widget.CardView>-->
|
||||||
|
|
||||||
|
<!-- <!– Multi-Host Support Card –>-->
|
||||||
|
<!-- <androidx.cardview.widget.CardView-->
|
||||||
|
<!-- android:id="@+id/multiHostCard"-->
|
||||||
|
<!-- android:layout_width="match_parent"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:layout_marginBottom="12dp"-->
|
||||||
|
<!-- android:clickable="true"-->
|
||||||
|
<!-- android:foreground="?android:attr/selectableItemBackground"-->
|
||||||
|
<!-- android:onClick="@{()->click.onMultiHostClick()}"-->
|
||||||
|
<!-- app:cardBackgroundColor="@color/white"-->
|
||||||
|
<!-- app:cardCornerRadius="16dp"-->
|
||||||
|
<!-- app:cardElevation="2dp">-->
|
||||||
|
|
||||||
|
<!-- <LinearLayout-->
|
||||||
|
<!-- android:layout_width="match_parent"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:gravity="center_vertical"-->
|
||||||
|
<!-- android:orientation="horizontal"-->
|
||||||
|
<!-- android:padding="20dp">-->
|
||||||
|
|
||||||
|
<!-- <androidx.cardview.widget.CardView-->
|
||||||
|
<!-- android:layout_width="48dp"-->
|
||||||
|
<!-- android:layout_height="48dp"-->
|
||||||
|
<!-- android:layout_marginEnd="16dp"-->
|
||||||
|
<!-- app:cardBackgroundColor="@color/colorPrimary"-->
|
||||||
|
<!-- app:cardCornerRadius="24dp"-->
|
||||||
|
<!-- app:cardElevation="0dp">-->
|
||||||
|
|
||||||
|
<!-- <ImageView-->
|
||||||
|
<!-- android:layout_width="24dp"-->
|
||||||
|
<!-- android:layout_height="24dp"-->
|
||||||
|
<!-- android:layout_gravity="center"-->
|
||||||
|
<!-- android:src="@drawable/ic_timeout"-->
|
||||||
|
<!-- app:tint="@color/white" />-->
|
||||||
|
|
||||||
|
<!-- </androidx.cardview.widget.CardView>-->
|
||||||
|
|
||||||
|
<!-- <LinearLayout-->
|
||||||
|
<!-- android:layout_width="0dp"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:layout_weight="1"-->
|
||||||
|
<!-- android:orientation="vertical">-->
|
||||||
|
|
||||||
|
<!-- <TextView-->
|
||||||
|
<!-- android:layout_width="wrap_content"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:fontFamily="@font/rubik_medium"-->
|
||||||
|
<!-- android:text="Multi-Host Support"-->
|
||||||
|
<!-- android:textColor="@color/colorTextTitle"-->
|
||||||
|
<!-- android:textSize="18sp"-->
|
||||||
|
<!-- android:textStyle="bold"-->
|
||||||
|
<!-- tools:fontFamily="sans-serif-medium" />-->
|
||||||
|
|
||||||
|
<!-- <TextView-->
|
||||||
|
<!-- android:id="@+id/multiHostSummary"-->
|
||||||
|
<!-- android:layout_width="wrap_content"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:layout_marginTop="2dp"-->
|
||||||
|
<!-- android:fontFamily="@font/rubik_regular"-->
|
||||||
|
<!-- android:text="Multiple host support enabled"-->
|
||||||
|
<!-- android:textColor="@color/colorTextContent"-->
|
||||||
|
<!-- android:textSize="14sp"-->
|
||||||
|
<!-- tools:fontFamily="sans-serif" />-->
|
||||||
|
|
||||||
|
<!-- </LinearLayout>-->
|
||||||
|
|
||||||
|
<!-- <Switch-->
|
||||||
|
<!-- android:id="@+id/multiHostSwitch"-->
|
||||||
|
<!-- android:layout_width="wrap_content"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:layout_marginStart="8dp"-->
|
||||||
|
<!-- android:clickable="false"-->
|
||||||
|
<!-- android:focusable="false" />-->
|
||||||
|
|
||||||
|
<!-- </LinearLayout>-->
|
||||||
|
|
||||||
|
<!-- </androidx.cardview.widget.CardView>-->
|
||||||
|
|
||||||
|
<!-- </LinearLayout>-->
|
||||||
|
|
||||||
<!-- System Configuration Section -->
|
<!-- System Configuration Section -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
@ -91,7 +91,7 @@
|
|||||||
app:layout_constraintBottom_toTopOf="@+id/actionButtonsContainer">
|
app:layout_constraintBottom_toTopOf="@+id/actionButtonsContainer">
|
||||||
|
|
||||||
<!-- Card with border -->
|
<!-- Card with border -->
|
||||||
<LinearLayout
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_margin="2dp"
|
android:layout_margin="2dp"
|
||||||
@ -477,13 +477,18 @@
|
|||||||
tools:text="12/12/2024 12:12:12" />
|
tools:text="12/12/2024 12:12:12" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
</LinearLayout>
|
</FrameLayout>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/scroll_hint"
|
||||||
|
android:layout_width="26dp"
|
||||||
|
android:layout_height="26dp"
|
||||||
|
android:layout_gravity="bottom|center_horizontal"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:src="@drawable/ic_down_arrow"
|
||||||
|
android:alpha="0.6" />
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<!-- Action Buttons Container -->
|
<!-- Action Buttons Container -->
|
||||||
|
|||||||
160
app/src/main/res/layout/item_qr_history.xml
Normal file
160
app/src/main/res/layout/item_qr_history.xml
Normal file
@ -0,0 +1,160 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
>
|
||||||
|
|
||||||
|
<data>
|
||||||
|
<import type="com.utsmyanmar.paylibs.utils.POSUtil"/>
|
||||||
|
<variable
|
||||||
|
name="payDetail"
|
||||||
|
type="com.utsmyanmar.paylibs.model.PayDetail" />
|
||||||
|
<variable
|
||||||
|
name="onItemClick"
|
||||||
|
type="com.utsmm.kbz.ui.management.ItemClickListener" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="4dp"
|
||||||
|
android:layout_marginVertical="6dp"
|
||||||
|
app:cardCornerRadius="12dp"
|
||||||
|
app:cardElevation="0dp"
|
||||||
|
app:cardBackgroundColor="@color/colorPrimary"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:foreground="?android:attr/selectableItemBackground"
|
||||||
|
android:onClick="@{() -> onItemClick.onClickCard(payDetail)}">
|
||||||
|
|
||||||
|
<!-- Card with border -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="2dp"
|
||||||
|
android:background="@drawable/bg_edittext_primary_border"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<!-- Transaction Icon -->
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:src="@drawable/ic_custom_pos"
|
||||||
|
app:tint="@color/white"
|
||||||
|
android:alpha="0.8"
|
||||||
|
android:layout_marginEnd="12dp"
|
||||||
|
android:layout_gravity="top" />
|
||||||
|
|
||||||
|
<!-- Transaction Details -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- Transaction Type and Amount Row -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginBottom="8dp">
|
||||||
|
|
||||||
|
<!-- Transaction Type -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@{POSUtil.getInstance().getTransName(payDetail)}"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
tools:text="SALE" />
|
||||||
|
|
||||||
|
<!-- Transaction Amount -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{POSUtil.getInstance().checkMinusSign(payDetail.transactionType)+POSUtil.getInstance().getDecimalAmountSeparatorFormat(payDetail.amount) + ` `+POSUtil.getInstance().currencyCodeToText(payDetail.currencyCode)}"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
tools:text="1,000.00 MMK" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Transaction Date -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{POSUtil.getInstance().convertDateFormatByDateString(payDetail.transDate)}"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:alpha="0.8"
|
||||||
|
android:fontFamily="sans-serif"
|
||||||
|
android:layout_marginBottom="6dp"
|
||||||
|
tools:text="2022-11-26" />
|
||||||
|
|
||||||
|
<!-- Card Number -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{POSUtil.getInstance().getCardNumMasking(payDetail.cardNo)}"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:alpha="0.8"
|
||||||
|
android:fontFamily="monospace"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
tools:text="468785******9564" />
|
||||||
|
|
||||||
|
<!-- Trace and RRN Row -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<!-- Trace Number -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
app:isTrace="@{payDetail}"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:alpha="0.7"
|
||||||
|
android:fontFamily="monospace"
|
||||||
|
tools:text="TRC:000050" />
|
||||||
|
|
||||||
|
<!-- RRN -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@{`RRN:`+payDetail.referNo}"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:alpha="0.7"
|
||||||
|
android:fontFamily="monospace"
|
||||||
|
android:textAlignment="textEnd"
|
||||||
|
tools:text="RRN:233001786242" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Arrow Icon -->
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="16dp"
|
||||||
|
android:src="@drawable/ic_right_arrow"
|
||||||
|
app:tint="@color/white"
|
||||||
|
android:alpha="0.6"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="8dp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
</layout>
|
||||||
74
app/src/main/res/layout/item_qr_pay_button.xml
Normal file
74
app/src/main/res/layout/item_qr_pay_button.xml
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
<import type="com.utsmm.kbz.R"/>
|
||||||
|
<import type="com.utsmm.kbz.util.enums.FeaturesType" />
|
||||||
|
<variable
|
||||||
|
name="text"
|
||||||
|
type="String" />
|
||||||
|
<variable
|
||||||
|
name="icon"
|
||||||
|
type="Integer" />
|
||||||
|
</data>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
>
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/btnItem"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:cardCornerRadius="20dp"
|
||||||
|
app:cardElevation="6dp"
|
||||||
|
android:layout_margin="6dp"
|
||||||
|
android:foreground="?android:attr/selectableItemBackground"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:background="@color/white"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintDimensionRatio="1:1"
|
||||||
|
>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/btnIcon"
|
||||||
|
android:layout_width="38dp"
|
||||||
|
android:layout_height="38dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
app:srcUrl="@{icon}"
|
||||||
|
app:tint="@color/colorPrimary"
|
||||||
|
tools:src="@drawable/ic_sale"
|
||||||
|
tools:tint="@color/colorPrimary" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:fontFamily="@font/rubik_medium"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:text="@{text}"
|
||||||
|
tools:text="button title"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="@color/colorPrimary"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</layout>
|
||||||
159
app/src/main/res/layout/item_qr_refund.xml
Normal file
159
app/src/main/res/layout/item_qr_refund.xml
Normal file
@ -0,0 +1,159 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
>
|
||||||
|
|
||||||
|
<data>
|
||||||
|
<import type="com.utsmyanmar.paylibs.utils.POSUtil"/>
|
||||||
|
<variable
|
||||||
|
name="payDetail"
|
||||||
|
type="com.utsmyanmar.paylibs.model.PayDetail" />
|
||||||
|
<variable
|
||||||
|
name="onItemClick"
|
||||||
|
type="com.utsmm.kbz.ui.qr_pay.QRRefundFragment.ClickEvent" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="4dp"
|
||||||
|
android:layout_margin="8dp"
|
||||||
|
android:layout_marginVertical="6dp"
|
||||||
|
app:cardCornerRadius="12dp"
|
||||||
|
app:cardElevation="0dp"
|
||||||
|
app:cardBackgroundColor="@color/white"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:foreground="?android:attr/selectableItemBackground"
|
||||||
|
android:onClick="@{() -> onItemClick.onCancel()}">
|
||||||
|
|
||||||
|
<!-- Card with border -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="2dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:background="@drawable/bg_edittext_primary_border"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Transaction Icon -->
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:src="@drawable/ic_custom_pos"
|
||||||
|
app:tint="@color/colorPrimary"
|
||||||
|
android:alpha="0.8"
|
||||||
|
android:layout_marginEnd="12dp"
|
||||||
|
android:layout_gravity="top" />
|
||||||
|
|
||||||
|
<!-- Transaction Details -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- Transaction Type and Amount Row -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginBottom="8dp">
|
||||||
|
|
||||||
|
<!-- Transaction Type -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@{POSUtil.getInstance().getTransName(payDetail)}"
|
||||||
|
android:textColor="@color/colorPrimary"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
tools:text="SALE" />
|
||||||
|
|
||||||
|
<!-- Transaction Amount -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{POSUtil.getInstance().checkMinusSign(payDetail.transactionType)+POSUtil.getInstance().getDecimalAmountSeparatorFormat(payDetail.amount) + ` `+POSUtil.getInstance().currencyCodeToText(payDetail.currencyCode)}"
|
||||||
|
android:textColor="@color/colorPrimary"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
tools:text="1,000.00 MMK" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Transaction Date -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{POSUtil.getInstance().convertDateFormatByDateString(payDetail.transDate)}"
|
||||||
|
android:textColor="@color/colorPrimary"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:alpha="0.8"
|
||||||
|
android:fontFamily="sans-serif"
|
||||||
|
android:layout_marginBottom="6dp"
|
||||||
|
tools:text="2022-11-26" />
|
||||||
|
|
||||||
|
<!-- Card Number -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{POSUtil.getInstance().getCardNumMasking(payDetail.cardNo)}"
|
||||||
|
android:textColor="@color/colorPrimary"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:alpha="0.8"
|
||||||
|
android:fontFamily="monospace"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
tools:text="468785******9564" />
|
||||||
|
|
||||||
|
<!-- Trace and RRN Row -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<!-- Trace Number -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
app:isTrace="@{payDetail}"
|
||||||
|
android:textColor="@color/colorPrimary"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:alpha="0.7"
|
||||||
|
android:fontFamily="monospace"
|
||||||
|
tools:text="TRC:000050" />
|
||||||
|
|
||||||
|
<!-- RRN -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@{`RRN:`+payDetail.referNo}"
|
||||||
|
android:textColor="@color/colorPrimary"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:alpha="0.7"
|
||||||
|
android:fontFamily="monospace"
|
||||||
|
android:textAlignment="textEnd"
|
||||||
|
tools:text="RRN:233001786242" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Arrow Icon -->
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="16dp"
|
||||||
|
android:src="@drawable/ic_right_arrow"
|
||||||
|
app:tint="@color/colorPrimary"
|
||||||
|
android:alpha="0.6"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="8dp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
</layout>
|
||||||
@ -5,58 +5,61 @@
|
|||||||
|
|
||||||
<data>
|
<data>
|
||||||
<import type="com.utsmm.kbz.R"/>
|
<import type="com.utsmm.kbz.R"/>
|
||||||
|
|
||||||
<import type="com.utsmm.kbz.util.enums.FeaturesType" />
|
|
||||||
<variable
|
<variable
|
||||||
name="item"
|
name="item"
|
||||||
type="com.utsmm.kbz.config.data.model.Features" />
|
type="com.utsmm.kbz.config.data.model.Features" />
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:id="@+id/trans_card"
|
android:id="@+id/trans_card"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="100dp"
|
||||||
android:layout_height="180dp"
|
android:layout_height="100dp"
|
||||||
android:layout_margin="8dp"
|
android:layout_margin="6dp"
|
||||||
app:cardCornerRadius="20dp"
|
android:foreground="?android:attr/selectableItemBackground"
|
||||||
app:cardElevation="6dp"
|
android:clickable="true"
|
||||||
android:foreground="?android:attr/selectableItemBackground"
|
android:focusable="true"
|
||||||
android:clickable="true"
|
app:cardCornerRadius="20dp"
|
||||||
app:disableBtn="@{item.isActive}"
|
app:cardElevation="6dp"
|
||||||
android:focusable="true">
|
app:disableBtn="@{item.isActive}"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintDimensionRatio="1:1">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
|
||||||
android:gravity="center"
|
|
||||||
android:background="@drawable/primary_card_bg"
|
|
||||||
android:padding="16dp">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="48dp"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
app:srcUrl="@{item.drawable}"
|
|
||||||
app:tint="@color/white"
|
|
||||||
tools:tint="@color/white"
|
|
||||||
tools:src="@drawable/ic_sale" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:fontFamily="@font/rubik_medium"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:textAlignment="center"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:text="@{item.name}"
|
|
||||||
tools:text="SALE"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:maxLines="2"
|
android:orientation="vertical"
|
||||||
android:ellipsize="end" />
|
android:padding="16dp"
|
||||||
|
android:background="@color/white">
|
||||||
|
|
||||||
</LinearLayout>
|
<ImageView
|
||||||
|
android:id="@+id/btnIcon"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
app:srcUrl="@{item.drawable}"
|
||||||
|
app:tint="@color/colorPrimary"
|
||||||
|
tools:src="@drawable/ic_sale"
|
||||||
|
tools:tint="@color/colorPrimary" />
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@{item.name}"
|
||||||
|
tools:text="button title"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="@color/colorPrimary"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
</layout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
|
||||||
|
</layout>
|
||||||
|
|||||||
62
app/src/main/res/layout/item_view_dashboard_old.xml
Normal file
62
app/src/main/res/layout/item_view_dashboard_old.xml
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
<import type="com.utsmm.kbz.R"/>
|
||||||
|
|
||||||
|
<import type="com.utsmm.kbz.util.enums.FeaturesType" />
|
||||||
|
<variable
|
||||||
|
name="item"
|
||||||
|
type="com.utsmm.kbz.config.data.model.Features" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/trans_card"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="180dp"
|
||||||
|
android:layout_margin="8dp"
|
||||||
|
app:cardCornerRadius="20dp"
|
||||||
|
app:cardElevation="6dp"
|
||||||
|
android:foreground="?android:attr/selectableItemBackground"
|
||||||
|
android:clickable="true"
|
||||||
|
app:disableBtn="@{item.isActive}"
|
||||||
|
android:focusable="true">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center"
|
||||||
|
android:background="@drawable/primary_card_bg"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
app:srcUrl="@{item.drawable}"
|
||||||
|
app:tint="@color/white"
|
||||||
|
tools:tint="@color/white"
|
||||||
|
tools:src="@drawable/ic_sale" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="@font/rubik_medium"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:text="@{item.name}"
|
||||||
|
tools:text="SALE"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:ellipsize="end" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</layout>
|
||||||
@ -62,6 +62,9 @@
|
|||||||
<action
|
<action
|
||||||
android:id="@+id/action_nav_settings_to_deleteKeyFragment"
|
android:id="@+id/action_nav_settings_to_deleteKeyFragment"
|
||||||
app:destination="@id/deleteKeyFragment" />
|
app:destination="@id/deleteKeyFragment" />
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_nav_settings_to_injectKeyFragment"
|
||||||
|
app:destination="@id/injectKeyFragment" />
|
||||||
|
|
||||||
</fragment>
|
</fragment>
|
||||||
<fragment
|
<fragment
|
||||||
@ -141,6 +144,9 @@
|
|||||||
<action
|
<action
|
||||||
android:id="@+id/action_nav_main_to_QRConnectingFragment"
|
android:id="@+id/action_nav_main_to_QRConnectingFragment"
|
||||||
app:destination="@id/QRConnectingFragment" />
|
app:destination="@id/QRConnectingFragment" />
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_nav_main_to_qrFragment"
|
||||||
|
app:destination="@id/qrFragment" />
|
||||||
<action
|
<action
|
||||||
app:launchSingleTop="true"
|
app:launchSingleTop="true"
|
||||||
app:popUpTo="@+id/nav_main"
|
app:popUpTo="@+id/nav_main"
|
||||||
@ -186,6 +192,12 @@
|
|||||||
app:popUpToInclusive="true"
|
app:popUpToInclusive="true"
|
||||||
android:id="@+id/action_cardWaitingFragment_to_nav_main"
|
android:id="@+id/action_cardWaitingFragment_to_nav_main"
|
||||||
app:destination="@id/nav_main" />
|
app:destination="@id/nav_main" />
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_cardWaitingFragment_to_pinPadFragment"
|
||||||
|
app:launchSingleTop="true"
|
||||||
|
app:popUpTo="@+id/cardWaitingFragment"
|
||||||
|
app:popUpToInclusive="true"
|
||||||
|
app:destination="@id/pinPadFragment" />
|
||||||
</fragment>
|
</fragment>
|
||||||
<fragment
|
<fragment
|
||||||
tools:layout="@layout/fragment_emv_input_pin"
|
tools:layout="@layout/fragment_emv_input_pin"
|
||||||
@ -276,6 +288,12 @@
|
|||||||
android:name="com.utsmm.kbz.ui.settings.ConfigSettingsFragment"
|
android:name="com.utsmm.kbz.ui.settings.ConfigSettingsFragment"
|
||||||
android:label="ConfigSettingsFragment" />
|
android:label="ConfigSettingsFragment" />
|
||||||
|
|
||||||
|
<fragment
|
||||||
|
android:id="@+id/injectKeyFragment"
|
||||||
|
android:name="com.utsmm.kbz.ui.settings.InjectKeyFragment"
|
||||||
|
android:label="InjectKeyFragment"
|
||||||
|
tools:layout="@layout/fragment_inject_key" />
|
||||||
|
|
||||||
<fragment
|
<fragment
|
||||||
tools:layout="@layout/fragment_password_screen"
|
tools:layout="@layout/fragment_password_screen"
|
||||||
android:id="@+id/inputPasswordFragment"
|
android:id="@+id/inputPasswordFragment"
|
||||||
@ -332,6 +350,18 @@
|
|||||||
app:popUpToInclusive="true"
|
app:popUpToInclusive="true"
|
||||||
android:id="@+id/action_inputPasswordFragment_to_inputTraceFragment"
|
android:id="@+id/action_inputPasswordFragment_to_inputTraceFragment"
|
||||||
app:destination="@id/inputTraceFragment" />
|
app:destination="@id/inputTraceFragment" />
|
||||||
|
<action
|
||||||
|
app:launchSingleTop="true"
|
||||||
|
app:popUpTo="@+id/inputPasswordFragment"
|
||||||
|
app:popUpToInclusive="true"
|
||||||
|
android:id="@+id/action_inputPasswordFragment_to_qrRefundList"
|
||||||
|
app:destination="@id/qrRefundList" />
|
||||||
|
<action
|
||||||
|
app:launchSingleTop="true"
|
||||||
|
app:popUpTo="@+id/inputPasswordFragment"
|
||||||
|
app:popUpToInclusive="true"
|
||||||
|
android:id="@+id/action_inputPasswordFragment_to_QRRefundProcessFragment"
|
||||||
|
app:destination="@id/QRRefundProcessFragment" />
|
||||||
|
|
||||||
</fragment>
|
</fragment>
|
||||||
|
|
||||||
@ -1070,6 +1100,72 @@
|
|||||||
android:id="@+id/action_receiptFragment_to_nav_main"
|
android:id="@+id/action_receiptFragment_to_nav_main"
|
||||||
app:destination="@id/nav_main" />
|
app:destination="@id/nav_main" />
|
||||||
</fragment>
|
</fragment>
|
||||||
|
<!-- qr menu-->
|
||||||
|
<fragment
|
||||||
|
android:id="@+id/qrFragment"
|
||||||
|
tools:layout="@layout/fragment_qr_pay"
|
||||||
|
android:name="com.utsmm.kbz.ui.qr_pay.QRPayFragment"
|
||||||
|
android:label="QRPayFragment" >
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_qrFragment_to_inputAmountFragment"
|
||||||
|
app:destination="@id/inputAmountFragment" />
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_qrFragment_to_qrHistory"
|
||||||
|
app:destination="@id/reprintAnyTransactionFragment"
|
||||||
|
/>
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_qrFragment_to_qr_refund_list"
|
||||||
|
app:destination="@id/qrRefundList"
|
||||||
|
/>
|
||||||
|
</fragment>
|
||||||
|
<fragment
|
||||||
|
android:id="@+id/qrRefundList"
|
||||||
|
tools:layout="@layout/fragment_qr_refund"
|
||||||
|
android:name="com.utsmm.kbz.ui.qr_pay.QRRefundFragment"
|
||||||
|
>
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_qrRefundList_to_qrRefundDetail"
|
||||||
|
app:destination="@id/qrRefundDetail"
|
||||||
|
/>
|
||||||
|
</fragment>
|
||||||
|
<fragment
|
||||||
|
android:id="@+id/qrRefundDetail"
|
||||||
|
tools:layout="@layout/fragment_qr_refund_detail"
|
||||||
|
android:name="com.utsmm.kbz.ui.qr_pay.QRRefundDetailFragment"
|
||||||
|
>
|
||||||
|
<action
|
||||||
|
app:launchSingleTop="true"
|
||||||
|
app:popUpToInclusive="true"
|
||||||
|
app:popUpTo="@id/mobile_navigation"
|
||||||
|
android:id="@+id/action_qrRefundDetail_to_nav_main"
|
||||||
|
app:destination="@id/nav_main" />
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_qrRefundDetail_inputPasswordFragment"
|
||||||
|
app:destination="@id/inputPasswordFragment"
|
||||||
|
/>
|
||||||
|
<!-- <action-->
|
||||||
|
<!-- app:launchSingleTop="true"-->
|
||||||
|
<!-- app:popUpTo="@id/qrRefundList"-->
|
||||||
|
<!-- app:popUpToInclusive="false"-->
|
||||||
|
<!-- android:id="@+id/action_qrRefundDetail_to_password"-->
|
||||||
|
<!-- app:destination="@id/QRRefundProcessFragment" />-->
|
||||||
|
</fragment>
|
||||||
|
<fragment
|
||||||
|
tools:layout="@layout/fragment_qr_refund_process"
|
||||||
|
android:id="@+id/QRRefundProcessFragment"
|
||||||
|
android:name="com.utsmm.kbz.ui.qr_pay.QRRefundProcessFragment"
|
||||||
|
android:label="QRRefundProcessFragment" >
|
||||||
|
<action
|
||||||
|
app:launchSingleTop="true"
|
||||||
|
app:popUpTo="@+id/QRRefundProcessFragment"
|
||||||
|
app:popUpToInclusive="true"
|
||||||
|
android:id="@+id/action_QRRefundProcessFragment_to_transactionResultFragment"
|
||||||
|
app:destination="@id/transactionResultFragment" />
|
||||||
|
<action
|
||||||
|
app:launchSingleTop="true"
|
||||||
|
app:popUpTo="@+id/QRRefundProcessFragment"
|
||||||
|
app:popUpToInclusive="true"
|
||||||
|
android:id="@+id/action_QRRefundProcessFragment_to_nav_main"
|
||||||
|
app:destination="@id/nav_main" />
|
||||||
|
</fragment>
|
||||||
</navigation>
|
</navigation>
|
||||||
@ -308,7 +308,7 @@
|
|||||||
<string name="title_processing">Processing</string>
|
<string name="title_processing">Processing</string>
|
||||||
<string name="enter_trans_id_text">Enter Transaction Id</string>
|
<string name="enter_trans_id_text">Enter Transaction Id</string>
|
||||||
<string name="title_trans_id">Transaction Id</string>
|
<string name="title_trans_id">Transaction Id</string>
|
||||||
<string name="title_wave_pay">Wave Pay</string>
|
<string name="title_wave_pay">MMQR Pay</string>
|
||||||
<string name="title_qr_scan">QR Scan</string>
|
<string name="title_qr_scan">QR Scan</string>
|
||||||
<string name="txt_wave_pay_description">Please scan here to complete your payment.</string>
|
<string name="txt_wave_pay_description">Please scan here to complete your payment.</string>
|
||||||
<string name="txt_title_papaer_roll">Paper roll not found!</string>
|
<string name="txt_title_papaer_roll">Paper roll not found!</string>
|
||||||
@ -362,6 +362,7 @@
|
|||||||
<string name="alert_sound_title">Alert Sound</string>
|
<string name="alert_sound_title">Alert Sound</string>
|
||||||
<string name="title_echo">Echo Test</string>
|
<string name="title_echo">Echo Test</string>
|
||||||
<string name="txt_processing_card">Processing card, please wait...</string>
|
<string name="txt_processing_card">Processing card, please wait...</string>
|
||||||
|
<string name="txt_processing_refund">Processing refund, please wait...</string>
|
||||||
<string name="title_processing_card">Processing Card</string>
|
<string name="title_processing_card">Processing Card</string>
|
||||||
<string name="title_log_on">Log-On</string>
|
<string name="title_log_on">Log-On</string>
|
||||||
<string name="title_log_off">Log-Off</string>
|
<string name="title_log_off">Log-Off</string>
|
||||||
@ -436,6 +437,7 @@
|
|||||||
<string name="txt_printing_settlement_report">Printing Settlement Report</string>
|
<string name="txt_printing_settlement_report">Printing Settlement Report</string>
|
||||||
<string name="txt_printing_settlement_report_failure">Printing Settlement Report Failed!\nPlease load paper roll.</string>
|
<string name="txt_printing_settlement_report_failure">Printing Settlement Report Failed!\nPlease load paper roll.</string>
|
||||||
<string name="txt_function_not_supported">FUNCTION NOT SUPPORTED</string>
|
<string name="txt_function_not_supported">FUNCTION NOT SUPPORTED</string>
|
||||||
|
<string name="txt_alert_pre_auth_cancel">ONLY ALLOWS MANUAL ENTRY</string>
|
||||||
<string name="txt_card_not_supported">CARD NOT SUPPORTED</string>
|
<string name="txt_card_not_supported">CARD NOT SUPPORTED</string>
|
||||||
<string name="title_ecr">ECR</string>
|
<string name="title_ecr">ECR</string>
|
||||||
<string name="txt_connect">Connect</string>
|
<string name="txt_connect">Connect</string>
|
||||||
@ -515,6 +517,7 @@
|
|||||||
<string name="txt_error_occurred">Error Occured</string>
|
<string name="txt_error_occurred">Error Occured</string>
|
||||||
<string name="error_occurred">Error Occured</string>
|
<string name="error_occurred">Error Occured</string>
|
||||||
<string name="nav_app_bar_open_drawer_description">Open navigation drawer</string>
|
<string name="nav_app_bar_open_drawer_description">Open navigation drawer</string>
|
||||||
|
<string name="no_history">No History yet</string>
|
||||||
<string-array name="pref_bank_name">
|
<string-array name="pref_bank_name">
|
||||||
<item>UTS</item>
|
<item>UTS</item>
|
||||||
<item>YOMA Bank</item>
|
<item>YOMA Bank</item>
|
||||||
|
|||||||
@ -6,5 +6,9 @@
|
|||||||
<domain includeSubdomains="true">128.199.170.203</domain>
|
<domain includeSubdomains="true">128.199.170.203</domain>
|
||||||
<domain includeSubdomains="true">152.42.199.193</domain>
|
<domain includeSubdomains="true">152.42.199.193</domain>
|
||||||
<domain includeSubdomains="true">api.kbzpay.com</domain>
|
<domain includeSubdomains="true">api.kbzpay.com</domain>
|
||||||
|
<domain-config>
|
||||||
|
<domain includeSubdomains="true">receipt-nest.utsmyanmar.com</domain>
|
||||||
|
</domain-config>
|
||||||
|
<domain includeSubdomains="true">sirius-nest.utsmyanmar.com</domain>
|
||||||
</domain-config>
|
</domain-config>
|
||||||
</network-security-config>
|
</network-security-config>
|
||||||
@ -14,4 +14,7 @@ public class ExampleUnitTest {
|
|||||||
public void addition_isCorrect() {
|
public void addition_isCorrect() {
|
||||||
assertEquals(4, 2 + 2);
|
assertEquals(4, 2 + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -84,6 +84,7 @@ dependencies {
|
|||||||
implementation project(path: ':paysdk-lib')
|
implementation project(path: ':paysdk-lib')
|
||||||
implementation project(path: ':nexsdk-lib')
|
implementation project(path: ':nexsdk-lib')
|
||||||
implementation project(path: ':xpay')
|
implementation project(path: ':xpay')
|
||||||
|
implementation project(path: ':nexdlkey-lib')
|
||||||
|
|
||||||
// implementation 'com.sunmi:printerlibrary:1.0.9'
|
// implementation 'com.sunmi:printerlibrary:1.0.9'
|
||||||
implementation 'com.sunmi:printerlibrary:1.0.23'
|
implementation 'com.sunmi:printerlibrary:1.0.23'
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import com.sunmi.pay.hardware.aidl.AidlConstants;
|
|||||||
import com.sunmi.pay.hardware.aidlv2.AidlConstantsV2;
|
import com.sunmi.pay.hardware.aidlv2.AidlConstantsV2;
|
||||||
import com.sunmi.pay.hardware.aidlv2.security.SecurityOptV2;
|
import com.sunmi.pay.hardware.aidlv2.security.SecurityOptV2;
|
||||||
import com.utsmyanmar.paylibs.Constant;
|
import com.utsmyanmar.paylibs.Constant;
|
||||||
|
import com.utsmyanmar.paylibs.PayLibNex;
|
||||||
import com.utsmyanmar.paylibs.utils.core_utils.ByteUtil;
|
import com.utsmyanmar.paylibs.utils.core_utils.ByteUtil;
|
||||||
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation;
|
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation;
|
||||||
import com.utsmyanmar.paylibs.utils.secure.TriDes;
|
import com.utsmyanmar.paylibs.utils.secure.TriDes;
|
||||||
@ -24,8 +25,11 @@ public final class TerminalKeyUtil {
|
|||||||
|
|
||||||
public static final String TAG = TerminalKeyUtil.class.getSimpleName();
|
public static final String TAG = TerminalKeyUtil.class.getSimpleName();
|
||||||
|
|
||||||
private static final byte[] main_key_data = ByteUtil.hexStr2Bytes("875f63741753d18811a3449090d1777b".toUpperCase());
|
// private static final byte[] main_key_data = ByteUtil.hexStr2Bytes("875f63741753d18811a3449090d1777b".toUpperCase()); // KBZ UAT
|
||||||
|
private static final byte[] main_key_data = ByteUtil.hexStr2Bytes("e121249099a677e8b7d4f6a9d49fe8d1".toUpperCase()); // MPU
|
||||||
private static final byte[] work_key_data = new byte[16];
|
private static final byte[] work_key_data = new byte[16];
|
||||||
|
|
||||||
|
|
||||||
public static void initNexKey() {
|
public static void initNexKey() {
|
||||||
byte[] IPEKByte = ByteUtil.hexStr2Bytes("5A4CFF6DE93F0488926166F3317EFD2F"); // IPEK
|
byte[] IPEKByte = ByteUtil.hexStr2Bytes("5A4CFF6DE93F0488926166F3317EFD2F"); // IPEK
|
||||||
byte[] IPEKKCVByte = ByteUtil.hexStr2Bytes("1F0C18");
|
byte[] IPEKKCVByte = ByteUtil.hexStr2Bytes("1F0C18");
|
||||||
@ -36,6 +40,8 @@ public final class TerminalKeyUtil {
|
|||||||
Arrays.fill(work_key_data, (byte) 0x31);
|
Arrays.fill(work_key_data, (byte) 0x31);
|
||||||
PinPad pinPad = BaseApplication.getInstance().deviceEngine.getPinPad();
|
PinPad pinPad = BaseApplication.getInstance().deviceEngine.getPinPad();
|
||||||
int result = pinPad.writeMKey(9, main_key_data, main_key_data.length);
|
int result = pinPad.writeMKey(9, main_key_data, main_key_data.length);
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// int resultPINKEY = pinPad.writeWKey(0, WorkKeyTypeEnum.PINKEY, work_key_data, work_key_data.length);
|
// int resultPINKEY = pinPad.writeWKey(0, WorkKeyTypeEnum.PINKEY, work_key_data, work_key_data.length);
|
||||||
// int resultTDKEY = pinPad.writeWKey(0, WorkKeyTypeEnum.TDKEY, work_key_data, work_key_data.length);
|
// int resultTDKEY = pinPad.writeWKey(0, WorkKeyTypeEnum.TDKEY, work_key_data, work_key_data.length);
|
||||||
@ -47,6 +53,12 @@ public final class TerminalKeyUtil {
|
|||||||
// int result = pinPad.dukptKeyInject(9, DukptKeyTypeEnum.BDK,IPEKByte,16,ksn);
|
// int result = pinPad.dukptKeyInject(9, DukptKeyTypeEnum.BDK,IPEKByte,16,ksn);
|
||||||
|
|
||||||
LogUtil.d(TAG, "save tmk key result: "+result);
|
LogUtil.d(TAG, "save tmk key result: "+result);
|
||||||
|
|
||||||
|
byte[] encryptedPIK = SystemParamsOperation.getInstance().getKeyPIK().get(0);
|
||||||
|
|
||||||
|
result = pinPad.writeWKey(9, WorkKeyTypeEnum.PINKEY,encryptedPIK,encryptedPIK.length);
|
||||||
|
|
||||||
|
LogUtil.d(TAG, "save PIK key result: "+result);
|
||||||
// LogUtil.d(TAG, "save pin key result: "+resultPINKEY);
|
// LogUtil.d(TAG, "save pin key result: "+resultPINKEY);
|
||||||
// LogUtil.d(TAG, "save tdk key result: "+resultTDKEY);
|
// LogUtil.d(TAG, "save tdk key result: "+resultTDKEY);
|
||||||
// LogUtil.d(TAG, "save tek key result: "+resultTEK);
|
// LogUtil.d(TAG, "save tek key result: "+resultTEK);
|
||||||
|
|||||||
@ -149,4 +149,10 @@ public interface PayDetailDao {
|
|||||||
@Query("SELECT * FROM paydetail ORDER BY PID DESC")
|
@Query("SELECT * FROM paydetail ORDER BY PID DESC")
|
||||||
LiveData<List<PayDetail>> getAllTrans();
|
LiveData<List<PayDetail>> getAllTrans();
|
||||||
|
|
||||||
|
@Query("SELECT * FROM paydetail WHERE transactionType = 20 ORDER BY PID DESC")
|
||||||
|
LiveData<List<PayDetail>> getAllQRHistory();
|
||||||
|
|
||||||
|
@Query("SELECT * FROM paydetail WHERE transactionType = 20 AND qrTransStatus = 1 AND isCanceled = 0 ORDER BY PID DESC")
|
||||||
|
LiveData<List<PayDetail>> getRefundableQRHistory();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,6 +23,7 @@ import com.utsmyanmar.baselib.db.dao.QuickPassDao;
|
|||||||
import com.utsmyanmar.baselib.db.dao.RidDao;
|
import com.utsmyanmar.baselib.db.dao.RidDao;
|
||||||
import com.utsmyanmar.baselib.db.model.EmvDetail;
|
import com.utsmyanmar.baselib.db.model.EmvDetail;
|
||||||
import com.utsmyanmar.baselib.network.DemoQRApiService;
|
import com.utsmyanmar.baselib.network.DemoQRApiService;
|
||||||
|
import com.utsmyanmar.baselib.network.EReceiptApiService;
|
||||||
import com.utsmyanmar.baselib.network.KPayApiService;
|
import com.utsmyanmar.baselib.network.KPayApiService;
|
||||||
import com.utsmyanmar.baselib.network.KPayRefundApiService;
|
import com.utsmyanmar.baselib.network.KPayRefundApiService;
|
||||||
import com.utsmyanmar.baselib.network.SiriusApiService;
|
import com.utsmyanmar.baselib.network.SiriusApiService;
|
||||||
@ -447,10 +448,12 @@ public class DatabaseModule {
|
|||||||
com.utsmyanmar.baselib.repo.local.PayWaveRepository payWaveRepository,
|
com.utsmyanmar.baselib.repo.local.PayWaveRepository payWaveRepository,
|
||||||
DemoQRApiService demoQRApiService,
|
DemoQRApiService demoQRApiService,
|
||||||
KPayApiService kPayApiService,
|
KPayApiService kPayApiService,
|
||||||
KPayRefundApiService kPayRefundApiService) {
|
KPayRefundApiService kPayRefundApiService,
|
||||||
|
EReceiptApiService eReceiptApiService
|
||||||
|
) {
|
||||||
return new com.utsmyanmar.baselib.repo.Repository(payDetailDao,
|
return new com.utsmyanmar.baselib.repo.Repository(payDetailDao,
|
||||||
siriusApiService, emvDetailDao,
|
siriusApiService, emvDetailDao,
|
||||||
payWaveRepository, demoQRApiService, kPayApiService, kPayRefundApiService);
|
payWaveRepository, demoQRApiService, kPayApiService, kPayRefundApiService, eReceiptApiService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import com.google.gson.Gson;
|
|||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
//import com.utsmyanmar.baselib.BuildConfig;
|
//import com.utsmyanmar.baselib.BuildConfig;
|
||||||
import com.utsmyanmar.baselib.network.DemoQRApiService;
|
import com.utsmyanmar.baselib.network.DemoQRApiService;
|
||||||
|
import com.utsmyanmar.baselib.network.EReceiptApiService;
|
||||||
import com.utsmyanmar.baselib.network.KPayApiService;
|
import com.utsmyanmar.baselib.network.KPayApiService;
|
||||||
import com.utsmyanmar.baselib.network.KPayRefundApiService;
|
import com.utsmyanmar.baselib.network.KPayRefundApiService;
|
||||||
import com.utsmyanmar.baselib.network.SiriusApiService;
|
import com.utsmyanmar.baselib.network.SiriusApiService;
|
||||||
@ -386,5 +387,25 @@ public class NetworkModule {
|
|||||||
return retrofit.create(KPayRefundApiService.class);
|
return retrofit.create(KPayRefundApiService.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
public EReceiptApiService provideEReceiptApiService(){
|
||||||
|
|
||||||
|
HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
|
||||||
|
interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
|
||||||
|
|
||||||
|
OkHttpClient client = new OkHttpClient.Builder()
|
||||||
|
.addInterceptor(interceptor)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
return new Retrofit.Builder()
|
||||||
|
.baseUrl("http://receipt-nest.utsmyanmar.com/") // base URL
|
||||||
|
.addCallAdapterFactory(RxJava3CallAdapterFactory.create())
|
||||||
|
.addConverterFactory(GsonConverterFactory.create())
|
||||||
|
.client(client)
|
||||||
|
.build()
|
||||||
|
.create(EReceiptApiService.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -383,7 +383,7 @@ public abstract class DataBindingFragment extends Fragment {
|
|||||||
getNavController(hostId()).popBackStack();
|
getNavController(hostId()).popBackStack();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void safeNavigateToRouteId(){
|
protected void safeNavigateToRouteId(){
|
||||||
Activity activity = getActivity();
|
Activity activity = getActivity();
|
||||||
if(activity != null && isAdded()) {
|
if(activity != null && isAdded()) {
|
||||||
NavDestination currentDestination = getNavController(hostId()).getCurrentDestination();
|
NavDestination currentDestination = getNavController(hostId()).getCurrentDestination();
|
||||||
|
|||||||
@ -0,0 +1,20 @@
|
|||||||
|
package com.utsmyanmar.baselib.network;
|
||||||
|
|
||||||
|
|
||||||
|
import com.google.gson.JsonElement;
|
||||||
|
import com.utsmyanmar.baselib.network.model.e_receipt.EReceiptResponse;
|
||||||
|
|
||||||
|
import io.reactivex.rxjava3.core.Observable;
|
||||||
|
import retrofit2.http.Body;
|
||||||
|
import retrofit2.http.Header;
|
||||||
|
import retrofit2.http.POST;
|
||||||
|
|
||||||
|
public interface EReceiptApiService {
|
||||||
|
|
||||||
|
@POST("transaction")
|
||||||
|
Observable<EReceiptResponse> sendReceipt(
|
||||||
|
@Header("x-timestamp") String timestamp,
|
||||||
|
@Header("x-api-key") String apiKey,
|
||||||
|
@Body Object body
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -29,15 +29,18 @@ public class SiriusInterceptor implements Interceptor {
|
|||||||
@Override
|
@Override
|
||||||
public Response intercept(@NonNull Chain chain) throws IOException {
|
public Response intercept(@NonNull Chain chain) throws IOException {
|
||||||
|
|
||||||
|
|
||||||
Request request = chain.request();
|
Request request = chain.request();
|
||||||
Request newRequest;
|
Request newRequest;
|
||||||
|
|
||||||
String hashed = "";
|
String hashed = "";
|
||||||
String nonce = TerminalUtil.getInstance().generateRandomNumbers();
|
String nonce = TerminalUtil.getInstance().generateRandomNumbers();
|
||||||
|
// String nonce = "1234567";
|
||||||
try {
|
try {
|
||||||
hashed = TerminalUtil.getInstance().generateHashedString(nonce);
|
// hashed = TerminalUtil.getInstance().generateHashedString(nonce); // old tms
|
||||||
|
hashed = TerminalUtil.getInstance().generateHashedString(nonce).toLowerCase(); // new tms
|
||||||
|
|
||||||
// LogUtil.d(TAG,"hashed :"+ hashed);
|
LogUtil.d(TAG,"hashed :"+ hashed);
|
||||||
} catch (NoSuchAlgorithmException e) {
|
} catch (NoSuchAlgorithmException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
@ -47,6 +50,7 @@ public class SiriusInterceptor implements Interceptor {
|
|||||||
// .addHeader("content-type", "application/json")
|
// .addHeader("content-type", "application/json")
|
||||||
.addHeader("request-id", hashed)
|
.addHeader("request-id", hashed)
|
||||||
.addHeader("request-code",nonce)
|
.addHeader("request-code",nonce)
|
||||||
|
// .addHeader("x-api-key","8f4df38d1001bcc4620b5c736c66a03eef4653eb3ba31105faa2f2ee294c4a46")
|
||||||
.build();
|
.build();
|
||||||
return chain.proceed(newRequest);
|
return chain.proceed(newRequest);
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,238 @@
|
|||||||
|
package com.utsmyanmar.baselib.network.model.e_receipt;
|
||||||
|
|
||||||
|
public class EReceiptRequest {
|
||||||
|
private String DE2;
|
||||||
|
private String DE3;
|
||||||
|
private String DE4;
|
||||||
|
private String DE7;
|
||||||
|
private String DE11;
|
||||||
|
|
||||||
|
private String DE22;
|
||||||
|
private String DE37;
|
||||||
|
|
||||||
|
private String DE38;
|
||||||
|
private String DE39;
|
||||||
|
private String DE41;
|
||||||
|
private String DE42;
|
||||||
|
|
||||||
|
private String DE49;
|
||||||
|
|
||||||
|
private String DE63_01;
|
||||||
|
private String DE63_02;
|
||||||
|
private String DE63_03;
|
||||||
|
private String DE63_04;
|
||||||
|
private String DE63_05;
|
||||||
|
private String DE63_06;
|
||||||
|
private String DE63_07;
|
||||||
|
private String DE63_08;
|
||||||
|
private String serial;
|
||||||
|
|
||||||
|
private String appId;
|
||||||
|
private String invoiceNumber;
|
||||||
|
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
private String cardLabel;
|
||||||
|
|
||||||
|
private String batchNumber;
|
||||||
|
|
||||||
|
public EReceiptRequest() {}
|
||||||
|
|
||||||
|
// GETTERS
|
||||||
|
|
||||||
|
public String getDE2() {
|
||||||
|
return DE2;
|
||||||
|
}
|
||||||
|
public String getDE38() {
|
||||||
|
return DE38;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDE22() {
|
||||||
|
return DE22;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDE63_01() {
|
||||||
|
return DE63_01;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDE63_02() {
|
||||||
|
return DE63_02;
|
||||||
|
}
|
||||||
|
public String getDE63_03() {
|
||||||
|
return DE63_03;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDE63_04() {
|
||||||
|
return DE63_04;
|
||||||
|
}
|
||||||
|
public String getDE3() {
|
||||||
|
return DE3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDE39() {
|
||||||
|
return DE39;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDE41() {
|
||||||
|
return DE41;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDE42() {
|
||||||
|
return DE42;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSerial() {
|
||||||
|
return serial;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDE49() {
|
||||||
|
return DE49;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDE37() {
|
||||||
|
return DE37;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDE7() {
|
||||||
|
return DE7;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDE4() {
|
||||||
|
return DE4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAppId(){
|
||||||
|
return appId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInvoiceNumber(){
|
||||||
|
return invoiceNumber;
|
||||||
|
}
|
||||||
|
public String getDE11(){
|
||||||
|
return DE11;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription(){
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCardLabel() {
|
||||||
|
return cardLabel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBatchNumber() {
|
||||||
|
return batchNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDE63_05() {
|
||||||
|
return DE63_05;
|
||||||
|
}
|
||||||
|
public String getDE63_06() {
|
||||||
|
return DE63_06;
|
||||||
|
}
|
||||||
|
public String getDE63_07() {
|
||||||
|
return DE63_07;
|
||||||
|
}
|
||||||
|
public String getDE63_08() {
|
||||||
|
return DE63_08;
|
||||||
|
}
|
||||||
|
public void setDE63_05(String DE63_05) {
|
||||||
|
this.DE63_05 = DE63_05;
|
||||||
|
}
|
||||||
|
public void setDE63_06(String DE63_06) {
|
||||||
|
this.DE63_06 = DE63_06;
|
||||||
|
}
|
||||||
|
public void setDE63_07(String DE63_07) {
|
||||||
|
this.DE63_07 = DE63_07;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDE63_08(String DE63_08) {
|
||||||
|
this.DE63_08 = DE63_08;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBatchNumber(String batchNumber) {
|
||||||
|
this.batchNumber = batchNumber;
|
||||||
|
}
|
||||||
|
// SETTERS
|
||||||
|
public void setDE3(String DE3) {
|
||||||
|
this.DE3 = DE3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDE39(String DE39) {
|
||||||
|
this.DE39 = DE39;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDE41(String DE41) {
|
||||||
|
this.DE41 = DE41;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDE42(String DE42) {
|
||||||
|
this.DE42 = DE42;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSerial(String serial) {
|
||||||
|
this.serial = serial;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDE49(String DE49) {
|
||||||
|
this.DE49 = DE49;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDE37(String DE37) {
|
||||||
|
this.DE37 = DE37;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDE7(String DE7) {
|
||||||
|
this.DE7 = DE7;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDE4(String DE4) {
|
||||||
|
this.DE4 = DE4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppId(String appId){
|
||||||
|
this.appId = appId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInvoiceNumber(String invoiceNumber){
|
||||||
|
this.invoiceNumber = invoiceNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDE11(String DE11){
|
||||||
|
this.DE11 = DE11;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description){
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDE2(String DE2) {
|
||||||
|
this.DE2 = DE2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDE38(String DE38) {
|
||||||
|
this.DE38 = DE38;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDE22(String DE22) {
|
||||||
|
this.DE22 = DE22;
|
||||||
|
}
|
||||||
|
public void setDE63_01(String DE63_01) {
|
||||||
|
this.DE63_01 = DE63_01;
|
||||||
|
}
|
||||||
|
public void setDE63_02(String DE63_02) {
|
||||||
|
this.DE63_02 = DE63_02;
|
||||||
|
}
|
||||||
|
public void setDE63_03(String DE63_03) {
|
||||||
|
this.DE63_03 = DE63_03;
|
||||||
|
}
|
||||||
|
public void setDE63_04(String DE63_04) {
|
||||||
|
this.DE63_04 = DE63_04;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCardLabel(String cardLabel) {
|
||||||
|
this.cardLabel = cardLabel;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user