Crypto Payment Integration In Laravel Websites
CoinRemitter’s Laravel plugin is easy to integrate and lets businesses accept cryptocurrency payments on their Magento-based website.
Laravel
Integrate CoinRemitter In Laravel
While taking a business on a global level, the payment method plays an important role. While accepting crypto payments, having a hassle-free payment method is a must. Crypto payment plugins do this for businesses.
Basically, Laravel is a PHP framework in which CoinRemitter can be integrated to process crypto transactions. This plugin will help merchants accept crypto payments without making customers leave their Laravel websites.
Merchants can integrate the Laravel plugin using the Laravel Composer. Most of the payment integration in Laravel contains simple coding. Here is how you can integrate crypto payments into Laravel using CoinRemitter’s plugin:
Installation Guide:
You can install the Coinremitter plugin using Laravel Composer:
composer require coinremitter/laravel
Register your config / app.php service provider, as below:
Add Coinremitter\CoinremiterServiceProvider: class line at the bottom of the provider's array.
'providers' => [
Coinremitter\CoinremiterServiceProvider::class,
]
Use the following command to publish the configuration file to configure folder:
php artisan vendor:publish --provider="Coinremitter\CoinremiterServiceProvider"
Set credentials of all coins you want to use from Coinremitter in config/coinremitter.php such as:
If this file doesn't exist then create and set the configuration like this. How to get Password and API key?
Note: Include specific coins in coinremitter.php that you wish to utilize in your system.
return [
'BTC'=>[
'API_KEY'=>'YOUR_API_KEY_FROM_COINREMITTER_WALLET',
'PASSWORD'=>'YOUR_PASSWORD_FOR_WALLET',
],
'LTC'=>[
'API_KEY'=>'YOUR_API_KEY_FROM_COINREMITTER_WALLET',
'PASSWORD'=>'YOUR_PASSWORD_FOR_WALLET',
],
];
Library Usage:
You must include package namespace wherever you prefer to use this library, such as:
use Coinremitter\Coinremitter;
After using the namespace to access all library methods by creating class objects like,
$btcWallet = new Coinremitter('BTC');
Here "BTC" must be in the config/coinremitter.php file array.
Get Wallet Balance
Get the balance of your wallet using a get_balance call.
$balance = $btcWallet->getBalance();
This will return either a response to success or a response to an error if anything went wrong.
{
"success": true,
"data": {
"wallet_id": "6746c765xxxxxxxxxxxxxx",
"wallet_name": "BTC-wallet",
"coin_symbol": "BTC",
"coin": "Bitcoin",
"coin_logo": "https://api.coinremitter.com/assets/images/coins/32x32/BTC.png",
"blockchain_network_name": "Bitcoin Network",
"contract_address": "",
"contract_address_url": "",
"explorer_url": "https://www.blockchain.com/explorer/transactions/btc/",
"chain_id": "",
"remaining_withdraw_limit_24h": "49",
"balance": "1.73000000",
"minimum_deposit_amount": "0.1"
}
}
Over 38,000 merchants are using CoinRemitter
Join them now