【发布时间】:2018-05-31 17:04:26
【问题描述】:
我有一个订阅计划的应用程序路径,我想阻止尚未确认使用条带付款的客户访问它,例如我有一个 10 美元的计划,任何在 24 小时内支付 10 美元的人都可以访问该页面
@app.route('/plan10', methods=['POST'])
def plan10():
customer = stripe.Customer.create(
email=request.form['stripeEmail'], source=request.form['stripeToken'])
charge = stripe.Charge.create(
customer=customer.id,
amount=1000,
currency='usd',
description='The Product'
)
return redirect(url_for('basicplan'))
这个想法是通过使用 python 和烧瓶键入 www.example.com/basicplan 来停止访问页面 basicplan 而无需付费
对于登录我们可以做
@app.route(/plan)
@login_required
def plan():
return render_template(plan.html)
现在我想停止为尚未使用 stripe 付费的客户使用 python 和烧瓶提供任何帮助
【问题讨论】:
标签: python flask stripe-payments