question

hergy80 avatar image
hergy80 asked hergy80 commented

INV TRAN on Rest Pay API

I'm using the sandbox. I keep getting the discover test card declined with a INV TRAN message. I've tried different encryption methods but no avail. It shows up on the test merchant payments page as a failed payment, so I'm assuming the card number is making it through, so I'm thinking it's not the encryption. I've also received a crypto error before when trying various things, so I think it is something else. I looked at the merchant's permissions under api tokens and Merchant, Orders, and Payments are all Read & Write.

My workflow is as follows:
- using v3/merchants/mid/orders to generate a new order
- using v3/merchants/mid/orders/orderid to set it open
- get the key using v2/merchant/mid/pay/key
- encrypt the card with the prefix prepended
- use the v2/merchant/mid/pay to post the payment which is where the error returns
REST APIDeveloper Pay API
2 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Lee Tickett avatar image Lee Tickett commented ·
The obvious question seems to be... do other cards work?
I just tested the discover card and it seems to work fine. Although I have always had issues as the cards which are supposed to decline also work for me!
0 Likes 0 ·
hergy80 avatar image hergy80 commented ·
I tried the other test number that is supposed to be declined, and it failed with the same message.
0 Likes 0 ·

1 Answer

·
hergy80 avatar image
hergy80 answered
Apparently it is something with the encryption. I was finally able to get it to work using the returned PEM certificate, extracting the public key from it, and then encrypting the card information using the public key. Everytime I tried using the modulus and exponent it would return the INV TRAN message. Seems like some better failure messages. Maybe something more explaining there was a crypo error or something.
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community