duyngha/trusha-sdk

Trustshare SDK for PHP

1.0.4 2023-02-08 05:45 UTC

This package is auto-updated.

Last update: 2024-09-08 09:19:53 UTC


README

此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