mirrorps/taler-php

PHP SDK for GNU Taler REST API

dev-main 2025-06-07 15:44 UTC

This package is auto-updated.

Last update: 2025-06-07 15:44:24 UTC


README

TalerPHP is a PHP SDK for interacting with GNU Taler payment systems. It provides a simple, secure way to integrate Taler payments into your PHP applications and services.

⚠️ Early Development Notice

TalerPHP is currently in early development. The API and features are subject to change, and the package is not yet ready for production use. We welcome feedback and contributions, but please use with caution and do not rely on this package for critical or production systems at this stage

Features

  • Easy API for interacting with Taler services
  • PSR-4 autoloading
  • Extensible and testable architecture

Prerequisites

Before you begin, ensure you have met the following requirements:

  • PHP 8.1 or newer
  • Composer
  • (Optional) PHPUnit for running tests

Installation

Install TalerPHP via Composer:

composer require mirrorps/taler-php

Requirements

• A PSR-18 HTTP client implementation (e.g., Guzzle, Symfony HttpClient)
• A PSR-17 HTTP factory implementation (e.g., Nyholm/psr7, guzzlehttp/psr7 version 2 or higher)
• Optional: For async request support, you need a client that implements the `HttpAsyncClient` interface from `php-http/httplug`

Usage

require "vendor/autoload.php";
use TalerPHP\Factory;

$taler = Factory::create([
    'base_url' => 'https://backend.demo.taler.net/instances/sandbox',
    'token'    => 'Bearer token'
]);

Configuration

  • base_url: The URL of your Taler backend instance.
  • token: Your authentication token ( ⚠️ do not hardcode; use environment variables or secure storage in your application).

Running Tests

To run the test suite:

composer install
php vendor/bin/phpunit

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

Security Note: SSRF Risk

The TalerPHP SDK allows developers to make HTTP requests to arbitrary endpoints based on configuration and API usage. If your application accepts or processes user-provided endpoints, you should be aware of the risk of Server-Side Request Forgery (SSRF).

License

This project is licensed under the MIT License. See LICENSE for details.

Support

If you have questions or need help, open an issue or start a discussion on the repository.

Acknowledgments

  • GNU Taler
  • All contributors and the open source community