PHPackages                             counos/counospay-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. [Payment Processing](/categories/payments)
4. /
5. counos/counospay-php

ActiveLibrary[Payment Processing](/categories/payments)

counos/counospay-php
====================

CounosPayment Php library

V1.1(5y ago)23.4k—0%1[1 issues](https://github.com/counos-platform/CounosPay-php/issues)mitPHP

Since Jun 29Pushed 5y agoCompare

[ Source](https://github.com/counos-platform/CounosPay-php)[ Packagist](https://packagist.org/packages/counos/counospay-php)[ RSS](/packages/counos-counospay-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

counospay-php
=============

[](#counospay-php)

PHP Counos Payment Gateway client

### Installing

[](#installing)

Easily install it through Composer:

```
composer require counos/counospay-php

```

Usage
-----

[](#usage)

To use this library, first you must have an Api Key. Go to , then add your terminal and get Api Key.

#### Connect to counos payment

[](#connect-to-counos-payment)

```
use Counos\CounosPay\Payment;

$counospay_api = new Payment("YOUR_COUNOS_PAYMENT_GATEWAY_API_KEY");

```

---

### Get all activated tickers of the terminal

[](#get-all-activated-tickers-of-the-terminal)

```
try
{
    $tickers = $counospay_api->Tickers();
}
catch (Exception $e)
{
    die("Cant't connect to payment gateway. please try again.");
}

```

---

#### Create a new payment

[](#create-a-new-payment)

```
try
{
    /**
     * $invoice_id must be unique per invoice, payment gateway uses this id to check the payment status, it can be a string (eg. inv-1, inv-vps-service-125)
     */
    $invoice_id    = 1;
    $ticker        =  'cca'; //$_POST['ticker'];
    $amount        = 9.99;
    $base_currency = 'USD';
    /**
     * @var $payment Counos\CounosPay\Models\Response\Order
     */
    $payment             = $counospay_api->NewOrderFromFiat($invoice_id, $base_currency, $ticker, $amount, true);
    $new_payment_created = [
        'invoice_id'      => $invoice_id,
        'payment_id'      => $payment->id,
        'confirmations'   => $payment->paymentConfirmations,
        'paid_amount'     => $payment->paidAmount,
        'expected_amount' => $payment->expectedAmount,
        'address'         => $payment->orderAddress,
        'ticker'          => $payment->ticker->keyword,
        'transaction_id'  => $payment->transactionId,
        'payment_uri'     => $payment->paymentUriQrCode,
        'paid'            => $payment->paid,
        'base_ticker'     => $base_currency,
        'base_amount'     => $amount,
    ];
    //In this step you must save this info (e.g. in db) then redirect user to a page that shows payment QR code and other info.
}
catch (Exception $e)
{
    die("Cant't connect to payment gateway. please try again.");
}

```

---

#### Check payment status

[](#check-payment-status)

In order to periodically check the payment status, it must be declared in cron jobs

```
try
{
    try
    {
        $payment = $counospay_api->OrderStatus($invoice_id);
    }
    catch (Exception $e)
    {
        //log errors
    }

    $db_invoice_model = retrieveInvoiceFromDB($invoice_id);

    /**
     * When a payment has been completed and reaches the defined number of confirmations, 'paid' turns to true, in this stage you must change the invoice status to 'PAID' and do some stuff for order.
     */
    if ($payment->paid)
    {
        $db_invoice_model->status = 'paid';
        //notice the user about the payment status
        //place order
        //and etc.
    }
    else if ($payment->paidAmount >= $payment->expectedAmount)
    {
        $db_invoice_model->paid_status = 'await_confirmations';
        //show a progress bar to the user about how many confirmations...
    }
    else
    {
        //user not yet made the payment
    }
}
catch (Exception $e)
{
    die("Cant't connect to payment gateway. please try again.");
}
function retrieveInvoiceFromDB($invoice_id)
{
    //get invoice model from db and return
}

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~1 days

Total

2

Last Release

2148d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e83cb1c8f225995a9db5085b21465696a89ab6e4d456879adf4d87a553495785?d=identicon)[counos](/maintainers/counos)

---

Top Contributors

[![counos](https://avatars.githubusercontent.com/u/38785860?v=4)](https://github.com/counos "counos (11 commits)")

### Embed Badge

![Health badge](/badges/counos-counospay-php/health.svg)

```
[![Health](https://phpackages.com/badges/counos-counospay-php/health.svg)](https://phpackages.com/packages/counos-counospay-php)
```

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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