FAQ: Card payments not working | Credit card transaction errors | How to read transaction logs to identify authorization issues?

This topic aims to foster knowledge of the VTEX platform’s payments module, since questions like these come up frequently.

With that in mind, before we look at what happens in this type of case, it’s important to understand how the payment flow works within VTEX.
It’s worth noting that in transactions, VTEX depends on the connector’s response to move forward with the payment flow. VTEX is 100% passive when it comes to the success or failure of each step in this flow — it’s the connector’s response that determines whether or not the transaction can proceed to the next status.

How does this process work? We have an article that covers it in detail — definitely worth a read:

As described in the article above, once an order is placed in a VTEX store, the transaction enters with a status of Authorizing, indicating that the process of sending information to the payment connector has begun. This is the step where VTEX sends the authorization request.

The Gateway is then responsible for analyzing the request and responding with whether or not the transaction should be authorized (status Approved or Denied).

If the status is Denied, it means exactly what it says — the transaction was declined, and the cancellation flow for that order is triggered.

But how do you check this within the transaction itself?

To do so, you need to access the transactions module and click on the desired transaction:

On the transaction page, you can review all logs along with their respective timestamps. Every transaction using a Credit Card as the payment method starts off like this:

Shortly after, the transaction data is sent — fields such as "orderId", "paymentMethod", "holder", "documentType", "document", and others — in the following log:

Note: If you need to look up a specific field, just use the Ctrl + F shortcut to search.

Shortly after, we receive the payment connector’s response. In cases where the transaction is denied, you’ll see something similar to the following screen log:

Some common messages in these cases are:

"returnMessage":"Unauthorized. Insufficient funds."

"returnMessage":"Unauthorized. Please try again."

Regardless of the message received as the connector’s response to the request made at the start of the transaction, the recommended course of action is to check with the partner to find out what may have happened, since VTEX is 100% passive with respect to the payment flow — we only receive the notification from the partner and update the transaction status accordingly.

If you still have any questions on the topic, feel free to ask right here! :smiling_face:

Karina Mota
Field Software Engineer | VTEX

Hi @KarinaMota, can you add another important detail: the frontend doesn’t validate whether the card is valid or not when the user types it in at checkout.

Thank you.

Hi @estevao_santos, it actually does validate! If the user enters any number incorrectly, the front-end displays the following message:

In this case, to generate this screen recording I entered the card’s security code as invalid data.

Karina Mota
Field Software Engineer | VTEX

Hi @KarinaMota

Hmmm! I see. I always had the understanding that it didn’t validate. So it makes sense to update my understanding on that.

Thanks.