1 | <?php |
||
12 | class Missive |
||
13 | { |
||
14 | /** @var \LBHurtado\Missive\Classes\SMSAbstract */ |
||
15 | protected $sms; |
||
16 | |||
17 | /** @var \LBHurtado\Missive\Repositories\AirtimeRepository */ |
||
18 | protected $airtimes; |
||
19 | |||
20 | public function __construct(AirtimeRepository $airtimes) |
||
24 | |||
25 | /** |
||
26 | * @param SMSAbstract $sms |
||
27 | * @return $this |
||
28 | */ |
||
29 | public function setSMS(SMSAbstract $sms) |
||
35 | |||
36 | /** |
||
37 | * @return SMSAbstract |
||
38 | */ |
||
39 | public function getSMS(): SMSAbstract |
||
43 | |||
44 | /** |
||
45 | * @return Contact |
||
46 | */ |
||
47 | public function getContact(): Contact |
||
51 | |||
52 | /** |
||
53 | * @param ChargeType $key |
||
54 | * @param int $qty |
||
55 | */ |
||
56 | public function chargeSMS(ChargeType $key, int $qty = 1) |
||
65 | |||
66 | /** |
||
67 | * @param string $otp |
||
68 | * @return $this |
||
69 | */ |
||
70 | public function verifyContact(string $otp) |
||
76 | |||
77 | /** |
||
78 | * @param array $attributes |
||
79 | */ |
||
80 | public function topupMobile(array $attributes) |
||
90 | |||
91 | /** |
||
92 | * Extract the associative array in config('missive.relay') |
||
93 | * to be used for default relay configuration e.g. |
||
94 | * |
||
95 | * [ |
||
96 | * 'from' => 'from_number', |
||
97 | * 'to' => 'to_number', |
||
98 | * 'message' => 'content', |
||
99 | * ] |
||
100 | * |
||
101 | * @return array |
||
102 | */ |
||
103 | public function getRelayProviderConfig(): array |
||
107 | |||
108 | /** |
||
109 | * Extract the associative array in config('tactician.fields') |
||
110 | * and "merge: it with the relay provider config to be used for validation e.g. |
||
111 | * |
||
112 | * from |
||
113 | * |
||
114 | * [ |
||
115 | * 'from' => 'required', |
||
116 | * 'to' => 'required', |
||
117 | * 'message' => 'string|max:800', |
||
118 | * ] |
||
119 | * |
||
120 | * to |
||
121 | * |
||
122 | * [ |
||
123 | * 'from_number' => 'required', |
||
124 | * 'to_number' => 'required', |
||
125 | * 'content' => 'string|max:800', |
||
126 | * ] |
||
127 | * |
||
128 | * @return array |
||
129 | */ |
||
130 | public function getRelayRules(): array |
||
143 | |||
144 | //TODO: create an artisan command to challenge |
||
145 | } |
||
146 |