我正在尝试在Django上执行条带化付款,但出现此错误

时间:2019-09-21 12:28:44

标签: django python-3.x stripe-payments

下面是引发的错误。我立即尝试按按钮提交付款,我在// charge处将错误归因于错误。

  / charge /处的

AttributeError   模块“条带”没有属性“收费”   请求方法:POST

     

Django版本:2.2.4   异常类型:AttributeError   异常值:
  模块'stripe'没有属性'Charge'

这是我的功能代码:

    if request.method == 'POST':
        charge = stripe.Charge.create(
            amount = 500,
            currency = 'usd',
            description = 'A django charge',
            source = request.POST['stripeToken']

        )
        return render(request, 'charge.html')

0 个答案:

没有答案