インターネットでお金を支払う方法はたくさんありますが、そのうちの 1 つが PayPal です。PayPal を統合する必要がある django プロジェクトに取り組んでいるので、私のビューでこのコードを使用します。
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'}
また、PayPalサンドボックスでテストアカウントを確認しましたが、トランザクションはありません