Download the PHP package cryptapi/php-cryptapi without Composer

On this page you can find all versions of the php package cryptapi/php-cryptapi. 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 php-cryptapi

CryptAPI

CryptAPI's PHP Library

Official PHP library of CryptAPI

Table of Contents

  1. Requirements
  2. Installation
  3. API and utils
  4. Help

Requirements:

Installation

on GitHubon Composer

API and utils

Generating a new address

Where:

$coin is the coin you wish to use, from CryptAPI's supported currencies (e.g 'btc', 'eth', 'erc20_usdt', ...) $my_address is your own crypto address, where your funds will be sent to $callback_url is the URL that will be called upon payment $parameters is any parameter you wish to send to identify the payment, such as ['order_id' => 1234] $cryptapi_params parameters that will be passed to CryptAPI (check which extra parameters are available here: https://docs.cryptapi.io/#operation/create) $payment_address is the newly generated address, that you will show your users $api_key is the API Key provided by BlockBee, since this library is also compatible with BlockBee API.

With get_address() you will be creating the request in our API using this endpoint: https://docs.cryptapi.io/#operation/create.

Response sample:

Getting notified when the user pays

The URL you provided earlier will be called when a user pays, for easier processing of the request we've added the process_callback helper

The $payment_data will be an array with the following keys:

address_in - the address generated by our service, where the funds were received

address_out - your address, where funds were sent

txid_in - the received TXID

txid_out - the sent TXID or null, in the case of a pending TX

confirmations - number of confirmations, or 0 in case of pending TX

value - the value that your customer paid

value_coin - the value that your customer paid, in the main coin denomination (e.g BTC)

value_forwarded - the value we forwarded to you, after our fee

value_forwarded_coin - the value we forwarded to you, after our fee, in the main coin denomination (e.g BTC)

coin - the coin the payment was made in (e.g: 'btc', 'eth', 'erc20_usdt', ...)

pending - whether the transaction is pending, if false means it's confirmed

plus, any values set on $params when requesting the address, like the order ID.

 

From here you just need to check if the value matches your order's value.

Checking the logs of a request

All the data returned in the response can be checked here: https://docs.cryptapi.io/#operation/logs

Response sample:

Generating a QR code

For object creation, same parameters as before. You must first call get_address as this method requires the payment address to have been created.

Where:

$value Value to request the user, in the main coin (BTC, ETH, etc). Optional, pass false to not add a value to the QR.

$size Size of the QR Code image in pixels. Optional, pass false to use the default size of 512.

Response is an object with qr_code (base64 encoded image data) and payment_uri (the value encoded in the QR), see https://docs.cryptapi.io/#operation/qrcode for more information.

Response sample:

Usage

Estimating transaction fees

Where:

$coin is the coin you wish to check, from CryptAPI's supported currencies (e.g 'btc', 'eth', 'erc20_usdt', ...)

$addresses The number of addresses to forward the funds to. Optional, defaults to 1.

$priority Confirmation priority, needs to be one of ['fast', 'default', 'economic']. Optional, defaults to default.

Response is an object with estimated_cost and estimated_cost_usd, see https://docs.cryptapi.io/#operation/estimate for more information.

Response sample:

Converting between cryptocurrencies and FIAT

Where:

$coin the target currency to convert to, from CryptAPI's supported currencies (e.g 'btc', 'eth', 'erc20_usdt', ...)

$value Value to convert in from.

$from Currency to convert from, FIAT or crypto.

Response is an object with value_coin and exchange_rate, see https://docs.cryptapi.io/#operation/convert for more information.

Response sample:

Getting supported coins

Response is an array with all support coins.

Response sample:

Help

Need help?
Contact us @ https://cryptapi.io/contacts/


All versions of php-cryptapi with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
ext-curl Version *
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 cryptapi/php-cryptapi contains the following files

Loading the files please wait ....