linx / oms-notifications-client-php
oms通知客户端
1.0.4
2023-05-25 15:23 UTC
Requires
- php: >=7.0
- guzzlehttp/guzzle: ~6.0|~7.0
- illuminate/support: ~5.4|~6.0|~8.0|~9.0
- illuminate/validation: ~5.4|~6.0|~8.0|~9.0
Requires (Dev)
- phpunit/phpunit: ~5.7
This package is not auto-updated.
Last update: 2024-09-26 21:39:09 UTC
README
安装
要安装OMS-Notification-Client,请运行以下命令,您将获得最新版本
composer require linx/oms-notifications-client-php
配置
将变量添加到环境文件(.env)中。
OMS_NOTIFICATION_HOST = http://oms-notification.com.br
文档
OMS通知客户端是一个用于访问OMS通知的库,它具有预定义的服务类,以方便集成。
Webhook
Webhook是一种用于应用程序之间集成的通知类型。
与Laravel一起使用
use Linx\OmsNotificationClient\Facades\WebhookFacade; $result = WebhookFacade::create(string 'clientId', string 'token', array 'inputData');
不与Laravel一起使用
use Linx\OmsNotificationClient\Notification\WebhookService; $webhookService = new WebhookService(); $result = $webhookService->create(string 'clientId', string 'token', array 'inputData');
inputData示例
$input = [ 'clientId' => 'clientid', 'referenceId' => 'ORDER-01216215-F1', 'application' => 'ORDER', 'url' => 'http://xpto.com', 'method' => 'POST', 'body'=> '....', 'headers' => [], 'retry' => 2, 'auth' => [ 'type' => 'Bearer', 'token' => 'GVSWcOmXb74QMSqBlXS7sSPhiDsatFIaPwf27xPR', ] ];
=======
创建发送至WhatsApp号码的通知。
与Laravel一起使用
use Linx\OmsNotificationClient\Facades\WhatsappFacade; $result = WhatsappFacade::create(string 'clientId', string 'token', array 'inputData');
不与Laravel一起使用
use Linx\OmsNotificationClient\Notification\WhatsappService; $whatsappService = new WhatsappService(); $result = $whatsappService->create(string 'clientId', string 'token', array 'inputData');
inputData示例
$input = [ 'clientId' => $client->clientId, 'referenceId' => 'ORDER-01216215-F1', 'application' => 89665, 'provider' => [ 'type' => 'TWILIO', 'sid' => 'ACXXXXXX', 'token' => 'GVSWcOmXb74QMSqBlXS7sSPhiDsatFIaPwf27xPR', ], 'to' => 8881231234, 'from' => 9991231234, 'body'=> '....', ];
维护者!
在packagist.org发布版本的分步指南。
- 创建版本,请注意语义版本化;
- 访问https://packagist.org.cn/packages/linx/oms-notifications-client-php
- 使用您的账户进行认证;
- 点击“更新”按钮;
如果您没有管理包的权限,请联系您的经理。
许可证
此库根据MIT许可证发布。