Compare commits
16 Commits
fc8349ad2d
...
7346bae086
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7346bae086 | ||
|
|
77d1050021 | ||
|
|
f6067f8de6 | ||
|
|
3c77d4d9c7 | ||
|
|
37b1538e1c | ||
|
|
95ec5993b5 | ||
|
|
d89ce9771f | ||
|
|
850bc21a9f | ||
|
|
2c98727f2e | ||
|
|
547c04e0ca | ||
|
|
4b10de477d | ||
|
|
f33f3463a8 | ||
|
|
133593a4d7 | ||
|
|
2fedb6cee2 | ||
|
|
84f0620481 | ||
|
|
b2a92f8cf8 |
@ -13,17 +13,6 @@
|
||||
</DropdownSelection>
|
||||
<DialogSelection />
|
||||
</SelectionState>
|
||||
<SelectionState runConfigName="testResponseSalePacket()">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
<DropdownSelection timestamp="2026-01-20T10:15:53.662415Z">
|
||||
<Target type="DEFAULT_BOOT">
|
||||
<handle>
|
||||
<DeviceId pluginId="PhysicalDevice" identifier="serial=0123456789ABCDEF" />
|
||||
</handle>
|
||||
</Target>
|
||||
</DropdownSelection>
|
||||
<DialogSelection />
|
||||
</SelectionState>
|
||||
</selectionStates>
|
||||
</component>
|
||||
</project>
|
||||
@ -1,5 +1,6 @@
|
||||
package com.utsmm.kbz;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.ActionBarDrawerToggle;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
@ -157,10 +158,10 @@ public class MainActivity extends AppCompatActivity implements
|
||||
}
|
||||
|
||||
private void initKey(){
|
||||
SystemParamsOperation.getInstance().setTmsAddress("https://api-tms-uat.kbzbank.com:8443/sirius");
|
||||
// SystemParamsOperation.getInstance().setTmsAddress("https://sirius-nest.utsmyanmar.com");
|
||||
SystemParamsOperation.getInstance().setEReceiptAddress("https://api-tms-uat.kbzbank.com:8443/receipt");
|
||||
// SystemParamsOperation.getInstance().setEReceiptAddress("http://receipt-nest.utsmyanmar.com");
|
||||
// SystemParamsOperation.getInstance().setTmsAddress("https://api-tms-uat.kbzbank.com:8443/sirius");
|
||||
SystemParamsOperation.getInstance().setTmsAddress("https://sirius-nest.utsmyanmar.com");
|
||||
// SystemParamsOperation.getInstance().setEReceiptAddress("https://api-tms-uat.kbzbank.com:8443/receipt");
|
||||
SystemParamsOperation.getInstance().setEReceiptAddress("https://receipt-nest.utsmyanmar.com");
|
||||
|
||||
PinPad pinPad = MyApplication.getInstance().deviceEngine.getPinPad();
|
||||
byte[] encryptedPIK = SystemParamsOperation.getInstance().getPIK();
|
||||
|
||||
@ -321,6 +321,7 @@ public class MainFragment extends DataBindingFragment {
|
||||
private void updateButtonStatus() {
|
||||
mainViewModel.settlementStatus.setValue(SystemParamsOperation.getInstance().getSettlementStatus());
|
||||
mainViewModel.kPayStatus.setValue(SystemParamsOperation.getInstance().getQRPayStatus());
|
||||
mainViewModel.voidStatus.setValue(SystemParamsOperation.getInstance().getVoidStatus());
|
||||
}
|
||||
|
||||
private void setUpCarouselImages() {
|
||||
|
||||
@ -68,8 +68,60 @@ public class DashboardTransFragment extends DataBindingFragment {
|
||||
initData();
|
||||
}
|
||||
|
||||
// private void initData() {
|
||||
// TMSUtil.getInstance().checkFeaturesList(requireActivity(),featuresList);
|
||||
// mainAdapter.notifyDataSetChanged();
|
||||
// }
|
||||
|
||||
Boolean isRefundEnabled = SystemParamsOperation.getInstance().getRefundStatus();
|
||||
Boolean isVoidEnabled = SystemParamsOperation.getInstance().getVoidStatus();
|
||||
Boolean isPreAuthEnabled = SystemParamsOperation.getInstance().getPreAuthStatus();
|
||||
Boolean isCashAdvanceEnabled = SystemParamsOperation.getInstance().getCashAdvanceStatus();
|
||||
private void initData() {
|
||||
TMSUtil.getInstance().checkFeaturesList(requireActivity(),featuresList);
|
||||
featuresList.clear();
|
||||
|
||||
ArrayList<Features> allFeatures = new ArrayList<>();
|
||||
TMSUtil.getInstance().checkFeaturesList(requireActivity(), allFeatures);
|
||||
|
||||
for (Features feature : allFeatures) {
|
||||
|
||||
switch (feature.getFeaturesType()) {
|
||||
|
||||
case REFUND:
|
||||
if (isRefundEnabled) {
|
||||
featuresList.add(feature);
|
||||
}
|
||||
break;
|
||||
case VOID:
|
||||
if (isVoidEnabled) {
|
||||
featuresList.add(feature);
|
||||
}
|
||||
break;
|
||||
|
||||
case PRE_AUTH_SALE:
|
||||
|
||||
case PRE_AUTH_COMPLETE_VOID:
|
||||
|
||||
case PRE_AUTH_VOID:
|
||||
|
||||
case PRE_AUTH_COMPLETE:
|
||||
if (isPreAuthEnabled) {
|
||||
featuresList.add(feature);
|
||||
}
|
||||
break;
|
||||
|
||||
case CASH_ADVANCE:
|
||||
if(isCashAdvanceEnabled){
|
||||
featuresList.add(feature);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
featuresList.add(feature);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
mainAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@ -131,7 +183,6 @@ public class DashboardTransFragment extends DataBindingFragment {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
Boolean demoStatus = SystemParamsOperation.getInstance().getDemoStatus();
|
||||
LogUtil.d("KMK", "demo => " + demoStatus);
|
||||
}
|
||||
|
||||
public class ClickEvent {
|
||||
|
||||
@ -1,11 +1,18 @@
|
||||
package com.utsmm.kbz.ui.settings;
|
||||
|
||||
import static com.utsmyanmar.paylibs.print.printx.BaseXPrint.wrapAddressText;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
import com.utsmm.kbz.BuildConfig;
|
||||
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class HostConfigViewModel extends ViewModel {
|
||||
public String appVersion = BuildConfig.VERSION_NAME;
|
||||
|
||||
@ -38,13 +45,11 @@ public class HostConfigViewModel extends ViewModel {
|
||||
|
||||
|
||||
public void loadConfig() {
|
||||
|
||||
SystemParamsOperation sp = SystemParamsOperation.getInstance();
|
||||
|
||||
// Merchant Info
|
||||
merchantName.setValue(sp.getMerchantName());
|
||||
merchantPhone.setValue(sp.getMerchantPhoneNo());
|
||||
merchantAddress1.setValue(sp.getMerchantAddress());
|
||||
merchantAddress1.setValue(wrapForUi(sp.getMerchantAddress()));
|
||||
merchantAddress2.setValue(sp.getMerchantAddress2());
|
||||
terminalName.setValue(sp.getTerminalName());
|
||||
|
||||
@ -81,6 +86,22 @@ public class HostConfigViewModel extends ViewModel {
|
||||
}
|
||||
}
|
||||
|
||||
public static String wrapForUi(String text) {
|
||||
if (text == null || text.isEmpty()) return "";
|
||||
|
||||
List<String> result = new ArrayList<>();
|
||||
|
||||
String[] paragraphs = text.split("\\n");
|
||||
|
||||
for (String paragraph : paragraphs) {
|
||||
List<String> wrappedLines = wrapAddressText(paragraph.trim(), 29);
|
||||
|
||||
result.addAll(wrappedLines);
|
||||
}
|
||||
|
||||
return TextUtils.join("\n", result);
|
||||
}
|
||||
|
||||
private String[] split(String raw) {
|
||||
if (raw == null || raw.trim().isEmpty()) {
|
||||
return new String[]{"", ""};
|
||||
|
||||
@ -399,10 +399,7 @@ public class SettlementTransactionFragment extends DataBindingFragment implement
|
||||
}
|
||||
|
||||
public void onConfirm(){
|
||||
if(saleCount == 0){
|
||||
showDeclineDialog("No Transaction Found!");
|
||||
return;
|
||||
}
|
||||
|
||||
if(sharedViewModel.getTransMenu().getValue() == TransMenu.SETTLEMENT) {
|
||||
/* April 10 , 2024 Smile requested not to send to host even settlement button was clicked */
|
||||
settlementViewModel.startSettlementProcess();
|
||||
|
||||
@ -647,7 +647,7 @@ public class TMSSetupsImpl implements TMSSetups{
|
||||
else if(TextUtils.equals(name,"bin_list")) {
|
||||
SystemParamsOperation.getInstance().setBinValue(data);
|
||||
}
|
||||
else if(TextUtils.equals(name, "printer_disable")){
|
||||
else if(TextUtils.equals(name, "printer_disabled")){
|
||||
SystemParamsOperation.getInstance().setPrinterDisabled(parseBoolean(data));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,18 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:bind="http://schemas.android.com/tools">
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View"/>
|
||||
<import type="android.text.TextUtils"/>
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.utsmm.kbz.ui.settings.HostConfigViewModel"/>
|
||||
|
||||
<variable
|
||||
name="sharedViewModel"
|
||||
type="com.utsmm.kbz.ui.core_viewmodel.SharedViewModel"/>
|
||||
|
||||
<variable
|
||||
name="click"
|
||||
type="com.utsmm.kbz.ui.settings.HostConfigFragment.ClickHandler"/>
|
||||
@ -23,12 +25,11 @@
|
||||
android:layout_height="match_parent"
|
||||
android:padding="16dp">
|
||||
|
||||
<!-- CARD SECTION -->
|
||||
<!-- ================= CARD ================= -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/hostCard"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="0dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@ -53,292 +54,204 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- HEADER -->
|
||||
|
||||
|
||||
<!-- Merchant Info -->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:text="@{viewModel.merchantName}"-->
|
||||
<!-- android:fontFamily="@font/rubik_regular"-->
|
||||
<!-- android:textSize="16sp"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- android:textAlignment="center"-->
|
||||
<!-- tools:text="Someone Mart"/>-->
|
||||
<!-- ===== HEADER ===== -->
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{viewModel.terminalName}"
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:textAlignment="center"
|
||||
tools:text="Terminal_Name"/>
|
||||
android:gravity="center"
|
||||
style="@style/HostLabelStyle"
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
tools:text="Terminal Name"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{viewModel.merchantAddress1}"
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
android:textSize="16sp"
|
||||
android:textSize="14sp"
|
||||
style="@style/HostLabelStyle"
|
||||
android:textStyle="bold"
|
||||
android:textAlignment="center"
|
||||
tools:text="Corner of Bogyoke and Botahtaung Pagoda Street"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{viewModel.merchantAddress2}"
|
||||
android:gravity="center"
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:textAlignment="center"
|
||||
tools:text="Yangon"/>
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:text="@{viewModel.terminalName}"-->
|
||||
<!-- android:fontFamily="@font/rubik_regular"-->
|
||||
<!-- android:textSize="16sp"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- tools:text="Terminal_Name"/>-->
|
||||
tools:text="Merchant Address Line 1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:text="--------------------------------------------------------------------------"
|
||||
android:gravity="left"
|
||||
android:paddingVertical="8dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="*************************************************"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
tools:text="*********************************************************"/>
|
||||
android:layout_width="match_parent"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="TERMINAL CONFIGURATION"
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:textAlignment="center"
|
||||
style="@style/HostLabelStyle"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="12dp"
|
||||
tools:text="TERMINAL CONFIGURATION"/>
|
||||
|
||||
<!-- PRIMARY HOST -->
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"/>
|
||||
|
||||
<!-- ===== PRIMARY HOST ===== -->
|
||||
<TextView
|
||||
android:text="PRIMARY HOST"
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="PRIMARY HOST"/>
|
||||
android:paddingBottom="4dp"
|
||||
style="@style/HostLabelStyle"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"/>
|
||||
|
||||
<TextView
|
||||
<TableLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text='@{"Name : " + viewModel.hostName}'
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="Name : Card Host"/>
|
||||
android:stretchColumns="1">
|
||||
|
||||
<TableRow>
|
||||
<TextView style="@style/HostLabelStyle" android:text="Name"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.hostName}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TextView style="@style/HostLabelStyle" android:text="TID"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.tid}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TextView style="@style/HostLabelStyle" android:text="MID"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.mid}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TextView style="@style/HostLabelStyle" android:text="Primary IP"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.primaryIp}'/>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TextView style="@style/HostLabelStyle" android:text="Primary Port"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.primaryPort}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TextView style="@style/HostLabelStyle" android:text="Secondary IP"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.secondaryIp}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TextView style="@style/HostLabelStyle" android:text="Secondary Port"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.secondaryPort}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TextView style="@style/HostLabelStyle" android:text="Currency"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.currencyCode}'/>
|
||||
</TableRow>
|
||||
</TableLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:text="--------------------------------------------------------------------------"
|
||||
android:gravity="left"
|
||||
android:paddingVertical="8dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text='@{"TID : " + viewModel.tid}'
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="TID : 12345678"/>
|
||||
android:layout_width="match_parent"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text='@{"MID : " + viewModel.mid}'
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="MID : 123456789876543"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text='@{"PRIMARY IP : " + viewModel.primaryIp}'
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="PRIMARY IP : primaryidport.com"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text='@{"PRIMARY PORT : " + viewModel.primaryPort}'
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="PRIMARY PORT : 8080"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text='@{"SECONDARY IP : " + viewModel.secondaryIp}'
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="SECONDARY IP : secondaryidport.com"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text='@{"SECONDARY PORT : " + viewModel.secondaryPort}'
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="SECONDARY PORT : 8080"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text='@{"CURRENCY CODE : " + viewModel.currencyCode}'
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="CURRENCY CODE : MMK"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="*************************************************"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
tools:text="********************************************************"/>
|
||||
|
||||
<!-- SECONDARY HOST -->
|
||||
<!-- ===== SECONDARY HOST ===== -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:visibility='@{!viewModel.secHostName.isEmpty() ? View.VISIBLE : View.GONE}'
|
||||
android:visibility='@{!TextUtils.isEmpty(viewModel.secHostName) ? View.VISIBLE : View.GONE}'
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="SECONDARY HOST"
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
android:textSize="14sp"
|
||||
style="@style/HostLabelStyle"
|
||||
android:textStyle="bold"
|
||||
tools:text="SECONDARY HOST"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text='@{"Name : " + viewModel.secHostName}'
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="Name : QR Host"/>
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:text='@{"TID : " + viewModel.secHostTid}'-->
|
||||
<!-- android:fontFamily="@font/rubik_regular"-->
|
||||
<!-- android:textSize="14sp"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- tools:text="TID : 87654321"/>-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:text='@{"MID : " + viewModel.secHostMid}'-->
|
||||
<!-- android:fontFamily="@font/rubik_regular"-->
|
||||
<!-- android:textSize="14sp"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- tools:text="MID : 987654321012345"/>-->
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text='@{"SHORT CODE : " + viewModel.shortCode}'
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="SHORT CODE : 12345678987"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text='@{"Primary Ip : " + viewModel.secHostPrimaryIp}'
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="Primary Ip : 10.10.10.10"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text='@{"Primary Port : " + viewModel.secHostPrimaryPort}'
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="Primary Port : 5000"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text='@{"Secondary Ip : " + viewModel.secHostSecondaryIp}'
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="Secondary Ip : 10.10.10.11"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text='@{"Secondary Port : " + viewModel.secHostSecondaryPort}'
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="Secondary Port : 5001"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text='@{"Currency Code : " + viewModel.currencyCode}'
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="Currency Code : MMK"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="*************************************************"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
tools:text="********************************************************"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"/>
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
<TableLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
tools:visibility="visible">
|
||||
android:stretchColumns="1">
|
||||
|
||||
<TableRow>
|
||||
<TextView style="@style/HostLabelStyle" android:text="Name"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.secHostName}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TextView style="@style/HostLabelStyle" android:text="Short Code"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.shortCode}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TextView style="@style/HostLabelStyle" android:text="Primary IP"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.secHostPrimaryIp}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TextView style="@style/HostLabelStyle" android:text="Primary Port"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.secHostPrimaryPort}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TextView style="@style/HostLabelStyle" android:text="Secondary IP"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.secHostSecondaryIp}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TextView style="@style/HostLabelStyle" android:text="Secondary Port"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.secHostSecondaryPort}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TextView style="@style/HostLabelStyle" android:text="Currency"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.currencyCode}'/>
|
||||
</TableRow>
|
||||
</TableLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:text="--------------------------------------------------------------------------"
|
||||
android:gravity="left"
|
||||
android:paddingVertical="8dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"/>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- ===== APP VERSION ===== -->
|
||||
<TextView
|
||||
android:text='@{"App Version : " + viewModel.appVersion}'
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="App Version : 1.0"/>
|
||||
</LinearLayout>
|
||||
style="@style/HostLabelStyle"
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"/>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</FrameLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<!-- ACTION BUTTONS -->
|
||||
<!-- ================= BUTTONS ================= -->
|
||||
<LinearLayout
|
||||
android:id="@+id/actionButtons"
|
||||
android:layout_width="match_parent"
|
||||
@ -356,8 +269,7 @@
|
||||
android:onClick="@{()-> click.onCancel()}"
|
||||
android:background="@drawable/bg_rounded_btn_cancel_cv"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:textStyle="bold"
|
||||
tools:text="Cancel"/>
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="0dp"
|
||||
@ -368,8 +280,7 @@
|
||||
android:onClick="@{()-> click.onPrint()}"
|
||||
android:background="@drawable/bg_rounded_btn_cv"
|
||||
android:textColor="@color/white"
|
||||
android:textStyle="bold"
|
||||
tools:text="Print"/>
|
||||
android:textStyle="bold"/>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
37
app/src/main/res/layout/item_label_config.xml
Normal file
37
app/src/main/res/layout/item_label_config.xml
Normal file
@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingVertical="2dp">
|
||||
|
||||
<!-- LABEL -->
|
||||
<TextView
|
||||
android:id="@+id/tvLabel"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Label"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:fontFamily="@font/rubik_regular"/>
|
||||
|
||||
<!-- COLON -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=" : "
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:fontFamily="@font/rubik_regular"/>
|
||||
|
||||
<!-- VALUE -->
|
||||
<TextView
|
||||
android:id="@+id/tvValue"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="Value"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:fontFamily="@font/rubik_regular"/>
|
||||
</LinearLayout>
|
||||
@ -94,4 +94,21 @@
|
||||
<item name="android:textColor">@color/colorPrimary</item>
|
||||
</style>
|
||||
|
||||
<style name="HostLabelStyle">
|
||||
<item name="android:layout_width">110dp</item> <item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:fontFamily">@font/rubik_regular</item>
|
||||
<item name="android:textSize">14sp</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:textColor">#000000</item>
|
||||
</style>
|
||||
|
||||
<style name="HostValueStyle">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:fontFamily">@font/rubik_regular</item>
|
||||
<item name="android:textSize">14sp</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:textColor">#000000</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@ -287,8 +287,8 @@ public class NetworkModule {
|
||||
tmsAddress = getTMSUrlFromNative();
|
||||
}
|
||||
|
||||
// String baseUrl = tmsAddress.trim() + "/api/v1/"; //for on prim
|
||||
String baseUrl = tmsAddress.trim() + "/"; //for uat and prod
|
||||
String baseUrl = tmsAddress.trim() + "/api/v1/"; //for on prim
|
||||
// String baseUrl = tmsAddress.trim() + "/"; //for uat and prod
|
||||
|
||||
final Gson gson =
|
||||
new GsonBuilder().create();
|
||||
|
||||
@ -24,12 +24,12 @@ public interface KPayApiService {
|
||||
|
||||
|
||||
//this accept "url" bez this api start with https and other are http in uat
|
||||
// @POST("closeorder")
|
||||
// Observable<KPayQRRequest.CloseOrderResponse> closeOrder(@Body KPayQRRequest.CloseOrderRequest closeOrderRequest);
|
||||
@POST
|
||||
Observable<KPayQRRequest.CloseOrderResponse> closeOrder(@Url String url, @Body KPayQRRequest.CloseOrderRequest closeOrderRequest);
|
||||
|
||||
|
||||
//this 2 is for production
|
||||
@POST("closeorder")
|
||||
Observable<KPayQRRequest.CloseOrderResponse> closeOrder(@Url String url, @Body KPayQRRequest.CloseOrderRequest closeOrderRequest);
|
||||
// @POST("closeorder")
|
||||
// Observable<KPayQRRequest.CloseOrderResponse> closeOrder(@Body KPayQRRequest.CloseOrderRequest closeOrderRequest);
|
||||
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ public class Repository {
|
||||
}
|
||||
|
||||
public Observable<KPayQRRequest.CloseOrderResponse> qrCloseOrder(KPayQRRequest.CloseOrderRequest request){
|
||||
String url = "https://api.kbzpay.com/payment/gateway/uat/closeorder"; //close this in prod
|
||||
String url = "https://api-uat.kbzpay.com/payment/gateway/uat/closeorder"; //close this in prod
|
||||
return kPayApiService.closeOrder(url, request); // this is for local
|
||||
// return kPayApiService.closeOrder(request); //this is for prod
|
||||
}
|
||||
|
||||
@ -42,6 +42,7 @@ import com.utsmyanmar.paylibs.utils.print_utils.BitmapUtils;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
@ -355,33 +356,31 @@ public abstract class BaseXPrint {
|
||||
print2ColumnsStringNoSpace("TXN FEES", ":" + PrintUtils.getInstance().getSeparatorNumberFormat(payDetail.getAdditionalAmount()));
|
||||
}
|
||||
}
|
||||
// emptyLine(2);
|
||||
lineBreak();
|
||||
dotBreak();
|
||||
// check is pin change
|
||||
|
||||
if (payDetail.getTradeAnswerCode().equals("00") || payDetail.getTradeAnswerCode().equals("000")) {
|
||||
String currencySign = currencyCodeToText(payDetail.getCurrencyCode());
|
||||
if (payDetail.getTransactionType() == TransactionType.BALANCE_INQUIRY) {
|
||||
printer.appendPrnStr("MMK " + PrintUtils.getInstance().getBalanceInquiryNumberFormat(payDetail.getAmount()), fontNormal, AlignEnum.LEFT,false);
|
||||
|
||||
} else if (payDetail.getTransactionType() == TransactionType.VOID || payDetail.getTransactionType() == TransactionType.REFUND || payDetail.getTransactionType() == TransactionType.PRE_SALE_CANCEL || payDetail.getTransactionType() == TransactionType.PRE_SALE_COMPLETE_VOID) {
|
||||
print2SideString("AMOUNT:" + currencySign, "- " + PrintUtils.getInstance().getSeparatorNumberFormat(payDetail.getAmount()));
|
||||
print2SideString("AMT:" + currencySign, "- " + PrintUtils.getInstance().getSeparatorNumberFormat(payDetail.getAmount()));
|
||||
} else if (payDetail.getTransactionType() == TransactionType.CASH_ADVANCE) {
|
||||
long totalAmount = payDetail.getAmount() + payDetail.getAdditionalAmount();
|
||||
print2SideString("AMOUNT:" + currencySign, PrintUtils.getInstance().getSeparatorNumberFormat(totalAmount));
|
||||
print2SideString("AMT:" + currencySign, PrintUtils.getInstance().getSeparatorNumberFormat(totalAmount));
|
||||
} else {
|
||||
print2SideString("AMOUNT:" + currencySign, PrintUtils.getInstance().getSeparatorNumberFormat(payDetail.getAmount()));
|
||||
print2SideString("AMT:" + currencySign, PrintUtils.getInstance().getSeparatorNumberFormat(payDetail.getAmount()));
|
||||
}
|
||||
lineBreak();
|
||||
dotBreak();
|
||||
} else {
|
||||
|
||||
lineBreak();
|
||||
dotBreak();
|
||||
emptyLine(2);
|
||||
printer.appendPrnStr("TRANSACTION FAIL", fontNormal, AlignEnum.CENTER,true);
|
||||
printer.appendPrnStr(BaseErrorCode.getCode(payDetail.getTradeAnswerCode()), fontNormal, AlignEnum.CENTER,true);
|
||||
|
||||
emptyLine(2);
|
||||
lineBreak();
|
||||
dotBreak();
|
||||
}
|
||||
|
||||
}
|
||||
@ -444,20 +443,16 @@ public abstract class BaseXPrint {
|
||||
printer.appendPrnStr("MID :" + payDetail.getMerchantNo(), fontNormal, AlignEnum.LEFT,false);
|
||||
|
||||
if (payDetail.getTransType().equals("SUMMARY_REPORT")) {
|
||||
printer.appendPrnStr("BATCH NO :" + batchNum, fontNormal, AlignEnum.LEFT,false);
|
||||
printer.appendPrnStr("BTH NO:" + batchNum, fontNormal, AlignEnum.LEFT,false);
|
||||
} else {
|
||||
// printer.printColumnsString(new String[]{"BATCH NO :" + batchNum, "INV NO: " + invoiceNo}, new int[]{2, 2}, new int[]{0, 2}, null);
|
||||
printer.appendPrnStr("BATCH NO :" + batchNum + " TRACE NO:" + traceNo, fontNormal, AlignEnum.LEFT,false);
|
||||
printer.appendPrnStr("BTH NO:" + batchNum + " TRACE NO:" + traceNo, fontNormal, AlignEnum.LEFT,false);
|
||||
}
|
||||
|
||||
|
||||
printer.appendPrnStr("\n", fontNormal, AlignEnum.LEFT,false);
|
||||
printer.appendPrnStr("\n", fontNormal, AlignEnum.LEFT,false);
|
||||
|
||||
|
||||
printer.appendPrnStr(transType.replace("_", " "), fontNormal, AlignEnum.CENTER,true);
|
||||
|
||||
|
||||
printer.appendPrnStr("\n", fontNormal, AlignEnum.LEFT,false);
|
||||
printer.appendPrnStr("\n", fontNormal, AlignEnum.LEFT,false);
|
||||
|
||||
@ -1007,6 +1002,32 @@ public abstract class BaseXPrint {
|
||||
|
||||
}
|
||||
|
||||
public static List<String> wrapAddressText(String text, int maxLen) {
|
||||
List<String> lines = new ArrayList<>();
|
||||
String[] words = text.split("\\s+");
|
||||
|
||||
StringBuilder currentLine = new StringBuilder();
|
||||
|
||||
for (String word : words) {
|
||||
// +1 for space (if line is not empty)
|
||||
if (currentLine.length() + word.length() + 1 <= maxLen) {
|
||||
if (currentLine.length() > 0) {
|
||||
currentLine.append(" ");
|
||||
}
|
||||
currentLine.append(word);
|
||||
} else {
|
||||
lines.add(currentLine.toString());
|
||||
currentLine = new StringBuilder(word);
|
||||
}
|
||||
}
|
||||
|
||||
if (currentLine.length() > 0) {
|
||||
lines.add(currentLine.toString());
|
||||
}
|
||||
|
||||
return lines;
|
||||
}
|
||||
|
||||
protected void printMerchantHeader() {
|
||||
String receiptHeader = "";
|
||||
String merchantName = "";
|
||||
@ -1016,41 +1037,27 @@ public abstract class BaseXPrint {
|
||||
String merchantPhoneNo = "";
|
||||
String terminalName = "";
|
||||
|
||||
|
||||
merchantName = SystemParamsOperation.getInstance().getMerchantName();
|
||||
receiptHeader = SystemParamsOperation.getInstance().getReceiptHeader();
|
||||
merchantAddress = SystemParamsOperation.getInstance().getMerchantAddress();
|
||||
merchantAddress2 = SystemParamsOperation.getInstance().getMerchantAddress2();
|
||||
merchantAddress3 = SystemParamsOperation.getInstance().getMerchantAddress3();
|
||||
merchantPhoneNo = SystemParamsOperation.getInstance().getMerchantPhoneNo();
|
||||
terminalName = SystemParamsOperation.getInstance().getTerminalName();
|
||||
|
||||
List<String> result = wrapAddressText(merchantAddress, 29);
|
||||
|
||||
if (receiptHeader == null || TextUtils.equals(receiptHeader, "") || receiptHeader.trim().isEmpty()) {
|
||||
receiptHeader = merchantName;
|
||||
}
|
||||
if (TextUtils.equals(merchantAddress, "") || merchantAddress == null) {
|
||||
merchantAddress = "";
|
||||
}
|
||||
if (TextUtils.equals(merchantAddress2, "") || merchantAddress2 == null) {
|
||||
merchantAddress2 = "";
|
||||
}
|
||||
if (TextUtils.equals(merchantAddress3, "") || merchantAddress3 == null) {
|
||||
merchantAddress3 = "";
|
||||
}
|
||||
// if (TextUtils.equals(merchantPhoneNo, "") || merchantPhoneNo == null) {
|
||||
// merchantPhoneNo = "MERCHANT PHONENO";
|
||||
// }
|
||||
if(TextUtils.equals(terminalName, "") || terminalName == null){
|
||||
terminalName = "";
|
||||
}
|
||||
// emptyLine(1);
|
||||
// printer.appendPrnStr(receiptHeader, fontNormal, AlignEnum.CENTER,false);
|
||||
printer.appendPrnStr(terminalName, fontNormal, AlignEnum.CENTER, true);
|
||||
printer.appendPrnStr(merchantAddress, fontNormal, AlignEnum.CENTER,false);
|
||||
printer.appendPrnStr(merchantAddress2, fontNormal, AlignEnum.CENTER,false);
|
||||
printer.appendPrnStr(merchantAddress3, fontNormal, AlignEnum.CENTER,false);
|
||||
// printer.appendPrnStr(merchantPhoneNo, fontNormal, AlignEnum.CENTER,false);
|
||||
// emptyLine(1);
|
||||
for (String line : result) {
|
||||
printer.appendPrnStr(line, fontNormal, AlignEnum.CENTER, false);
|
||||
}
|
||||
|
||||
dotBreak();
|
||||
}
|
||||
|
||||
@ -1114,8 +1121,6 @@ public abstract class BaseXPrint {
|
||||
printer.appendPrnStr("DATE :" + POSUtil.getInstance().formatDisplayDate(payDetail.getTransDate()), fontNormal, AlignEnum.LEFT, false);
|
||||
printer.appendPrnStr("TIME :" + payDetail.getTransTime(), fontNormal, AlignEnum.LEFT, false);
|
||||
if (payDetail.getTransactionType() == TransactionsType.MMQR.value && payDetail.getQrTransStatus() == 1) {
|
||||
// printer.appendPrnStr("TRACE NO:" + traceNum + " INV NO:" + invoiceNo, fontNormal, AlignEnum.LEFT,false);
|
||||
// printer.appendPrnStr("INV NO :" + invoiceNo , fontNormal, AlignEnum.LEFT,false);
|
||||
printer.appendPrnStr("TRACE NO :" + traceNum , fontNormal, AlignEnum.LEFT,false);
|
||||
} else if (!payDetail.getTransType().equals(SETTLEMENT) && !payDetail.getTransType().equals(SUMMARY) && payDetail.getTransactionType() != TransactionsType.MMQR_REFUND.value && payDetail.getTransactionType() != TransactionsType.MMQR.value) {
|
||||
printer.appendPrnStr("BTH NO:" + batchNum + " INV NO:" + invoiceNo, fontNormal, AlignEnum.LEFT,false);
|
||||
@ -1133,19 +1138,17 @@ public abstract class BaseXPrint {
|
||||
}
|
||||
|
||||
if(isSettlement) {
|
||||
|
||||
printer.appendPrnStr("BATCH :" + batchNum, fontNormal, AlignEnum.LEFT,false);
|
||||
printer.appendPrnStr("HOST :" + "KBZ Bank "+currencySign, fontNormal, AlignEnum.LEFT,false);
|
||||
|
||||
}
|
||||
|
||||
if(isCardTransaction) {
|
||||
lineBreak();
|
||||
dotBreak();
|
||||
} else {
|
||||
emptyLine(1);
|
||||
}
|
||||
|
||||
|
||||
printer.appendPrnStr(transType.replace("_", " "),fontNormal, AlignEnum.CENTER,true);
|
||||
// printer.appendPrnStr("TRAN TYPE :" + transType.replace("_", " "),fontNormal, AlignEnum.LEFT,false);
|
||||
|
||||
@ -1179,10 +1182,6 @@ public abstract class BaseXPrint {
|
||||
printer.appendPrnStr("", printedTime, fontNormal, false);
|
||||
printer.appendPrnStr(title, fontNormal , AlignEnum.CENTER, false);
|
||||
|
||||
// if (payDetail.getTransactionType() == TransactionsType.MMQR.value && payDetail.getQrTransStatus() == 1) {
|
||||
//// printer.appendPrnStr("TRACE NO:" + traceNum + " INV NO:" + invoiceNo, fontNormal, AlignEnum.LEFT,false);
|
||||
// printer.appendPrnStr("INV NO :" + invoiceNo , fontNormal, AlignEnum.LEFT,false);
|
||||
// }
|
||||
dotBreak();
|
||||
}
|
||||
protected void printTransHeader(PayDetail payDetail, HostType hostType) {
|
||||
|
||||
@ -266,6 +266,7 @@ public class PrintXImpl extends BaseXPrint implements PrintX {
|
||||
printTransDetail(payDetail);
|
||||
|
||||
if (payDetail.getTradeAnswerCode().equals(Constant.ANSWER_CODE_APPROVED) || payDetail.getTradeAnswerCode().equals(Constant.ANSWER_CODE_ACCEPT)) {
|
||||
emptyLine(2);
|
||||
printTransFooter(false,payDetail, isMerchantCopy);
|
||||
} else {
|
||||
String receiptFooter = SystemParamsOperation.getInstance().getReceiptFooter();
|
||||
|
||||
@ -417,47 +417,103 @@ public class TransactionsOperation {
|
||||
/*
|
||||
* handling issuer script
|
||||
* */
|
||||
// private void emvProcess(PayDetail payDetail) {
|
||||
// String resultStr = "";
|
||||
// try {
|
||||
// resultStr = Objects.requireNonNull(responseMap.get("F039")).getDataStr();
|
||||
// } catch (NullPointerException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//
|
||||
// LogUtil.d(Constant.TAG, "SALE PROCESS RESPONSE CODE :" + resultStr);
|
||||
//
|
||||
// HashMap<String, MsgField> resp = (responseMap instanceof HashMap) ? (HashMap<String, MsgField>) responseMap
|
||||
// : new HashMap<>(responseMap);
|
||||
//
|
||||
// if(BaseCardType.IC.getValue() == payDetail.getCardType() && responseMap.get("F055") != null) {
|
||||
// AuthorizationProcessUtil.authorizationProcess(resp, payDetail);
|
||||
// } else {
|
||||
// boolean equals = TextUtils.equals(resultStr, Constant.ANSWER_CODE_ACCEPT) || TextUtils.equals(resultStr, Constant.ANSWER_CODE_APPROVED);
|
||||
// EmvOnlineResultEntity emvOnlineResult = new EmvOnlineResultEntity();
|
||||
// MsgField field38,field39,field55;
|
||||
// if (resp != null) {
|
||||
// field38 = resp.get("F038");
|
||||
// field39 = resp.get("F039");
|
||||
// field55 = resp.get("F055");
|
||||
//
|
||||
// if(equals)
|
||||
// LogUtil.d(TAG,"Field 38:"+field38.getDataStr());
|
||||
// LogUtil.d(TAG,"Field 39:"+field39.getDataStr());
|
||||
// LogUtil.d(TAG,"Field 55:"+field55.getDataStr());
|
||||
// if(equals)
|
||||
// emvOnlineResult.setAuthCode(field38.getDataStr());
|
||||
// emvOnlineResult.setRejCode(field39.getDataStr());
|
||||
// emvOnlineResult.setRecvField55(ByteUtil.hexStr2Bytes(field55.getDataStr()));
|
||||
// }
|
||||
// if(equals) {
|
||||
// importOnlineProcessStatus(SdkResult.Success,emvOnlineResult);
|
||||
// } else {
|
||||
// importOnlineProcessStatus(SdkResult.Fail,emvOnlineResult);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
private void emvProcess(PayDetail payDetail) {
|
||||
String resultStr = "";
|
||||
try {
|
||||
resultStr = Objects.requireNonNull(responseMap.get("F039")).getDataStr();
|
||||
} catch (NullPointerException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
MsgField f39 = responseMap != null ? responseMap.get("F039") : null;
|
||||
String resultStr = f39 != null ? f39.getDataStr() : "";
|
||||
|
||||
LogUtil.d(Constant.TAG, "SALE PROCESS RESPONSE CODE : " + resultStr);
|
||||
|
||||
HashMap<String, MsgField> resp = (responseMap instanceof HashMap) ? (HashMap<String, MsgField>) responseMap
|
||||
boolean approved =
|
||||
TextUtils.equals(resultStr, Constant.ANSWER_CODE_ACCEPT)
|
||||
|| TextUtils.equals(resultStr, Constant.ANSWER_CODE_APPROVED);
|
||||
|
||||
HashMap<String, MsgField> resp =
|
||||
(responseMap instanceof HashMap)
|
||||
? (HashMap<String, MsgField>) responseMap
|
||||
: new HashMap<>(responseMap);
|
||||
|
||||
if(BaseCardType.IC.getValue() == payDetail.getCardType() && responseMap.get("F055") != null) {
|
||||
MsgField field38 = resp.get("F038");
|
||||
MsgField field55 = resp.get("F055");
|
||||
|
||||
LogUtil.d(TAG, "Field 55: " + (field55 != null ? field55.getDataStr() : "null"));
|
||||
|
||||
if (BaseCardType.IC.getValue() == payDetail.getCardType()
|
||||
&& approved
|
||||
&& field55 != null
|
||||
&& !TextUtils.isEmpty(field55.getDataStr())) {
|
||||
|
||||
AuthorizationProcessUtil.authorizationProcess(resp, payDetail);
|
||||
} else {
|
||||
boolean equals = TextUtils.equals(resultStr, Constant.ANSWER_CODE_ACCEPT) || TextUtils.equals(resultStr, Constant.ANSWER_CODE_APPROVED);
|
||||
return;
|
||||
}
|
||||
|
||||
if (BaseCardType.IC.getValue() == payDetail.getCardType() && approved) {
|
||||
|
||||
EmvOnlineResultEntity emptyResult = new EmvOnlineResultEntity();
|
||||
emptyResult.setRejCode(resultStr);
|
||||
|
||||
importOnlineProcessStatus(SdkResult.Success, emptyResult);
|
||||
return;
|
||||
}
|
||||
|
||||
EmvOnlineResultEntity emvOnlineResult = new EmvOnlineResultEntity();
|
||||
MsgField field38,field39,field55;
|
||||
if (resp != null) {
|
||||
field38 = resp.get("F038");
|
||||
field39 = resp.get("F039");
|
||||
field55 = resp.get("F055");
|
||||
|
||||
if(equals)
|
||||
LogUtil.d(TAG,"Field 38:"+field38.getDataStr());
|
||||
LogUtil.d(TAG,"Field 39:"+field39.getDataStr());
|
||||
LogUtil.d(TAG,"Field 55:"+field55.getDataStr());
|
||||
if(equals)
|
||||
if (approved && field38 != null) {
|
||||
emvOnlineResult.setAuthCode(field38.getDataStr());
|
||||
emvOnlineResult.setRejCode(field39.getDataStr());
|
||||
emvOnlineResult.setRecvField55(ByteUtil.hexStr2Bytes(field55.getDataStr()));
|
||||
}
|
||||
if(equals) {
|
||||
importOnlineProcessStatus(SdkResult.Success,emvOnlineResult);
|
||||
} else {
|
||||
importOnlineProcessStatus(SdkResult.Fail,emvOnlineResult);
|
||||
}
|
||||
}
|
||||
|
||||
if (f39 != null) {
|
||||
emvOnlineResult.setRejCode(f39.getDataStr());
|
||||
}
|
||||
|
||||
importOnlineProcessStatus(
|
||||
approved ? SdkResult.Success : SdkResult.Fail,
|
||||
emvOnlineResult
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ public class SystemParamsSettings implements Serializable {
|
||||
// private String tmsAddress = "http://128.199.170.203";
|
||||
private String tmsAddress = "https://sirius-nest.utsmyanmar.com";
|
||||
// private String tmsAddress = "https://api-tms-uat.kbzbank.com:8443/sirius"; //for uat
|
||||
private String ereceiptAddress = "http://receipt-nest.utsmyanmar.com"; //for on prime
|
||||
private String ereceiptAddress = "https://receipt-nest.utsmyanmar.com"; //for on prime
|
||||
// private String ereceiptAddress = "https://api-tms-uat.kbzbank.com:8443/receipt"; //for uat
|
||||
|
||||
private String binValues = "";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user