question

pharzad avatar image
pharzad asked tulasi commented

failureMessage: 'INV TRAN' on sandbox environment

When I'm calling v2/merchant/${merchantId}/pay/ I'm getting failureMessage: 'INV TRAN' on sandbox environment. Not sure what is the problem. Is it the encryption on my auth 2 token.
Payments
10 |2000

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

zgreathouse avatar image
zgreathouse Deactivated answered tulasi commented
If the issue was with your auth 2 token (api_token) then you would receive a 401 error code in your response. It is possible the card is not being encrypted properly. Here is a link to our Developer API examples for reference: https://github.com/cloverhackathons/DeveloperPayAPI

Your issue could be caused by the card you are using. Have you tried using our test card numbers?

Here is a link to a thread of another Developer who had the same issue:
https://community.clover.com/comments/5988/view.html


1 comment
10 |2000

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

tulasi avatar image tulasi commented ·

@zgreathouse I am having the same issue. I posted a question 3 days back but no one replied.

I am using sandbox account and trying to add credit card payments. I have enabled the Process Credit Cards in my settings

I am using the test credit card details 4264281511117771
["paymentId" => "GY1RFDCK18ETT" , "result" => "DECLINED", "failureMessage" => "INV TRAN"]
I am using php. this is how i encrypted credit card num:
$rsa = new phpseclib\Crypt\RSA();
$rsa->loadKey([ 'e' => new BigInteger(base64_decode($getPay["exponent"]), 256), 'n' => new BigInteger(base64_decode($getPay["modulus"]), 256) ]);
$card = base64_encode($rsa->encrypt($getPay["prefix"].'4264281511117771'));

I really need help on this.
Please help me with this issue.

0 Likes 0 ·
pharzad avatar image
pharzad answered
Correction on my message, the last part i meant Is it the encryption or my auth 2 token.
10 |2000

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

pharzad avatar image
pharzad answered zgreathouse Deactivated commented
@zgreathouse code sample helped me a lot, lemme tell you what was my confusion: in the documentation it says "then use RSA/OAEP/SHA1 encryption on the resulting string using the provided modulus and exponent." I didn't know you can use the generated pem key!

Thanks a lot!
1 comment
10 |2000

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

zgreathouse avatar image zgreathouse commented ·

Thank you for your feedback! I'll submit a ticket to have our docs make this more clear.

0 Likes 0 ·

Welcome to the
Clover Developer Community