Commit 9c20d48b authored by Antonio.Suerte's avatar Antonio.Suerte

Remittance API Misleading Status Code Fix

parent 8fad5972
...@@ -174,6 +174,11 @@ class MoneyRequest extends System { ...@@ -174,6 +174,11 @@ class MoneyRequest extends System {
$sha = hash("sha256", $checkSignature); $sha = hash("sha256", $checkSignature);
if($this -> signature != $sha){ if($this -> signature != $sha){
$this -> result["combination"] = [
"real_raw" => $checkSignature,
"real_signature" => $sha
];
$this -> result[PARAM_RESULT] = sprintf("%02d", VAL_INT_90); $this -> result[PARAM_RESULT] = sprintf("%02d", VAL_INT_90);
$this -> result[PARAM_STATUS] = "REJECTED"; $this -> result[PARAM_STATUS] = "REJECTED";
}else{ }else{
...@@ -189,7 +194,7 @@ class MoneyRequest extends System { ...@@ -189,7 +194,7 @@ class MoneyRequest extends System {
}else{ }else{
$format = sprintf("%02d", $this -> ctransfer[PARAM_RESULT]); $format = sprintf("%02d", $this -> ctransfer[PARAM_RESULT]);
$this -> result[PARAM_RESULT] = sprintf("%02d", $this -> result[PARAM_RESULT]); $this -> result[PARAM_RESULT] = $format;
$this -> result[PARAM_STATUS] = "ERROR(CODE:{$format})"; $this -> result[PARAM_STATUS] = "ERROR(CODE:{$format})";
} }
} }
...@@ -280,6 +285,10 @@ class MoneyRequest extends System { ...@@ -280,6 +285,10 @@ class MoneyRequest extends System {
'[REMITTANCE_CALLBACK_RESULT]'.json_encode($this -> result) '[REMITTANCE_CALLBACK_RESULT]'.json_encode($this -> result)
]); ]);
if(isset($this -> result["combination"])){
unset($this -> result["combination"]);
}
echo json_encode($this -> result); echo json_encode($this -> result);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment