Skip to main content

PHP SDK

The openpay/sdk Composer package provides a PHP client for the Open Pay API. Requires PHP 8.1+.

Installation

Initialization

Store your API credentials in environment variables or a .env file. Never commit them to version control.

Create a Payment

Create a Checkout Session

Verify Webhook Signature

For Laravel, use $request->getContent() instead of file_get_contents('php://input') and access headers with $request->header('X-Webhook-Signature').

List Payments

Error Handling

Laravel Integration

If you are using Laravel, publish the config and set your credentials in .env: