mujhtech/laravel-lazerpay
Composer 安装命令:
composer require mujhtech/laravel-lazerpay
包简介
Laravel package for lazerpay api
关键字:
README 文档
README
A Laravel Package for lazerpay api
Installation
To get the latest version of Lazerpay, simply require it
composer require mujhtech/laravel-lazerpay
Or add the following line to the require block of your composer.json file.
"mujhtech/laravel-lazerpay": "1.0.*"
Once Laravel Sendchamp is installed, you need to register the service provider. Open up config/app.php and add the following to the providers key.
'providers' => [ ... Mujhtech\Lazerpay\LazerpayServiceProvider::class, ... ]
If you use Laravel >= 5.5 you can skip this step and go to
configuration
Mujhtech\Lazerpay\LazerpayServiceProvider::class
Also, register the Facade like so:
'aliases' => [ ... 'Lazerpay' => Mujhtech\Lazerpay\Facades\Lazerpay::class, ... ]
Configuration
You can publish the configuration file using this command:
php artisan vendor:publish --provider="Mujhtech\Lazerpay\LazerpayServiceProvider"
A configuration-file named lazerpay.php with some sensible defaults will be placed in your config directory:
<?php return [ /** * Live API url * */ 'baseUrl' => 'https://api.lazerpay.engineering/api/v1', /** * Public Key * */ 'publicKey' => getenv('LAZERPAY_PUBLIC_KEY'), /** * Secret Key * */ 'secretKey' => getenv('LAZERPAY_SECRET_KEY'), ];
Usage
Open your .env file and add your api key like so:
LAZERPAY_PUBLIC_KEY=pk_xxxxx LAZERPAY_SECRET_KEY=sk_xxxxx
If you are using a hosting service like heroku, ensure to add the above details to your configuration variables.
Use Case
/** * Verify transaction * Verify transactions after payments * @return array */ Lazerpay::verifyTransaction(string $reference) /** * Alternatively, use the helper. */ lazerpay()->verifyTransaction(string $reference) /** * Get all coins * @return array */ Lazerpay::getAllCoins() /** * Alternatively, use the helper. */ lazerpay()->getAllCoins() /** * Get coin rate * @query string $coin, string $currency * @return array */ Lazerpay::getCoinRate(string $coin, string $currency) /** * Alternatively, use the helper. */ lazerpay()->getCoinRate(string $coin, string $currency) /** * Get wallet balance * @query string $coin * @return array */ Lazerpay::getWalletBalance(string $coin) /** * Alternatively, use the helper. */ lazerpay()->getWalletBalance(string $coin) /** * Crypto Transfer * @param string $reference * Unique case sensitive transaction reference. If you do not pass this parameter, Lazerpay will generate a unique reference for you. * @param string $amount * The amount you want to send out * @param string $fromCoin * Crypto you want to swap from * @param string $toCoin * Crypto you want to swap to * @param string $blockchain * The blockchain network you are sending to * @param array $metadata e.g ['type' => "Crypto swap"] * @return array */ Lazerpay::cryptoTransfer(string $reference, string $coin, string $recipient, string $amount, array $metadata, string $blockchain) /** * Alternatively, use the helper. */ lazerpay()->cryptoTransfer(string $reference, string $coin, string $recipient, string $amount, array $metadata, string $blockchain) /** * Crypto Swap * @param string $reference * Unique case sensitive transaction reference. If you do not pass this parameter, Lazerpay will generate a unique reference for you. * @param string $amount * The amount you want to send out * @param string $fromCoin * Crypto you want to swap from * @param string $toCoin * Crypto you want to swap to * @param string $blockchain * The blockchain network you are sending to * @param array $metadata e.g ['type' => "Crypto swap"] * @return array */ Lazerpay::cryptoSwap(string $reference, string $fromCoin, string $toCoin, integer $amount, array $metadata, string $blockchain) /** * Alternatively, use the helper. */ lazerpay()->cryptoSwap(string $reference, string $fromCoin, string $toCoin, integer $amount, array $metadata, string $blockchain) /** * Crypto Swap Amount * This endpoint helps you get the amount you will receive on swap even before initiating the swap * @param string $amount * The amount you want to send out * @param string $fromCoin * Crypto you want to swap from * @param string $toCoin * Crypto you want to swap to * @param string $blockchain * The blockchain network you are sending to * @return array */ Lazerpay::cryptoSwapAmount(string $fromCoin, string $toCoin, string $amount, string $blockchain) /** * Alternatively, use the helper. */ lazerpay()->cryptoSwapAmount(string $fromCoin, string $toCoin, string $amount, string $blockchain) /** * Get all payment links * @return array */ Lazerpay::getPaymentLinks() /** * Alternatively, use the helper. */ lazerpay()->getPaymentLinks() /** * Fetch payment link * @param string $reference or id * @return array */ Lazerpay::fetchPaymentLink(string $reference) /** * Alternatively, use the helper. */ lazerpay()->fetchPaymentLink(string $reference) /** * Create Payment link * With payment links, you can share your unique payment link to anyone in the world. * @param string $amount * Amount the user will pay * @param string $currency * Payment page currency * @param string $title * The title of the link * @param string $description * Description of the payment page * @param string $logo * Your logo url * @param string $type * Payment links type default is "standard" * @return array */ Lazerpay::createPaymentLink(string $title, string $description, string $type = 'standard', string $logo, string $amount, string $currency, string $redirect_url) /** * Alternatively, use the helper. */ lazerpay()->createPaymentLink(string $title, string $description, string $type = 'standard', string $logo, string $amount, string $currency, string $redirect_url) /** * Update Payment link * Update a particular payment link with the following endpoint. * @param string $reference * Id or reference * @param string $amount * Amount the user will pay * @param string $currency * Payment page currency * @param string $title * The title of the link * @param string $description * Description of the payment page * @param string $logo * Your logo url * @param string $type * Payment links type default is "standard" * @return array */ Lazerpay::updatePaymentLink(string $reference, string $title, string $description, string $type = 'standard', string $logo, string $amount, string $currency, string $redirect_url) /** * Alternatively, use the helper. */ lazerpay()->updatePaymentLink(string $reference, string $title, string $description, string $type = 'standard', string $logo, string $amount, string $currency, string $redirect_url)
License
The MIT License (MIT). Please see License File for more information.
mujhtech/laravel-lazerpay 适用场景与选型建议
mujhtech/laravel-lazerpay 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7 次下载、GitHub Stars 达 1, 最近一次更新时间为 2022 年 06 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「payment」 「github」 「crypto」 「laravel」 「open source」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mujhtech/laravel-lazerpay 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mujhtech/laravel-lazerpay 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mujhtech/laravel-lazerpay 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Handles basic OAuth/OAuth2 authentication along with classes for common services
MediaWiki extension that allows embedding external content, specified by URL, into your wiki pages
Laravel package for the simplification and integration of many of your users most wanted login providers. Installation is a breeze. Never worry about OAuth again.
GitHub Webhook Listener with plugin-based API for creating your own triggerered actions
Creates a markdown changelog for your GitHub repository.
Lightweight Application To Convert WordPress Readme Into Github Markdown
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-06-05