---
title: Event Listeners
slug: L4Ct-event-listeners
docTags: 
createdAt: 2025-05-02T10:40:00.253Z
---

After completing transactions in Pay3 SDK UI, the Pay3 SDK publishes events via Firebase real-time database for all native SDKs. The listener can be registered after successfully completing the anonymos login in Firebase which happens during initialisation.

### pay3-sdk-transaction-status

This event is fired by Pay3 SDK in following scenario &#x20;

1. On completion of Checkout transaction triggered by `TriggerOpenCheckout`

**Snapshot 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\:upvtC67WkwGNCSCjVAQ0v) for reference.
   1. &#x20;`code` (Type number): Error code.
   2. `message` (Type string):  Error message.

:::CodeblockTabs
Pay3Helper.cs&#x20;

```cpp
   public class Pay3Helper : MonoBehaviour {
   // Pseudocode to attach a listner to receive transaction status 
    // events with in the Unity application 
    private void StartTransactionListener() {
      FirebaseDatabase.GetInstance(fbApp)
        .GetReference("/app_notifications/"+fbUserId+"/pay3-sdk-transaction-status")
        .ValueChanged += (object sender2, ValueChangedEventArgs event) => {
          // Extract event data from snapshot object returned by the event listener
        };
    }
  }  
```
:::

***

