nowo-tech / openpay-php
Clean-room PHP SDK for the public Openpay REST API. PHP 8.3+ and FrankenPHP worker-safe (no static merchant credentials).
Fund package maintenance!
Requires
- php: >=8.3
- ext-curl: *
- ext-json: *
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.64
- igor-php/igor-php: ^0.9.7
- nowo-tech/phpstan-frankenphp: ^1.1
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5
- rector/rector: ^2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
⭐ Found this useful? Install from Packagist · Star on GitHub.
Clean-room PHP SDK for the public Openpay REST API. Namespace Nowo\Openpay\. License MIT. Release 1.1.1.
Independent implementation from public docs — not a redistribution of openpay/sdk. No process-wide static merchant credentials (FrankenPHP worker-safe, including when the kernel is not reset between requests).
Merchant resources: charges, customers, cards, tokens, webhooks.
Documentation
- Installation
- Configuration
- Usage
- Upgrading
- Security
- Coverage
- FrankenPHP demo
- FrankenPHP worker mode audit
- Spec-driven development
- Spec Kit
- GitHub CI
- Changelog
- Code of Conduct
Quick start
use Nowo\Openpay\Client; use Nowo\Openpay\Country; use Nowo\Openpay\Credentials; use Nowo\Openpay\Session; $credentials = new Credentials( merchantId: getenv('OPENPAY_MERCHANT_ID') ?: '', privateKey: getenv('OPENPAY_PRIVATE_KEY') ?: '', country: Country::Mx, sandbox: true, publicIp: $_SERVER['REMOTE_ADDR'] ?? '127.0.0.1', ); $session = new Session($credentials); $customer = $session->run(static fn (Client $client) => $client->customers->create([ 'name' => 'Demo', 'email' => 'demo@example.test', ]));
Install
composer require nowo-tech/openpay-php:^1.1
Tests
composer test
composer test-coverage
make qa
License
MIT — see LICENSE.
Independent clean-room client for the public Openpay REST API. Not a redistribution of openpay/sdk. “Openpay” is a trademark of its owners.
