evasquez/laravel-braintree
Composer 安装命令:
composer require evasquez/laravel-braintree
包简介
README 文档
README
Installation
In your Laravel project's composer.json file, add laravel-braintree as a dependency in the require object:
"evasquez/laravel-braintree": "dev-master"
You do not need to add any other dependencies, as laravel-braintree loads in the other dependencies automatically.
Finally, do a composer update.
Once installed, add the ServiceProvider to your provider array within app/config/app.php:
'providers' => array( 'Evasquez\LaravelBraintree\LaravelBraintreeServiceProvider' )
Configuration
To publish a boilerplate configuration file, run:
php artisan config:publish evasquez/laravel-braintree
Then open app/config/packages/evasquez/laravel-braintree/braintree.php to setup your environment and keys:
<?php return array( 'environment' => 'sandbox', 'merchantId' => 'my-merchant-id', 'publicKey' => 'my-public-key', 'privateKey' => 'my-private-key', 'clientSideEncryptionKey' => 'my-client-side-encryption-key', );
You can setup different environmental configurations by creating matching folders inside the app/config/packages/evasquez/laravel-braintree directory. For instance, if you have a local environment, add a config file at app/config/packages/evasquez/laravel-braintree/local/braintree.php for that environment.
Usage
Once setup, you can use the Braintree PHP classes as spelled out in the documentation.
braintree.js
If you are using braintree.js, you can easily output your client side encryption key in your Blade views:
<script type="text/javascript" src="https://js.braintreegateway.com/v2/braintree.js"></script> <script type="text/javascript"> var braintree = Braintree.create("@braintreeClientSideEncryptionKey"); ... </script>
Credits
Thanks to the bradleyboy/laravel-braintree package, as I used it as a starting point.
evasquez/laravel-braintree 适用场景与选型建议
evasquez/laravel-braintree 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 19 次下载、GitHub Stars 达 1, 最近一次更新时间为 2015 年 07 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 evasquez/laravel-braintree 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 evasquez/laravel-braintree 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 19
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2015-07-15