Compare commits
No commits in common. "37b1538e1c2b36a8df4826ad63f5a9a7d1fd355b" and "850bc21a9ff24faa4421c778232af9154d72b307" have entirely different histories.
37b1538e1c
...
850bc21a9f
@ -399,7 +399,10 @@ public class SettlementTransactionFragment extends DataBindingFragment implement
|
||||
}
|
||||
|
||||
public void onConfirm(){
|
||||
|
||||
if(saleCount == 0){
|
||||
showDeclineDialog("No Transaction Found!");
|
||||
return;
|
||||
}
|
||||
if(sharedViewModel.getTransMenu().getValue() == TransMenu.SETTLEMENT) {
|
||||
/* April 10 , 2024 Smile requested not to send to host even settlement button was clicked */
|
||||
settlementViewModel.startSettlementProcess();
|
||||
|
||||
@ -417,103 +417,47 @@ public class TransactionsOperation {
|
||||
/*
|
||||
* handling issuer script
|
||||
* */
|
||||
// private void emvProcess(PayDetail payDetail) {
|
||||
// String resultStr = "";
|
||||
// try {
|
||||
// resultStr = Objects.requireNonNull(responseMap.get("F039")).getDataStr();
|
||||
// } catch (NullPointerException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//
|
||||
// LogUtil.d(Constant.TAG, "SALE PROCESS RESPONSE CODE :" + resultStr);
|
||||
//
|
||||
// HashMap<String, MsgField> resp = (responseMap instanceof HashMap) ? (HashMap<String, MsgField>) responseMap
|
||||
// : new HashMap<>(responseMap);
|
||||
//
|
||||
// if(BaseCardType.IC.getValue() == payDetail.getCardType() && responseMap.get("F055") != null) {
|
||||
// AuthorizationProcessUtil.authorizationProcess(resp, payDetail);
|
||||
// } else {
|
||||
// boolean equals = TextUtils.equals(resultStr, Constant.ANSWER_CODE_ACCEPT) || TextUtils.equals(resultStr, Constant.ANSWER_CODE_APPROVED);
|
||||
// EmvOnlineResultEntity emvOnlineResult = new EmvOnlineResultEntity();
|
||||
// MsgField field38,field39,field55;
|
||||
// if (resp != null) {
|
||||
// field38 = resp.get("F038");
|
||||
// field39 = resp.get("F039");
|
||||
// field55 = resp.get("F055");
|
||||
//
|
||||
// if(equals)
|
||||
// LogUtil.d(TAG,"Field 38:"+field38.getDataStr());
|
||||
// LogUtil.d(TAG,"Field 39:"+field39.getDataStr());
|
||||
// LogUtil.d(TAG,"Field 55:"+field55.getDataStr());
|
||||
// if(equals)
|
||||
// emvOnlineResult.setAuthCode(field38.getDataStr());
|
||||
// emvOnlineResult.setRejCode(field39.getDataStr());
|
||||
// emvOnlineResult.setRecvField55(ByteUtil.hexStr2Bytes(field55.getDataStr()));
|
||||
// }
|
||||
// if(equals) {
|
||||
// importOnlineProcessStatus(SdkResult.Success,emvOnlineResult);
|
||||
// } else {
|
||||
// importOnlineProcessStatus(SdkResult.Fail,emvOnlineResult);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
private void emvProcess(PayDetail payDetail) {
|
||||
String resultStr = "";
|
||||
try {
|
||||
resultStr = Objects.requireNonNull(responseMap.get("F039")).getDataStr();
|
||||
} catch (NullPointerException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
MsgField f39 = responseMap != null ? responseMap.get("F039") : null;
|
||||
String resultStr = f39 != null ? f39.getDataStr() : "";
|
||||
LogUtil.d(Constant.TAG, "SALE PROCESS RESPONSE CODE :" + resultStr);
|
||||
|
||||
LogUtil.d(Constant.TAG, "SALE PROCESS RESPONSE CODE : " + resultStr);
|
||||
|
||||
boolean approved =
|
||||
TextUtils.equals(resultStr, Constant.ANSWER_CODE_ACCEPT)
|
||||
|| TextUtils.equals(resultStr, Constant.ANSWER_CODE_APPROVED);
|
||||
|
||||
HashMap<String, MsgField> resp =
|
||||
(responseMap instanceof HashMap)
|
||||
? (HashMap<String, MsgField>) responseMap
|
||||
HashMap<String, MsgField> resp = (responseMap instanceof HashMap) ? (HashMap<String, MsgField>) responseMap
|
||||
: new HashMap<>(responseMap);
|
||||
|
||||
MsgField field38 = resp.get("F038");
|
||||
MsgField field55 = resp.get("F055");
|
||||
|
||||
LogUtil.d(TAG, "Field 55: " + (field55 != null ? field55.getDataStr() : "null"));
|
||||
|
||||
if (BaseCardType.IC.getValue() == payDetail.getCardType()
|
||||
&& approved
|
||||
&& field55 != null
|
||||
&& !TextUtils.isEmpty(field55.getDataStr())) {
|
||||
|
||||
if(BaseCardType.IC.getValue() == payDetail.getCardType() && responseMap.get("F055") != null) {
|
||||
AuthorizationProcessUtil.authorizationProcess(resp, payDetail);
|
||||
return;
|
||||
}
|
||||
|
||||
if (BaseCardType.IC.getValue() == payDetail.getCardType() && approved) {
|
||||
|
||||
EmvOnlineResultEntity emptyResult = new EmvOnlineResultEntity();
|
||||
emptyResult.setRejCode(resultStr);
|
||||
|
||||
importOnlineProcessStatus(SdkResult.Success, emptyResult);
|
||||
return;
|
||||
}
|
||||
|
||||
} else {
|
||||
boolean equals = TextUtils.equals(resultStr, Constant.ANSWER_CODE_ACCEPT) || TextUtils.equals(resultStr, Constant.ANSWER_CODE_APPROVED);
|
||||
EmvOnlineResultEntity emvOnlineResult = new EmvOnlineResultEntity();
|
||||
MsgField field38,field39,field55;
|
||||
if (resp != null) {
|
||||
field38 = resp.get("F038");
|
||||
field39 = resp.get("F039");
|
||||
field55 = resp.get("F055");
|
||||
|
||||
if (approved && field38 != null) {
|
||||
if(equals)
|
||||
LogUtil.d(TAG,"Field 38:"+field38.getDataStr());
|
||||
LogUtil.d(TAG,"Field 39:"+field39.getDataStr());
|
||||
LogUtil.d(TAG,"Field 55:"+field55.getDataStr());
|
||||
if(equals)
|
||||
emvOnlineResult.setAuthCode(field38.getDataStr());
|
||||
emvOnlineResult.setRejCode(field39.getDataStr());
|
||||
emvOnlineResult.setRecvField55(ByteUtil.hexStr2Bytes(field55.getDataStr()));
|
||||
}
|
||||
if(equals) {
|
||||
importOnlineProcessStatus(SdkResult.Success,emvOnlineResult);
|
||||
} else {
|
||||
importOnlineProcessStatus(SdkResult.Fail,emvOnlineResult);
|
||||
}
|
||||
}
|
||||
|
||||
if (f39 != null) {
|
||||
emvOnlineResult.setRejCode(f39.getDataStr());
|
||||
}
|
||||
|
||||
importOnlineProcessStatus(
|
||||
approved ? SdkResult.Success : SdkResult.Fail,
|
||||
emvOnlineResult
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user