PHPackages                             icepay/checkout-sdk - 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. [Payment Processing](/categories/payments)
4. /
5. icepay/checkout-sdk

ActiveLibrary[Payment Processing](/categories/payments)

icepay/checkout-sdk
===================

ICEPAY PHP SDK for integrating Checkout API.

v1.3.0(2mo ago)02PHPPHP &gt;=8.1

Since Dec 4Pushed 2mo agoCompare

[ Source](https://github.com/ICEPAY/checkout-sdk)[ Packagist](https://packagist.org/packages/icepay/checkout-sdk)[ RSS](/packages/icepay-checkout-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (10)Versions (7)Used By (0)

Usage
=====

[](#usage)

Installations
-------------

[](#installations)

To install the ICEPAY Checkout SDK, run the following command:

```
composer require icepay/checkout-sdk
```

The SDK requires implementations for PSR-7 (HTTP Message) and PSR-17 (HTTP Factory) interfaces. You can use any compatible libraries, such as Guzzle or Nyholm.

For example, to install the SDK along with Nyholm PSR-7 and Symfony HTTP Client, run:

```
composer require icepay/checkout-sdk nyholm/psr7 symfony/http-client
```

Basic Example
-------------

[](#basic-example)

Here's a simple example of how to use the ICEPAY Checkout SDK:

```
require 'vendor/autoload.php';
use ICEPAY\Checkout\CheckoutClient;
use ICEPAY\Checkout\Models\Amount;
use ICEPAY\Checkout\Models\Request\Checkout;

$checkoutClient = (new CheckoutClient())->withAuthorization(merchantId: 'your_merchant_id', merchantSecret: 'your_merchant_secret');
$reference = '#' . time();
$checkoutRequest = new createCheckout(
    reference: $reference,
    description: 'Test Checkout',
    amount: new Amount(1234, Amount::CURRENCY_EUR),
);

$response = $this->checkoutClient->checkout($checkoutRequest);
print_r($response->links->checkout);
```

Using a custom HTTP Client
--------------------------

[](#using-a-custom-http-client)

You can use your own PSR-7 and PSR-17 compatible HTTP client with the SDK. Here's an example client that wraps proprietary HTTP client logic:

```
