# Subscription Module
The purpose of this module is to provide a starting point for applications that wish to charge users a monthly subscription fee for access to certain features of the site. This is implemented using [Stripe](https://stripe.com).
### Features Supported
- After registering an account, users will be redirected to the page for subscribing using a credit card.
- Pages protected by `SubscriptionRoute` will be redirected to the subscribe page if no subscription is found.
- Navigation items using the `SubscriptionNav` component will only appear to active subscribers.
- Subscribers in this boilerplate are provided access to a super special magic number, whose GraphQL query is protected and available only to subscribers.
- After subscribing, the user will be charged $10 a month.
- Users can update their card details from the profile page.
- Users can cancel their subscription.
- When a subscription charge fails, an email is sent to the user via a webhook.
- When a subscription is canceled after several failed attempts to charge, an email is sent to the user via a webhook.
- In development, [stripe-local](https://github.com/jsonmaur/stripe-local) is used to query for Stripe events and POSTs them to the webhook endpoint.
### Getting Started
1. Sign up for a [Stripe](https://stripe.com) developer account.
2. Ensure subscriptions are enabled in `config/subscription.js`.
3. Place your Stripe publishable key in `config/subscription.js`.
4. Place your Stripe secret key in your `.env` file (stripe endpoint secret not needed right away).
5. Run `yarn stripe:setup`, which will create a subscription plan for you using Stripe's API.
6. Start the app, register a new user, and go through the subscription creation process.
### Deployment
Before deploying, you will need to create an actual webhook endpoint inside the Stripe management console (cannot be automated). The two events currently supported are `customer.subscription.deleted` and `invoice.payment_failed`. At this point, you could choose to provide a stripe endpoint secret in your `.env` file, but it is not necessary. It helps prevent fraudulent webhooks from being processed.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
【资源说明】 毕业设计 基于区块链的全球汇款源码+详细文档+全部资料(高分项目).zip毕业设计 基于区块链的全球汇款源码+详细文档+全部资料(高分项目).zip毕业设计 基于区块链的全球汇款源码+详细文档+全部资料(高分项目).zip毕业设计 基于区块链的全球汇款源码+详细文档+全部资料(高分项目).zip 【备注】 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如软件工程、计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载使用,也可作为毕设项目、课程设计、作业、项目初期立项演示等,当然也适合小白学习进阶。 3、如果基础还行,可以在此代码基础上进行修改,以实现其他功能,也可直接用于毕设、课设、作业等。 欢迎下载,沟通交流,互相学习,共同进步!
资源推荐
资源详情
资源评论
收起资源包目录
毕业设计 基于区块链的全球汇款源码+详细文档+全部资料(高分项目).zip (523个子文件)
.babelrc 391B
.babelrc 213B
Dockerfile 334B
.dockerignore 15B
.env 426B
.eslintignore 70B
.eslintrc 205B
.eslintrc 205B
.eslintrc 166B
.eslintrc 166B
.eslintrc 166B
.eslintrc 63B
.eslintrc 58B
.eslintrc 40B
.flowconfig 592B
.gitignore 132B
schema.graphql 3KB
schema.graphql 2KB
schema.graphql 919B
schema.graphql 330B
User.graphql 292B
PostsQuery.graphql 256B
rootSchema.graphql 230B
schema.graphql 197B
Register.graphql 189B
AddPost.graphql 189B
CommentSubscription.graphql 188B
EditUser.graphql 185B
Subscribe.graphql 184B
AddUser.graphql 182B
Login.graphql 168B
PostsSubscription.graphql 168B
UsersQuery.graphql 162B
PostQuery.graphql 162B
UsersState.client.graphql 159B
UpdateOrderBy.client.graphql 140B
ResetPassword.graphql 138B
CancelSubscription.graphql 138B
EditComment.graphql 136B
UpdateFilter.client.graphql 135B
DeleteUser.graphql 134B
AddComment.graphql 132B
AddComment.client.graphql 130B
EditPost.graphql 121B
UsersStateQuery.client.graphql 117B
PostSubscription.graphql 114B
SubscriptionQuery.graphql 106B
CardInfoQuery.graphql 104B
CommentQuery.client.graphql 102B
DeleteComment.graphql 100B
UserQuery.graphql 91B
ForgotPassword.graphql 90B
CurrentUserQuery.graphql 85B
Profile.graphql 78B
FilesQuery.graphql 78B
UpdateCard.graphql 77B
schema.graphql 75B
UploadFiles.graphql 74B
SubscribersOnlyNumberQuery.graphql 73B
DeletePost.graphql 70B
Contact.graphql 69B
Subscription.graphql 59B
RemoveFile.graphql 57B
Post.graphql 53B
Comment.graphql 51B
schema.graphql 40B
Logout.graphql 29B
ModuleQuery.graphql 18B
favicon.ico 15KB
lodash_v4.x.x.js 133KB
jsdom_vx.x.x.js 87KB
eslint_vx.x.x.js 71KB
react-native-web_vx.x.x.js 65KB
webpack_vx.x.x.js 62KB
eslint-plugin-jsx-a11y_vx.x.x.js 40KB
styled-components_v2.x.x.js 28KB
haul_vx.x.x.js 25KB
eslint-plugin-react_vx.x.x.js 20KB
expo_vx.x.x.js 17KB
reactstrap_vx.x.x.js 15KB
eslint-plugin-flowtype_vx.x.x.js 13KB
resolvers.js 12KB
vector-icons_vx.x.x.js 12KB
eslint-plugin-import_vx.x.x.js 11KB
tcomb_vx.x.x.js 11KB
Post.spec.js 10KB
crud.js 9KB
mocha-webpack_vx.x.x.js 9KB
chai_v4.x.x.js 8KB
bootstrap_vx.x.x.js 8KB
express_v4.x.x.js 8KB
node-sass_vx.x.x.js 8KB
index.js 8KB
sql.js 8KB
spinjs_vx.x.x.js 7KB
babel-core_vx.x.x.js 7KB
exp_vx.x.x.js 7KB
fs-extra_vx.x.x.js 7KB
minilog_vx.x.x.js 7KB
shelljs_vx.x.x.js 6KB
共 523 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
不走小道
- 粉丝: 3246
- 资源: 5112
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功