# Status Transitions

This page explains the possible status transitions a transaction could go through and what they mean.

## Google Pay transaction statuses

`OPEN` - transaction has been created. This is the initial status.\
`AUTHORIZED` - transaction payment is authorized.\
`SUCCESS` - transaction has been successfully paid.\
`CANCELLED` - transaction has not succeeded; cancelled by the consumer.\
`EXPIRED` - transaction has not succeeded; expired.\
`FAILURE` - transaction has not succeeded; unknown reason.

## Status Transitions

The diagram below shows all state transitions a transaction could go through.

![](https://files.readme.io/88f042a-State_-_GooglePay_Statuses.png)

<br />

Once a transaction has been created the status will be `OPEN`. While the state of a transaction is `OPEN` a consumer can try to make a payment with it.

Once a payment is successful, the transaction status will transition to `SUCCESS`.  This is the happy-flow. At this point the consumer has paid and the funds will eventually make its way to your accounts.

It can also happen that the payment of a transaction has been authorized, but not yet paid, in this case the status will be `AUTHORIZED`. Eventually it can transitions to `SUCCESS`.

Of course there are other possibilities as you will have seen in the state diagram.

It could transition to `CANCELLED` if the consumer did not complete the payment and instead clicked on the cancel button.

It could transition to `EXPIRED` if the `expiresAt` timestamp has been reached and the transaction is still `OPEN`.

It could transition to `FAILURE` if the payment failed.