Skip to content

Commit

Permalink
changes code
Browse files Browse the repository at this point in the history
  • Loading branch information
arif98741 committed Oct 2, 2020
1 parent b39daaf commit 3f03c6f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function HttpPostMethod($PostURL, $PostData)
curl_setopt($url, CURLOPT_SSL_VERIFYPEER, 0);

$resultData = curl_exec($url);
$response = json_decode($resultData, true, 512, JSON_THROW_ON_ERROR);
$response = json_decode($resultData, true, 512);
curl_close($url);
return $response;
}
Expand Down
22 changes: 22 additions & 0 deletions src/RequestHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,28 @@ public function fire($accountNumber = '01711428036')

$Result_Data = $this->helper->HttpPostMethod($PostURL, $PostData);

if ($Result_Data === NULL)
{
return $this->response = [
'status' => 'error',
'response' => [
'code' => 102,
'message' => 'NULL Response. Check your internet connection',
],
'request' => [
'environment' => $this->base->environment,
'time' =>[
'request time'=> date('Y-m-d H:i:s'),
'timezone'=> $this->base->getTimezone()
],
'url' => $PostURL,
'SensitiveData' => $SensitiveData,
'PostData' => $PostData,
],
'server' => Helper::serverDetails()
];
}

if (array_key_exists('sensitiveData', $Result_Data) && array_key_exists('signature', $Result_Data)) {

if (!empty($Result_Data['sensitiveData']) && !empty($Result_Data['signature'])) {
Expand Down

0 comments on commit 3f03c6f

Please sign in to comment.