vvvinceocam/svix-php
Composer 安装命令:
composer require vvvinceocam/svix-php
包简介
Unofficial PHP SDK for Svix
README 文档
README
Unofficial PHP SDK for Svix.
Basic usage
<?php use Svix\Svix; use Svix\Internal\Model\ApplicationIn; use Svix\Internal\Model\EndpointIn; use Svix\Internal\Model\MessageIn; $client = new Svix('auth token'); // Create an application for a customer $app = new ApplicationIn(); $app->setName('Super Customer'); $app->setUid('id-from-our-application'); $app = $client->applications->create($app); // Bind an endpoint $endpoint = new EndpointIn(); $endpoint->setUrl('https://example.com/customer/endpoint'); $endpoint = $client->endpoints->create($app->getId(), $endpoint); // Get the secret that customer must use to validate webhook calls $secret = $client->endpoints->getSecret($app->getId(), $endpoint->getId()); // Send a message to our freshly enrolled customer $message = new MessageIn(); $message->setEventType('billing.started'); $message->setPayload([ 'some' => 'data', 'with' => [ 'arbitrary' => 'depth', ], ]); $client->messages->create($app->getId(), $message);
统计信息
- 总下载量: 1.77k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-11-06