定制 norzechowicz/promosms-api 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

norzechowicz/promosms-api

Composer 安装命令:

composer require norzechowicz/promosms-api

包简介

PromoSMS.pl API client.

README 文档

README

#Fully object oriented api for PromoSMS.pl service

Api is under development but you can install it via composer.

"require": {
    "norzechowicz/promosms-api": "1.0.x-dev"
}

Following code is an example how to send sms and get delivery report.

<?php

require __DIR__ . '/vendor/autoload.php';

use PromoSMS\Api\Client;
use PromoSMS\Api\Sms\Sms;

$client = new Client('login@email.com', md5('password'));

$sms = new Sms();
$sms->setReceiver('123123123');
$sms->setMessage('This new message');

$response = $client->send($sms);

if ($response->isValid()) {
    // Get sms delivery report
    $report = $client->report($response->getId());
    echo "SMS id: " . $response->getId() . "\n";

    if ($report->isReceived()) {
        echo "SMS was received at: " . $report->getTime()->format('Y-m-d H:i:s') . "\n";
    } else {
        echo "SMS wasn't received yet. Please check later.\n";
    }
} else {
    // If something went wrong check the status
    // Full status list is available here: http://dev.promosms.pl/sms-api/HTTP_SSL_API#Statusy_zwracane_przez_system
    echo "Error status code: " . $response->getStatus();
}

Following code is an example how to check account ballance.

<?php

require __DIR__ . '/vendor/autoload.php';

use PromoSMS\Api\Client;
use PromoSMS\Api\Sms\Sms;

$client = new Client('login@email.com', md5('password'));
echo "Current account balance is: " . $client->balance()->getAmount() / 100 . "\n";

###TODO

  • Add MaxSMS support
  • Add FasterSMS support
  • Add feature to check how many sms will be sent for text message content.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-06-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固