nextgen-tech/multiinfo
Composer 安装命令:
composer require nextgen-tech/multiinfo
包简介
README 文档
README
This package was created to help communicating with Plus MultiInfo API.
Implemented Endpoints
Package has implementented most Requests, Parsers and Responses of the API
Sending
SendSms- send short message (up to 160 characters)SendSmsRaw- send binary messageSendSmsLong- send long message (up to 1377 characters)Package- send bundle of short messages
Receiving
GetSms- read received messages
Status
InfoSms- get the status of sent messagePackageInfo- get the status of sent bundle
Requirements
| Version | PHP |
|---|---|
| 0.x | >= 7.4 |
Installation
composer require nextgen-tech/multiinfo
Usage
First, you need to initiate base classes.
use NGT\MultiInfo\Certificate; use NGT\MultiInfo\Credentials; use NGT\MultiInfo\Handler; use NGT\MultiInfo\Url; use NGT\MultiInfo\Connections\HttpConnection; // Create instance of credentials. $credentials = new Credentials( $login, // Login of API user $password, // Password of API user $serviceId // Service ID ); // Create instance of certificate. $certificate = new Certificate( $path, // Path to certificate (CURLOPT_SSLCERT) $privateKeyPath, // Path to certificate private key (CURLOPT_SSLKEY) $password, // Certificate password (CURLOPT_SSLCERTPASSWD) $type // Certificate type - defaults to PEM (CURLOPT_SSLCERTTYPE) ); // Create instance of API URL. $url = Url::api1(); // or URL::api2(), depends of service configuration // Create instance of connection. $connection = new HttpConnection($url, $certificate); // Create handler instance. $handle = new Handler($connection);
Then you can create Request, send it through Handler and receive Response.
$request = new \NGT\MultiInfo\Requests\SendSmsRequest($credentials); $request->setContent('message'); // Required, content of the message $request->setDestination('48123456789'); // Required, phone number of the recipient $request->setValidTo(new DateTime('+7 days')); // Optional, period of validity of the message $request->setRequestDeliveryNotification(true); // Optional, indicates whether the delivery notification should be requested $request->setZeroClass(true); // Optional, indicates whether the message should be sent as zero class $request->setAdvancedEncoding(true); // Optional, indicates whether the message should use advanced encoding $request->setDeleteWhenProcessed(true); // Optional, indicates whether the message should be deleted after processing. $request->setReplyTo(12345); // Optional, ID of message to which the message is replying $request->setOrigin('CUSTOM'); // Optional, origin (nadpis) of the message. /** @var \NGT\MultiInfo\Responses\SendSmsResponse */ $response = $handler->handle($request); $response->getMessageId(); // ID of the message $response->getSender(); // Phone number of the sender $response->getReceiver(); // Phone number of the receiver $response->getContentType(); // Content type of the message $response->getContent(); // Content of the message $response->getProtocolId(); // ID of the protocol $response->getCodingScheme(); // Coding scheme $response->getServiceId(); // ID of the service $response->getConnectorId(); // ID of the connector $response->getReceivedAt(); // Date of receiving message
Each endpoint has its own Request, Parser and Response. It is highly recommended to look into Requests and Responses directories in order to get the list of all available methods.
nextgen-tech/multiinfo 适用场景与选型建议
nextgen-tech/multiinfo 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 977 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 08 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 nextgen-tech/multiinfo 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 nextgen-tech/multiinfo 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 977
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-08-17