Download the PHP package sonnenglas/yoco-php-sdk without Composer

On this page you can find all versions of the php package sonnenglas/yoco-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yoco-php-sdk

yoco-php-sdk

Framework-agnostic PHP SDK for the Yoco Online (Checkout) Payment API, with first-class support for Standard Webhooks signature verification.

Packagist Version Packagist Downloads PHP Version


Features

Why this SDK?

Yoco does not publish an official PHP SDK at the time of writing, and the third-party packages we could find were either Laravel-specific, abandoned, or predated the current Checkout API.

sonnenglas/yoco-php-sdk is built against the current public Yoco Online Payments API, targets modern PHP (8.2+), and stays out of your dependency injection container by design.

Requirements

Installation

If you do not already have a PSR-18 client installed:

php-http/discovery will auto-wire any installed PSR-18 client and PSR-17 factories — you only need to inject them manually if you want to override defaults (timeouts, retry middleware, mock client in tests, etc.).

Quick start

1. Create a hosted checkout

2. Verify an incoming webhook

3. Refund a checkout

Documentation

Supported features

In scope Out of scope
POST /api/checkouts — create checkout GET /v1/payments/{id} (main Yoco API)
POST /api/checkouts/{id}/refund — full + partial refund Payouts (/v1/payouts)
POST /api/webhooks — register subscription Locations (/v1/locations)
GET /api/webhooks — list subscriptions OAuth applications
DELETE /api/webhooks/{id} — delete subscription Yoco Card Machine / POS APIs
Standard Webhooks signature verification (v1) In-person card-present payments
Standard Webhooks key rotation (multi-signature headers)
Test-mode detection (processingMode, mode fields)
Idempotency-Key auto-generation (UUID v4)
Retry-After parsing on rate-limit responses

The SDK targets the Yoco Online Payments API at https://payments.yoco.com/api. The broader api.yoco.com/v1 surface (payments, payouts, locations) is intentionally not implemented — open an issue if you need it.

Exceptions

All SDK exceptions extend Sonnenglas\Yoco\Exceptions\YocoException.

HTTP Exception When
400 ValidationException Invalid request body or parameters.
401 AuthenticationException Defensive — Checkout API uses 403, but proxies may return 401.
403 AuthenticationException Missing or invalid API key.
409 IdempotencyConflictException Another request with the same Idempotency-Key is in flight.
422 IdempotencyMismatchException Re-used Idempotency-Key with a different request body.
429 RateLimitException ($retryAfter) Rate limit reached (defensive; surfaces Retry-After if present).
other ApiException Anything else (5xx, unmapped 4xx, malformed JSON, etc.).
SignatureVerificationException Webhook signature failed verification.

Security

See SECURITY.md for the full security policy and reporting process.

Development

Versioning

This project follows Semantic Versioning 2.0.0.

Contributing

Pull requests, issues, and discussions are welcome. Please read CONTRIBUTING.md before opening a PR — it covers the dev setup, coding standards, and the test-first workflow used throughout the codebase.

For bug reports and feature requests, please use the GitHub issue templates.

License

Released under the MIT License.

Credits

Built and maintained by SONNENGLAS.

If this SDK saves you time, please consider starring the GitHub repository.


All versions of yoco-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.0 || ^2.0
php-http/discovery Version ^1.19
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sonnenglas/yoco-php-sdk contains the following files

Loading the files please wait ...