Integrate Blockonomics bitcoin payment gateway in PHP

Integrate Blockonomics bitcoin payment gateway in PHP

Blockonomics Bitcoin payment gateway is the only in the e-commerce industry to allow full decentralization. Purchases made on your website are sent to your account directly, rather than to a wallet for payment gateways. Not only does this save you fees when taking out your coins, but it also allows you to take ownership of your revenue without the need for a middle man. Never lose income from wallet hacks payment gateway-be your own bank!

Why Blockonomics bitcoin payment gateway?

The fastest and easiest way to start accepting Blockonomics Bitcoin payments on your online eCommerce website. Blockonomics has helped thousands of eCommerce sites increase sales since 2015, by including Bitcoin, Ethereum and Litecoin as their customers ‘ payment option.

In this article, I will explain to you how to integrate the Blockonomics payment gateway to accept bitcoin payment using PHP.

Step-1: Before starting first, create your merchant account with https://www.blockonomics.co/

Step-2: Create a Database Configuration file (dbconfig.php)

Step-3: Create a database table to store transaction details

copy and paste the following MySQL database query script to create a ‘transaction_details’ table.

In the above,

tnx_id = Transaction id,

address = Bitcoin payment address,

value= Total order amount in USD,

bits= Total order amount in bitcoin,

status = payment status (-1= pending, 2= success)

Step-4: Create your callback page (callback.php)

Copy and paste below code to update transaction status after payment.

Step-5: Create Blockonomics Configurations file (blockConfig.php)

Copy and paste below Blockonomics Configurations code in blockConfig.php file

Step-6: How to get API_KEY and set Callback URL

Blockonomics bitcoin payment gateway

Callback URL should be like

Step-7: Create a payment page (payment.php)

When your e-commerce website will process checkout then you need to store cart items details and customer details into the database. After inserting the order details, you need to get generated order id and pass generated order id and total order amount to payment.php file.

In the above code, you can see I used ajax to check payment status. After success payment, I am redirecting the customer to thankyou.php page.

Step-8: Create a page (ajax_payment_success.php )

Copy and paste below code to check payment status after every second interval

Step-9: Create a page (thankyou.php)

After successful payment redirect the customer to thank you page where you can show order details

Step-10: Create a page (error.php)

ALSO READ: Authorize.Net Payment Gateway Integration using PHP

ALSO READ: Integrate Recurring Stripe Subscription Payment with PHP

Conclusion:

This is the simple and easy steps to Integrate the Blockonomics bitcoin payment gateway in PHP. You can modify and customize code as per your requirement.

Are you want to get implementation help, or modify or extend the functionality of this script? Submit a paid service request

Related posts