|
|
@ -26,10 +26,12 @@ import com.cst.im30.MainApplication; |
|
|
|
import com.cst.im30.R; |
|
|
|
import com.cst.im30.R; |
|
|
|
import com.cst.im30.common.CallableInterface; |
|
|
|
import com.cst.im30.common.CallableInterface; |
|
|
|
import com.cst.im30.common.Constants; |
|
|
|
import com.cst.im30.common.Constants; |
|
|
|
|
|
|
|
import com.cst.im30.model.CancelRequest; |
|
|
|
import com.cst.im30.model.EventLogDetailed; |
|
|
|
import com.cst.im30.model.EventLogDetailed; |
|
|
|
import com.cst.im30.model.PreAuthRequest; |
|
|
|
import com.cst.im30.model.PreAuthRequest; |
|
|
|
import com.cst.im30.model.SaleCompletionRequest; |
|
|
|
import com.cst.im30.model.SaleCompletionRequest; |
|
|
|
import com.cst.im30.model.SaleRequest; |
|
|
|
import com.cst.im30.model.SaleRequest; |
|
|
|
|
|
|
|
import com.cst.im30.model.VoidRequest; |
|
|
|
import com.cst.im30.service.IDVerificationService; |
|
|
|
import com.cst.im30.service.IDVerificationService; |
|
|
|
import com.cst.im30.service.PaymentService; |
|
|
|
import com.cst.im30.service.PaymentService; |
|
|
|
import com.cst.im30.utility.Logger; |
|
|
|
import com.cst.im30.utility.Logger; |
|
|
@ -105,8 +107,6 @@ public class MainActivity extends AppCompatActivity implements CallableInterface |
|
|
|
|
|
|
|
|
|
|
|
initEchoClient(); |
|
|
|
initEchoClient(); |
|
|
|
connectEchoClient(); |
|
|
|
connectEchoClient(); |
|
|
|
|
|
|
|
|
|
|
|
//checkPaymentResult();
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -116,7 +116,6 @@ public class MainActivity extends AppCompatActivity implements CallableInterface |
|
|
|
Intent incomingIntent = getIntent(); |
|
|
|
Intent incomingIntent = getIntent(); |
|
|
|
String action = incomingIntent.getAction(); |
|
|
|
String action = incomingIntent.getAction(); |
|
|
|
if (Constants.INTENT_REFRESH.equalsIgnoreCase(action)) { |
|
|
|
if (Constants.INTENT_REFRESH.equalsIgnoreCase(action)) { |
|
|
|
|
|
|
|
|
|
|
|
String code = incomingIntent.getStringExtra("code"); |
|
|
|
String code = incomingIntent.getStringExtra("code"); |
|
|
|
String status = incomingIntent.getStringExtra("status"); |
|
|
|
String status = incomingIntent.getStringExtra("status"); |
|
|
|
|
|
|
|
|
|
|
@ -203,8 +202,6 @@ public class MainActivity extends AppCompatActivity implements CallableInterface |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void initViews() { |
|
|
|
private void initViews() { |
|
|
|
startWork(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
runOnUiThread(() -> { |
|
|
|
runOnUiThread(() -> { |
|
|
|
sliderLayout.setVisibility(View.INVISIBLE); |
|
|
|
sliderLayout.setVisibility(View.INVISIBLE); |
|
|
|
testTitle.setVisibility(View.INVISIBLE); |
|
|
|
testTitle.setVisibility(View.INVISIBLE); |
|
|
@ -223,7 +220,6 @@ public class MainActivity extends AppCompatActivity implements CallableInterface |
|
|
|
load.setVisibility(View.GONE); |
|
|
|
load.setVisibility(View.GONE); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
stopWork(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void paymentProcess(EventLogDetailed eventLogDetailed) { |
|
|
|
private void paymentProcess(EventLogDetailed eventLogDetailed) { |
|
|
@ -236,6 +232,16 @@ public class MainActivity extends AppCompatActivity implements CallableInterface |
|
|
|
|
|
|
|
|
|
|
|
if (Constants.PAY_FUNCTION_SALE.equalsIgnoreCase(payFunction)) { |
|
|
|
if (Constants.PAY_FUNCTION_SALE.equalsIgnoreCase(payFunction)) { |
|
|
|
handlePayFunctionSale(eventLogDetailed); |
|
|
|
handlePayFunctionSale(eventLogDetailed); |
|
|
|
|
|
|
|
} else if (Constants.PAY_FUNCTION_VOID.equalsIgnoreCase(payFunction)) { |
|
|
|
|
|
|
|
handlePayFunctionVoid(eventLogDetailed); |
|
|
|
|
|
|
|
} else if (Constants.PAY_FUNCTION_INQUIRY.equalsIgnoreCase(payFunction)) { |
|
|
|
|
|
|
|
//handlePayFunctionPreAuth(eventLogDetailed);
|
|
|
|
|
|
|
|
} else if (Constants.PAY_FUNCTION_CANCEL.equalsIgnoreCase(payFunction)) { |
|
|
|
|
|
|
|
handlePayFunctionCancel(eventLogDetailed); |
|
|
|
|
|
|
|
} else if (Constants.PAY_FUNCTION_SETTLEMENT.equalsIgnoreCase(payFunction)) { |
|
|
|
|
|
|
|
//handlePayFunctionPreAuth(eventLogDetailed);
|
|
|
|
|
|
|
|
} else if (Constants.PAY_FUNCTION_SET_DATE_TIME.equalsIgnoreCase(payFunction)) { |
|
|
|
|
|
|
|
//handlePayFunctionPreAuth(eventLogDetailed);
|
|
|
|
} else if (Constants.PAY_FUNCTION_PRE_AUTH.equalsIgnoreCase(payFunction)) { |
|
|
|
} else if (Constants.PAY_FUNCTION_PRE_AUTH.equalsIgnoreCase(payFunction)) { |
|
|
|
handlePayFunctionPreAuth(eventLogDetailed); |
|
|
|
handlePayFunctionPreAuth(eventLogDetailed); |
|
|
|
} else if (Constants.PAY_FUNCTION_SALE_COMPLETION.equalsIgnoreCase(payFunction)) { |
|
|
|
} else if (Constants.PAY_FUNCTION_SALE_COMPLETION.equalsIgnoreCase(payFunction)) { |
|
|
@ -244,7 +250,7 @@ public class MainActivity extends AppCompatActivity implements CallableInterface |
|
|
|
String msg = "Unsupported Pay Function: " + payFunction; |
|
|
|
String msg = "Unsupported Pay Function: " + payFunction; |
|
|
|
Toast.makeText(MainActivity.this, msg, Toast.LENGTH_SHORT).show(); |
|
|
|
Toast.makeText(MainActivity.this, msg, Toast.LENGTH_SHORT).show(); |
|
|
|
resetView(); |
|
|
|
resetView(); |
|
|
|
Logger.logWTF(msg); |
|
|
|
Logger.logW(msg); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -254,17 +260,32 @@ public class MainActivity extends AppCompatActivity implements CallableInterface |
|
|
|
initSalePayment(request); |
|
|
|
initSalePayment(request); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
Toast.makeText(MainActivity.this, "Invalid Sale Request", Toast.LENGTH_SHORT).show(); |
|
|
|
Toast.makeText(MainActivity.this, "Invalid Sale Request", Toast.LENGTH_SHORT).show(); |
|
|
|
Logger.logWTF("Invalid Sale Request: " + request.toString()); |
|
|
|
Logger.logW("Invalid Sale Request: " + request.toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void handlePayFunctionVoid(EventLogDetailed eventLogDetailed) { |
|
|
|
|
|
|
|
VoidRequest request = PaymentUtils.createVoidRequest(eventLogDetailed); |
|
|
|
|
|
|
|
if (PaymentUtils.validateVoidRequest(request)) { |
|
|
|
|
|
|
|
initVoid(request); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
Toast.makeText(MainActivity.this, "Invalid Void Request", Toast.LENGTH_SHORT).show(); |
|
|
|
|
|
|
|
Logger.logW("Invalid Void Request: " + request.toString()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void handlePayFunctionCancel(EventLogDetailed eventLogDetailed) { |
|
|
|
|
|
|
|
CancelRequest request = new CancelRequest(); |
|
|
|
|
|
|
|
initCancel(request); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void handlePayFunctionPreAuth(EventLogDetailed eventLogDetailed) { |
|
|
|
private void handlePayFunctionPreAuth(EventLogDetailed eventLogDetailed) { |
|
|
|
PreAuthRequest request = PaymentUtils.createPreAuthRequest(eventLogDetailed); |
|
|
|
PreAuthRequest request = PaymentUtils.createPreAuthRequest(eventLogDetailed); |
|
|
|
if (PaymentUtils.validatePreAuthRequest(request)) { |
|
|
|
if (PaymentUtils.validatePreAuthRequest(request)) { |
|
|
|
initPreAuth(request); |
|
|
|
initPreAuth(request); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
Toast.makeText(MainActivity.this, "Invalid Pre Auth Request", Toast.LENGTH_SHORT).show(); |
|
|
|
Toast.makeText(MainActivity.this, "Invalid Pre Auth Request", Toast.LENGTH_SHORT).show(); |
|
|
|
Logger.logWTF("Invalid Pre Auth Request: " + request.toString()); |
|
|
|
Logger.logW("Invalid Pre Auth Request: " + request.toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -274,76 +295,10 @@ public class MainActivity extends AppCompatActivity implements CallableInterface |
|
|
|
initSaleCompletion(request); |
|
|
|
initSaleCompletion(request); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
Toast.makeText(MainActivity.this, "Invalid Sale Completion Request", Toast.LENGTH_SHORT).show(); |
|
|
|
Toast.makeText(MainActivity.this, "Invalid Sale Completion Request", Toast.LENGTH_SHORT).show(); |
|
|
|
Logger.logWTF("Invalid Sale Completion Request: " + request.toString()); |
|
|
|
Logger.logW("Invalid Sale Completion Request: " + request.toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void checkPaymentResult() { |
|
|
|
|
|
|
|
//Get status from Status Screen
|
|
|
|
|
|
|
|
Intent intent = getIntent(); |
|
|
|
|
|
|
|
Bundle retryInfoGet = intent.getExtras(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (retryInfoGet != null) { |
|
|
|
|
|
|
|
String referenceSet = (String) retryInfoGet.get("referenceCurrent"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String statusSet = (String) retryInfoGet.get("statusCurrent"); |
|
|
|
|
|
|
|
//set status null
|
|
|
|
|
|
|
|
if (statusSet != null) { |
|
|
|
|
|
|
|
status = statusSet; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
status = "start"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String amountSet = (String) retryInfoGet.get("amountCurrent"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//if payment success
|
|
|
|
|
|
|
|
if (status.toLowerCase().trim().equals("success")) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (status.toLowerCase().trim().equals("pending")) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
initViews(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//if payment fail
|
|
|
|
|
|
|
|
/*Button buttonRetryPayment = (Button) findViewById(R.id.button_retry_payment); |
|
|
|
|
|
|
|
buttonRetryPayment.getBackground().setColorFilter(Color.CYAN, PorterDuff.Mode.MULTIPLY); |
|
|
|
|
|
|
|
buttonRetryPayment.setEnabled(true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Get data from StatusActivty - refNum & amount only
|
|
|
|
|
|
|
|
//String referenceNumber = StatusActivity.getRefNum();
|
|
|
|
|
|
|
|
//get and set again
|
|
|
|
|
|
|
|
*//*textViewViewRespTranslateRefNum = findViewById(R.id.textview_response_translate_refNum);
|
|
|
|
|
|
|
|
textViewViewRespTranslateStatus = findViewById(R.id.textview_response_translate_status); |
|
|
|
|
|
|
|
textViewViewRespTranslateAmount = findViewById(R.id.textview_response_translate_amount);*//*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//String statusTemp = StatusActivity.getStatus();
|
|
|
|
|
|
|
|
//runOnUiThread(() -> textViewViewRespTranslateStatus.setText(statusSet));
|
|
|
|
|
|
|
|
//String amount = StatusActivity.getAmount();
|
|
|
|
|
|
|
|
//runOnUiThread(() -> textViewViewRespTranslateAmount.setText("RM " + amountSet));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//for checking
|
|
|
|
|
|
|
|
if (buttonRetryPayment.isEnabled()) {*/ |
|
|
|
|
|
|
|
//show payment info
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//if user click retry ->disable coz show retry on status activity
|
|
|
|
|
|
|
|
//buttonRetryPayment.setOnClickListener(v -> retryPayment());
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
//if return fail
|
|
|
|
|
|
|
|
//runOnUiThread(() -> textViewViewRespTranslateRefNum.setText("Reference Number..."));
|
|
|
|
|
|
|
|
//runOnUiThread(() -> textViewViewRespTranslateStatus.setText("Status..."));
|
|
|
|
|
|
|
|
//runOnUiThread(() -> textViewViewRespTranslateAmount.setText("Amount..."));
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//refreshUI();
|
|
|
|
|
|
|
|
//if null
|
|
|
|
|
|
|
|
/*runOnUiThread(() -> textViewViewRespTranslateRefNum.setText("Reference Number...")); |
|
|
|
|
|
|
|
runOnUiThread(() -> textViewViewRespTranslateStatus.setText("Status...")); |
|
|
|
|
|
|
|
runOnUiThread(() -> textViewViewRespTranslateAmount.setText("Amount..."));*/ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void receiveMessagePayment(Object... args) { |
|
|
|
private void receiveMessagePayment(Object... args) { |
|
|
|
Logger.logD("Received Payment Message"); |
|
|
|
Logger.logD("Received Payment Message"); |
|
|
|
|
|
|
|
|
|
|
@ -351,23 +306,15 @@ public class MainActivity extends AppCompatActivity implements CallableInterface |
|
|
|
String data; |
|
|
|
String data; |
|
|
|
try { |
|
|
|
try { |
|
|
|
data = jsonObject.getJSONObject("data").getString("code"); |
|
|
|
data = jsonObject.getJSONObject("data").getString("code"); |
|
|
|
MainApplication.currentCode = data; |
|
|
|
MainApplication.incomingCode = data; |
|
|
|
} catch (JSONException e) { |
|
|
|
} catch (JSONException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (MainApplication.working) { |
|
|
|
if (MainApplication.incomingCode != null && !MainApplication.incomingCode.isEmpty()) { |
|
|
|
Logger.logE("Received Payment Message but IM30 is currently working!"); |
|
|
|
|
|
|
|
PaymentService service = new PaymentService(this); |
|
|
|
|
|
|
|
service.verifyReject(MainApplication.currentCode); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (MainApplication.currentCode != null && !MainApplication.currentCode.isEmpty()) { |
|
|
|
|
|
|
|
initViews(); |
|
|
|
initViews(); |
|
|
|
PaymentService service = new PaymentService(this); |
|
|
|
PaymentService service = new PaymentService(this); |
|
|
|
service.getEventLog(MainApplication.currentCode); |
|
|
|
service.getEventLog(MainApplication.incomingCode); |
|
|
|
startWork(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
@ -379,23 +326,25 @@ public class MainActivity extends AppCompatActivity implements CallableInterface |
|
|
|
String data; |
|
|
|
String data; |
|
|
|
try { |
|
|
|
try { |
|
|
|
data = jsonObject.getJSONObject("data").getString("code"); |
|
|
|
data = jsonObject.getJSONObject("data").getString("code"); |
|
|
|
MainApplication.currentCode = data; |
|
|
|
MainApplication.incomingCode = data; |
|
|
|
} catch (JSONException e) { |
|
|
|
} catch (JSONException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// todo adapt for cancel on kiosk / polling
|
|
|
|
if (MainApplication.working) { |
|
|
|
if (MainApplication.working) { |
|
|
|
Logger.logE("Received IC Verification Message but IM30 is currently working!"); |
|
|
|
Logger.logE("Received IC Verification Message but IM30 is currently working!"); |
|
|
|
IDVerificationService service = new IDVerificationService(this); |
|
|
|
IDVerificationService service = new IDVerificationService(this); |
|
|
|
service.verifyReject(MainApplication.currentCode); |
|
|
|
service.verifyReject(MainApplication.incomingCode); |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
startWork(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (MainApplication.currentCode != null && !MainApplication.currentCode.isEmpty()) { |
|
|
|
if (MainApplication.incomingCode != null && !MainApplication.incomingCode.isEmpty()) { |
|
|
|
initViews(); |
|
|
|
initViews(); |
|
|
|
IDVerificationService service = new IDVerificationService(this); |
|
|
|
IDVerificationService service = new IDVerificationService(this); |
|
|
|
service.getEventLog(MainApplication.currentCode); |
|
|
|
service.getEventLog(MainApplication.incomingCode); |
|
|
|
startWork(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -405,6 +354,7 @@ public class MainActivity extends AppCompatActivity implements CallableInterface |
|
|
|
|
|
|
|
|
|
|
|
// NRIC
|
|
|
|
// NRIC
|
|
|
|
if (source.equalsIgnoreCase(IDVerificationService.SUCCESS_GET_EVENT_LOG)) { |
|
|
|
if (source.equalsIgnoreCase(IDVerificationService.SUCCESS_GET_EVENT_LOG)) { |
|
|
|
|
|
|
|
MainApplication.currentCode = MainApplication.incomingCode; |
|
|
|
MainApplication.currentEventLogDetailed = (EventLogDetailed) object; |
|
|
|
MainApplication.currentEventLogDetailed = (EventLogDetailed) object; |
|
|
|
Intent i = new Intent(MainActivity.this, ICCActivity.class); |
|
|
|
Intent i = new Intent(MainActivity.this, ICCActivity.class); |
|
|
|
icVerificationLauncher.launch(i); |
|
|
|
icVerificationLauncher.launch(i); |
|
|
@ -420,9 +370,24 @@ public class MainActivity extends AppCompatActivity implements CallableInterface |
|
|
|
|
|
|
|
|
|
|
|
// Payment
|
|
|
|
// Payment
|
|
|
|
else if (source.equalsIgnoreCase(PaymentService.SUCCESS_GET_EVENT_LOG)) { |
|
|
|
else if (source.equalsIgnoreCase(PaymentService.SUCCESS_GET_EVENT_LOG)) { |
|
|
|
MainApplication.currentEventLogDetailed = (EventLogDetailed) object; |
|
|
|
EventLogDetailed incomingEventLogDetailed = (EventLogDetailed) object; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean cancelPayFunction = incomingEventLogDetailed.getPayFunction().equalsIgnoreCase(Constants.PAY_FUNCTION_CANCEL); |
|
|
|
|
|
|
|
if (cancelPayFunction) { |
|
|
|
|
|
|
|
// Cancel whether working or not at the moment
|
|
|
|
|
|
|
|
MainApplication.currentEventLogDetailed = incomingEventLogDetailed; |
|
|
|
paymentProcess(MainApplication.currentEventLogDetailed); |
|
|
|
paymentProcess(MainApplication.currentEventLogDetailed); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
if (MainApplication.working) { |
|
|
|
|
|
|
|
Logger.logE("Received Payment Message but IM30 is currently working!"); |
|
|
|
|
|
|
|
PaymentService service = new PaymentService(this); |
|
|
|
|
|
|
|
service.verifyReject(MainApplication.incomingCode); |
|
|
|
|
|
|
|
} else { |
|
|
|
startWork(); |
|
|
|
startWork(); |
|
|
|
|
|
|
|
MainApplication.currentEventLogDetailed = incomingEventLogDetailed; |
|
|
|
|
|
|
|
paymentProcess(MainApplication.currentEventLogDetailed); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} else if (source.equalsIgnoreCase(PaymentService.FAIL_GET_EVENT_LOG)) { |
|
|
|
} else if (source.equalsIgnoreCase(PaymentService.FAIL_GET_EVENT_LOG)) { |
|
|
|
resetView(); //todo try again? ^
|
|
|
|
resetView(); //todo try again? ^
|
|
|
|
} |
|
|
|
} |
|
|
@ -442,7 +407,6 @@ public class MainActivity extends AppCompatActivity implements CallableInterface |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// --- NRIC ------------------------------------------------------------------------------------
|
|
|
|
// --- NRIC ------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
private boolean verifyIC(String name, String cardNo) { |
|
|
|
private boolean verifyIC(String name, String cardNo) { |
|
|
@ -515,6 +479,37 @@ public class MainActivity extends AppCompatActivity implements CallableInterface |
|
|
|
app2app(extra); |
|
|
|
app2app(extra); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initVoid(VoidRequest request) { |
|
|
|
|
|
|
|
Logger.logD("Void Payment: " + request.toString()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Bundle extra = new Bundle(); |
|
|
|
|
|
|
|
extra.putString("pay_function", request.getPayFunction()); |
|
|
|
|
|
|
|
extra.putString("pay_amount", String.valueOf(request.getPayAmount())); |
|
|
|
|
|
|
|
extra.putString("pay_print_receipt_id", request.getPayPrintReceiptId()); |
|
|
|
|
|
|
|
extra.putString("pay_trace_no", request.getPayTraceNo()); |
|
|
|
|
|
|
|
extra.putString("pay_invoice_no", request.getPayInvoiceNo()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String payPosTxnId = request.getPayPosTxnId(); |
|
|
|
|
|
|
|
if (payPosTxnId != null && !payPosTxnId.isEmpty()) { |
|
|
|
|
|
|
|
extra.putString("pay_pos_txn_id", payPosTxnId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MainApplication.currentVoidRequest = request; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app2app(extra); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initCancel(CancelRequest request) { |
|
|
|
|
|
|
|
Logger.logD(request.toString()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Bundle extra = new Bundle(); |
|
|
|
|
|
|
|
extra.putString("pay_function", request.getPayFunction()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MainApplication.currentCancelRequest = request; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app2app(extra); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void initPreAuth(PreAuthRequest request) { |
|
|
|
private void initPreAuth(PreAuthRequest request) { |
|
|
|
Logger.logD(request.toString()); |
|
|
|
Logger.logD(request.toString()); |
|
|
|
|
|
|
|
|
|
|
@ -564,8 +559,6 @@ public class MainActivity extends AppCompatActivity implements CallableInterface |
|
|
|
Logger.logD("App2App Call to: " + Constants.APP_2_APP); |
|
|
|
Logger.logD("App2App Call to: " + Constants.APP_2_APP); |
|
|
|
|
|
|
|
|
|
|
|
startActivity(intent); |
|
|
|
startActivity(intent); |
|
|
|
|
|
|
|
|
|
|
|
startWork(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// --- MISC ------------------------------------------------------------------------------------
|
|
|
|
// --- MISC ------------------------------------------------------------------------------------
|
|
|
@ -633,10 +626,6 @@ public class MainActivity extends AppCompatActivity implements CallableInterface |
|
|
|
MainApplication.working = true; |
|
|
|
MainApplication.working = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void stopWork() { |
|
|
|
|
|
|
|
MainApplication.working = false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onBackPressed() { |
|
|
|
public void onBackPressed() { |
|
|
|
Logger.logI("Back Button Disabled!"); |
|
|
|
Logger.logI("Back Button Disabled!"); |
|
|
|