Code Monkey home page Code Monkey logo

smsc-ru's People

Contributors

alexey-m-ukolov avatar antonydevanchi avatar arlanram avatar artshev avatar atymic avatar casperboone avatar enniel avatar finesse avatar freekmurze avatar jhaoda avatar kefir500 avatar mhamlet avatar oyed avatar pinguinjkeke avatar spycrabo avatar themsaid avatar tyurind avatar vanodevium avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

smsc-ru's Issues

Code review

Let me know when your package is ready. I'll do a review of the code.

Add phone to message object

It happens that you need to directly specify the recipient in the message object. (For example, a similar functionality is in the library for working with Firebase Cloud Messaging). This is necessary when we work with AnonymousNotifiable.

Wrong parameters for CouldNotSendNotification

Error in "src/Exceptions/CouldNotSendNotification.php" at 48 line

return new static( "The communication with smsc.ru failed. Reason: {$exception->getMessage()}". $exception->getCode(), $exception );

Line must be ended by comma.
return new static( "The communication with smsc.ru failed. Reason: {$exception->getMessage()}", $exception->getCode(), $exception );

Updated to support Laravel 5.6

add support for new 5.6 version laravel

  Problem 1
    - laravel-notification-channels/smsc-ru v1.1.3 requires illuminate/support 5.1.*|5.2.*|5.3.*|5.4.*|5.5.* -> satisfiable by laravel/framework[v5.5.34], illuminate/support[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.1.6, v5.1.8, v5.2.0, v5.2.19, v5.2.21, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.31, v5.2.32, v5.2.37, v5.2.43, v5.2.45, v5.2.6, v5.2.7, v5.3.0, v5.3.16, v5.3.23, v5.3.4, v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.27, v5.4.36, v5.4.9, v5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34].
    - laravel-notification-channels/smsc-ru v1.1.2 requires illuminate/support 5.1.*|5.2.*|5.3.*|5.4.*|5.5.* -> satisfiable by laravel/framework[v5.5.34], illuminate/support[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.1.6, v5.1.8, v5.2.0, v5.2.19, v5.2.21, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.31, v5.2.32, v5.2.37, v5.2.43, v5.2.45, v5.2.6, v5.2.7, v5.3.0, v5.3.16, v5.3.23, v5.3.4, v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.27, v5.4.36, v5.4.9, v5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34].
    - laravel-notification-channels/smsc-ru v1.1.3 requires illuminate/support 5.1.*|5.2.*|5.3.*|5.4.*|5.5.* -> satisfiable by laravel/framework[v5.5.34], illuminate/support[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.1.6, v5.1.8, v5.2.0, v5.2.19, v5.2.21, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.31, v5.2.32, v5.2.37, v5.2.43, v5.2.45, v5.2.6, v5.2.7, v5.3.0, v5.3.16, v5.3.23, v5.3.4, v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.27, v5.4.36, v5.4.9, v5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34].
    - laravel-notification-channels/smsc-ru v1.1.0 requires illuminate/queue 5.1.*|5.2.*|5.3.*|5.4.* -> satisfiable by illuminate/queue[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.1.6, v5.1.8, v5.2.0, v5.2.19, v5.2.21, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.31, v5.2.32, v5.2.37, v5.2.43, v5.2.45, v5.2.6, v5.2.7, v5.3.0, v5.3.16, v5.3.23, v5.3.4, v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.27, v5.4.36, v5.4.9].
    - laravel-notification-channels/smsc-ru v1.1.1 requires illuminate/queue 5.1.*|5.2.*|5.3.*|5.4.* -> satisfiable by illuminate/queue[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.1.6, v5.1.8, v5.2.0, v5.2.19, v5.2.21, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.31, v5.2.32, v5.2.37, v5.2.43, v5.2.45, v5.2.6, v5.2.7, v5.3.0, v5.3.16, v5.3.23, v5.3.4, v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.27, v5.4.36, v5.4.9].
.....
    - Installation request for laravel/framework 5.6.* -> satisfiable by laravel/framework[v5.6.0].
    - Installation request for laravel-notification-channels/smsc-ru ^1.1 -> satisfiable by laravel-notification-channels/smsc-ru[v1.1.0, v1.1.1, v1.1.2, v1.1.3].

Whats wrong?

NotificationChannels \ SmscRu \ Exceptions \ CouldNotSendNotification
Notification was not sent. Phone number is missing.

Move setting $apiUrl

Hi, maybe move the setting apiUrl from file SmscRuApi.php

protected $apiUrl = 'https://smsc.ru/sys/send.php';

in the configuration file config/services.php. Example:

// config/services.php
...
'smscru' => [
    'url'  => env('SMSCRU_URL'),
    'login'  => env('SMSCRU_LOGIN'),
    'secret' => env('SMSCRU_SECRET'),
    'sender' => 'John_Doe'
],
...

I need to change only the address smsc.ru to smsc.kz. This services identical. Thank.

Unable to return no phones from routeNotificationForSmscru

If I return null, an empty string or an empty array from the routeNotificationForSmscru method of a Notifiable, I get a CouldNotSendNotification exception. I think this is incorrect because all the built-in Laravel channels just do nothing if no recipient is set (examples: 1, 2, 3).

To workaround it I have to do the following in my notification classes:

public function via($notifiable)
{
    if ($notifiable->routeNotificationFor('smscru', $this)) {
        return [SmscRuChannel::class];
    } else {
        return [];
    }
}

There is one more problem. Notifications objects are not passed to the routeNotificationForSmscru method so I can't decide what number to send an SMS to depending on the notification class or object.

Also it would be great if I can return either a string or an array of phone numbers from routeNotificationForSmscru method. I know I can return multiple phones in a single string separating them by comma, but the array would be a more convenient and Laravel-style way.

If you agree, I can implement all the features and make a pull request.

Конфликт параметров

Если передать пустой параметр login, psw, sender значения по умолчанию будут перезаписаны на пустые.

В метод send прилетает массив параметров:

Array
(
    [phones] => +78008835651
    [mes] => Код подтверждения: 92899. Используйте его, чтобы войти.
    [sender] => 
)

Есть $base который содержит базовый набор параметров, также содержит sender, который берется из настроек.

При выполнении $params = array_merge($base, $params); где $params['sender'] === '' (пустая строка) происходит смещение и базовый параметр sender перезаписываться на пустое значение.

Так как в NotificationChannels\SmscRu\SmscRuMessage свойство $from пустая строка, то базовое значение всегда перезаписывается на пустое, если явно не указать в массиве $params.

screen shot 2018-03-15 at 20 50 42

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.