christianbraybrooke/stripe-laravel-payment-intents
Composer 安装命令:
composer require christianbraybrooke/stripe-laravel-payment-intents
包简介
README 文档
README
This package is still under development, and will require some more documentation. For help, please email chris@purplemountmedia.com.
Composer
First, require the package from packagist.org using the snippet below in the terminal. Laravel 5.5 and greater will autoload our Service provider.
composer require christianbraybrooke/stripe-laravel-payment-intents
Database
By default we will store all transactions in the database using the payment_records table. If this is not desirable, please place the following in your \App\Providers\AppServiceProvider's boot method.
use ChrisBraybrooke\LaravelStripePaymentIntent\Facades\StripePaymentIntent; /** * Bootstrap any application services. * * @return void */ public function boot() { StripePaymentIntent::dontSavePaymentRecords(); }
Next, you will need to publish the required migrations & migrate.
php artisan vendor:publish --tag="payment-migrations"
php artisan migrate
Stripe
In order for us to be able to communicate with Stripe, you will need to add your API keys to the .env file, if you haven't done so already. You will find your keys here https://dashboard.stripe.com/apikeys
STRIPE_KEY=### STRIPE_SECRET=###
Usage
Payment Form
Out of the box, we give you a simple payment form component which will allow you to get up and running in no time. Simply add the payment feilds and scripts components to the desired page and you are good to go!
@paymentFields([ // Amount in lowest currency (pence, cents etc.). // Currency in valid currency code. // Success URL is the route we will post to completed form data to. 'amount' => 12500, 'currency' => 'GBP', 'successUrl' => route('payment.submit') ]) @endpaymentFields // Somewhere towards the footer @paymentScripts() @endpaymentScripts
Customisation
Currently, there are two things you can do to change the look of the payment form. These can be registered in your \App\Providers\AppServiceProvider's boot method.
use ChrisBraybrooke\LaravelStripePaymentIntent\Facades\StripePaymentIntent; /** * Bootstrap any application services. * * @return void */ public function boot() { // Will give the inputs on the payment form a class of: 'form-control' StripePaymentIntent::setInputClass('form-control'); // Will change the colour of elements like the submit button. StripePaymentIntent::setThemeColor('#efefef'); }
christianbraybrooke/stripe-laravel-payment-intents 适用场景与选型建议
christianbraybrooke/stripe-laravel-payment-intents 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6 次下载、GitHub Stars 达 1, 最近一次更新时间为 2019 年 08 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 christianbraybrooke/stripe-laravel-payment-intents 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 christianbraybrooke/stripe-laravel-payment-intents 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-08-19