payment4/cryptogateway
Composer 安装命令:
composer require payment4/cryptogateway
包简介
Payment4 Crypto Payment Gateway for Laravel
README 文档
README
Payment4 revolutionizes the way businesses transact. Seamlessly accept a variety of digital currencies, ensuring swift, secure, and borderless transactions to empower your global enterprise.
- Streamlined and Efficient
- Promises/A+ Compatibility
- Secure Sandboxing
Installation
You can install the package via composer:
composer require payment4/cryptogateway
Next, you should publish the configuration file using the vendor:publish Artisan command. The configuration file will be placed in your application's config directory.
php artisan vendor:publish --provider="Payment4\CryptoGateway\Payment4ServiceProvider"
Requirements
- php "^7.2|^8.0|^8.1|^8.2|^8.3"
- laravel-framework "^7.0|^8.0|^9.0|^10.0|^11.0"
- Register for Free or Login on the https://payment4.com
- Create new gateway and get apiKey
Configuration
Add your APIKEY in Payment4 config.
'apiKey' => env('PAYMENT4_API_KEY', ''),
furthermore, you can add your APIKEY to .env file, please look at to following example:
PAYMENT4_API_KEY= __YOUR_API_KEY
If you use callbackUrl as static url you can set it here, otherwise, leave it blank.
'callbackUrl' => env('PAYMENT4_CALLBACK_URL', ''),
If you use webhookUrl as static url you can set it here, otherwise, leave it blank.
'webhookUrl' => env('PAYMENT4_WEBHOOK_URL', ''),
languages
'language' => 'EN',
Supported Languages :
- FR
- ES
- AR
- TR
- FA
- EN
Note : non-sensitive to uppercase or lowercase
currency
'currency' => 'USD',
Supported Currencies :
- USD
- EUR
- TRY
- GBP
- AED
- IRT
Note : non-sensitive to uppercase or lowercase
- sandBox
to activation set True
'sandBox' => false,
Usage
Create Payment4 instance
Ex1:
/** * apiKey and sandBox are optional if already set them to config file. */ $initParams = [ 'apiKey' => '######', 'sandBox' => false, ]; $paymentInstance = Payment4($initParams);
Ex2:
$paymentInstance = Payment4();
Requesting a Payment
/** * amount is required * callbackParams, webhookParams, webhookUrl, language, currency are optional. * callbackUrl is optional if already set it to config file. * If no language is provided, the default language is set to 'en'. * If no currency is provided, the default currency is set to 'USD'. */ $amount = 10; $options = [ 'callbackUrl' => "https://your-domain.com/callback", 'callbackParams' => [ 'your key' => 'your value', 'your key' => 'your value', ], 'webhookUrl' => "https://your-domain.com/webhook", 'webhookParams' => [ 'your key' => 'your value', 'your key' => 'your value', ], 'language' => 'EN', 'currency' => 'USD', ]; $response = $paymentInstance->requestPayment($amount, $options); if ($createPayment->status) { return responseSuccess( [ 'url' => $createPayment->data->paymentUrl, ] ); } else { return responseError( [ 'message' => $createPayment->message ?? '', ] ); }
Verifying a Payment
/** * amount and paymentUid are required */ $paymentUid = ''; $amount = 10; $options = [ 'currency' => 'USD', ]; $response = $paymentInstance->verifyPayment($paymentUid, $amount, $options);
Powered by Payment4
payment4/cryptogateway 适用场景与选型建议
payment4/cryptogateway 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 100 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 12 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「payment」 「crypto」 「laravel」 「payment4」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 payment4/cryptogateway 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 payment4/cryptogateway 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 payment4/cryptogateway 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
High-level cryptographic primitives and security utilities for Maatify systems including password hashing, reversible encryption, HKDF key derivation, and key rotation.
Alfabank REST API integration
A simple PHP Cryptography Implementation for the Ark Blockchain.
A simple PHP API client for the Ark Blockchain.
A Laravel bridge for Ark Core.
Laravel Minimal Wallet Plugin
统计信息
- 总下载量: 100
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-12-05