PHPackages                             dogpay/chain - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. dogpay/chain

ActiveComposer[Payment Processing](/categories/payments)

dogpay/chain
============

DogPay PHP, An object-oriented library for calling DogPay payment channels

v1.0.2(1y ago)029MITPHPPHP &gt;=7.0

Since Aug 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/jyzhengzifan/dogpay)[ Packagist](https://packagist.org/packages/dogpay/chain)[ Docs](https://github.com/jyzhengzifan/dogpay)[ RSS](/packages/dogpay-chain/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

PHP-DogPay
==========

[](#php-dogpay)

Installation
------------

[](#installation)

The recommended way to install PHP-DogPay is through [Composer](https://getcomposer.org).

```
$ composer require dogpay/chain
```

Create User
-----------

[](#create-user)

```
require 'vendor/autoload.php';

use Dogpay\Chain\DogPay;

$config = [
    'key' => 'Your Key',
    'secret' => 'Your Secret',
    'public_key' => 'Your RSA Public Key',
    'private_key' => 'Your RSA Private Key',
    'chain_public_key' => 'Chain RSA Public Key',
];
$dogPay = new DogPay($config);

$open_id = 'project100005';

$result = $dogPay->createUser($open_id);
```

Create Wallet
-------------

[](#create-wallet)

```
require 'vendor/autoload.php';

use Dogpay\Chain\DogPay;

$config = [
    'key' => 'Your Key',
    'secret' => 'Your Secret',
    'public_key' => 'Your RSA Public Key',
    'private_key' => 'Your RSA Private Key',
    'chain_public_key' => 'Chain RSA Public Key',
];
$dogPay = new DogPay($config);

$open_id = 'project100000'; //It is recommended to use project name + user unique identifier
$chain_id = 2;  //The Chain ID can be checked through the table below

$result = $dogPay->createWallet($open_id, $chain_id);
```

Withdraw
--------

[](#withdraw)

```
require 'vendor/autoload.php';

use Dogpay\Chain\DogPay;

$config = [
    'key' => 'Your Key',
    'secret' => 'Your Secret',
    'public_key' => 'Your RSA Public Key',
    'private_key' => 'Your RSA Private Key',
    'chain_public_key' => 'Chain RSA Public Key',
];
$dogPay = new DogPay($config);

$open_id = 'project100000';
$token_id = 4;  //The Token ID can be checked through the table below
$amount = 100;  //Amount of withdrawal
$address = 'TQ33qyLenhYxqMDPtVwdS92UhZwRWdD1VL';    //Withdrawal address
$callback_url = 'https://Your callback address';
$safe_check_code = '202408080808081';   //Security verification code for user withdrawal transactions

$result = $dogPay->withdraw($open_id, $token_id, $amount, $address, $callback_url, $safe_check_code);
```

Notification callback
---------------------

[](#notification-callback)

```
require 'vendor/autoload.php';

use Dogpay\Chain\DogPay;

$postData = file_get_contents('php://input');
if(!$postData){
    exit;
}
$postData = json_decode($postData, true);

$config = [
    'key' => 'Your Key',
    'secret' => 'Your Secret',
    'public_key' => 'Your RSA Public Key',
    'private_key' => 'Your RSA Private Key',
    'chain_public_key' => 'Chain RSA Public Key',
];
$dogPay = new DogPay($config);

if(!$dogPay->verifyRsaSignature($postData)){
    //Failed to verify signature
    exit;
}

//The signature verification is successful, and the following business logic is processed
if($postData['type'] == 1){
    //Recharge transaction

}elseif($postData['type'] == 2){
    //Withdrawal transaction

}else{
    //Type Error
    exit;
}

$response = [
    'code' => 0,
    'msg' => 'ok',
    'data' => null,
];
exit(json_encode($response));
```

Second review of withdrawal order
---------------------------------

[](#second-review-of-withdrawal-order)

```
require 'vendor/autoload.php';

use Dogpay\Chain\DogPay;
use Dogpay\Chain\Client;

$postData = file_get_contents('php://input');

if(!$postData){
    exit;
}
$postData = json_decode($postData, true);

$config = [
    'key' => 'Your Key',
    'secret' => 'Your Secret',
    'public_key' => 'Your RSA Public Key',
    'private_key' => 'Your RSA Private Key',
    'chain_public_key' => 'Chain RSA Public Key',
    'chain_withdraw_public_key' => 'Chain withdrawal risk control RSA public key',
];
$dogPay = new DogPay($config);

if(!$dogPay->verifyWithdrawRsaSignature($postData)){
    //Failed to verify signature
    exit;
}

//Verify the order information requested by the platform here. If the information is correct, the corresponding information will be as follows
$response = [
    'code' => 0,
    'timestamp' => time(),
    'message' => '',
];
$client = new Client($config);
$sign = $client->encryption($response);
$response['sign'] = $sign;

exit(json_encode($response));
```

Chain ID
--------

[](#chain-id)

Coin NameFull nameBlockchain browser addressChain IDetheth1trxTron2btcbtc3solsolana4xrpxrp5eth\_optimismoptimism10bnbbnb56matic\_polygonMATIC polygon chain137TONToncoin15186Token ID
--------

[](#token-id)

TokenIDValueDescription1ETH-ETHETH Network ETH2ETH-USDTETH Network USDT3TRON-TRXTRON Network TRX4TRON-USDTTRON Network token：USDT5BNB-BNBBNB Smart Chain Network BNB6BNB-USDTBNB Smart Chain Network token：USDT11Polygon-MATICPolygon Network Matic12Polygon-USDTPolygon Network token：USDT13Polygon-USDCPolygon Network token：USDC22BNB-USDCBNB Smart Chain Network token：USDC23BNB-DAIBNB Smart Chain Network token：DAI24ETH-USDCETH Network USDC25ETH-DAIETH Network DAI130Optimism-ETHOptimism Network ETH131Optimism-WLDOptimism Network token：WLD132Optimism-USDTOptimism Network token：USDT100BTC-BTCBTC Network BTC 主链币200TON-TONTON Network TON 主链币

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

3

Last Release

638d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e9e8689b01801748785f80d813f86c5923bf49e02fd909c4c338fb538800385?d=identicon)[jyzhengzifan](/maintainers/jyzhengzifan)

### Embed Badge

![Health badge](/badges/dogpay-chain/health.svg)

```
[![Health](https://phpackages.com/badges/dogpay-chain/health.svg)](https://phpackages.com/packages/dogpay-chain)
```

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
