topphp/topphp-cloudsms
Composer 安装命令:
composer require topphp/topphp-cloudsms
包简介
Components based on Kaituo cloud SMS
README 文档
README
凯拓云短信
基于凯拓未来科技有限公司研发的云短信系统封装的PHP sdk
Structure
组件结构
src/parameterInjection/
src/
tests/
Install
Via Composer
$ composer require topphp/topphp-cloudsms
开始使用
初始化
<?php
namespace Topphp\TopphpCloudsms;
include 'vendor/autoload.php';
$account='xxx'; #账号
$password='xxx'; #密码
$key='xxx';
$iv='xxxxx';
$url='xxxx.xxx.xxx'; 请求地址
$ShortMessage=new ShortMessage();
$ShortMessage->setUrl($url)->setKey($key)->setIv($iv)->setAccount($account)->setPassword($password);
发送短信
$arr=$ShortMessage
->setTemplateParam("{code:1223}")
->setCode(86)国家号,中国86 国际通过国际配置接口查询
->setMobile('xxxxxxxx') #手机号多个用,隔开
->setSignatureId("25") #签名id,签名接口获取
->setTemplateId("36")# 模板id,模板接口获取
->sendMessage();
验证下游
$arr=$ShortMessage->authenticateCompany();
获取签名集合
$arr=$ShortMessage->listSignatures();
获取签名( signatureId从签名集合获取 )
$signatureId=26;
$arr=$ShortMessage->getSignature($signatureId);
获取模板集合
$arr=$ShortMessage->listTemplates();
获取模板 ( templateId从模板集合获取 )
$templateId='38';
$arr=$ShortMessage->getTemplate($templateId);
获取支付配置
$arr=$ShortMessage->getPaySettingData();
获取支付日志集合
$arr=$ShortMessage
->setPageNum(1) #第几页
->setPageSize(10) #每页个数
->setStartTime('') #开始时间
->setEndTime(time()) #结束时间 time()类型时间戳
->listCompanyPayLogs();
获取支付记录
$orderNo='N20200717150058810220'; #从支付日志集合获取
$arr=$ShortMessage->getCompanyPayLog($orderNo);
获取短信日志集合
$arr=$ShortMessage
->setPageNum(1)
->setPageSize(10)
->setType(1) #1 国内,2 国际
->setPhone('') #手机号和日期不能同时为空
->setDate(time()) #手机号和日期不能同时为空 time()类型时间戳
->listCompanySmsLogs();
支付-国内套餐参数
$arr=$ShortMessage
->setPayPlanId(21) # 套餐id 从支付配置查询
->setPayType(1) #1. 微信 2. 支付宝
->companyPaySetMeal();
支付-国内通过短信数量收费
$arr=$ShortMessage
->setCount(21) #数量
->setPayType(2) #1. 微信 2. 支付宝
->companyPaySetMealNumber();
支付-国际只能通过多少钱购买
$arr=$ShortMessage
->setMoney(5000) #钱
->setPayType(2)# 1. 微信 2. 支付宝
->companyPaySetMealMoney();
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email sleep@kaituocn.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
topphp/topphp-cloudsms 适用场景与选型建议
topphp/topphp-cloudsms 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 67 次下载、GitHub Stars 达 1, 最近一次更新时间为 2020 年 10 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 topphp/topphp-cloudsms 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 topphp/topphp-cloudsms 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 67
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-10-30