PHPackages                             keeal/keeal-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. keeal/keeal-php

ActiveLibrary[API Development](/categories/api)

keeal/keeal-php
===============

Keeal PHP SDK — hosted checkout REST API client

0.1.0(3mo ago)01MITPHPPHP ^8.1

Since Apr 6Pushed 2w agoCompare

[ Source](https://github.com/KeealPay/keeal-php)[ Packagist](https://packagist.org/packages/keeal/keeal-php)[ RSS](/packages/keeal-keeal-php/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

Keeal PHP SDK
=============

[](#keeal-php-sdk)

[![PHP](https://camo.githubusercontent.com/1f28f2b4faa0e0f1224d8870dbbc65deeea67e3391cd0be5ca39bb23feddf1cc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312b2d3737374242343f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://www.php.net/)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](./LICENSE)

Official **PHP** client for Keeal **hosted checkout**: create sessions with your secret API key, redirect buyers to the returned URL, and verify webhooks.

**Repository:** [github.com/KeealPay/keeal-php](https://github.com/KeealPay/keeal-php) · **Package:** `keeal/keeal-php`

---

Overview
--------

[](#overview)

Keeal **hosted checkout** is a redirect-based payment flow:

1. **Create a session** on your server with your secret API key (`keeal_sk_…`).
2. **Redirect** the customer to the session `url` returned by the API.
3. **Fulfill** your order when you receive a signed `checkout.session.completed` webhook.

Your server never handles card data. Payment UI, PayPal, and cancellation are handled on Keeal's hosted page.

---

Installation
------------

[](#installation)

```
composer require keeal/keeal-php
```

Requires **PHP 8.1+** with the `json` extension.

---

Configuration
-------------

[](#configuration)

Set these environment variables on your server:

VariableDescription`KEEAL_API_KEY`Secret API key (`keeal_sk_…`) from the Keeal dashboard`KEEAL_BASE_URL`API base URL including `/api`, e.g. `https://api.keeal.com/api``KEEAL_WEBHOOK_SECRET`Webhook signing secret (`whsec_…`) from **Settings → API Keys → Webhook**Use separate keys, base URLs, and webhook secrets for staging and production.

When constructing `KeealCheckout`, pass `apiKey` and `baseUrl` explicitly (from `getenv()` or your framework's config).

---

Quick start
-----------

[](#quick-start)

```
