0

I have this:

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

and the answers is that:

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'

Note: I'm using Django, but with the shell works excelent, y don't know why with django don't work.

Thanks.

Pablo Alejandro
  • 591
  • 2
  • 10
  • 19

1 Answers1

0

You probably have a stripe directory or stripe.py file so that when you type:

import stripe

this file or directory is imported in place of the real stripe module.

You can solve this by renaming the file/directory to anything else.

Ywain
  • 16,854
  • 4
  • 51
  • 67