有很多方法可以在互联网上付款,其中一个是 PayPal。我正在开发 django 项目,我需要集成 paypal,所以我在我的观点中使用了这个代码:
from paypal.pro.views import PayPalPro
def buy_it_now(request):
item = {
"amt": "10.00",
"inv": "inventory",
"custom": "tracking",
"cancelurl": "http://...",
"returnurl": "http://..."}
kw = {"item": item,
"payment_template": "payment.html",
"confirm_template": "confirmation.html",
"success_url": "/success/"}
ppp = PayPalPro(**kw)
return ppp(request)
但我在控制台中得到了这个:
PayPal Response:
{'ack': 'Failure',
'build': '5715372',
'correlationid': 'd328871dd352',
'l_errorcode0': '10002',
'l_longmessage0': 'Security header is not valid',
'l_severitycode0': 'Error',
'l_shortmessage0': 'Security error',
'timestamp': '2013-05-03T13:10:14Z',
'version': '54.0'}
我还在贝宝沙盒中检查了我的测试帐户,没有交易