I'm new to VISA developer and trying to send requests to https://sandbox.api.visa.com/cofds-web/v1/datainfo to check whether the credit card is valid or not in Python.
Python code:
cert = 'C:\\Users\\user\\visa_cert\\cert.pem'
ca_cert = 'C:\\Users\\user\\visa_cert\\ca_cert.cer'
key = 'C:\\Users\\user\\visa_cert\\my_key.pem'
user_id = 'your user id of your project'
password = 'your password of your project'
timeout = 10
cred_info = 'credit_info.json'
payload = json.loads('''{
"requestHeader": {
"requestMessageId": "6da6b8b024532a2e0eacb1af58581",
"messageDateTime": "2019-02-35 05:25:12.327"
},
"requestData": {
"pANs": [
4072208010000000
],
"group": "STANDARD"
}
}
''')
try:
response = requests.post(url,
verify = (ca_cert),
cert=(cert, key),
# headers = headers,
auth=(user_id, password),
json = payload,
timeout=timeout
)
except Exception as e:
print(e)
Execution itself succeeded, but the response says the "Ecpectd input credential was not present"
Response header and contetns are as below.
# response header:
{'Server': 'nginx', 'Date': 'Fri, 03 Jun 2022 13:52:17 GMT', 'Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '130', 'Connection': 'keep-alive', 'X-SERVED-BY': 'c6795c5t4', 'X-CORRELATION-ID': '1654264337_872_241384137_c6795c5t4_VDP_WS', 'X-ERROR-ORIGIN': '9200', 'X-APP-STATUS': '400', 'X-Frame-Options':
'SAMEORIGIN', 'X-XSS-Protection': '0', 'X-Content-Type-Options': 'nosniff', 'Strict-Transport-Security': 'max-age=31536000;includeSubdomains', 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-cache', 'Expires': '-1'}
# response content:
b'{"responseStatus":{"status":400,"code":"9125","severity":"ERROR","message":"Expected input credential was not present","info":""}}'
I followed the instruction here(https://developer.visa.com/pages/working-with-visa-apis/two-way-ssl#configuring_a_twoway_ssl_keystor...) to generate the CA certificate, double-checked my user_id and password are correct and two-way SSL certificate is active.
I googled this error, but I'm still not sure how to fix this problem.
Thank you. passiveradio