Download the PHP package payintohq/payinto-php-sdk without Composer
On this page you can find all versions of the php package payintohq/payinto-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download payintohq/payinto-php-sdk
More information about payintohq/payinto-php-sdk
Files in payintohq/payinto-php-sdk
Package payinto-php-sdk
Short Description PHP SDK for the Payinto Business and Checkout APIs.
License MIT
Informations about the package payinto-php-sdk
Payinto PHP SDK
PHP 8.1+ SDK for the Payinto Business API and Checkout API v1.
Installation
The SDK uses https://api.payinto.co for both production and sandbox credentials. Select the environment with the credential you provide; no base URL setting is required.
Secret keys (sk_) belong only on your server. Public keys (pk_) are suitable for Checkout initialization flows. Amounts use the lowest currency unit: NGN amounts are kobo.
Laravel
Laravel applications receive the service provider and facade through Composer package auto-discovery. Publish the package configuration with:
Define both live and test credentials in your .env file, then select the active credential pair with PAYINTO_ENV:
Use PAYINTO_ENV=test when testing. The API host remains https://api.payinto.co; the selected credential and webhook-secret pair changes.
PAYINTO_WEBHOOK_TOLERANCE controls the accepted timestamp window in seconds. The default is five minutes. Set it to 0 to disable timestamp checking while retaining HMAC verification.
Inject Payinto\Client into a class or use the Payinto facade:
Responses and errors
Every successful call returns ApiResponse:
Non-2xx responses throw AuthenticationException, ValidationException, RateLimitException, or ApiException; network failures throw TransportException. Each exposes statusCode, responseData, responseHeaders, method, and uri.
Validation error bags returned by the API are preserved in
ValidationException::$responseData['errors']:
If an API error envelope is returned with a successful HTTP status instead of
a non-2xx status, the SDK returns it as an ApiResponse; inspect
$response->status() and $response->raw() in that case.
Business API
All Business API calls use the configured secret key.
Flexible endpoint payloads are passed as associative arrays. Query parameters are passed as the final array argument where supported.
Checkout API
This PHP SDK provides server-side access to the Payinto Checkout API. For the browser-based popup checkout experience, use the official @payinto/checkout-sdk npm package instead. The popup SDK is responsible for opening and managing the customer-facing checkout flow, while this package is intended for backend initialization, reconciliation, payment status checks, and related server-side operations.
Initialize Checkout
The returned checkout token is consumed by the browser popup integration. Use the official @payinto/checkout-sdk package for retrieving the checkout session, submitting payment methods, and logging customer-facing checkout activity.
Checkout Transaction Status Query (TSQ)
Webhook verification
Verify the webhook before processing its JSON payload. Always pass the exact raw request body because Payinto signs the original bytes before JSON decoding or re-encoding.
Laravel
Non-Laravel PHP
For a plain PHP application, read the raw request body and the X-Payinto-Signature HTTP header before decoding the JSON payload:
The package automatically handles the X-Payinto-Signature format: t={timestamp},v1={signature}. The verifier computes an HMAC-SHA256 signature over {timestamp}.{raw_request_body} and compares it using a timing-safe comparison. Webhook secrets must remain server-side and must never be exposed to browser code.
Set webhookTimestampTolerance to the number of accepted seconds. For example, 300 allows a five-minute clock difference, while 0 disables timestamp checking but keeps HMAC verification enabled.
Custom requests
Future endpoints can be accessed through the raw client while retaining the same response and exception behavior:
Testing
Use a mocked Guzzle client in application tests; never commit API keys. See tests/Unit/ClientTest.php for request and authentication examples.