forgingblock/forgingblock-php

ForgingBlock Crypto Payment Gateway PHP API library

Maintainers

Package info

github.com/forgingblock/ForgingBlock-php-lib

pkg:composer/forgingblock/forgingblock-php

Statistics

Installs: 30

Dependents: 0

Suggesters: 0

Stars: 27

Open Issues: 0

dev-master 2021-12-01 06:51 UTC

This package is not auto-updated.

Last update: 2026-04-17 02:21:44 UTC


README

The official PHP library for the ForgingBlock API.

PHP versions

PHP version 5.4 and above are supported.

Documentation

For more details visit ForgingBlock API docs.

Installation

Install with composer:

composer require forgingblock/forgingblock-php

Usage

use Forgingblock\ApiClient;

//$payment_mode are test or live
$forgingblock = new ApiClient($payment_mode);
$forgingblock->SetValue('trade',  $trade);
$forgingblock->SetValue('token', $token);
$forgingblock->SetValue('amount', round($amount, 2));								
$forgingblock->SetValue('currency',$currency_code);		
$forgingblock->SetValue('link', $returnURL);
$forgingblock->SetValue('notification', $notifyURL);
$forgingblock->SetValue('order', $order_id);
$forgingblock->CreateInvoice();				
$InvoiceURL = $forgingblock->GetInvoiceURL();
if ($InvoiceURL) header('Location: '.$InvoiceURL);
else echo  $forgingblock->GetError();

Notifications

use Forgingblock\ApiClient;
$forgingblock = new ApiClient($payment_mode);
$forgingblock->SetValue('trade',  $trade);
$forgingblock->SetValue('token', $token);
$forgingblock->SetValue('invoice', $invoice_id);		
		
$forgingblock->CheckInvoiceStatus();
$payment_status = $forgingblock->GetInvoiceStatus();