저는 파이썬에서 페이팔 적응 지불 API에 대한 지불 요청을하고 추가 정보없이 일반 오류 ID 580001을 받고 있습니다.Adaptive Payments 유료 API 오류 580001
headers = {
# API credentials for the API caller business account
'X-PAYPAL-SECURITY-USERID': config.PAYPAL_API_USER_ID,
'X-PAYPAL-SECURITY-PASSWORD': config.PAYPAL_API_PASSWORD,
'X-PAYPAL-SECURITY-SIGNATURE': config.PAYPAL_API_SIGNATURE,
'X-PAYPAL-APPLICATION-ID': 'APP-80W284485P519543T',
'X-PAYPAL-REQUEST-DATA-FORMAT': 'JSON',
'X-PAYPAL-RESPONSE-DATA-FORMAT': 'JSON'
}
payload = {
"actionType": "PAY",
"currencyCode": "USD",
"receiverList": {
"receiver": [{
"amount": "1.00",
"email": "[email protected]"
}]
},
# where the sender is redirected
"returnUrl": config.SUCCESS_URL,
"cancelUrl": config.SUCCESS_URL,
"requestEnvelope": {
"errorLanguage":"en_US",
# error detail level
"detailLevel":"ReturnAll"
}
}
import urllib2, urllib
payload = urllib.urlencode(payload)
request = urllib2.Request(url='https://svcs.sandbox.paypal.com/AdaptivePayments/Pay',
data=payload,
headers=headers)
f = urllib2.urlopen(request)
contents = f.read()
응답 : 내 자격 증명
{"responseEnvelope":
{"timestamp":"2013-08-22T15:44:50.97507:00",
"ack":"Failure",
"correlationId":"df4f39293971f",
"build":"6941298"
},
"error"[ {"errorId":"580001",
"domain":"PLATFORM",
"subdomain":"Application",
"severity":"Error",
"category":"Application",
"message":"Invalid request: {0}"}
]
}
컬링은, 그냥 실패한 것 urrllib 겪고의 작품. 내가 실수로 HTTP GET을 보내는 것과 같은 오류 코드를 가진 다른 사람들을 읽었을 때, 나는 request.get_method()를 통해 이것이 실제로 POST한다는 것을 확인했다. 어떤 아이디어?
curling 명령뿐 아니라 python 스크립트 전체를 게시 할 수 있습니까? – Dennis
Dennis에게 감사드립니다. 아래 답변을 게시했습니다. – sara