acoriss / payment-gateway
PHP SDK for Acoriss Payment Gateway
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/acoriss/payment-gateway
Requires
- php: >=8.1
- guzzlehttp/guzzle: ^7.8
Requires (Dev)
- phpunit/phpunit: ^10.5
README
A PHP SDK for interacting with the Acoriss Payment Gateway API. Mirrors the functionality of the existing Node.js SDK: creating payment sessions and retrieving payments.
Installation
Require via Composer (after publishing to Packagist or using VCS repo):
composer require acoriss/payment-gateway
For local development inside this monorepo:
cd sdks/php
composer install
Quick Start
use Acoriss\PaymentGateway\Client; $client = new Client([ 'apiKey' => 'your-api-key', 'apiSecret' => 'your-api-secret', // enables automatic HMAC-SHA256 signing // 'environment' => 'live', // default is 'sandbox' ]); $session = $client->createSession([ 'amount' => 5000, 'currency' => 'USD', 'customer' => [ 'email' => 'john@example.com', 'name' => 'John Doe' ], 'description' => 'Order #1234' ]); echo $session['checkoutUrl']; $payment = $client->getPayment($session['id']); print_r($payment);
Configuration Options
| Key | Type | Description |
|---|---|---|
| apiKey | string | Required API key |
| apiSecret | string | Optional secret for HMAC signing |
| environment | `sandbox | live` |
| baseUrl | string | Overrides environment base URL |
| signer | SignerInterface |
Custom signing strategy |
| timeout | float | Timeout in seconds (default 15) |
Signing
createSessionsigns the raw JSON request body.getPaymentsigns only the payment ID string.- Provide either
apiSecret, a customSignerInterface, or passsignatureOverrideper call.
Error Handling
All API/network errors throw Acoriss\PaymentGateway\Exceptions\APIException exposing:
try { $client->createSession($payload); } catch (\Acoriss\PaymentGateway\Exceptions\APIException $e) { echo $e->getMessage(); var_dump($e->getStatus(), $e->getData(), $e->getHeaders()); }
Testing
composer install
composer test
Versioning & Compatibility
SDK targets PHP >= 8.1 and Guzzle 7.x.
License
MIT