asplinsol/trustshare-api-php

用于访问TrustShare API的PHP库

v1.0.0 2022-05-09 20:13 UTC

This package is auto-updated.

Last update: 2024-09-10 01:13:54 UTC


README

欢迎使用TrustShare API参考文档。在这里,您可以找到我们提供的端点的详细信息以及系统中实体的结构。# 入门 开始使用我们的沙箱环境只需几分钟。让我们开始... 1. 创建组织 — 前往仪表板登录并创建您的组织。您可以为Checkout UI提供您的徽标和品牌强调色,该UI由客户端SDK实例化。 1. 生成API密钥 — 前往仪表板的开发者部分并生成新的密钥对。私钥用于与TrustShare API交互,而公钥用于实例化客户端SDK。 # 环境 TrustShare API有两个环境,沙箱生产。这两个环境都在相同的端点下可用,但是API密钥和客户端机密的前缀都是环境名称。 - 沙箱 API密钥的格式为:sandbox_api_[0-9a-z]。 - 生产 API密钥的格式为:live_api_[0-9a-z]。 ## 沙箱 我们的沙箱环境力求与生产环境尽可能接近,但是有一些限制和功能需要注意。 - 卡片支付通常需要7天才能结算到账户。在生产环境中,这通常接近2天。 - 在沙箱中,手动入账支付只能模拟小于或等于250,000.00的情况。 - 沙箱中的Open Banking将始终使用“模拟银行”UI来接受支付。 # Webhooks 由于支付本质上是异步的,因此支付方式,包括收付款的接收和释放可能需要任意长的时间来结算或执行。因此建议您集成我们的Webhook事件以实时通知支付变化。有关我们Webhooks的更多信息,请访问我们的Webhook事件指南。 # 认证 每个API调用都必须包含一个包含您的API密钥的Authorization头。

此PHP包由Swagger Codegen项目自动生成

  • API版本:1.0.0
  • 构建包:io.swagger.codegen.v3.generators.php.PhpClientCodegen

要求

PHP 5.5及更高版本

安装和用法

Composer

要使用Composer安装绑定,请将以下内容添加到composer.json

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}

然后运行composer install

手动安装

下载文件并包含autoload.php

    require_once('/path/to/SwaggerClient-php/vendor/autoload.php');

测试

要运行单元测试

composer install
./vendor/bin/phpunit

入门

请按照安装程序进行操作,然后运行以下操作

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Swagger\Client\Api\ParticipantsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$body = new \Swagger\Client\Model\V1ParticipantsBody(); // \Swagger\Client\Model\V1ParticipantsBody | 
$authorization = "authorization_example"; // string | Your API Key in the format `[sandbox|live]_api_[0-9a-z]`.

try {
    $result = $apiInstance->createParticipant($body, $authorization);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ParticipantsApi->createParticipant: ', $e->getMessage(), PHP_EOL;
}

$apiInstance = new Swagger\Client\Api\ParticipantsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$authorization = "authorization_example"; // string | Your API Key in the format `[sandbox|live]_api_[0-9a-z]`.
$id = "id_example"; // string | A unique ID of an existing participant.  A string in the format: `participant_[0-9a-z]`

try {
    $result = $apiInstance->getParticipant($authorization, $id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ParticipantsApi->getParticipant: ', $e->getMessage(), PHP_EOL;
}
?>

API端点文档

所有URI都是相对于https://rest.trustshare.io

模型文档

授权文档

所有端点都不需要授权。

作者

support@trustshare.co