Browse Source

Update

hbw_build
Wong Joon Hui 3 years ago
parent
commit
d625a00c92
  1. 3
      app/src/main/java/com/cst/im30/activity/MainActivity.java
  2. 2
      app/src/main/java/com/cst/im30/service/UploadTransactionSalePaymentService.java

3
app/src/main/java/com/cst/im30/activity/MainActivity.java

@ -373,7 +373,7 @@ public class MainActivity extends AppCompatActivity implements CallableInterface
@Override @Override
public void callBack(String source, Object object) { public void callBack(String source, Object object) {
// Logger.logD(source); Logger.logD(source);
String code = MainApplication.code; String code = MainApplication.code;
String status = MainApplication.status; String status = MainApplication.status;
@ -464,6 +464,7 @@ public class MainActivity extends AppCompatActivity implements CallableInterface
// Payment Response // Payment Response
else if (UploadTransactionSalePaymentService.SUCCESS.equalsIgnoreCase(source)) { else if (UploadTransactionSalePaymentService.SUCCESS.equalsIgnoreCase(source)) {
Logger.logD("Code:" + code + ":" + "Status:" + status);
if (PaymentUtils.validateResponseCodeAndMessage(code, status)) { if (PaymentUtils.validateResponseCodeAndMessage(code, status)) {
PaymentService service = new PaymentService(this); PaymentService service = new PaymentService(this);
service.verifySuccess(MainApplication.currentCode); service.verifySuccess(MainApplication.currentCode);

2
app/src/main/java/com/cst/im30/service/UploadTransactionSalePaymentService.java

@ -72,10 +72,12 @@ public class UploadTransactionSalePaymentService {
JSONObject responseJSON = null; JSONObject responseJSON = null;
if (response.errorBody() != null) { if (response.errorBody() != null) {
responseJSON = new JSONObject(response.errorBody().string()); responseJSON = new JSONObject(response.errorBody().string());
Logger.logAPI(responseJSON.toString());
} }
callback.callBack(FAIL, responseJSON); callback.callBack(FAIL, responseJSON);
} else { } else {
JSONObject responseJSON = new JSONObject(response.body()); JSONObject responseJSON = new JSONObject(response.body());
Logger.logAPI(responseJSON.toString());
callback.callBack(SUCCESS, responseJSON); callback.callBack(SUCCESS, responseJSON);
} }
} catch (Exception e) { } catch (Exception e) {

Loading…
Cancel
Save