Skip to content plugins
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
litepay_ch.php class for our Merchant & Payment API

This is php class for our Merchant & Payment API. This extenstion allows to easily accept bitcoins (and other cryptocurrencies such as Litecoin, Cash & more) at your website.

To successfully use this class, you need to import it in your project & call it. If you want to use our Merchant API, you will need to Register for Merchant and create a VENDOR ID.


Our api requires some info from you, to be able to generate a address for your payment;

$method -> Use 'btc' / 'ltc' / 'zec' / 'bch' / 'bsv' as a value for parameter method, based on entered value a Bitcoin, Litecoin, Zcash, Bitcoin Cash, Bitcoin SV address will be generated

$address -> Your Receiving Bitcoin/Litecoin/Zcash/BCASH/BitcoinSV Address (Where you would like the payment to be sent)

$callback_url - The callback URL to be notified when a payment is received. Remember to URL Encode the callback URL when calling the create method. The domain must be valid, or else your request will be denied.

$callback_req - It allows you to choose if you want to get a callback from our system. 0 for no, 1 for yes (Default is 1) (If you choose to not receive a callback, set it to 0 and do not send a url.)


Payment API:

include('litepay_ch.php'); //in your file
$litepay = new litepay('api'); //using payment API 
$_secret = 'my_secret_passphrase';
$invoice_id = '123_order_number'; 
$callback_url =  ''.$invoice_id.'&secret='.$_secret; 

$method = 'btc';
$return_address = '1BDesouFJaHyr7DejtGrq7K14D5gSbS4DT';

$parameters = array(
    'callback'=> urlencode($callback_url),

$new_address = $litepay->receive($parameters);
if($new_address->status == "success") { 
    $address = $new_address->input_address;

Merchant API:

  1. Go to and register for a merchant
  2. Go to vendor id & create a vendor & passphrase, you will receive them on your email
$litepay = new litepay('merchant'); //using Merchant API 

$invoice_id = 22;

//always have a valid domain in callback/return
$callback_url = ''.$invoice_id;
$return_url = '';

$parameters = array(
    'vendor' => 'VENDOR_ID',
    'invoice' => $invoice_id,
    'secret' => 'PASSPHRASE',
    'price' => '2',
    'callbackUrl' => urlencode($callback_url),
    'returnUrl' => urlencode($return_url)

$data = $litepay->merchant($parameters);
if ($data->status == 'success') {
 header("Location: $data->url");   
} else {
 print $data->message;



These plugins has been developed by
More info on our API here:
If you need any further support regarding our services you can contact us via:
Twitter: @litepaych

You can’t perform that action at this time.