e-receipt settlement/popup retry dialog when paper roll is empty/key inject implemented
This commit is contained in:
parent
2f4db87441
commit
6bf49b3f19
@ -188,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
|
||||||
|
|||||||
@ -16,18 +16,25 @@ 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;
|
||||||
@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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;
|
||||||
@ -196,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();
|
||||||
|
|||||||
@ -307,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..
|
||||||
|
|||||||
@ -99,25 +99,38 @@ public class EReceiptUtil {
|
|||||||
EReceiptRequest request = new EReceiptRequest();
|
EReceiptRequest request = new EReceiptRequest();
|
||||||
|
|
||||||
request.setDE3(convertTransactionType(payDetail.getTransactionType()));
|
request.setDE3(convertTransactionType(payDetail.getTransactionType()));
|
||||||
|
request.setDE7(currentTimeStamp);
|
||||||
|
request.setDE11(payDetail.getVoucherNo());
|
||||||
|
|
||||||
if(payDetail.getTransactionType() == TransactionsType.SETTLEMENT.value) {
|
if(payDetail.getTransactionType() == TransactionsType.SETTLEMENT.value) {
|
||||||
SettleData settleData = payDetail.getSettleDataObj();
|
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_01(settleData.getSaleCount()+"");
|
||||||
request.setDE63_02(settleData.getSaleAmount()+"");
|
request.setDE63_02(settleData.getSaleAmount()+"");
|
||||||
request.setDE63_03(settleData.getRefundCount()+"");
|
request.setDE63_03(settleData.getRefundCount()+"");
|
||||||
request.setDE63_04(settleData.getRefundAmount()+"");
|
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.setBatchNumber(batchNumber);
|
||||||
|
request.setInvoiceNumber(invoiceNo);
|
||||||
request.setDescription("success");
|
request.setDescription("success");
|
||||||
request.setDE39("A");
|
request.setDE39("A");
|
||||||
|
request.setDE37("0000");
|
||||||
|
request.setDE49("MMK");
|
||||||
} else {
|
} else {
|
||||||
request.setDE2(POSUtil.getInstance().getCardNumMasking(payDetail.getCardNo()));
|
request.setDE2(POSUtil.getInstance().getCardNumMasking(payDetail.getCardNo()));
|
||||||
|
|
||||||
request.setDE4(amount);
|
request.setDE4(amount);
|
||||||
request.setDE7(currentTimeStamp);
|
|
||||||
request.setDE11(payDetail.getVoucherNo());
|
|
||||||
|
|
||||||
request.setDE37(payDetail.getReferNo());
|
request.setDE37(payDetail.getReferNo());
|
||||||
request.setDE38(payDetail.getApprovalCode());
|
request.setDE38(payDetail.getApprovalCode());
|
||||||
|
|||||||
@ -235,6 +235,80 @@
|
|||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<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_key_index"
|
||||||
|
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="Inject Key"
|
||||||
|
android:textColor="@color/colorTextTitle"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:fontFamily="sans-serif-medium" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/injectKeyText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:text="Click to inject"
|
||||||
|
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>
|
||||||
|
|
||||||
|
|
||||||
<!-- <!– Demo Mode Card –>-->
|
<!-- <!– Demo Mode Card –>-->
|
||||||
|
|||||||
@ -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
|
||||||
@ -285,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"
|
||||||
|
|||||||
@ -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'
|
||||||
|
|||||||
@ -21,6 +21,10 @@ public class EReceiptRequest {
|
|||||||
private String DE63_02;
|
private String DE63_02;
|
||||||
private String DE63_03;
|
private String DE63_03;
|
||||||
private String DE63_04;
|
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 serial;
|
||||||
|
|
||||||
private String appId;
|
private String appId;
|
||||||
@ -120,6 +124,32 @@ public class EReceiptRequest {
|
|||||||
return batchNumber;
|
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) {
|
public void setBatchNumber(String batchNumber) {
|
||||||
this.batchNumber = batchNumber;
|
this.batchNumber = batchNumber;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -63,6 +63,7 @@ dependencies {
|
|||||||
// implementation project(path:':PayLib-release-1.4.58')
|
// implementation project(path:':PayLib-release-1.4.58')
|
||||||
implementation project(path: ':nexsdk-lib')
|
implementation project(path: ':nexsdk-lib')
|
||||||
implementation project(path: ':paysdk-lib')
|
implementation project(path: ':paysdk-lib')
|
||||||
|
implementation project(path: ':nexdlkey-lib')
|
||||||
// implementation project(path: ':sunmiui-lib')
|
// implementation project(path: ':sunmiui-lib')
|
||||||
|
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import android.os.Build;
|
|||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.nexgo.oaf.apiv3.SdkResult;
|
||||||
import com.nexgo.oaf.apiv3.device.printer.AlignEnum;
|
import com.nexgo.oaf.apiv3.device.printer.AlignEnum;
|
||||||
import com.nexgo.oaf.apiv3.device.printer.DotMatrixFontEnum;
|
import com.nexgo.oaf.apiv3.device.printer.DotMatrixFontEnum;
|
||||||
import com.nexgo.oaf.apiv3.device.printer.FontEntity;
|
import com.nexgo.oaf.apiv3.device.printer.FontEntity;
|
||||||
@ -847,6 +848,11 @@ public abstract class BaseXPrint {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void startPrintNex() {
|
protected void startPrintNex() {
|
||||||
|
|
||||||
|
if(printer.getStatus() != SdkResult.Success) {
|
||||||
|
callbackStatus.onFailure();
|
||||||
|
}
|
||||||
|
|
||||||
printer.startPrint(true, new OnPrintListener() {
|
printer.startPrint(true, new OnPrintListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onPrintResult(final int retCode) {
|
public void onPrintResult(final int retCode) {
|
||||||
|
|||||||
@ -33,3 +33,4 @@ include ':xpay'
|
|||||||
include ':ecr'
|
include ':ecr'
|
||||||
include ':ecr-service-lib'
|
include ':ecr-service-lib'
|
||||||
include ':qrgen-lib'
|
include ':qrgen-lib'
|
||||||
|
include ':nexdlkey-lib'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user