/**
  * @param string $number
  * @param string $message
  * @param null|string $fromName
  * @param int $status_report_req
  * @return SmsSendResponse
  */
 public function sendText($number, $message, $fromName = null, $status_report_req = 0)
 {
     $fromName = $fromName !== null ? $fromName : $this->defaultFromName;
     $number = PhoneNumber::prefixFilter($number);
     $response = $this->nexmoClient->sendTextMessage($fromName, $number, $message, $status_report_req);
     return SmsSendResponse::createFromResponse($response);
 }
Example #2
0
 /**
  * @param $country
  * @return bool|float - sms pricing | false on fail
  */
 public function smsPricing($country)
 {
     $response = $this->nexmoClient->accountSmsPrice($country);
     return floatval($response['mt']);
 }
Example #3
0
 /**
  * @param string $number
  * @param string $pin
  * @param int $client_ref
  * @return SmsSendResponse
  */
 public function send2fa($number, $pin, $client_ref = false)
 {
     $number = PhoneNumber::prefixFilter($number);
     $response = $this->nexmoClient->send2faMessage($number, $pin, $client_ref);
     return SmsSendResponse::createFromResponse($response);
 }