项目作者: CubePayIO

项目描述 :
CubePay API library for PHP, a third-party cryptocurrency payment gateway.
高级语言: PHP
项目地址: git://github.com/CubePayIO/cubepay-php.git
创建时间: 2018-09-25T08:12:08Z
项目社区:https://github.com/CubePayIO/cubepay-php

开源协议:

下载


CubePay API standard library for PHP

A third-party cryptocurrency payment gateway.

Make it easy for receiving cryptocurrency!

More information at https://cubepay.io.

API Document

https://document.cubepay.io

Installation

  • The minimum required PHP version of Yii is PHP 5.4.
  • It works best with PHP 7.
  1. $ php composer.phar require cubepay/cubepay-api-library

Usage

Initialization

  1. use CubePay\CubePay;
  2. $cubepay = new CubePay(CLIENT_ID, CLIENT_SECRET, URL);

Get available cryptocurrencies

You can use these currencies at payment API for receive/send coin.

  1. $response = $cubepay->getCoin();

Get available fiat currenies.

You can only use these fiat currencies for your product’s original list price. We’ll convert value by exchange rate between currency of list price and currency of actual paid.

  1. $response = $cubepay->getFiat();

Do Payment

Render a page with these payment information:

  • Your shop information
  • Item name
  • Payable coin list and corresponding price.
  1. $response = $cubepay->doPayment($sourceCoinId, $sourceAmount, $itemName, $merchantTransactionId, $other = null, $returnUrl = null, $ipnUrl = null, $sendCoinId = null, $sendAmount = null, $receiveAddress = null);

Init payment With specific coin

Initial payment with specific coin. The payment will expire after 6 hours.

  1. $response = $cubepay->doPaymentByCoinId($coinId, $sourceCoinId, $sourceAmount, $itemName, $merchantTransactionId, $other = null, $returnUrl = null, $ipnUrl = null, $sendCoinId = null, $sendAmount = null, $receiveAddress = null);

Query payment information

Query payment information by specific identity

  1. $response = $cubepay->queryPayment($id = null, $merchantTransactionId = null);