Download the PHP package tokenpay-platform/sdk-php without Composer
On this page you can find all versions of the php package tokenpay-platform/sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tokenpay-platform/sdk-php
More information about tokenpay-platform/sdk-php
Files in tokenpay-platform/sdk-php
Package sdk-php
Short Description Official PHP SDK for the TokenPay payment gateway.
License MIT
Homepage https://github.com/gpgo/tokenpay-sdk-php
Informations about the package sdk-php
TokenPay PHP SDK
Official PHP SDK for the TokenPay payment gateway — P2P crypto trading platform with fiat on/off ramps and webhook-driven merchant integrations.
Source of truth. The canonical source lives in the private
gpgo/tokenpaymonorepo undersdks/php/. A public mirror is auto-published togpgo/tokenpay-sdk-phpon everyv*-phprelease tag; that mirror is what Packagist installs from. See ADR-097 indocs/DECISIONS.md(monorepo only) for the rationale.
Requirements
- PHP 8.1 or newer (tested on 8.1, 8.2, 8.3, 8.4).
- Composer 2.x.
- The
ext-jsonandext-hashextensions (present in every standard PHP build).
Install
The Packagist vendor prefix is
tokenpay-platform/rather than the shortertokenpay/because the latter is held by a defensive dependency-confusion registrar (m-vendors, unrelated to this project). The GitHub repository is stillgpgo/tokenpay-sdk-php; only the Packagist vendor differs.
Quick start
Retrieve, list, cancel
The OpenAPI spec exposes
cancelPayment, not a refund endpoint. The SDK tracks the spec; a dedicated refund method will land when the server-side endpoint does.
Verify a webhook
The TokenPay server signs every webhook with HMAC-SHA256 over a canonical
string method + "\n" + path + "\n" + timestamp + "\n" + payload. The SDK
verifies the signature with constant-time comparison.
Client options
Errors
| Class | When |
|---|---|
TokenPay\SDK\Exceptions\ApiException |
HTTP 4xx / 5xx from the TokenPay API. getStatusCode() + getBody() available. |
TokenPay\SDK\Exceptions\NetworkException |
Transport failures (DNS, connection, TLS, timeout). |
TokenPay\SDK\Exceptions\TokenPayException |
Base class for both of the above. Catch this for "any SDK error". |
The client retries transient failures (5xx + network) with exponential
backoff up to maxRetries times (default 3). 4xx responses are never
retried.
WooCommerce integration
A minimal WooCommerce integration lives under
examples/woocommerce/. It demonstrates:
- Creating a payment on checkout (
WC_Payment_Gateway::process_payment). - Verifying an incoming webhook and updating the order status.
The example is runnable against a local WooCommerce instance for development; live-site production testing is part of the TokenPay Integration Partners review (S091).
Versioning and stability
The TokenPay API follows the deprecation policy in
docs/api/VERSIONING.md: v1 stable with a
6-month deprecation window. This SDK's minor versions track the API's minor
bumps; patch versions are bug fixes only. See CHANGELOG.md.
Publishing (maintainer-only)
Packagist auto-publishes via the GitHub webhook on every tag push. Maintainer workflow:
Packagist webhook configuration, the one-time namespace reservation, and
the public-mirror sync workflow are documented in
docs/ops/packagist-setup.md
(monorepo only). The sync itself runs from
.github/workflows/sync-php-sdk.yml.
Security
Please report security issues privately to [email protected] rather
than via a public GitHub issue. See the repo's root SECURITY.md.
License
MIT — see LICENSE.