Laravel package for cryptomus.com
cryptopayment/cryptomus-laravel-integrate-market is a Laravel package for laravel package for cryptomus.com.
It currently has 0 GitHub stars and 3 downloads on Packagist.
Install it with composer require cryptopayment/cryptomus-laravel-integrate-market.
Discover more Laravel packages by cryptopayment
or browse all Laravel packages to compare alternatives.
Last updated
The free Laravel package to help you integrate payment with cryptomus.com
If you prefer to install this package into your own Laravel application, please follow the installation steps below
https://laravel.com/docs/installation
composer require funnydevjsc/cryptomus-laravel-integrate
php artisan vendor:publish --provider="cryptopayment\Cryptomus\CryptomusServiceProvider" --tag="cryptomus"
If publishing files fails, please create corresponding files at the path config/cryptomus.php and app\Http\Controllers\CryptomusControllers.php from this package. And you can also further customize the CryptomusControllers.php file to suit your project.
After publishing the package assets a configuration file will be located at config/cryptomus.php. Please contact cryptomus.com to get those values to fill into the config file.
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
// Other kernel properties...
/**
* The application's route middleware groups.
*
* @var array
*/
protected $routeMiddleware = [
// Other middlewares...
'cryptomus' => 'App\Http\Middleware\CryptomusMiddleware',
];
}
<?php
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\CryptomusController;
// Other routes properties...
Route::group(['middleware' => ['cryptomus']], function () {
Route::post('/cryptomus/webhook', [CryptomusController::class, 'webhook']);
});
}
Then your IPN (Webhook) URL will be something like https://yourdomain.ltd/api/cryptomus/webhook, and you should provide it to Cryptomus's account setting. You could provide it to routes/web.php if you want but remember that Cryptomus will check for referer matched with the pre-registration URL. So make sure that you provide them the right URL of website.
<?php
namespace App\Console\Commands;
use cryptopayment\Cryptomus\CryptomusSdk;
use Illuminate\Console\Command;
class CryptomusTestCommand extends Command
{
protected $signature = 'cryptomus:test';
protected $description = 'Test Cryptomus SDK';
public function __construct()
{
parent::__construct();
}
public function handle()
{
$instance = new CryptomusSdk();
echo $instance->create_payment(
'INV-test-01',
100,
'USDT',
'BSC',
'INV-test-01',
'https://yourdomain.ltd/invoices/INV-test-01',
'https://yourdomain.ltd/invoices/INV-test-01',
'https://yourdomain.ltd/invoices/INV-test-01?success=true' // Remember that param success=true or any similar is just for toast notification, do not put any logical process here
);
}
}
Please see CONTRIBUTING for details.
If you discover any security related issues, use the issue tracker.
The MIT License (MIT). Please see License File for more information.