pecunia-wallet/pecunia-sdk-php 问题修复 & 功能扩展

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

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

pecunia-wallet/pecunia-sdk-php

最新稳定版本:v1.0.0

Composer 安装命令:

composer require pecunia-wallet/pecunia-sdk-php

包简介

Pecunia Wallet PHP SDK

README 文档

README

Packagist Version License PHP Version

This SDK provides an easy way to interact with Pecunia Wallet REST API. Consult it for rich details.

Installation

Install via Composer:

$ composer require pecunia-wallet/pecunia-sdk-php

Usage

require 'vendor/autoload.php';

// Initialize client
$client = new \Pecunia\Client('your-api-token-here');

// Get all invoices
$invoices = $client->getAllInvoices();
foreach ($invoices as $invoice) {
    echo "Invoice ID: {$invoice->id}, Requested Amount: {$invoice->amount->requested}\n";
}

// Create new invoice
$newInvoiceRef = $client->createInvoice([
    'amount' => '10',
    'sourceCurrency' => 'USD',
    'lifeTime' => 'PT1H', // 1 hour
    'availableCoins' => ['BTC', 'LTC']
]);

// Invoice details
$invoiceDetails = $client->getInvoice($newInvoiceRef->id);

// Get a payment link for the user
$paymentUrl = $newInvoiceRef->paymentUrl; // or $invoiceDetails->paymentUrl

// Verify callback signature
$payload = "request-body";              // Raw callback body
$header = "request-x-signature-header"; // X-Signature header
$secret = "your-callback-secret-here";  // Your callback secret

$ver = \Pecunia\Callback::verifySignature(
    $payload,
    $header,
    currentSecret: $secret,
    previousSecret: $secret // Previous secret is optional but supported for rotation
);

if ($ver) {
    echo "Verified signature with " . ($ver == 'v0' ? 'previous' : 'current') . "secret";
} else {
    echo "Failed to verify the signature.\n";
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固