承接 reattract/sdk 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

reattract/sdk

最新稳定版本:v0.1.4

Composer 安装命令:

composer require reattract/sdk

包简介

Reattract.io API client

README 文档

README

Example integration

Making calls

<?php
// YourModule.php

require('vendor/autoload.php');

use Reattract\Sdk\Configuration;
use Reattract\Sdk\Resources\Customer;

// Configuration values are static and can be part of your application initializtion.
Configuration::$secretKey = '<secret_key>;
Configuration::$publicKey = '<public_key>';

// Resources, which map to http endpoints, can all be found in the resources folder.
// Fetch a paginated list of customers
$response = Customer::list();
print_r($response->body);

// List call responses will be paginated and you can see the pagination data as follows
print_r($response->pagination);

Verfiying Webhooks

<?php
// Verify webhooks

use Reattract\Sdk\Configuration;
use Reattract\Sdk\WebhookVerification;

Configuration::$webhookSecretKey = 'whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw';

// Example payload and headers
// The payload should be a raw payload
$payload = '{"test": 2432232314}';
$header = array(
        'svix-id'  => 'msg_p5jXN8AQM9LWM0D4loKWxJek',
        'svix-timestamp' => '1614265330',
        'svix-signature' => 'v1,g0hM9SsE+OTPJTGt/tmIKtSyZlE3uFJELVlNIOLJ1OE=',
        );

// Throws on error, returns the verified content on success
$wh = new WebhookVerification($payload, $header);
$result = $wh->verify();
// $result will be an associative array with the success status and the error [if present]
// [
//   'success' => false,
//   'error' => <error object>
// ];

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2023-04-20