PHPackages                             sarani/cryptopay - 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. sarani/cryptopay

ActiveLibrary[Payment Processing](/categories/payments)

sarani/cryptopay
================

Multicurrency Crypto Payment. Pay with cryptocurrency whenever you want.

1.0.1(4y ago)2462MITPHP

Since Apr 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/ZeroNilZero/cryptopay)[ Packagist](https://packagist.org/packages/sarani/cryptopay)[ Docs](https://github.com/ZeroNilZero/cryptopay)[ RSS](/packages/sarani-cryptopay/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

cryptopay
=========

[](#cryptopay)

cryptopay is a *php* library for **Cryptocurrency Payment** with support of accepting multiple cryptocurrencies. with this library you can add and support crypto payment to your *sites*, *Apps* and Telegram *bot*.

Get Start
---------

[](#get-start)

To use this library, you need to create free Telegram account with [CryptoBot](http://t.me/CryptoBot?start=r-84540).

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

[](#installation)

Use the package manager [composer](http://getcomposer.org) to install `sarani/cryptopay`.

```
composer require sarani/cryptopay
```

Usage and Methods
-----------------

[](#usage-and-methods)

```
// use Sarani\CryptoBot;

# init
$cryp_payment_token = 'token';
$mode = 'test'; // empty for real account
$crypto = new Sarani\CryptoPay\Api($cryp_payment_token, 'test');
```

### getMe

[](#getme)

Use this method to test your app's authentication token. Requires no parameters. On success, returns basic information about an app.

```
$me = $crypto->getMe();
```

### createInvoice

[](#createinvoice)

Use this method to create a new invoice. On success, returns an object of the created invoice.

- **asset** (String) Currency code. Supported assets: “BTC”, “TON”, “ETH” (testnet only), “USDT”, “USDC” and “BUSD”.
- **amount** (String)Amount of the invoice in float. For example: 125.50
- **description** (String) Optional. Description for the invoice. User will see this description when they pay the invoice. Up to 1024 characters.
- **hidden\_message** (String) Optional. Text of the message that will be shown to a user after the invoice is paid. Up to 2o48 characters.
- **paid\_btn\_name** (String) Optional. Name of the button that will be shown to a user after the invoice is paid. Supported names: *viewItem* – “View Item”, *openChannel* – “Open Channel”, *openBot* – “Open Bot”, *callback* – “Return”
- **paid\_btn\_url** (String) Optional. Required if paid\_btn\_name is used. URL to be opened when the button is pressed. You can set any success link (for example, a link to your bot). Starts with https or http.
- **payload** (String) Optional. Any data you want to attach to the invoice (for example, user ID, payment ID, ect). Up to 4kb.
- **allow\_comments** (Boolean) Optional. Allow a user to add a comment to the payment. Default is true.
- **allow\_anonymous** (Boolean) Optional. Allow a user to pay the invoice anonymously. Default is true.
- **expires\_in** (Number) Optional. You can set a payment time limit for the invoice in seconds. Values between 1-2678400 are accepted.

```
# create invoice, return Invoices object
  $inv = $crypto->createInvoice($params = [
    'asset'   => 'USDT',
    'amount'  => '2.50',
    'payload' =>  '11158', # subscription id
    'allow_comments' => False,
    'allow_anonymous' => True,
    'paid_btn_name' => 'openBot',
    'paid_btn_url' => 'https://t.me/demobot',
    'hidden_message' => 'Thanks for your payment',
    'description' => 'Monthly Subscription'
  ]);
  echo $inv->id();
  echo $inv->url();
```

### getInvoices

[](#getinvoices)

- asset (String) Optional. Currency codes separated by comma. Supported assets: “BTC”, “TON”, “ETH” (testnet only), “USDT”, “USDC” and “BUSD”. Defaults to all assets.
- **invoice\_ids** (String) Optional. Invoice IDs separated by comma.
- **status** (String) Optional. Status of invoices to be returned. Available statuses: “active” and “paid”. Defaults to all statuses.
- **offset** (Number) Optional. Offset needed to return a specific subset of invoices. Default is 0.
- **count** (Number) Optional. Number of invoices to be returned. Values between 1-1000 are accepted. Defaults to 100.

```
# get invoice, return array of Invoices object
$res = $crypto->getInvoices($params = [
  'asset'  =>  'TON', // Crypto symbols
  'invoice_ids'   => '12600,12626,12745', // ids seperated by comma
]);
```

### transfer

[](#transfer)

Use this method to send coins from your app's balance to a user. On success, returns object of completed transfer.

- **user\_id** (Number) Telegram user ID. User must have previously used [CryptoBot](http://t.me/CryptoBot?start=r-84540)(@CryptoTestnetBot for testnet).
- **asset** (String) Currency code. Supported assets: “BTC”, “TON”, “ETH” (testnet only), “USDT”, “USDC” and “BUSD”.
- **amount** (String) Amount of the transfer in float. The minimum and maximum amounts for each of the support asset roughly correspond to the limit of 0.01-25000 USD. Use getExchangeRates to convert amounts. For example: 125.50
- **spend\_id** (String) Unique ID to make your request idempotent and ensure that only one of the transfers with the same spend\_id will be accepted by Crypto Pay API. This parameter is useful when the transfer should be retried (i.e. request timeout, connection reset, 500 HTTP status, etc). It can be some unique withdrawal identifier for example. Up to 64 symbols.
- **comment** (String) Optional. Comment for the transfer. Users will see this comment when they receive a notification about the transfer. Up to 1024 symbols.
- **disable\_send\_notification** (Boolean) Optional. Pass true if the user should not receive a notification about the transfer. Default is false.

```
# transfer to user, return Transfer object
$transfer = $crypto->transfer($params = [
  'user_id'  =>  '1111111', // telegram user_id
  'asset'   => 'USDT', // Crypto
  'amount'  => '2.50', // amount
  'spend_id' =>  '1001', # reequest uniqe id to avoid double transfer
  'disable_send_notification'  =>  False,
  'comment' =>  'gift transfer'
]);
```

getBalance
----------

[](#getbalance)

Use this method to get a balance of your app. Returns array of assets.

### getExchangeRates

[](#getexchangerates)

Use this method to get exchange rates of supported currencies. Returns array of currencies.

### getCurrencies

[](#getcurrencies)

Use this method to get a list of supported currencies. Returns array of currencies.

### Webhooks getUpdate

[](#webhooks-getupdate)

Use Webhooks to get updates for your app. Webhook request may be sent at least one time.

To make sure that the Webhook request was sent by Crypto Pay API, use a secret path in the URL, e.g. . Since nobody else knows your app's token, you can be pretty sure it's [CryptoBot](http://t.me/CryptoBot?start=r-84540).

**How to enable Webhooks?**Open [CryptoBot](http://t.me/CryptoBot?start=r-84540) (@CryptoTestnetBot for testnet), go to Crypto Pay → My Apps, choose an app, open ‘Webhooks’ and tap ‘Enable Webhooks’. Then send HTTPS url used to receive updates.

```
# webhook, return Webhook object with Update and Invoice
$hook = new Sarani\CryptoPay\Webhook();
$update = $hook->getUpdate(); // Update object
$nvoice =   $update->getPayload(); // Invoice Object
echo( $nvoice->status());
```

Contributing
------------

[](#contributing)

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Disclaimer
----------

[](#disclaimer)

This project and its author is not associated with CryptoBot.

Financial Support
-----------------

[](#financial-support)

This Library is free for uses, But if you like it, any Supports are Wellcome.

> You can support with [this invoice](http://t.me/CryptoBot?start=IVcdWKiAiL1L) or Join [CryptoBot](http://t.me/CryptoBot?start=r-84540) with [affiliated](http://t.me/CryptoBot?start=r-84540) link .

> Or send directly:
>
> - TON: `UQC09HtKpaK0prsE1X-V7cnk5JE_NrSy4bgTxVeCU8kfO1A6`
> - BTC: `17sL8eapiCs1eeq2nRVAZozsn6ws9HCToP`
> - BTC, TON, USDT, USDC, BUSD, BNB: Transfer with [CryptoBot](http://t.me/CryptoBot?start=IVcdWKiAiL1L)

License
-------

[](#license)

This project is released under the [MIT License](https://github.com/ZeroNilZero/cryptopay/blob/main/LICENSE.txt) License.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

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 ~0 days

Total

2

Last Release

1479d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e2225ea65a328d9e2267410fa9e2be32e308cec54a27c3677d2fb31b3f37cb9?d=identicon)[sarani](/maintainers/sarani)

---

Top Contributors

[![ZeroNilZero](https://avatars.githubusercontent.com/u/14243321?v=4)](https://github.com/ZeroNilZero "ZeroNilZero (14 commits)")

---

Tags

bitcoincryptocrypto-pay-apicrypto-paymentcryptocurrencypayment-gatewaypayment-servicetoncoinusdtcryptopaymentcryptocurrencytelegram crypto paymenttelegram bot payment

### Embed Badge

![Health badge](/badges/sarani-cryptopay/health.svg)

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

###  Alternatives

[shetabit/multipay

PHP Payment Gateway Integration Package

291348.2k3](/packages/shetabit-multipay)[bitpay/sdk

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

42337.5k4](/packages/bitpay-sdk)[victorybiz/laravel-crypto-payment-gateway

GoUrl.io Crypto Payment Gateway for Laravel

642.5k](/packages/victorybiz-laravel-crypto-payment-gateway)[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4845.9k](/packages/sebdesign-laravel-viva-payments)[henryejemuta/laravel-monnify

A laravel package to seamlessly integrate monnify api within your laravel application

132.1k](/packages/henryejemuta-laravel-monnify)[tsaiyihua/laravel-linepay

linepay library for laravel

102.9k](/packages/tsaiyihua-laravel-linepay)

PHPackages © 2026

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