seunex17/paychant-php

在您的网站上接受加密货币支付的最简单方式

v1.0.3 2021-09-10 20:26 UTC

This package is auto-updated.

Last update: 2024-09-17 22:47:03 UTC


README

简介

Paychant是一个加密货币支付网关。成立于2019年,我们的使命是增加非洲对加密货币支付的采用,提供像现金一样使用加密货币的解决方案,一个让买家可以使用他们喜欢的加密货币来支付卖家(商家)的平台。我们通过提供全面的支付集成和即时支付结算,为商家提供整个加密货币生态系统,支持尼日利亚奈拉、比特币或以太坊。

商户使用的加密货币支付网关API

Paychant API是为那些希望在他们的平台上接受加密货币作为支付方式,但不想具备深厚技术专长并承担与加密货币汇率波动相关的风险的企业而设计的。因此,该API适用于从基本项目到企业级集成等各种应用。

Paychant支付网关提供接受比特币、以太坊和泰达币的过程,并为每个创建的订单生成唯一的地址,为付款人提供实时汇率,并为商家提供管理支付交易和付款的仪表板系统。

我们在网站上实现API进行支付处理的过程非常简单。API凭证可以从Paychant商户仪表板生成。我们还提供了一个沙盒环境,可以使用比特币和以太坊测试网令牌进行API集成测试,这有助于开发者在进入实时模式之前执行测试交易。

网站 (https://paychant.com)

安装

通过Composer

推荐

composer require seunex17/paychant-php

用法

Composer自动加载器

<?php

use ZubDev\Paychant;

require './vendor/autoload.php';

$paychant = new Paychant('ENVIRONMENT', 'YOUR API KEY');

创建新订单

<?php

use ZubDev\Paychant;

require './vendor/autoload.php';

$paychant = new Paychant('ENVIRONMENT', 'YOUR API KEY');

// Create new transaction
$request = [
   'amount' => 100, // Product price
   'currency' => 'NGN', // Available current are (NGN, USD, GBP, EUR, AUD, CAD, JPY, CNY)
   'title' => 'Sample product name', // Title of the order
   'payer_info' => 'johndoe@example.com', // Payer information
   'description' => 'Sample order description', // Description your order
   'cancel_url' => 'https://example.com/cancel', // Page to redirect to when user cancel payment
   'success_url' => 'https://example.com/success', // Page to redirect to for payment verification
   'callback_url' => 'https://example.com/webhook', // Webhook page for instant notification of order status
   //'token' => '', // If you will to generate a custom token you can fill in this Max 50
];

// Send request to payment page
$paychant->createNewOrder($request);

// For debugging if you get blank screen
// Please uncomment below code

// print_r($paychant->createNewOrder($request));

获取订单

<?php

use ZubDev\Paychant;

require './vendor/autoload.php';

$paychant = new Paychant('ENVIRONMENT', 'YOUR API KEY');
$data = $paychant->getOrder('ORDER ID');

echo '<pre>';
print_r($data);
echo '</pre>';

获取所有订单

<?php

use ZubDev\Paychant;

require './vendor/autoload.php';

$paychant = new Paychant('ENVIRONMENT', 'YOUR API KEY');
$data = $paychant->listOrders();

echo '<pre>';
print_r($data);
echo '</pre>';

获取汇率

<?php

use ZubDev\Paychant;

require './vendor/autoload.php';

$paychant = new Paychant('ENVIRONMENT', 'YOUR API KEY');
$data = $paychant->getExchangeRates();

echo '<pre>';
print_r($data);
echo '</pre>';

设置webhook

<?php

use ZubDev\Paychant;

require './vendor/autoload.php';

$webhookKey = 'YOUR WEBHOOK SECRET KEY';
$paychant = new Paychant('ENVIRONMENT', 'YOUR API KEY');

/*
* Webhook will always return an array
*/

var_dump($paychant->webhook($webhookKey)); // This return an array

贡献

欢迎贡献,修复错误,添加新功能