通过laravel在条纹上创建计划 [英] Create plan on stripe through laravel

查看:78
本文介绍了通过laravel在条纹上创建计划的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想根据我的应用程序在条带上创建一个计划.这种情况是,用户需要以不同的价格来支付经常性付款.因此,这就是为什么我要为每个用户创建计划.

I want to create a plan from my application on stripe. The scenario is that users are charged with different prices as recurring payments. So, that is why I want to create plan for each user.

我正在使用 laravel 5 "laravel/cashier": "~5.0"

推荐答案

laravel/cashier只是没有内置此功能.尽管如此,使用Stripe的API很容易,但您也不会感到不走运.作为依赖项下载到您的供应商文件夹中.如果没有,则可以使用composer下载.

laravel/cashier just doesn't have this functionality baked in. You aren't out of luck though as it is easy to just use Stripe's API which should be downloaded as a dependency in your vendor folder. If not you can just download it with composer.

composer require stripe/stripe-php 2.*

您可以将其与

use \Stripe\Plan;

Plan::create(array(
  "amount" => 2000,
  "interval" => "month",
  "name" => "Amazing Gold Plan",
  "currency" => "usd",
  "id" => "gold")
);

您可以在此处了解更多信息- https://stripe.com/docs/api#create_plan

You can read more here - https://stripe.com/docs/api#create_plan

这篇关于通过laravel在条纹上创建计划的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆