cryptopayment/cryptomus-laravel-integrate-market
Composer 安装命令:
composer require cryptopayment/cryptomus-laravel-integrate-market
包简介
Laravel package for cryptomus.com
关键字:
README 文档
README
The free Laravel package to help you integrate payment with cryptomus.com
Use Cases
- Create a payment link with cryptomus.com
- Parse result from cryptomus.com
- Example webhook
Features
- Dynamic cryptomus.com credentials from config/cryptomus.php
- Easy to create payment link with a simple line code
Requirements
- PHP: 8.1 or higher
- Laravel 9.0 or higher
Quick Start
If you prefer to install this package into your own Laravel application, please follow the installation steps below
Installation
Step 1. Install a Laravel project if you don't have one already
https://laravel.com/docs/installation
Step 2. Require the current package using composer:
composer require funnydevjsc/cryptomus-laravel-integrate
Step 3. Publish the controller file and config file
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.
Step 4. Update the various config settings in the published config file:
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.
Step 5. Add middleware protection:
app/Http/Kernel.php
<?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', ]; }
Step 6. Add route:
routes/api.php
<?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.
Testing
<?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 ); } }
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, use the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
cryptopayment/cryptomus-laravel-integrate-market 适用场景与选型建议
cryptopayment/cryptomus-laravel-integrate-market 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 09 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「package」 「payment」 「crypto」 「laravel」 「bitcoin」 「litecoin」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 cryptopayment/cryptomus-laravel-integrate-market 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 cryptopayment/cryptomus-laravel-integrate-market 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 cryptopayment/cryptomus-laravel-integrate-market 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
High-level cryptographic primitives and security utilities for Maatify systems including password hashing, reversible encryption, HKDF key derivation, and key rotation.
Simple ASCII output of array data
Package for view storage in laravel
User Approval Laravel Package
A simple PHP Cryptography Implementation for the Ark Blockchain.
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 46
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-09-30