question

carwashreports avatar image
carwashreports asked carwashreports commented

402 Invalid CVC when creating customer with eComm payment token

Hello,
I have an application that currently allows for signing people up for monthly membership plans. We are on the Clover Flex Gen 2 only. During the sign up flow we currently open up a WebView that has a EComm iFrame in which the CC info is manually entered. Once this form submits a token back to our server we create a customer and save this token on file in order to have a multi-pay token, following the directions here: https://docs.clover.com/docs/ecommerce-saving-card

To make the sign up process easier we are trying to use the Rest Pay Display API in order to get the eComm compatible token instead of the manual form entry via iFrame. We are using this endpoint: https://docs.clover.com/reference/request_token

For some reason we are getting back a 402 when taking the token returned from the Rest Pay Display API and attempting to create a customer:

%{"error" => %{"code" => "invalid_cvc", "message" => "CVV not found during card verification for Clover token clv_1TSTSqeJUN9uekt2gce6aEnx", "type" => "card_error"}, "message" => "402 Payment Required"}


Is this expected? I've seen other posts in the forum about this error but those seem to be related to using the token directly for payment multiple times. We are only trying to post the customer right now, and doing this exact flow with the iFrame approach works fine. Are we missing a step in order to use the token returned from the Rest Pay Display API?

Also, is there any way to enable a button to exit the Clover Pay Display API? Currently on success/error we just have it display a message but the device just hangs. The 4 corner touch to exit is not the easiest approach, have to do it multiple times as it doesn't sense all 4 touches every time.

Update: So I did update the initial request to get the token to include manual entry as an option. Not sure if this matters but I was testing with the provided test card that came with the Flex device, is that an issue? I manually enter in the success Discover card from here: https://docs.clover.com/docs/testing-us-payment-flows, looks like it gets past the 402 response but we do get a 500 now:

body: %{
                  
     "code" => "processing_error",
     "message" => "There was an error communicating with the server. Please try again.: TokenizationResult: null",
     "requestId" => "e0747e54-ec97-4a10-af33-b4c89f6c484b",
     "requestType" => "REQUEST_TOKEN",
     "type" => "api_error"
   }
REST APIecommerce
10 |2000

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

1 Answer

·
David Marginian avatar image
David Marginian Deactivated answered carwashreports commented

A token needs to be used within approximately 10 minutes of being created. You shouldn't be using the ecomm API from a native app. What is your app id?

17 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.

carwashreports avatar image carwashreports commented ·
In this case it is being used within 10 minutes. We are not making the calls to the EComm API from the native app, they are happening from our backend server. Our app has a native app to provide industry customized checkout flows for car washes (does things like LP scanning, menu in a way that is specific to car washes, etc.). Orders and memberships submit to our backend server where we provide some custom reporting and handle the monthly billing of members via the EComm API.


In this scenario a customer selects a monthly membership plan, in the native app we collect their info. Vehicle, name, package, etc. We submit this info to our backend which saves it and then makes a call to the Rest Pay Display API to get a ecomm compatible token. The returned token needs to be used to bill this customer once a month for their membership, so we need to set it up as a multi-pay token. As soon as the response token from the Rest Pay Display API comes in we make the request to set it up as a multi pay token. However when making that request to set it up as a multi pay token we are getting the error responses, 402 and 500.

0 Likes 0 ·
carwashreports avatar image carwashreports commented ·

Do you recommend a different approach for this use case? Currently we have everything working, it's just instead of using the Rest Pay Display API we are using the clover hosted iFrame to get the token: https://docs.clover.com/docs/using-the-clover-hosted-iframe

This works, but being able to just tap a card on the Flex would be a much easier user flow and multiple people have asked for it to work that way. Using the Rest Pay Display API was the only way we could find in the docs to try to do something like this.

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ carwashreports commented ·

It sounds like because we provide no way of natively obtaining an ecomm token that you are being forced into a workaround. Using RPD isn't ideal because the app is meant to be customer facing and cannot be cleanly exited. To work around that problem you are launching an iframe from within a web view. Am I correctly understanding the problem? I think we are working on a way to be able to get a token via the Android SDK, let me check on that, give me a few days.

0 Likes 0 ·
carwashreports avatar image carwashreports David Marginian ♦♦ commented ·
Yes you are correct, if we could retrieve an EComm compatible token natively that would be way easier. We wouldn't need either the iFrame or RPD, just request it locally on the device and then submit it to our backend for use with the monthly billing through EComm api calls there.


I had asked about it before on the forum but they had directed me to use RPD, maybe my explanation was not clear at the time.
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