1

I'm trying to integrate Vantiv payment gateway using python language.

But when I request on URL https://w1.mercurycert.net/PaymentsAPI/Credit/Sale with the provided test credentials merchant id: 755847002 and password: xyz it still gives me an error message like:

Unauthorized: Access is denied due to invalid credentials.

I am passing JSON data as provided in the documentation:

card_data = {
    "InvoiceNo": "1",
    "RefNo": "1",
    "Memo": "MPS Example JSON v1.0",
    "Purchase": "1.00",
    "Frequency": "OneTime",
    "RecordNo": "RecordNumberRequested",
    "TerminalName": "MPS Terminal",
    "ShiftID": "MPS Shift",
    "OperatorID": "MPS Operator",
    "AcctNo": "4003000123456781",
    "ExpDate": "0517",
    "Address": "4 Corporate Square",
    "Zip": "30329",
    "CVVData": "880",
}
headers = {
    'Authorization': 'Basic [Wzc1NTg0NzAwMV06W3h5el0=]',
    'Content-Type': 'application/json',
}
payment = requests.post(
    'https://w1.mercurycert.net/PaymentsAPI/Credit/Sale',
    headers=headers,
    data=card_data)

When I look at the response variable payment, it still shows that error message. Can anyone help me on how to overcome this?

Ralf
  • 16,086
  • 4
  • 44
  • 68
Mohit Bhalodia
  • 63
  • 1
  • 10

1 Answers1

0

Actually, All I needed was to encode "Authorization" header and it worked.

I was using this API at wrong place, API that I used (RESP API) can be used with scanner devices only which can encode data. Instead I needed to use Hosted Checkout API and it worked for me.

Mohit Bhalodia
  • 63
  • 1
  • 10