Works in Laravel, Symfony, WordPress and plain PHP. Source on GitHub.
No Composer (for example inside a WordPress plugin)? Copy the package into your plugin and require_once __DIR__ . '/ketapay-php/init.php';.

Set up

Create a checkout session

Parameters are plain arrays with snake_case keys, exactly as the API takes them, typed for PHPStan and PhpStorm. Fields read exactly as the API sends them: $session->url, $escrow->milestones[0]->status. Status values have constants in KetaPay\Enums.

Act for a customer

Lists

list() returns the first page. foreach over it walks every item across all pages.

Webhooks

Errors

Every error extends KetaPay\Errors\KetaPayError. Branch on $e->code (a string such as dispute_open), never on the message.

Sandbox