File tree 2 files changed +92
-0
lines changed 2 files changed +92
-0
lines changed Original file line number Diff line number Diff line change 67
67
'password ' => env ('TILIL_PASSWORD ' ),
68
68
'short_code ' => env ('TILIL_SHORTCODE ' ),
69
69
'call_back_url ' => env ('TILIL_CALL_BACK_URL ' )
70
+ ],
71
+
72
+ 'aptus ' => [
73
+ 'username ' => env ('APTUS_USERNAME ' ),
74
+ 'password ' => env ('APTUS_PASSWORD ' ),
75
+ 'senderid ' => env ('APTUS_SENDERID ' )
70
76
]
71
77
],
72
78
90
96
'infosky ' => \CraftedSystems \LaravelSMS \Gateways \InfoSky::class,
91
97
'infobip ' => \CraftedSystems \LaravelSMS \Gateways \InfoBip::class,
92
98
'tilil ' => \CraftedSystems \LaravelSMS \Gateways \Tilil::class,
99
+ 'aptus ' => \CraftedSystems \LaravelSMS \Gateways \Aptus::class,
93
100
]
94
101
];
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: vincent
5
+ * Date: 12/14/17
6
+ * Time: 6:04 PM
7
+ */
8
+
9
+ namespace CraftedSystems \LaravelSMS \Gateways ;
10
+
11
+
12
+ use CraftedSystems \Aptus \AptusSMS ;
13
+ use CraftedSystems \LaravelSMS \Contracts \SMSContract ;
14
+ use Illuminate \Http \Request ;
15
+
16
+ class Aptus implements SMSContract
17
+ {
18
+ /**
19
+ * @var AptusSMS
20
+ */
21
+ protected $ class ;
22
+
23
+
24
+ /**
25
+ * MicroMobile constructor.
26
+ * @param $settings
27
+ * @throws \Exception
28
+ */
29
+ public function __construct ($ settings )
30
+ {
31
+ if (!class_exists ('CraftedSystems\Aptus\AptusSMS ' )) {
32
+
33
+ throw new \Exception ("Class 'CraftedSystems\Aptus\AptusSMS' does not exist " );
34
+ }
35
+
36
+ $ this ->class = new AptusSMS ($ settings );
37
+ }
38
+
39
+ /**
40
+ * @param $recipient
41
+ * @param $message
42
+ * @param null $params
43
+ * @return mixed
44
+ * @throws \Exception
45
+ */
46
+ public function send ($ recipient , $ message , $ params = null )
47
+ {
48
+ $ response = $ this ->class ->send ($ recipient , $ message );
49
+ $ d = explode (", " , $ response );
50
+
51
+ $ data = [
52
+ 'is_success ' => $ d [0 ] === 'OK ' ,
53
+ 'queued ' => $ d [1 ],
54
+ 'message_id ' => $ d [2 ]
55
+ ];
56
+
57
+ return (object )$ data ;
58
+ }
59
+
60
+ /**
61
+ * @return mixed
62
+ */
63
+ public function getBalance ()
64
+ {
65
+ return $ this ->class ->getBalance ();
66
+ }
67
+
68
+
69
+ /**
70
+ * @param Request $request
71
+ * @return mixed|object
72
+ */
73
+ public function getDeliveryReports (Request $ request )
74
+ {
75
+ $ response = $ this ->class ->getDeliveryReports ($ request );
76
+
77
+ $ data = [
78
+ 'status ' => $ response ->dlrDesc ,
79
+ 'message_id ' => $ response ->messageId ,
80
+ 'network ' => $ response ->network
81
+ ];
82
+
83
+ return (object )$ data ;
84
+ }
85
+ }
You can’t perform that action at this time.
0 commit comments