paycryptoone/paycrypto-php-client
Composer 安装命令:
composer require paycryptoone/paycrypto-php-client
包简介
PHP client preconfigured for paycrypto.one
README 文档
README
PHP client for paycrypto.one API.
- Packagist: paycryptoone/paycrypto-php-client
- GitHub: PayCryptoOne/paycrypto-php-client
Установка
composer require paycryptoone/paycrypto-php-client
Ключи: конструктор или переменные окружения
Через конструктор:
<?php use PayCrypto\Client\PayCryptoClient; $client = new PayCryptoClient( publicKey: 'your_public_key', privateKey: 'your_private_key', baseUrl: 'https://api.paycrypto.one/api/v1/', authMode: 'signature' );
Или через фабрику из env (в .env или getenv: PAYCRYPTO_PUBLIC_KEY, PAYCRYPTO_PRIVATE_KEY, PAYCRYPTO_BASE_URL):
use PayCrypto\Client\PayCryptoClientFactory; $client = PayCryptoClientFactory::createFromEnv('signature'); $client = PayCryptoClientFactory::createFromEnv('private-key');
Примеры по эндпоинтам
Создание инвойса — invoice (POST)
use PayCrypto\Client\PayCryptoClient; use cryptoscan\command\InvoiceCreate; $client = new PayCryptoClient($publicKey, $privateKey); $cmd = new InvoiceCreate(10.5, 'order-' . time()); $cmd->setCurrency('USD')->setCryptocurrency('USDT')->setNetwork('TRC-20')->setMetadata('my-order'); $result = $client->invoiceCreate($cmd); $invoiceId = $result->getId(); $wallet = $result->getWallet(); $finalAmount = $result->getFinalAmount();
Виджет инвойса — invoice/widget (POST)
use cryptoscan\command\WidgetCreate; $widget = new WidgetCreate(7.5, 'widget-order-' . time()); $widget->setCurrency('USD')->setLang('ru-RU')->setWidgetDescription('Оплата заказа'); $result = $client->widgetCreate($widget); $widgetUrl = $result->getWidgetUrl(); $invoiceId = $result->getId();
Получить инвойс по ID — invoice/:id (GET)
$detail = $client->invoiceDetail($invoiceId); $detail->getId(); $detail->getClientReferenceId(); $detail->getStatus(); $detail->getFinalAmount();
Список инвойсов — invoices (GET)
$list = $client->invoiceList([ 'status' => 'paid_all', 'client_reference_id' => 'order', 'created_at_from' => 1700000000, 'created_at_to' => 1700003600, 'sort_by' => 'created_at', 'sort_order' => 'desc', 'limit' => 20, 'offset' => 0, ]); $items = $list->getItems(); $total = $list->getTotal();
Поиск инвойсов — invoice?query= (GET)
$list = $client->invoiceSearch('order-123'); $items = $list->getItems();
Подтверждение оплаты инвойса — invoice/confirm/:id (PUT)
use cryptoscan\command\InvoiceConfirm; $confirm = new InvoiceConfirm($invoiceId, 'tx-hash-or-id-' . time()); $result = $client->invoiceConfirm($confirm); $status = $result->getStatus();
Текущий пользователь — user (GET)
$user = $client->userDetail(); $userId = $user->getId();
Список курсов — currency-rate (GET)
$rates = $client->currencyRate(); $items = $rates->getItems();
Статус курса по валюте — currency-rate/:currency/status (GET)
$status = $client->currencyRateStatus('USD'); $supported = $status->isSupported();
Проверки
Smoke:
composer smoke
E2E:
composer e2e
paycryptoone/paycrypto-php-client 适用场景与选型建议
paycryptoone/paycrypto-php-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「payments」 「crypto」 「paycrypto」 「cryptoscan」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 paycryptoone/paycrypto-php-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 paycryptoone/paycrypto-php-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 paycryptoone/paycrypto-php-client 相关的其它包
同方向 / 同关键字的高下载量 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
High-level cryptographic primitives and security utilities for Maatify systems including password hashing, reversible encryption, HKDF key derivation, and key rotation.
A simple PHP Cryptography Implementation for the Ark Blockchain.
A simple PHP API client for the Ark Blockchain.
A Laravel bridge for Ark Core.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-06