0

我有这个:

return stripe.Charge.create(
      amount=amount,
      currency=currency,
      source=source, # obtained with Stripe.js
      description=description
    )

答案是:

File "/home/pdonaire1/desarrollos/4geeks/mall4g/apps/orders/stripe.py", line 16, in stripe_charge_create
    return stripe.Charge.create(
AttributeError: 'module' object has no attribute 'Charge'

注意:我使用的是 Django,但是 shell 工作得很好,你不知道为什么 django 不能工作。

谢谢。

4

1 回答 1

0

您可能有一个stripe目录或stripe.py文件,以便在您键入时:

import stripe

该文件或目录被导入以代替真实stripe模块。

您可以通过将文件/目录重命名为其他任何内容来解决此问题。

于 2016-04-14T08:38:50.017 回答