0

我是一個盒式磁帶/夾層應用程序,運行正常,https設置正確。其工作正常,直到我去結帳過程結束後,我得到在瀏覽器中的以下調試錯誤:條紋,Django和墨盒/夾層的問題

異常類型:AuthenticationError 異常值:
沒有提供API密鑰。 (提示:使用「stripe.api_key =」設置您的API密鑰)。您可以從Stripe Web界面生成API密鑰。詳情請參閱https://stripe.com/api,如果您有任何疑問,請發送郵件至[email protected]。 異常地點:/home/jamesgilbert/lib/python2.7/stripe/api_requestor.py在request_raw,線183

回溯: 文件「/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 ) 文件中payment_handler 34.描述=順序) 文件「/home/johnsmith/lib/python2.7/stripe/resource 「/home/johnsmith/lib/python2.7/cartridge_stripe/ 初始化 py」 爲。 py「在創建 344. response,api_key = requestor.request('post',url,params,headers) 請求 中的文件」/home/johnsmith/lib/python2.7/stripe/api_requestor.py「140。 method.lower(),url,params,headers) request_raw中的文件「/home/johnsmith/lib/python2.7/stripe/api_requestor.py」183.'沒有提供API密鑰。 (提示:使用'

設置你的API密鑰然後我得到了在Apache的錯誤日誌如下: /home/johnsmith/lib/python2.7/cartridge/shop/views.py:226:

UserWarning:SHOP_CHECKOUT_FORM_CLASS設置已被棄用 - 請爲checkout_steps視圖定義您自己的urlpattern,並傳入您自己的form_class參數。

我在設置中設置了正確的條帶api鍵,在其他地方看過,走向死衚衕嗎?

很多謝謝

回答

0

您需要將Stripe API密鑰添加到您的settings.py文件(您說你已經完成)。類似於以下行,但使用Stripe開發人員網站中的自己的API密鑰。

STRIPE_API_KEY =「sk_test_XXXXXXXXXXXXXXXXXXXXXXXX」

您還需要引用Python接口文件(你必須一直在做得到這個錯誤消息)。

SHOP_HANDLER_PAYMENT = 「cartridge.shop.payment.stripe_api.process」

而且,你需要安裝strip-python模塊。

好像你做了這一切,所以我不知道這是否會有所幫助,但也許它會觸發一些事情來幫助你解決這個問題。

0

Cartridge-stripe似乎沒有被維護。我建議使用墨盒內置的條形支付處理程序,這將在墨盒的下一個文檔發佈(PR)中記錄。