PHPackages                             unipayment/client - 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. unipayment/client

ActiveLibrary[Payment Processing](/categories/payments)

unipayment/client
=================

This SDK provides a convenient abstraction of UniPayment's Gateway API and allows developers to focus on payment flow/e-commerce integration rather than on the specific details of client-server interaction using the raw API.

2.0.6(1y ago)01.2k3MITPHPPHP &gt;=7.4 || &gt;=8.0

Since Sep 16Pushed 1y ago2 watchersCompare

[ Source](https://github.com/UniCryptoLab/UniPaymentClient.PHP)[ Packagist](https://packagist.org/packages/unipayment/client)[ Docs](https://unipayment.io)[ RSS](/packages/unipayment-client/feed)WikiDiscussions v2.x.x Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (15)Used By (0)

UniPayment PHP Client
=====================

[](#unipayment-php-client)

[![GitHub license](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/UniCryptoLab/UniPaymentClient.PHP/blob/main/UniPaymentClient/LICENSE.txt)[![Packagist](https://camo.githubusercontent.com/d5594aa8b562583a5057aec52e4823a8bec6642df5bc1af9cbc6269f213f490c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f756e697061796d656e742f636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/unipayment/client)

A PHP SDK for the [UniPayment Client API](https://unipayment.readme.io/reference/overview).

This SDK provides a convenient abstraction of UniPayment's Gateway API and allows developers to focus on payment flow/e-commerce integration rather than on the specific details of client-server interaction using the raw API.

Getting Started
---------------

[](#getting-started)

[Integration Tutorial](https://bit.ly/up-help-integration)

Before using the UniPayment API, sign up for your [API key](https://console.unipayment.io/).

If you want to use the Sandbox, sign up [here](https://sandbox-console.unipayment.io/).

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

[](#installation)

### Install Composer

[](#install-composer)

```
curl -sS https://getcomposer.org/installer | php
```

### Install via composer

[](#install-via-composer)

Add unipayment/client into require section of composer.json

```
{
  "require": {
    "unipayment/client": "2.*"
  }
}
```

Initializing UniPayment SDK
---------------------------

[](#initializing-unipayment-sdk)

```
$configuration = new \UniPayment\SDK\Configuration();
$configuration->setClientId('your client id');
$configuration->setClientSecret('your secret key');
$configuration->setAppId('your app id');
$configuration->setIsSandbox(false);
```

Sandbox is used in the same way with is\_sandbox as true.

```
$configuration = new \UniPayment\SDK\Configuration();
$configuration->setClientId('your client id');
$configuration->setClientSecret('your secret key');
$configuration->setAppId('your app id');
$configuration->setIsSandbox(true);
$configuration->setDebug(true);
```

Create an invoice
-----------------

[](#create-an-invoice)

> Reference：[https://unipayment.readme.io/reference/create\_invoice](https://unipayment.readme.io/reference/create_invoice)

```
$createInvoiceRequest = new \UniPayment\SDK\Model\CreateInvoiceRequest();
$createInvoiceRequest->setAppId($configuration->getAppId());
$createInvoiceRequest->setOrderId(Uuid::uuid4());
$createInvoiceRequest->setPriceAmount(1.0);
$createInvoiceRequest->setPriceCurrency('USD');
$createInvoiceRequest->setLang("en");
$createInvoiceRequest->setExtArgs("Merchant Pass Through Data");

$billingAPI  = new \UniPayment\SDK\BillingAPI($configuration);
try{
    $createInvoiceResponse = $billingAPI->createInvoice($createInvoiceRequest);
} catch (\UniPayment\SDK\UnipaymentSDKException $e) {
   ...
}
```

### CreateInvoiceResponse

[](#createinvoiceresponse)

```
{
  "msg": "",
  "code": "OK",
  "data": {
    "app_id": "df01ae1f-8c31-4ecd-8ab1-9e31289d4823",
    "payment_method_type": "UNKNOWN",
    "invoice_id": "88144dSLPujPsUJYakkJdx",
    "order_id": "ORDER_1721023791051",
    "price_amount": 2.0,
    "price_currency": "USD",
    "network": null,
    "address": null,
    "pay_amount": 0.0,
    "pay_currency": null,
    "exchange_rate": 0.0,
    "paid_amount": 0.0,
    "refunded_price_amount": 0.0,
    "create_time": "2024-07-15T06:09:54",
    "expiration_time": "2024-07-15T06:29:54",
    "confirm_speed": "Medium",
    "status": "New",
    "error_status": "None",
    "invoice_url": "https://sandbox.api.unipayment.com/i/88144dSLPujPsUJYakkJdx"
  }
}
```

Webhook Notification
--------------------

[](#webhook-notification)

[Webhook Tutorial](https://bit.ly/up-help-webhook)

Webhook Signature Verification
------------------------------

[](#webhook-signature-verification)

Use the below code to verify of the 'hmac\_signature' which can extract from the request header

```
use UniPayment\SDK\Utils\WebhookSignatureUtil;

//Use raw json payload (no formatting or pretty print)
$payload = 'json payload';
$secretKey = 'your secret key';
$signature = 'signature to verify';
$valid = WebhookSignatureUtil::isValid($payload, $secretKey, $signature);
```

Run Example
-----------

[](#run-example)

1.Get source code form GitHub

```
git clone https://github.com/UniCryptoLab/UniPaymentClient.PHP.git
```

2.Run project in PHPStorm

License
-------

[](#license)

MIT License

Copyright (c) 2024 UniPayment

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~65 days

Recently: every ~35 days

Total

14

Last Release

492d ago

Major Versions

1.1.2 → 2.0.02024-08-22

PHP version history (4 changes)1.0.0PHP ^7.3 || ^8.0

2.0.0PHP &gt;=7.4 || &gt;=8.3

2.0.1PHP &gt;=7.4

2.0.3PHP &gt;=7.4 || &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/76d230e148ab6eb3f9e461d481788b4bf554a7da436aded09cf557c7068d13a9?d=identicon)[unipayment](/maintainers/unipayment)

---

Top Contributors

[![shameem-devp](https://avatars.githubusercontent.com/u/1511232?v=4)](https://github.com/shameem-devp "shameem-devp (29 commits)")[![UniCryptoLab](https://avatars.githubusercontent.com/u/101961719?v=4)](https://github.com/UniCryptoLab "UniCryptoLab (20 commits)")[![issamlk1](https://avatars.githubusercontent.com/u/8859524?v=4)](https://github.com/issamlk1 "issamlk1 (1 commits)")

---

Tags

paymentgatewaybitcoinethUSDCUSDTunipayment

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/unipayment-client/health.svg)

```
[![Health](https://phpackages.com/badges/unipayment-client/health.svg)](https://phpackages.com/packages/unipayment-client)
```

###  Alternatives

[bitpay/sdk

Complete version of the PHP library for the new cryptographically secure BitPay API

42337.5k4](/packages/bitpay-sdk)[bitpay/sdk-light

Light version of the PHP library for the new cryptographically secure BitPay API

19143.6k3](/packages/bitpay-sdk-light)[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4845.9k](/packages/sebdesign-laravel-viva-payments)[omnipay/bitpay

BitPay driver for the Omnipay payment processing library

1383.2k1](/packages/omnipay-bitpay)[coingate/omnipay-coingate

CoinGate driver for the Omnipay payment processing library

1037.0k1](/packages/coingate-omnipay-coingate)[plisio/plisio-api-php

155.8k](/packages/plisio-plisio-api-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
