awd-studio/smsc 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

awd-studio/smsc

Composer 安装命令:

composer require awd-studio/smsc

包简介

An API for sending messages with the https://smsc.ua / https://smsc.ru / https://smsc.kz / https://smsc.tj / https://smscentre.com services.

README 文档

README

Latest Stable Version Total Downloads License

SMSC

Simple library for sending SMS and other messages

An API for sending short messages with the SMSC services.

Supported gateways:

Installing

SMSC library can be installed directly from Composer.

composer require awd-studio/smsc

How to use:

Send messages

<?php

use Smsc\Settings\Settings;
use Smsc\Services\SmscMessage;

// Create new settings item
$settings = new Settings([
    'login' => $MY_LOGIN,
    'psw'   => $MY_PASSWORD
]);

// Create new message
$options = [
    'translit' => true, // Set transliteration
];
$sms = new SmscMessage($settings, $phones, $message, $options);

// Send SMS
$sms->send();

// Get response data
$response = $smsc->getData()->getResponse();
// Or get processed results
$response = $smsc->results();

Check balance

<?php

use Smsc\Settings\Settings;
use Smsc\Services\SmscBalance;

// Create new settings item
$settings = new Settings([
    'login' => $MY_LOGIN,
    'psw'   => $MY_PASSWORD
]);

// Create new balance
$balance = new SmscBalance($settings);

// Send request
$balance->send();

Get Sender-IDs

<?php

use Smsc\Settings\Settings;
use Smsc\Services\SmscSenders;

// Create new settings item
$settings = new Settings([
    'login' => $MY_LOGIN,
    'psw'   => $MY_PASSWORD
]);

// Create new balance
$senders = new SmscSenders($settings);
$senders->getSenders();

// Send request
$senders->send();

// Manage Sender IDs
$arr = $senders->results();

More examples

<?php

use Smsc\Settings\Settings;
use Smsc\Services\SmscMessage;

// Create new settings item
$settings = new Settings([
    'login' => $MY_LOGIN,
    'psw'   => $MY_PASSWORD
]);
$sms = new SmscMessage($settings, $phones, $message, $options);

// Send MMS
$sms->mms($theme = 'My message theme');
$sms->send();

// Send E-mail
$sms->email($theme = 'My message theme');
$sms->send();

// Send Viber
$sms->viber();
$sms->send();

// Send HLR
$sms->hlr();
$sms->send();

// Send Flash-SMS
$sms->flash();
$sms->send();

// Send Ping-SMS
$sms->ping();
$sms->send();

// Voice message
$sms->call('w3'); // Voice call with women alternative voice #2.
$sms->send();

// Set additional options
$options = [
    'id'      => 123,        // Set SMS ID
    'time'    => $timestamp, // Set SMS sending time
    'valid'   => 10,         // Set SMS live time for 100 hours
    'tinyurl' => true,       // Automate short URL's
];
$sms = new SmscMessage($settings, $phones, $message, $options);
$sms->send();

More information here.

统计信息

  • 总下载量: 1.28k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-08-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固