heleket/php-sdk
Composer 安装命令:
composer require heleket/php-sdk
包简介
Official PHP SDK for the Heleket cryptocurrency payment API: payments, payouts, balance, exchange rates, and signed webhooks. Zero runtime dependencies.
README 文档
README
The official PHP SDK for the Heleket cryptocurrency payment API. Covers the full documented surface (payments, payouts, balance, services, exchange rates), ships with unit tests, runnable examples, a debug mode, a webhook inspector CLI, and a Docker harness.
Built to be copied or composer require'd directly into your project. Zero runtime dependencies — only ext-curl and ext-json (bundled with PHP).
Quickstart
require __DIR__ . '/vendor/autoload.php'; use Heleket\Client; $payment = Client::payment($paymentApiKey, $merchantId); $invoice = $payment->createInvoice([ 'amount' => '15.00', 'currency' => 'USD', 'order_id' => 'order-42', ]); echo $invoice['url']; // → https://pay.heleket.com/pay/<uuid>
Install
composer require heleket/php-sdk
…or clone this folder into your project and add it to your autoloader.
Requirements: PHP 7.4+, ext-curl, ext-json. For new deployments, target PHP 8.2+ — 7.4 is end-of-life. The bundled Docker image uses PHP 8.3.
Documentation
Full reference lives in docs/:
- 01 — Installation
- 02 — Configuration
- 03 — Architecture
- 04 — Payments API
- 05 — Payouts API
- 06 — Webhooks ⚑ critical reading
- 07 — Debugging
- 08 — Testing
- 09 — Error handling
- 10 — Reference (statuses, currencies, endpoints)
- 12 — Troubleshooting (top mistakes)
What's in the box
src/ Production code — zero dependencies beyond ext-curl, ext-json
tests/ PHPUnit unit tests + FakeTransport for offline testing
examples/ Twelve runnable scripts (01..12) demonstrating every endpoint
bin/ heleket-webhook-inspect — CLI to verify and dump any webhook payload
docker/ php:7.4-cli-alpine with Composer baked in
docs/ Full module documentation in English
Common tasks
make install # Composer install make test # PHPUnit make stan # PHPStan level 8 make qa # All quality gates make example-invoice # Create a real invoice (needs .env) make example-webhook # Run the webhook listener on :8000 make docker-shell # Drop into a containerized PHP 7.4 shell make help # Full target list
Security notes (read this)
- Always verify webhook signatures. See docs/06-webhooks.md. Never trust the payload otherwise.
- Whitelist Heleket's webhook source IP
31.133.220.8at your firewall or reverse proxy. - Never log raw API keys — the debug dumper logs only the request method, URL, and body (never headers), but a misconfigured logger wrapping the SDK can still capture credentials.
- Two separate API keys — payments and payouts. Don't mix them up; webhooks of the wrong kind will fail verification. (One exception:
/v1/payment/refunduses the payout key — callPayoutClient::refund().)
Releasing
Versions are published to Packagist automatically from git tags on
github.com/Heleket/php-sdk (the Packagist ↔ GitHub webhook is already wired up).
- Land changes on
main; make suremake qais green. - Update
CHANGELOG.md. - Tag and push:
git tag 2.1.0 && git push origin 2.1.0.
Packagist picks up the new tag within a minute. The version reported in the User-Agent header is read from Composer at runtime, so there is nothing else to bump.
Major versions: the 1.x line lives on the 1.x branch (tag 1.0.0) and must keep working — never delete or move old tags. See UPGRADING.md for the 1.x → 2.x migration guide.
License
MIT — see LICENSE.
heleket/php-sdk 适用场景与选型建议
heleket/php-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13.01k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 01 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「payments」 「sdk」 「crypto」 「payouts」 「heleket」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 heleket/php-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 heleket/php-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 heleket/php-sdk 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Dealing with payments through the Egyptian payment gateway PayMob
Librería para la gestión sencilla de pagos mediante TPV Redsys y Paypal
A PSR-7 compatible library for making CRUD API endpoints
Scanpay module for Magento 2
Official Safaricom Daraja M-Pesa integration for Laravel built on ysg/payment-core.
Официальный PHP SDK для платёжного шлюза Oblodai: приём платежей, выплаты, статические кошельки, вебхуки.
统计信息
- 总下载量: 13.01k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-01-30