We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fbfbdbe commit fc95f5dCopy full SHA for fc95f5d
src/Adapters/ParsaSms.php
@@ -3,6 +3,7 @@
3
namespace Tartan\IranianSms\Adapter;
4
5
use Ghasedak\GhasedakApi;
6
+use Exception;
7
8
class ParsaSms extends AdapterAbstract implements AdapterInterface
9
{
@@ -41,7 +42,13 @@ public function send(String $number, String $message)
41
42
43
$response = curl_exec($curl);
44
curl_close($curl);
-
45
+
46
+ $response_array = json_decode($response,TRUE);
47
48
+ if (!(isset($response_array['result']) && $response_array['result'] == 'success')){
49
+ throw new Exception("Error: ".$response);
50
+ }
51
52
return $response;
53
}
54
0 commit comments