Reputation: 26647
I can run and test my application in sandbox mode using the google app engine example provided by paypal. Now I want to enable live mode for testing a real payment now that sandbox mode works. I've registered a PayPal application at www.x.com and I filled out the details as these:
My business setup looks as follows:
These settings look like they could work in live mode but it seems I have some setting wrong since I get an error message when trying to activate live mode:
ERROR 2012-01-02 07:29:49,973 webapp2.py:1528] 'payKey'
Traceback (most recent call last):
File "/media/Lexar/montao/bnano-www/webapp2.py", line 1511, in __call__
rv = self.handle_exception(request, response, e)
File "/media/Lexar/montao/bnano-www/webapp2.py", line 1505, in __call__
rv = self.router.dispatch(request, response)
File "/media/Lexar/montao/bnano-www/webapp2.py", line 1253, in default_dispatcher
return route.handler_adapter(request, response)
File "/media/Lexar/montao/bnano-www/webapp2.py", line 1077, in __call__
return handler.dispatch()
File "/media/Lexar/montao/bnano-www/webapp2.py", line 547, in dispatch
return self.handle_exception(e, self.app.debug)
File "/media/Lexar/montao/bnano-www/webapp2.py", line 545, in dispatch
return method(*args, **kwargs)
File "/media/Lexar/montao/bnano-www/handler.py", line 531, in post
(ok, pay) = self.start_purchase(item)
File "/media/Lexar/montao/bnano-www/handler.py", line 570, in start_purchase
purchase.paykey = pay.paykey()
File "/media/Lexar/montao/bnano-www/paypal.py", line 81, in paykey
return self.response['payKey']
KeyError: 'payKey'
INFO 2012-01-02 07:29:49,985 recording.py:372] Saved; key: __appstats__:088300, part: 132 bytes, full: 17070 bytes, overhead: 0.000 + 0.005; link: http://localhost:8080/_ah/stats/details?time=1325489388311
INFO 2012-01-02 07:29:50,015 dev_appserver.py:2753] "POST /buy/ag1kZXZ-Ym5hbm8td3d3cgsLEgRJdGVtGJwCDA/ HTTP/1.1" 500 -
The part of the code that could be relevant is
def paykey( self ):
return self.response['payKey']
and of course that doesn't help much so where should I look? Is my settings.py correct when I changed it to the following:
# settings for app
#PAYPAL_ENDPOINT = 'https://svcs.sandbox.paypal.com/AdaptivePayments/' # sandbox
PAYPAL_ENDPOINT = 'https://svcs.paypal.com/AdaptivePayments/' # production
#PAYPAL_PAYMENT_HOST = 'https://www.sandbox.paypal.com/au/cgi-bin/webscr' # sandbox
PAYPAL_PAYMENT_HOST = 'https://www.paypal.com/webscr' # production
PAYPAL_USERID = '[email protected]'#'niklas_1224389428_biz_api1.eddaconsult.se'
PAYPAL_PASSWORD = '<my-paypal-password>'#'13344842639'
PAYPAL_SIGNATURE = 'Al6HBBNk4bKFht2fR-p2FlAb2YAJFKl5p2MzHpo.QKYewU2btYPIm.'
PAYPAL_APPLICATION_ID = 'APP-9F666043V7920644G'#'APP-80W284485P519543T' # live
PAYPAL_EMAIL = '[email protected]'#'[email protected]'
PAYPAL_COMMISSION = 0.2 # 20%
USE_CHAIN = False
USE_IPN = False
USE_EMBEDDED = False
SHIPPING = False # not yet working properly; PayPal bug
# EMBEDDED_ENDPOINT = 'https://paypal.com/webapps/adaptivepayment/flow/pay'
EMBEDDED_ENDPOINT = 'https://www.sandbox.paypal.com/webapps/adaptivepayment/flow/pay'
API_ID = '8byQd46LwexZ'
TRANSACTION_KEY = '3a578UZJXnh6Aa25'
Any other ideas where my error message might be coming from?
Thanks
Upvotes: 0
Views: 835
Reputation: 19356
It can't get a payKey. And that fails because you're using the wrong credentials:
PAYPAL_USERID = '[email protected]'#'niklas_1224389428_biz_api1.eddaconsult.se'
PAYPAL_PASSWORD = '<my-paypal-password>'#'13344842639'
Change this to use your API username and API password instead.
Upvotes: 1