定制 dappcrypto/cpay 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dappcrypto/cpay

Composer 安装命令:

composer require dappcrypto/cpay

包简介

DApp Crypto payment gateway SDK without KYC/KYB. Supports MetaMask and Trust Wallet. Payments in USDT, USDC, ETH, BNB, BTC.

README 文档

README

PHP SDK for accepting cryptocurrency payments without KYC/KYB.
Supports MetaMask, Trust Wallet and popular cryptocurrencies.

🚀 Features

  • No KYC / No KYB
  • Crypto payments
  • Wallets: MetaMask, Trust Wallet
  • Currencies: USDT, USDC, ETH, BTC
  • Networks: Ethereum, BNB Smart Chain and others
  • Invoice generation
  • Self-custody
  • Composer installation
  • MIT License

🔧 Installation

composer require dappcrypto/cpay

Create Invoice

examples/CreateInvoice.php - Example Create Invoice

use cpay\CPay;

$PrivateKey = '...'; // Your private key for aRecipient
$PDataObj = [
    'aRecipient'=>'0x...', // Your wallet account address (aRecipient)
    'aRecipientExt'=>'0x...', // Your wallet address for receiving USDT, USDC cryptocurrency
    'deadline'=>(time()+(60*60*24*365)), // Deadline time seconds UTC
    'nOrder'=>'1', // Order ID
    'nRToken'=>"1.50", // Amount USDT, USDC
    'nRType'=>'1', // 1 - USDT, 2 - USDC
    'sTextData'=>CPay::instance()->getTextData(['success'=>'','error'=>'','return'=>'','Description'=>''])['base64String'],
    'start'=>time(),
];
$DefaultChainId = 1;

$InvoiceData = CPay::instance()->createInvoice($PDataObj, $PrivateKey, $DefaultChainId);
if($InvoiceData['error']!=0){
    // Error creating invoice
} else {
    // The invoice has been successfully created.
    echo '<a href="'.$InvoiceData['LinkInvoice'].'">Pay</a>';
}

Get Invoice Status

use cpay\CPay;

$aRecipient = '0x...';
$nOrder = '1';

$OrderData = CPay::instance()->getOrderData($aRecipient, $nOrder);
if($OrderData['error']!=0){
    // Payment failed or is pending confirmation. Please try again later.
} else {
    // TODO The order has been successfully paid.
}

Webhook

examples/PageWebhook.php - Example Create Invoice

use cpay\CPay;

$aRecipient='0x...';
$WebhookData = CPay::instance()->getWebhook($aRecipient);
if($WebhookData['error']!=0){
    // Order error
    print_r($WebhookData);
} else {
    // TODO Order success
    echo 'Order: '.$WebhookData['orderData']['nOrder'].' was successfully paid in chain id: '.$WebhookData['orderData']['chain'].' aRecipient:'. $WebhookData['orderData']['aRecipient'];
}

Shop Registration (No KYC / No KYB)

Registration steps:

  1. Create a new account in MetaMask wallet
  2. Go to https://dappcrypto.github.io and create a shop in Ethereum, BNB Smart Chain and others
  3. Set the URL
  4. Use the private key and wallet address of this account in the SDK

⚠ IMPORTANT SECURITY WARNINGS

Attention!
A separate account with a private key must be used ONLY for:

  • shop registration
  • shop management on dappcrypto.github.io
  • invoice creation

Attention!
To receive cryptocurrency payments, specify a different wallet in the SDK
and keep its private key strictly secret.

Failure to follow these rules may result in loss of funds.

Versions

  • v1.0.2 - Signature update.
  • v1.0.1 - The success page example has been updated.
  • v1.0.0 - PHP SDK for accepting cryptocurrency payments

Requirements

  • PHP >= 8.0

Contacts

dappcrypto/cpay 适用场景与选型建议

dappcrypto/cpay 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 12 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 dappcrypto/cpay 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 dappcrypto/cpay 我们能提供哪些服务?
定制开发 / 二次开发

基于 dappcrypto/cpay 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 46
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-25