Download the PHP package tigusigalpa/telegram-wallet-php without Composer

On this page you can find all versions of the php package tigusigalpa/telegram-wallet-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package telegram-wallet-php

Telegram Wallet Pay PHP SDK

Telegram wallet PHP/Laravel

PHP Version Latest Version

Accept crypto payments in your PHP app or Laravel project. This SDK wraps the Telegram Wallet Pay API, letting your users pay with TON, USDT, BTC, and NOT — right inside Telegram.

📖 Full documentation available on Wiki

Why This Package?

Building a Telegram bot with payments? We've got you covered:

Installation

Install via Composer:

Requirements

Quick Start

Here's how simple it is to create a payment:

With Laravel

Using Laravel? It's even cleaner with the Facade:

Handling Webhooks

When a payment succeeds (or fails), Wallet Pay will notify your server:

Configuration

The defaults work great for most cases. Here's how to customize if needed:

Laravel Configuration

Publish the configuration file:

Edit config/walletpay.php:

Add to your .env:

API Reference

Here's everything you can do with the client:

Method What it does
createOrder($request) Create a new payment order
getOrderPreview($orderId) Check order status
getOrderList($offset, $count) List orders (paginated, max 10,000)
getOrderAmount() Get total order count

Order Parameters

Parameter Required What it's for
amount Yes How much to charge (e.g., new MoneyAmount('USD', '9.99'))
description Yes What the user sees (5-100 chars)
externalId Yes Your order ID — use this to match payments
timeoutSeconds Yes How long the order stays valid (30s to 10 days)
customerTelegramUserId Yes Only this Telegram user can pay
autoConversionCurrency No Convert payment to TON/USDT/BTC/NOT (+1% fee)
returnUrl No Where to send user after payment
failReturnUrl No Where to send user if payment fails
customData No Your metadata — comes back in webhooks

Currencies

For pricing: USD, EUR
For receiving: TON, USDT, BTC, NOT

Order Lifecycle

Status Meaning
ACTIVE Waiting for payment
PAID Payment received! 🎉
EXPIRED Time ran out
CANCELLED User or system cancelled

Webhook Events

Setting Up Webhooks

Webhooks tell you when payments happen. Here's how to set them up properly.

Step 1: Configure Your URL

In your Wallet Pay store settings, set the webhook URL:

Important:

Step 2: Allowlist Wallet Pay IPs

If you have a firewall, allow these IPs:

Step 3: Handle Duplicate Webhooks

Wallet Pay might send the same webhook multiple times (network issues happen). Use eventId to avoid processing duplicates:

How Signature Verification Works

You don't need to implement this yourself (our WebhookVerifier handles it), but here's what happens under the hood:

Heads up: The URI path must match exactly what you configured — including the trailing slash (or lack thereof).

Laravel Deep Dive

Service Provider

The package auto-registers — no setup needed! But if you need manual registration:

Facade

Webhook Middleware

We include middleware that verifies webhook signatures for you. Register it in app/Http/Kernel.php:

Simple Route Example

Full Controller Example

Here's a production-ready controller with payment creation and webhook handling:

When Things Go Wrong

Errors are typed, so you can handle them gracefully:

Exception What happened
InvalidRequestException Bad request (check your parameters)
InvalidApiKeyException Invalid API key
OrderNotFoundException Order doesn't exist
RateLimitException Slow down! Too many requests
ServerException Wallet Pay is having issues
InvalidWebhookSignatureException Webhook signature doesn't match

Example

Things to Know

Opening the Payment Link

The payment link (directPayLink) needs to be opened correctly:

✅ In a Telegram Web App: Use Telegram.WebApp.openTelegramLink(url)
✅ In a bot message: Use it as an Inline Button URL
❌ Don't use: openLink() or MenuButtonWebApp — payment will fail

Payment Button Text

Telegram requires specific button text:

Yes, the purse emoji is mandatory. 👛

Preventing Duplicate Orders

Use externalId as your idempotency key. If you retry with the same ID, you'll get the existing order back:

Auto-Conversion Fees

Want to receive payments in a specific crypto? Set autoConversionCurrency, but note:

When Can You Withdraw?

Funds are held for 48 hours after payment before you can withdraw them. This is a Wallet Pay policy.

One User Per Order

Only the Telegram user specified in customerTelegramUserId can pay that order. This prevents payment link sharing.

Testing

What's Next?

This package is built to grow. The architecture separates payment functionality from future trading features (spot trading, tokenized stocks, perpetual futures). When Wallet adds new APIs, we'll add support without breaking your existing code.

Contributing

Found a bug? Have an idea? PRs are welcome!

  1. Fork it
  2. Create your branch (git checkout -b fix/something)
  3. Make your changes
  4. Run tests (vendor/bin/phpunit)
  5. Open a PR

Please follow PSR-12 and include tests for new features.

License

MIT — do whatever you want with it.

Links

Need Help?

Open an issue on GitHub — I'll do my best to help.


Built by Igor Sazonov


All versions of telegram-wallet-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
guzzlehttp/guzzle Version ^7.0
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tigusigalpa/telegram-wallet-php contains the following files

Loading the files please wait ...