HEX
Server: LiteSpeed
System: Linux s12873.lon1.stableserver.net 5.14.0-611.11.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Dec 3 09:47:37 EST 2025 x86_64
User: jairicem (1242)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /home/jairicem/4pfxclusive.ng/vendor/tecdiary/sms/src/Gateways/ItexmoGateway.php
<?php

namespace Tecdiary\Sms\Gateways;

class ItexmoGateway implements SmsGatewayInterface
{
    public $config;
    public $response = '';

    protected $params = [];
    protected $url = 'https://www.itexmo.com/php_api/api.php';

    public function __construct($config)
    {
        $this->config = $config;
        $this->params['3'] = $this->config[$this->config['gateway']]['api_code'];
    }

    public function getUrl()
    {
        return $this->url;
    }

    public function sendSms($mobile, $message)
    {
        $this->params['1'] = $mobile;
        $this->params['2'] = $message;
        $client = new \GuzzleHttp\Client();
        try {
            $this->response = $client->post($this->getUrl(), ['form_params'=>$this->params])->getBody()->getContents();
        } catch (\Exception $e) {
            $this->response = ['error' => $e->getMessage()];
        }
        return $this;
    }

    public function response()
    {
        return $this->response;
    }
}