<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
funnydevjsc / cryptomus-laravel-integrate example snippets
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',
];
}
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']);
});
}
php
namespace App\Console\Commands;
use FunnyDev\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
);
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.