asplinsol/trustshare-api-php

PHP library for access to TrustShare API

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

This package is auto-updated.

Last update: 2025-07-10 03:08:57 UTC


README

Welcome to the trustshare API Reference documentation. Here you can find detailed information about the endpoints we provide as well as the shape of entities within the system. # Getting Started It only takes a few minutes to begin using our Sandbox environment straight away. Let's begin... 1. Create an Organisation — Head over to the dashboard to login and being creating your Organisation. You can provide your logo and your brand's accent colour to customise the Checkout UI which is instantiated from the Client SDK. 1. Generate an API Key — Head to the developers section of the dashboard and generate a new key pair. The private key is used to interact with the trustshare API, where-as the public key is used to instantiate the Client SDK. # Environments The trustshare API has two environments, Sandbox and Live. Both environments are available under the same endpoint however API Keys and client secrets are prefixed with the environment name. - A Sandbox API Key will be in the format: sandbox_api_[0-9a-z]. - A Live API Key will be in the format: live_api_[0-9a-z]. ## Sandbox Our Sandbox environment endeavours to be as close to the Live environment as possible, however, there are a couple of limitations and features which should be noted. - Card payments take around 7 days to settle into accounts. In Live this is generally closer to 2 days. - Manual inbound payments can only be "faked" in Sandbox when they are less-than or equal-to 250,000.00. - Open Banking in Sandbox will always use a "Mock Bank" UI to accept the payment. # Webhooks Payments are, by their very nature, asynchronous. As such methods of payment, including the receipt and release of funds can take an arbitrary amount of time to settle or execute. It is therefore advised to integrate with our Webhook Events to be notified of changes to payments in real-time. For more information about our Webhooks, please visit our Webhook Events guide. # Authentication Every API call must include an Authorization header containing your API Key.

This PHP package is automatically generated by the Swagger Codegen project:

  • API version: 1.0.0
  • Build package: io.swagger.codegen.v3.generators.php.PhpClientCodegen

Requirements

PHP 5.5 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

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

Then run composer install

Manual Installation

Download the files and include autoload.php:

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

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

<?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;
}
?>

Documentation for API Endpoints

All URIs are relative to https://rest.trustshare.io

Class Method HTTP request Description
ParticipantsApi createParticipant POST /v1/participants Create a Participant
ParticipantsApi getParticipant GET /v1/participant/{id} Get a Participant
PaymentsApi createPaymentIntent POST /v1/intents/payment Create a Payment Intent
PaymentsApi createRefunds POST /v1/outbounds/refunds Create Refunds
PaymentsApi createReleases POST /v1/outbounds/releases Create Releases
PaymentsApi getCheckout GET /v1/checkout/{id} Get a Checkout
PaymentsApi getInbound GET /v1/inbound/{id} Get an Inbound
PaymentsApi getIntent GET /v1/intent/{id} Get an Intent
PaymentsApi getInvoice GET /v1/invoice/{id} Get an Invoice
PaymentsApi getOutbound GET /v1/outbound/{id} Get an Outbound
PaymentsApi getProject GET /v1/project/{id} Get a Project
PaymentsApi getSettlement GET /v1/settlement/{id} Get a Settlement
ProjectsApi createProject POST /v1/projects Create a Project
ProjectsApi getProject GET /v1/project/{id} Get a Project
VerificationsApi createVerification POST /v1/verifications Create a Verification
VerificationsApi getParticipant GET /v1/participant/{id} Get a Participant
VerificationsApi getVerification GET /v1/verification/{id} Get a Verification

Documentation For Models

Documentation For Authorization

All endpoints do not require authorization.

Author

support@trustshare.co