• 12-02-2021, 00:50:34
    #1
    Platin üye
    Elimde Örnek olarak Bu api sistemi var,

    <?php
    /**
     * Created by PhpStorm.
     * User: Viktor
     * Date: 17.07.15
     * Time: 14:42
     */
    
    namespace sms;
    
    
    use SoapClient;
    use System\Config;
    
    class TurboSMS implements ISMS
    {
    
        protected $client = null;
    
        public function __construct()
        {
            $this->client = new SoapClient('http://turbosms.in.ua/api/wsdl.html');
            $smsconfig = new Config('sms-gateway');
    
    
            if ($smsconfig->turbosms) {
                if (isset($smsconfig->turbosms->login) && isset($smsconfig->turbosms->password)) {
                    $auth = Array(
                        'login' => $smsconfig->turbosms->login,
                        'password' => $smsconfig->turbosms->password
                    );
                }
                else {
                    $auth = Array(
                        'login' => '',
                        'password' => ''
                    );
                }
                // Авторизируемся на сервере
                $result = $this->client->Auth($auth);
                // echo '1'.$result->AuthResult . PHP_EOL;
            }
        }
    
        public function sendSMS($to, $text)
        {
            $smsconfig = new Config('sms-gateway');
            $sms    = Array(
                'sender'      => $smsconfig->turbosms->sender,
                'destination' => $to,
                'text'        => $text
            );
    
            $result = $this->client->SendSMS($sms);
            $result = $result->SendSMSResult->ResultArray;
    
    
            if (isset($result[0])) {
                return true;
            }
    
            return false;
        }
    
    
    
    }



    NetGSM 'in yapısını buna nasıl giydirebilirim ? Sürekli hata alıyorum.
  • 12-02-2021, 00:54:49
    #2
    NetGSM' in kendi api dökümantasyonunda ki kodu neden kullanmıyorsunuz?
  • 12-02-2021, 00:55:53
    #3
    Platin üye
    OguzhanTufekci adlı üyeden alıntı: mesajı görüntüle
    NetGSM' in kendi api dökümantasyonunda ki kodu neden kullanmıyorsunuz?
    bu yapıya göre giydirilmesi gerekli fakat sadece soap url değiştiğinde olmuyor.
  • 12-02-2021, 01:00:09
    #4
    Hata almanız normal, NetGSM in istediği parametreler ile sizin burada kullandığınız Class içerisinde ki fonksiyonun istediği parametreler farklılık gösterebilir. Aldığınız hatayı yazar mısınız?