Download the PHP package noname9/api-php without Composer

On this page you can find all versions of the php package noname9/api-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package api-php

B2BinPay API client for PHP

Accepting Bitcoin, Bitcoin Cash, Ethereum, DASH, Litecoin, Monero, NEO, NEM, Ripple, B2BX and any ERC20, NEO tokens in one place!

Build Status Scrutinizer Code Quality Coverage Status

Requirements

Composer Installation

The easiest way to install the B2BinPay API client is to require it with Composer through command-line:

or by editing composer.json:

Getting started

See example code with comments in public/index.php

Create Provider instance

Use the API key and secret to access your B2BinPay account:

Test Mode

In order to use testing sandbox, pass true as a third parameter for B2Binpay\Provider:

Warning: Sandbox and main gateway have their own pairs of key and secret!

Create a bill

The payment currency is considered to match the currency of your wallet.

Create a new bill:

_where LIFETIME - number of seconds for payment page to live and WALLET_ID - your B2BinPay wallet id._

Now the bill id is available in the $bill->id property. You should store this id with your order.

After storing the bill id you can find an url to the payment page in the $bill->url property.

Finally, you can check bill status by requesting it using the stored id:

The bill status will be stored in $billCheck->status property.

Convert currency

You can get actual rates and convert supported currencies respecting your wallet's parameters.

Get rates for USD:

Convert currency using actual rates:

Now you can provide $amount variable as a second parameter for createBill() method to set an accurate amount of cryptocurrency.

Add markup

You can add some markup to the existing amount.

Set 10% markup for current amount:

Get your wallet's params

You can retrieve your wallet's params to find out actual currency and current amount:

Now your wallet's currency alpha code is stored in the $wallet->currency->alpha parameter.

You can use it for createBill(), addMarkup() and convertCurrency() methods.

Callback

Once bill status changed, our server can send a callback to your configured Callback URL. Also, you can specify Tracking ID, which will return with the callback to identify the exact order. To do that provide additional parameters to createBill() method:

Warning: If specified, your Callback URL should return the message "OK" with status 200. Until that payment will not be considered complete!

Callback verification

You can verify Callback request headers by comparing it with the getAuthorization() method output:

Callback body

Callback request will contain the following data:

List of bill statuses

Status Description
-2 Payment error
-1 Payment lifetime is exceeded
1 Payment pending
2 Payment success
3 Payment freeze
4 Payment closed (funds are withdrawn)

License

B2BinPay\API-PHP is licensed under the MIT License.


All versions of api-php with dependencies

PHP Build Version
Package Version
Requires litipk/php-bignumbers Version ^0.8
guzzlehttp/guzzle Version ^6.3
vlucas/phpdotenv Version ^4.0
php Version ^7
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package noname9/api-php contains the following files

Loading the files please wait ....