think.studio/laravel-cashier-tools
最新稳定版本:2.2.1
Composer 安装命令:
composer require think.studio/laravel-cashier-tools
包简介
Set of utils what not added to main laravel cashier stripe package.
README 文档
README
Installation
Install the package via composer:
composer require think.studio/laravel-cashier-tools
Usage
Create promotion codes command
php artisan cashier-tools:api:create:promotion-codes COUPON_ID_2021 -P "2021$" >> codes.txt php artisan cashier-tools:api:create:promotion-codes COUPON_ID_2021 -S 20 -C 100 --p_max_redemptions=10 --stripe-secret=sk_live_4FL... >> codes.txt
Use helper for checkout redirect url
Builder to support redirect url params: (Like '{CHECKOUT_SESSION_ID}')
$url = route('cpd.account.index'); $subscription->allowPromotionCodes() ->checkout([ 'success_url' => StripeCheckoutUrlBuilder::prepareSuccessUrl($url), 'cancel_url' => StripeCheckoutUrlBuilder::prepareCancelUrl($url), ]); $subscription->checkout([ 'success_url' => StripeCheckoutUrlBuilder::make($url) ->withSessionId() ->useResultStatus('foo') ->url(), 'cancel_url' => StripeCheckoutUrlBuilder::make($url) ->useResultStatus('bar') ->url(), ]);
Use dashboard router
DashboardRouter::fromConfig()->productsUrl() DashboardRouter::fromConfig()->productsUrl($stripeProduct->id) (new DashboardRouter(true))->promotionCodesUrl($promotionCode->id)
Credits
统计信息
- 总下载量: 26
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-20