---
title: Event Listeners
slug: fiat-docs/cQJy-event-listeners
docTags: 
createdAt: 2023-10-19T09:16:20.518Z
---

### &#x20;Introduction

After completing transactions in Pay3 SDK UI, the Pay3 SDK publishes events to App.&#x20;

### pay3-sdk-transaction-status

This event is fired by Pay3 SDK on completion of checkout transaction triggered by checkout webview **`pay3.geCheckoutWebView()`**

**Payload**

1. **`data`** (Type Object): Following keys are present in this object&#x20;
   1. `status` (Type string): The status can have values `SUCCESS` or `ERROR`.
   2. `message` (Type string): User-friendly message returned after completion of the transaction.
   3. `orderId` (Type string): Pay3 Order ID. &#x20;
   4. `requestId` (Type string): Unique id passed by App.
2. **`error`** (Type Object, Optional): Following keys will be present if there is an error. Please refer to [SDK Errors](docId\:hPVtdMjhhdvuXdY6PD3-A) for reference.
   1. &#x20;`code` (Type number): Error code.
   2. `message` (Type string):  Error message.

:::CodeblockTabs
index.js

```javascript
pay3.on('pay3-sdk-transaction-status', (payload: any) => {
    // Add your custom logic to handle the transaction status 
    setPay3CheckoutVisibleState(false); // Can be used to hide the Checkout WebView
  },
);
```
:::

### Sample Event

```javascript
{
    "data": {
        "message": "Transaction completed successfully",
        "orderId": "7a38ee7f-d5a9-45c8-af6b-e75d4190722a",
        "receipt": "txnReceipt",
        "requestId": "252425",
        "status": "SUCCESS"
    },
    "ts": 1706087047736
}
```

