我正在验证PayOne(https://www.payone.de/en/)上的信用卡。在
我从PAYONE平台客户端API文档的According to 3.4.1 Verifying credit cards (creditcardcheck)
和3.1.2 Standard parameter
部分获得的参数列表_英语.pdf(您可以在此处请求https://www.payone.de/en/contact/)。在
# build hash on server side:
import hmac
import hashlib
params = {
'aid': '123456',
'api_version': '3.12',
'mid': '123456',
'mode': 'test',
'portalid': '1234567',
'responsetype': 'JSON',
'request': 'creditcardcheck',
'storecarddata': 'yes'
}
message = ''.join([params[k] for k in sorted(params)])
return hmac.new(b'some-secret-key!', msg=message.encode('utf-8'), digestmod=hashlib.sha384).hexdigest()
{ "customermessage": "An error occured while processing this transaction (wrong parameters).", "errorcode": "2007", "errormessage": "Hash incorrect", "status": "ERROR" }
我使用的是python3.5和angular2。在
我做错什么了?在
哈希方法已在web界面中选择:https://pmi.pay1.de/merchants/?navi=portal&rc=1(Method hash calculation*: SHA2-384 (recommended method)
)
{1美元^
默认情况下,付款人商户账户使用md5而不是sha384
该输出:
^{pr2}$然后,打开URL并确保除了在URL中传递的信用卡参数(和回调方法)之外的所有参数都在散列中。在本例中:
https://secure.pay1.de/client-api/?aid=54321&cardcvc2=123&cardexpiredate=1801&cardpan=4111111111111111&cardtype=V&mid=12345&mode=test&portalid=2222222&responsetype=JSON&encoding=UTF-8&request=creditcardcheck&storecarddata=yes&hash=a435bff18234ec02a2dffa4d4850a08f
解决方案是不带
api_version
参数的调用端点:PS公司
同时,
api_version
是第3.1.2 Standard parameter
节的必需参数,也是在3.1.4 Calculation of the HASH value
节进行散列处理的参数。所以它看起来像是输入文档。在相关问题 更多 >
编程相关推荐