Skip to content

Commit

Permalink
decode response and add verify false for ssl http
Browse files Browse the repository at this point in the history
  • Loading branch information
mfrouh committed Aug 25, 2022
1 parent b1d514a commit fdd72d4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/BaseClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public function getBalance()
'return' => 'json'
];

$response = Http::get(self::Base_Url . '/getbalance.php', $data);

$response = Http::withOptions(['verify' => false])->get(self::Base_Url . '/getbalance.php', $data);
$response = json_decode($response);
return ['status' => true, 'response' => $response->currentuserpoints, 'message' => $response->MessageIs];
} catch (Exception $error) {
return ['status' => false, 'response' => $error, 'message' => 'error'];
Expand All @@ -39,9 +39,9 @@ public function sendSms($message, $phoneNumber, $phoneCode)
'return' => 'json'
];

$response = Http::get(self::Base_Url . '/sendsms.php', $data);
$response = Http::withOptions(['verify' => false])->get(self::Base_Url . '/sendsms.php', $data);

return $response;
return json_decode($response);
} catch (Exception $error) {
return $error;
}
Expand Down

0 comments on commit fdd72d4

Please sign in to comment.