question

Danielle Cox avatar image
Danielle Cox asked Raymond Lee Deactivated commented

/v2 pay token not working in production

We are attempting to use the token returned by the v2 pay interface. This works in sandbox all day long. In production, it returns
{ "paymentId": "HE1BE9TXD6WGE", "result": "DECLINED", "failureMessage": "796-INVLD DETOK"}

I submitted to https://api.clover.com:443/v2/merchant/{merchant_id}....
{"orderId":"W7HS2WZ863YHA", "currency":"usd", "amount":245, "taxAmount": 16, "token": [token redacted]}

Again, the same code base works in sandbox every time. It does not work on production. I saw a two year old post suggesting that this was not implemented, but looking at https://docs.clover.com/clover-platform/docs/devel... it says that this should work.

Any suggestions? The intention here is for a card on file solution.
Payments
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.

Danielle Cox avatar image Danielle Cox commented ·

To be clear, this is not working in production using a production merchant and all production data obtained via production API calls. References to dev are simply for comparison and to show that this has worked returning an approved response in that environment. The call to the api endpoint for attempting to pay via token is identical to the call with the card information that worked with the exception that the token is sent instead of the card specific information.

This is not an attempt to use dev tokens in prod.

The result from the original payment has a "token" and a "vaultedCard". The "vaultedCard" also includes a token. The token that is working in the sandbox and that I am attempting to use in production is the root level token.

0 Likes 0 ·
chanel avatar image
chanel Deactivated answered Danielle Cox commented
Tokens generated in sandbox will not work in production and vice versa. You will need to regenerate the token in production.

If you are already doing this, please edit your question to include the actual code that you are using to utilize the DevPay endpoint.
3 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.

Danielle Cox avatar image Danielle Cox commented ·

I have the exact api request I am making in the question. This works (with a dev generated token) in sandbox and it does not work (with a production saved token) from production. I make a call with the credit card information and it returns back a token. I get (this is a dev example) back something like {"paymentId":"DD6MDVE6EK2JC","result":"APPROVED","authCode":"OK9905","token":"9Q814Y5QY37W6","vaultedCard":{"first6": "476173", "last4":"0010", "expirationDate":"0620","token":"9613142534200010"}}

I can then send in 9Q814Y5QY37W6 and it works. I have sent the calls in via postman, so there is no other code to submit.

0 Likes 0 ·
chanel avatar image chanel Danielle Cox commented ·

@Danielle Cox, sorry for the confusion.

Because DevPay is not meant to be used in Production through Postman, I cannot help you at this time. The next steps would be to implement the use of DevPay within your app, then provide it here. Examples in various languages can be found here: https://github.com/cloverhackathons/DeveloperPayAPI

0 Likes 0 ·
Danielle Cox avatar image Danielle Cox commented ·

@Chanel it is being attempted via curl as I. The example you have linked to and guzzle in the php framework. I wouldn’t thing the manner of the post call would be that important. Using the actual card information works no problem, but using the token returned from that call is what doesn’t work. I gave the http post endpoint and the body, the only thing I didn’t include was the bearer token but, besides it working for all other api calls, it would have returned a different error if that were what was wrong

0 Likes 0 ·
Raymond Lee avatar image
Raymond Lee Deactivated answered Raymond Lee Deactivated commented
The issue you are seeing is due to the fact that in our Production environments, test merchants by default do not have MultiPay support enabled. This means they do not support the use of the vaultedCard tokens that you are trying to use.

I will look into whether it is possible to enable MultiPay support for Production test merchants, but for now you will be unable to use vaultedCard tokens on your Production test merchant.
6 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.

Danielle Cox avatar image Danielle Cox commented ·

This is being attempted in the production environment on a real merchant, not a test merchant. Also, I am using the token being returned, not the token in the vaultedcard portion of the json

0 Likes 0 ·
zgreathouse avatar image zgreathouse Danielle Cox commented ·

In that case it is possible that the Production Merchant Account does not have mutli-pay token enabled. Could you please provide the Merchant ID in a private comment so we may confirm this?

2 Likes 2 ·
Danielle Cox avatar image Danielle Cox zgreathouse commented ·

I don't know how to do that. I do see if I call the api merchant/xxxx/gateway it shows supportsMultiPayToken=false <- is that what we are trying to do here? If so, how do we get that turned on? (as an aside, why return a token if not supported?)

0 Likes 0 ·
Show more comments

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