production ready
This commit is contained in:
parent
c9dd1b93f7
commit
58118a2fb5
@ -13,12 +13,6 @@
|
||||
</DropdownSelection>
|
||||
<DialogSelection />
|
||||
</SelectionState>
|
||||
<SelectionState runConfigName="testSalePacket()">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
</SelectionState>
|
||||
<SelectionState runConfigName="testResponseSalePacket()">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
</SelectionState>
|
||||
</selectionStates>
|
||||
</component>
|
||||
</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 {
|
||||
release {
|
||||
minifyEnabled true
|
||||
@ -82,7 +54,7 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
debug {
|
||||
debuggable true
|
||||
debuggable false
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
|
||||
@ -110,6 +110,8 @@ public class MainActivity extends AppCompatActivity implements
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
BaseApplication.getInstance().deviceEngine.getPlatform().hideNavigationBar();
|
||||
|
||||
// Keep screen on
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
|
||||
@ -147,7 +149,6 @@ public class MainActivity extends AppCompatActivity implements
|
||||
initKey();
|
||||
}
|
||||
}, 500);
|
||||
|
||||
}
|
||||
|
||||
private void initKey(){
|
||||
@ -426,15 +427,15 @@ public class MainActivity extends AppCompatActivity implements
|
||||
SystemParamsOperation.getInstance().setDownloadedParams(false);
|
||||
|
||||
handleAutoSettlementIntent(getIntent());
|
||||
|
||||
BaseApplication.getInstance().deviceEngine.getPlatform().hideNavigationBar();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop(){
|
||||
super.onStop();
|
||||
BaseApplication.getInstance().deviceEngine.getPlatform().showNavigationBar();
|
||||
BaseApplication.getInstance().deviceEngine.getPlatform().enableHomeButton();
|
||||
BaseApplication.getInstance().deviceEngine.getPlatform().enableTaskButton();
|
||||
// BaseApplication.getInstance().deviceEngine.getPlatform().showNavigationBar();
|
||||
// BaseApplication.getInstance().deviceEngine.getPlatform().enableHomeButton();
|
||||
// BaseApplication.getInstance().deviceEngine.getPlatform().enableTaskButton();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -502,14 +503,15 @@ public class MainActivity extends AppCompatActivity implements
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
BaseApplication.getInstance().deviceEngine.getPlatform().showNavigationBar();
|
||||
BaseApplication.getInstance().deviceEngine.getPlatform().enableHomeButton();
|
||||
BaseApplication.getInstance().deviceEngine.getPlatform().enableTaskButton();
|
||||
// BaseApplication.getInstance().deviceEngine.getPlatform().showNavigationBar();
|
||||
// BaseApplication.getInstance().deviceEngine.getPlatform().enableHomeButton();
|
||||
// BaseApplication.getInstance().deviceEngine.getPlatform().enableTaskButton();
|
||||
// Clean up RxJava disposables
|
||||
compositeDisposable.clear();
|
||||
// Reset screen mode
|
||||
// Disconnect ECR
|
||||
ECRHelper.INSTANCE.disconnect();
|
||||
BaseApplication.getInstance().deviceEngine.getPlatform().showNavigationBar();
|
||||
}
|
||||
|
||||
// Navigation drawer interaction listeners
|
||||
@ -520,6 +522,12 @@ public class MainActivity extends AppCompatActivity implements
|
||||
navController.navigate(R.id.inputPasswordFragment);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause(){
|
||||
super.onPause();
|
||||
BaseApplication.getInstance().deviceEngine.getPlatform().showNavigationBar();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickFunction() {
|
||||
closeDrawer();
|
||||
|
||||
@ -146,10 +146,10 @@ public class MainFragment extends DataBindingFragment {
|
||||
delayFunctionCall(() -> {
|
||||
NexGoSDK.getInstance().cancelCheckCard();
|
||||
NexGoSDK.getInstance().closeReader();
|
||||
enableHomeButton();
|
||||
disableTaskButton();
|
||||
// enableHomeButton();
|
||||
// disableTaskButton();
|
||||
// BaseApplication.getInstance().deviceEngine.getPlatform().hideNavigationBar();
|
||||
BaseApplication.getInstance().deviceEngine.getPlatform().showNavigationBar();
|
||||
// BaseApplication.getInstance().deviceEngine.getPlatform().showNavigationBar();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -223,6 +223,35 @@
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 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
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -231,27 +260,37 @@
|
||||
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}">
|
||||
|
||||
<!-- Label : 30% -->
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_weight="3"
|
||||
android:text="MMQR Ref"
|
||||
android:textColor="@color/colorTextContent"
|
||||
android:textSize="14sp"
|
||||
android:fontFamily="@font/rubik_regular" />
|
||||
|
||||
<!-- Value : 70% -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="7"
|
||||
android:gravity="end"
|
||||
|
||||
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"
|
||||
|
||||
tools:text="REF123456789123456789123456789012345" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
@ -82,9 +82,6 @@ public class NetworkModule {
|
||||
|
||||
public static native String getTMSUrlFromNative();
|
||||
|
||||
public static String Refund_Base_Url = "https://api.kbzpay.com:18008/payment/gateway/uat/";
|
||||
|
||||
|
||||
private static OkHttpClient getUnsafeOkHttpClient() {
|
||||
try {
|
||||
// Create a trust manager that does not validate certificate chains
|
||||
@ -395,6 +392,21 @@ public Retrofit provideKPayRefundRetrofit(@ApplicationContext Context context) {
|
||||
|
||||
// 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();
|
||||
if (TextUtils.isEmpty(pass)) {
|
||||
pass = "test123";
|
||||
@ -456,7 +468,7 @@ public Retrofit provideKPayRefundRetrofit(@ApplicationContext Context context) {
|
||||
.build();
|
||||
|
||||
return new Retrofit.Builder()
|
||||
.baseUrl(Refund_Base_Url)
|
||||
.baseUrl(refundBaseUrl)
|
||||
.client(okHttp)
|
||||
.addCallAdapterFactory(RxJava3CallAdapterFactory.create())
|
||||
.addConverterFactory(GsonConverterFactory.create())
|
||||
@ -468,7 +480,7 @@ public Retrofit provideKPayRefundRetrofit(@ApplicationContext Context context) {
|
||||
|
||||
// Provide fallback Retrofit to avoid crash, but no SSL
|
||||
return new Retrofit.Builder()
|
||||
.baseUrl(Refund_Base_Url)
|
||||
.baseUrl(refundBaseUrl)
|
||||
.client(new OkHttpClient())
|
||||
.addCallAdapterFactory(RxJava3CallAdapterFactory.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
|
||||
@POST
|
||||
Observable<KPayQRRequest.CloseOrderResponse> closeOrder(@Url String url, @Body KPayQRRequest.CloseOrderRequest closeOrderRequest);
|
||||
@POST("closeorder")
|
||||
Observable<KPayQRRequest.CloseOrderResponse> closeOrder(@Body KPayQRRequest.CloseOrderRequest closeOrderRequest);
|
||||
|
||||
|
||||
//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).toLowerCase(); // new tms
|
||||
|
||||
LogUtil.d(TAG,"hashed :"+ hashed);
|
||||
// LogUtil.d(TAG,"hashed :"+ hashed);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
@ -86,8 +86,8 @@ 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
|
||||
return kPayApiService.closeOrder(url, request);
|
||||
// String url = "https://api.kbzpay.com/payment/gateway/uat/closeorder"; //close this in prod
|
||||
return kPayApiService.closeOrder(request);
|
||||
// return kPayApiService.closeOrder(request); //this is for prod
|
||||
}
|
||||
|
||||
|
||||
@ -895,7 +895,7 @@ public abstract class BaseXPrint {
|
||||
dashBreak();
|
||||
print2ColumnsString("Sale Total :MMK", PrintUtils.getInstance().getSeparatorOnlyNumberFormat(totalAmount));
|
||||
dashBreak();
|
||||
print2ColumnsString("Sale Total :MMK", PrintUtils.getInstance().getSeparatorOnlyNumberFormat(totalAmount - refundTotal));
|
||||
print2ColumnsString("Grand Total :MMK", PrintUtils.getInstance().getSeparatorOnlyNumberFormat(totalAmount - refundTotal));
|
||||
dashBreakEnding();
|
||||
// emptyLine(2);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user