production ready
This commit is contained in:
parent
c9dd1b93f7
commit
58118a2fb5
@ -13,12 +13,6 @@
|
|||||||
</DropdownSelection>
|
</DropdownSelection>
|
||||||
<DialogSelection />
|
<DialogSelection />
|
||||||
</SelectionState>
|
</SelectionState>
|
||||||
<SelectionState runConfigName="testSalePacket()">
|
|
||||||
<option name="selectionMode" value="DROPDOWN" />
|
|
||||||
</SelectionState>
|
|
||||||
<SelectionState runConfigName="testResponseSalePacket()">
|
|
||||||
<option name="selectionMode" value="DROPDOWN" />
|
|
||||||
</SelectionState>
|
|
||||||
</selectionStates>
|
</selectionStates>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@ -47,34 +47,6 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// defaultConfig {
|
|
||||||
// applicationId "com.utsmm.kbz.sit"
|
|
||||||
// minSdk 24
|
|
||||||
// targetSdk 33
|
|
||||||
// versionCode 1
|
|
||||||
// versionName "1.0"
|
|
||||||
//
|
|
||||||
//// applicationId "com.utsmm.kbz"
|
|
||||||
//// versionName "1.10"
|
|
||||||
//
|
|
||||||
// testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
||||||
//
|
|
||||||
//// // Add CMake configuration
|
|
||||||
//// externalNativeBuild {
|
|
||||||
//// cmake {
|
|
||||||
//// cppFlags "-std=c++14"
|
|
||||||
//// }
|
|
||||||
//// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Configure CMake
|
|
||||||
// externalNativeBuild {
|
|
||||||
// cmake {
|
|
||||||
// path "src/main/cpp/CMakeLists.txt"
|
|
||||||
// version "3.22.1"
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
minifyEnabled true
|
minifyEnabled true
|
||||||
@ -82,7 +54,7 @@ android {
|
|||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
debug {
|
debug {
|
||||||
debuggable true
|
debuggable false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
|
|||||||
@ -110,6 +110,8 @@ public class MainActivity extends AppCompatActivity implements
|
|||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
BaseApplication.getInstance().deviceEngine.getPlatform().hideNavigationBar();
|
||||||
|
|
||||||
// Keep screen on
|
// Keep screen on
|
||||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||||
|
|
||||||
@ -147,7 +149,6 @@ public class MainActivity extends AppCompatActivity implements
|
|||||||
initKey();
|
initKey();
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initKey(){
|
private void initKey(){
|
||||||
@ -426,15 +427,15 @@ public class MainActivity extends AppCompatActivity implements
|
|||||||
SystemParamsOperation.getInstance().setDownloadedParams(false);
|
SystemParamsOperation.getInstance().setDownloadedParams(false);
|
||||||
|
|
||||||
handleAutoSettlementIntent(getIntent());
|
handleAutoSettlementIntent(getIntent());
|
||||||
|
BaseApplication.getInstance().deviceEngine.getPlatform().hideNavigationBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStop(){
|
public void onStop(){
|
||||||
super.onStop();
|
super.onStop();
|
||||||
BaseApplication.getInstance().deviceEngine.getPlatform().showNavigationBar();
|
// BaseApplication.getInstance().deviceEngine.getPlatform().showNavigationBar();
|
||||||
BaseApplication.getInstance().deviceEngine.getPlatform().enableHomeButton();
|
// BaseApplication.getInstance().deviceEngine.getPlatform().enableHomeButton();
|
||||||
BaseApplication.getInstance().deviceEngine.getPlatform().enableTaskButton();
|
// BaseApplication.getInstance().deviceEngine.getPlatform().enableTaskButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -502,14 +503,15 @@ public class MainActivity extends AppCompatActivity implements
|
|||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
BaseApplication.getInstance().deviceEngine.getPlatform().showNavigationBar();
|
// BaseApplication.getInstance().deviceEngine.getPlatform().showNavigationBar();
|
||||||
BaseApplication.getInstance().deviceEngine.getPlatform().enableHomeButton();
|
// BaseApplication.getInstance().deviceEngine.getPlatform().enableHomeButton();
|
||||||
BaseApplication.getInstance().deviceEngine.getPlatform().enableTaskButton();
|
// BaseApplication.getInstance().deviceEngine.getPlatform().enableTaskButton();
|
||||||
// Clean up RxJava disposables
|
// Clean up RxJava disposables
|
||||||
compositeDisposable.clear();
|
compositeDisposable.clear();
|
||||||
// Reset screen mode
|
// Reset screen mode
|
||||||
// Disconnect ECR
|
// Disconnect ECR
|
||||||
ECRHelper.INSTANCE.disconnect();
|
ECRHelper.INSTANCE.disconnect();
|
||||||
|
BaseApplication.getInstance().deviceEngine.getPlatform().showNavigationBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Navigation drawer interaction listeners
|
// Navigation drawer interaction listeners
|
||||||
@ -520,6 +522,12 @@ public class MainActivity extends AppCompatActivity implements
|
|||||||
navController.navigate(R.id.inputPasswordFragment);
|
navController.navigate(R.id.inputPasswordFragment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause(){
|
||||||
|
super.onPause();
|
||||||
|
BaseApplication.getInstance().deviceEngine.getPlatform().showNavigationBar();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClickFunction() {
|
public void onClickFunction() {
|
||||||
closeDrawer();
|
closeDrawer();
|
||||||
|
|||||||
@ -146,10 +146,10 @@ public class MainFragment extends DataBindingFragment {
|
|||||||
delayFunctionCall(() -> {
|
delayFunctionCall(() -> {
|
||||||
NexGoSDK.getInstance().cancelCheckCard();
|
NexGoSDK.getInstance().cancelCheckCard();
|
||||||
NexGoSDK.getInstance().closeReader();
|
NexGoSDK.getInstance().closeReader();
|
||||||
enableHomeButton();
|
// enableHomeButton();
|
||||||
disableTaskButton();
|
// disableTaskButton();
|
||||||
// BaseApplication.getInstance().deviceEngine.getPlatform().hideNavigationBar();
|
// BaseApplication.getInstance().deviceEngine.getPlatform().hideNavigationBar();
|
||||||
BaseApplication.getInstance().deviceEngine.getPlatform().showNavigationBar();
|
// BaseApplication.getInstance().deviceEngine.getPlatform().showNavigationBar();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -223,6 +223,35 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- MMQR Ref Row -->
|
<!-- MMQR Ref Row -->
|
||||||
|
<!-- <LinearLayout-->
|
||||||
|
<!-- android:layout_width="match_parent"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:orientation="horizontal"-->
|
||||||
|
<!-- android:gravity="center_vertical"-->
|
||||||
|
<!-- android:layout_marginTop="8dp"-->
|
||||||
|
<!-- android:visibility="@{(sharedViewModel.payDetail != null && sharedViewModel.payDetail.qrReferNo != null && !sharedViewModel.payDetail.qrReferNo.empty) ? android.view.View.VISIBLE : android.view.View.GONE}">-->
|
||||||
|
|
||||||
|
<!-- <TextView-->
|
||||||
|
<!-- android:layout_width="0dp"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:layout_weight="1"-->
|
||||||
|
<!-- android:text="MMQR Ref"-->
|
||||||
|
<!-- android:textColor="@color/colorTextContent"-->
|
||||||
|
<!-- android:textSize="14sp"-->
|
||||||
|
<!-- android:fontFamily="@font/rubik_regular" />-->
|
||||||
|
|
||||||
|
<!-- <TextView-->
|
||||||
|
<!-- android:layout_width="wrap_content"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:text="@{sharedViewModel.payDetail.qrReferNo}"-->
|
||||||
|
<!-- android:textColor="@color/colorTextTitle"-->
|
||||||
|
<!-- android:textSize="14sp"-->
|
||||||
|
<!-- android:fontFamily="@font/rubik_medium"-->
|
||||||
|
<!-- tools:text="REF123456789"-->
|
||||||
|
<!-- android:maxLines="1"-->
|
||||||
|
<!-- android:ellipsize="end"/>-->
|
||||||
|
|
||||||
|
<!-- </LinearLayout>-->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -231,27 +260,37 @@
|
|||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:visibility="@{(sharedViewModel.payDetail != null && sharedViewModel.payDetail.qrReferNo != null && !sharedViewModel.payDetail.qrReferNo.empty) ? android.view.View.VISIBLE : android.view.View.GONE}">
|
android:visibility="@{(sharedViewModel.payDetail != null && sharedViewModel.payDetail.qrReferNo != null && !sharedViewModel.payDetail.qrReferNo.empty) ? android.view.View.VISIBLE : android.view.View.GONE}">
|
||||||
|
|
||||||
|
<!-- Label : 30% -->
|
||||||
<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="3"
|
||||||
android:text="MMQR Ref"
|
android:text="MMQR Ref"
|
||||||
android:textColor="@color/colorTextContent"
|
android:textColor="@color/colorTextContent"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:fontFamily="@font/rubik_regular" />
|
android:fontFamily="@font/rubik_regular" />
|
||||||
|
|
||||||
|
<!-- Value : 70% -->
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="7"
|
||||||
|
android:gravity="end"
|
||||||
|
|
||||||
android:text="@{sharedViewModel.payDetail.qrReferNo}"
|
android:text="@{sharedViewModel.payDetail.qrReferNo}"
|
||||||
android:textColor="@color/colorTextTitle"
|
android:textColor="@color/colorTextTitle"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:fontFamily="@font/rubik_medium"
|
android:fontFamily="@font/rubik_medium"
|
||||||
tools:text="REF123456789" />
|
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
|
||||||
|
tools:text="REF123456789123456789123456789012345" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|||||||
@ -82,9 +82,6 @@ public class NetworkModule {
|
|||||||
|
|
||||||
public static native String getTMSUrlFromNative();
|
public static native String getTMSUrlFromNative();
|
||||||
|
|
||||||
public static String Refund_Base_Url = "https://api.kbzpay.com:18008/payment/gateway/uat/";
|
|
||||||
|
|
||||||
|
|
||||||
private static OkHttpClient getUnsafeOkHttpClient() {
|
private static OkHttpClient getUnsafeOkHttpClient() {
|
||||||
try {
|
try {
|
||||||
// Create a trust manager that does not validate certificate chains
|
// Create a trust manager that does not validate certificate chains
|
||||||
@ -395,6 +392,21 @@ public Retrofit provideKPayRefundRetrofit(@ApplicationContext Context context) {
|
|||||||
|
|
||||||
// char[] password = "test123".toCharArray();
|
// char[] password = "test123".toCharArray();
|
||||||
|
|
||||||
|
// public static String Refund_Base_Url = "https://api.kbzpay.com:18008/payment/gateway/uat/";
|
||||||
|
|
||||||
|
|
||||||
|
String refundBaseUrl = "";
|
||||||
|
String IpAddress = SystemParamsOperation.getInstance().getSecHostIpAddress();
|
||||||
|
|
||||||
|
|
||||||
|
if (IpAddress != null && !IpAddress.isEmpty()) {
|
||||||
|
refundBaseUrl = IpAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (refundBaseUrl.isEmpty()) {
|
||||||
|
refundBaseUrl = "https://api.kbzpay.com/payment/gateway/";
|
||||||
|
}
|
||||||
|
|
||||||
String pass = SystemParamsOperation.getInstance().getCertificatePassword();
|
String pass = SystemParamsOperation.getInstance().getCertificatePassword();
|
||||||
if (TextUtils.isEmpty(pass)) {
|
if (TextUtils.isEmpty(pass)) {
|
||||||
pass = "test123";
|
pass = "test123";
|
||||||
@ -456,7 +468,7 @@ public Retrofit provideKPayRefundRetrofit(@ApplicationContext Context context) {
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
return new Retrofit.Builder()
|
return new Retrofit.Builder()
|
||||||
.baseUrl(Refund_Base_Url)
|
.baseUrl(refundBaseUrl)
|
||||||
.client(okHttp)
|
.client(okHttp)
|
||||||
.addCallAdapterFactory(RxJava3CallAdapterFactory.create())
|
.addCallAdapterFactory(RxJava3CallAdapterFactory.create())
|
||||||
.addConverterFactory(GsonConverterFactory.create())
|
.addConverterFactory(GsonConverterFactory.create())
|
||||||
@ -468,7 +480,7 @@ public Retrofit provideKPayRefundRetrofit(@ApplicationContext Context context) {
|
|||||||
|
|
||||||
// Provide fallback Retrofit to avoid crash, but no SSL
|
// Provide fallback Retrofit to avoid crash, but no SSL
|
||||||
return new Retrofit.Builder()
|
return new Retrofit.Builder()
|
||||||
.baseUrl(Refund_Base_Url)
|
.baseUrl(refundBaseUrl)
|
||||||
.client(new OkHttpClient())
|
.client(new OkHttpClient())
|
||||||
.addCallAdapterFactory(RxJava3CallAdapterFactory.create())
|
.addCallAdapterFactory(RxJava3CallAdapterFactory.create())
|
||||||
.addConverterFactory(GsonConverterFactory.create())
|
.addConverterFactory(GsonConverterFactory.create())
|
||||||
|
|||||||
@ -24,8 +24,8 @@ public interface KPayApiService {
|
|||||||
|
|
||||||
|
|
||||||
//this accept "url" bez this api start with https and other are http in uat
|
//this accept "url" bez this api start with https and other are http in uat
|
||||||
@POST
|
@POST("closeorder")
|
||||||
Observable<KPayQRRequest.CloseOrderResponse> closeOrder(@Url String url, @Body KPayQRRequest.CloseOrderRequest closeOrderRequest);
|
Observable<KPayQRRequest.CloseOrderResponse> closeOrder(@Body KPayQRRequest.CloseOrderRequest closeOrderRequest);
|
||||||
|
|
||||||
|
|
||||||
//this 2 is for production
|
//this 2 is for production
|
||||||
|
|||||||
@ -40,7 +40,7 @@ public class SiriusInterceptor implements Interceptor {
|
|||||||
// hashed = TerminalUtil.getInstance().generateHashedString(nonce); // old tms
|
// hashed = TerminalUtil.getInstance().generateHashedString(nonce); // old tms
|
||||||
hashed = TerminalUtil.getInstance().generateHashedString(nonce).toLowerCase(); // new 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);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -86,8 +86,8 @@ public class Repository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Observable<KPayQRRequest.CloseOrderResponse> qrCloseOrder(KPayQRRequest.CloseOrderRequest request){
|
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.kbzpay.com/payment/gateway/uat/closeorder"; //close this in prod
|
||||||
return kPayApiService.closeOrder(url, request);
|
return kPayApiService.closeOrder(request);
|
||||||
// return kPayApiService.closeOrder(request); //this is for prod
|
// return kPayApiService.closeOrder(request); //this is for prod
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -895,7 +895,7 @@ public abstract class BaseXPrint {
|
|||||||
dashBreak();
|
dashBreak();
|
||||||
print2ColumnsString("Sale Total :MMK", PrintUtils.getInstance().getSeparatorOnlyNumberFormat(totalAmount));
|
print2ColumnsString("Sale Total :MMK", PrintUtils.getInstance().getSeparatorOnlyNumberFormat(totalAmount));
|
||||||
dashBreak();
|
dashBreak();
|
||||||
print2ColumnsString("Sale Total :MMK", PrintUtils.getInstance().getSeparatorOnlyNumberFormat(totalAmount - refundTotal));
|
print2ColumnsString("Grand Total :MMK", PrintUtils.getInstance().getSeparatorOnlyNumberFormat(totalAmount - refundTotal));
|
||||||
dashBreakEnding();
|
dashBreakEnding();
|
||||||
// emptyLine(2);
|
// emptyLine(2);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user