dv-net/dv-net-php-client 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

dv-net/dv-net-php-client

最新稳定版本:v0.9.7

Composer 安装命令:

composer require dv-net/dv-net-php-client

包简介

A convenient way to integrate DV.net to your platform

README 文档

README

A PHP client for DV Net API integration.

Extended documentation

You can find extended documentation at https://docs.dv.net/

Installation

composer require dv-net/dv-net-php-client

Setup

Initialize the client with your API configuration:

// Create HTTP client (you can use the built-in SimpleHttpClient or your own implementation) $httpClient = new SimpleHttpClient(); // Initialize the merchant client with your API host $client = new MerchantClient( httpClient: $httpClient, host: 'https://api.example.com' // Your DV Net API host ); // Alternatively, you can pass the host in each request: $client = new MerchantClient( httpClient: $psrHttpClient, xApiKey: 'your-api-key', host: 'https://api.example.com' );

Usage

Signature Verification

Verify the authenticity of request signatures:

$merchantUtilsManager = new MerchantUtilsManager(); $isValid = $merchantUtilsManager->checkSign( clientSignature: 'received-signature-hash', clientKey: 'your-client-key', requestBody: ['data' => 'request-payload'] ); // Returns boolean indicating if the signature is valid

Exchange Balances

Get the total exchange balances across all currencies:

$client = new MerchantClient($httpClient, $host); $response = $client->getExchangeBalances( xApiKey: 'your-api-key' ); // Returns TotalExchangeBalanceResponse object with total USD value and individual currency balances

External Wallet

Create or retrieve an external wallet for a user:

$response = $client->getExternalWallet( xApiKey: 'your-api-key', email: 'user@example.com', ip: '127.0.0.1', storeExternalId: 'store-123', amount: '100.00', currency: 'USD' ); // Returns ExternalAddressesResponse object with wallet details and payment URL

Processing Wallets Balances

Get balances for all processing wallets:

$balances = $client->getProcessingWalletsBalances( xApiKey: 'your-api-key' ); // Returns ProcessingWalletBalancesResponse object with detailed balance information

Store Currencies

Get list of available currencies for the store:

$currencies = $client->getStoreCurrencies( xApiKey: 'your-api-key' ); // Returns CurrenciesResponse object with detailed currency information

Store Currency Rate

Get current exchange rate for a specific currency:

$rate = $client->getStoreCurrencyRate( xApiKey: 'your-api-key', currencyId: 'BTC' ); // Returns CurrencyRate object with current rate and source information

Withdrawal Processing Status

Check the status of a withdrawal:

$status = $client->getWithdrawalProcessingStatus( xApiKey: 'your-api-key', withdrawalId: 'withdrawal-123' ); // Returns ProcessingWithdrawal object with detailed withdrawal status

Initialize Transfer

Initialize a new withdrawal transfer:

$withdrawal = $client->initializeTransfer( xApiKey: 'your-api-key', addressTo: '0x123...', currencyId: 'ETH', amount: '1.5' ); // Returns WithdrawalResponse object with transfer details

Webhook Processing

Process incoming webhooks:

$mapper = new WebhookMapper(); $webhook = $mapper->mapWebhook($rawWebhookData); // Returns either ConfirmedWebhook or UnconfirmedWebhook object

统计信息

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

GitHub 信息

  • Stars: 15
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固