0

My It is a cartridge/mezzanine app and is running fine with https set up properly. Its working fine until I get to the end of the checkout process, I get the following debug error in the browser:

Exception Type: AuthenticationError Exception Value:
No API key provided. (HINT: set your API key using "stripe.api_key = "). You can generate API keys from the Stripe web interface. See https://stripe.com/api for details, or email support@stripe.com if you have any questions. Exception Location: /home/jamesgilbert/lib/python2.7/stripe/api_requestor.py in request_raw, line 183

Traceback: File "/home/johnsmith/webapps/cartridgeshop/lib/python2.7/Django-1.8.4-py2.7.egg/django/core/handlers/base.py" in get_response 132. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/johnsmith/webapps/cartridgeshop/lib/python2.7/Django-1.8.4-py2.7.egg/django/views/decorators/cache.py" in _wrapped_view_func 57. response = view_func(request, *args, **kwargs) File "/home/johnsmith/lib/python2.7/cartridge/shop/views.py" in checkout_steps 282. transaction_id = payment_handler(request, form, order) File "/home/johnsmith/lib/python2.7/cartridge_stripe/init.py" in payment_handler 34. description=order) File "/home/johnsmith/lib/python2.7/stripe/resource.py" in create 344. response, api_key = requestor.request('post', url, params, headers) File "/home/johnsmith/lib/python2.7/stripe/api_requestor.py" in request 140. method.lower(), url, params, headers) File "/home/johnsmith/lib/python2.7/stripe/api_requestor.py" in request_raw 183. 'No API key provided. (HINT: set your API key using '

I then got the following in the apache error logs: /home/johnsmith/lib/python2.7/cartridge/shop/views.py:226:

UserWarning: The SHOP_CHECKOUT_FORM_CLASS setting is deprecated - please define your own urlpattern for the checkout_steps view, passing in your own form_class argument.

I have the correct stripe api keys in the settings and everything set up as it should be, I have looked in other places and coming to a dead end?

Many Thanks

jameslewis
  • 11
  • 1
  • 4

2 Answers2

0

You need to add the Stripe API key to your settings.py file (which you said you had already done). Something like the following line but with your own API key from the Stripe developer web site.

STRIPE_API_KEY="sk_test_XXXXXXXXXXXXXXXXXXXXXXXX"

You also need to reference the python interface file (which you must have been doing to get this error message).

SHOP_HANDLER_PAYMENT = "cartridge.shop.payment.stripe_api.process"

And, you need to install the strip-python module.

Seems like you did all this so I'm not sure if this will help but maybe it will trigger something to get you over this.

andrewmo
  • 1,922
  • 1
  • 17
  • 20
0

Cartridge-stripe doesn't seem to be maintained. I'd advise using the stripe payment handler built into cartridge, which will be documented in cartridge's next docs release (PR).

Ryne Everett
  • 6,427
  • 3
  • 37
  • 49