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を使用していますが、シェルはうまく機能しますが、なぜdjangoが機能しないのかわかりません。

ありがとう。

4

1 に答える 1

0

おそらくstripeディレクトリまたはstripe.pyファイルがあるので、次のように入力します。

import stripe

このファイルまたはディレクトリは、実際のstripeモジュールの代わりにインポートされます。

ファイル/ディレクトリの名前を別の名前に変更することで、これを解決できます。

于 2016-04-14T08:38:50.017 に答える