ahadcove/cashier-braintree

Laravel Cashier 提供了一个表达性、流畅的接口,用于 Braintree 的订阅计费服务。

v11.0.0 2024-08-13 16:29 UTC

README

Build Status Total Downloads Latest Stable Version Latest Unstable Version License

简介

Laravel Cashier Braintree 提供了一个表达性、流畅的接口,用于访问 Braintree 的订阅计费服务。它几乎处理了你可能不想亲自编写的所有订阅计费模板代码。除了基本的订阅管理外,Cashier Braintree 还可以处理优惠券、订阅互换、宽限期取消以及生成发票 PDF。

支持

支持 PHP ^7.2, Laravel ~6.12|~6.13|~6.14, 和 phpunit ~8.0

测试

为了运行库的测试,你需要在本地以及 Braintree 账户中设置以下详细信息。

本地

环境变量

BRAINTREE_MERCHANT_ID=
BRAINTREE_PUBLIC_KEY=
BRAINTREE_PRIVATE_KEY=
BRAINTREE_MODEL=Laravel\Cashier\Tests\User

你可以在 phpunit.xml.dist 文件中设置这些变量。

Braintree

计划

* Plan ID: monthly-10-1, Price: $10, Billing cycle of every month
* Plan ID: monthly-10-2, Price: $10, Billing cycle of every month
* Plan ID: yearly-100-1, Price: $100, Billing cycle of every 12 months

折扣

* Discount ID: coupon-1, Price: $5
* Discount ID: plan-credit, Price $1

官方文档

Cashier Braintree 的文档可以在 Laravel 网站 上找到。

提交构建

* Update composer.json to include new php version
* Checkout branch for version that you want
* Create a git tag with the version
* That's it. It will auto be updated on packagist and you can now install it in your app