定制 dappcrypto/cpay 二次开发

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

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

dappcrypto/cpay

最新稳定版本:v1.0.2

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

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固