yogesh-laravel / stripe
此包用于实现 Stripe API
dev-master
2022-09-16 16:04 UTC
Requires
- stripe/stripe-php: ^9.5
This package is not auto-updated.
Last update: 2024-09-21 19:25:28 UTC
README
如果以下任何一项适用于您的项目,则目录结构应遵循行业标准,命名为以下:
your_Laravel_project/
vendor/
安装
通过 Composer
$ composer require yogesh-laravel/stripe
$ composer dump-autoload
Add Environment Key STRIPE_SECRET_KEY in .env
Add Environment Key STRIPE_CURRENCY in .env
用法
use yogeshlaravel\stripe\StripeHelper;
计划 API 使用
StripeHelper::createPlan($amount,$product_name);
StripeHelper::updatePlan($stripe_price_id,$order_id);
StripeHelper::deletePlan($stripe_price_id);
客户 API 使用
StripeHelper::addCustomer($user);
StripeHelper::updateCustomer($user);
StripeHelper::getCustomer($stripe_customer_id);
卡 API 使用
StripeHelper::createCard($stripe_customer_id, $card_token);
StripeHelper::allCards($stripe_customer_id,$limit);
StripeHelper::deleteCard($stripe_customer_id, $cardId);
订阅 API 使用
StripeHelper::createSubscription($stripe_customer_id, $stripe_price_id);
StripeHelper::updateSubscription($stripe_subscription_id, $stripe_price_id);
StripeHelper::cancelSubscription($user);
收费 API 使用
StripeHelper::createDirectCharge($cardToken, $amount, $desc=null);
StripeHelper::createCharge($stripe_customer_id, $cardId, $amount, $desc=null);
StripeHelper::createRefund($charge_id);
价格 API 使用
StripeHelper::createPrice($amount,$product_name);
安全
如果您发现任何与安全相关的问题,请发送电子邮件至 yrana8786@gmail.com,而不是使用问题跟踪器。
致谢
- [kumarashok30592@gmail.com]