question

pbuilder avatar image
pbuilder asked David Marginian commented

Why is the payment decline message different for V1 endpoints "create customer" and "create charge"?

If a customer chooses to store their card details we call the V1 "create customer" endpoint which will save customer data as well as the token. We then can call the "create charge" endpoint and charge the same token with no issues.

If we use one of the test "decline" cards we get inconsistent errors (see results below). We pass the error messages back to the customer to allow them to correct the issue but the message from the "create customer" endpoint would mean nothing to them.

If we ignore the "create customer" endpoint error and attempt the charge anyway we then get:

"You cannot use a clover token more than once unless it is marked as multipay."

which also would mean nothing to the customer.


Is there a better way to do this without having to parse all the errors before presenting them to the customer?


The "create customer" endpoint returns:

{

"message": "402 Payment Required",

"error": {

"type": "card_error",

"code": "card_declined",

"message": "Token verification failed for token clv_1TSTS8QxKbg85ZEdGQNHdsNE"

}

}

The "create charge" endpoint returns:

{

"message": "402 Payment Required",

"error": {

"code": "card_declined",

"message": "DECLINED: No reason provided.",

"charge": "5CVE6JBPM3MXA",

"declineCode": "issuer_declined"

}

}

REST APIe-commerce api
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 answered David Marginian commented

I am not 100% following you. When you make the create customer call, the code returned is "card_declined". You should be able to interpret that and present an error to the customer that they can comprehend.

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.

I was hoping to provide better feedback to the customer, but you are correct that is an option.

Also, when saving tokens this way we have no way to check the card expiration date to notify recurring payment customers to update their card.

Is there a way to get a card expiration date without waiting for a decline?

0 Likes 0 ·

When you tokenize the card the expiration month/year will be in the response (card.exp_month, card.exp_year). Unfortunately, now, you would have to save that data along with the customer data on your end. At some point (hopefully later this year) we will support real time account updater at which time the tokens would be updated automatically.

0 Likes 0 ·

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