Integration Guide
Integrate with the SDK
Once the SDK is configured, you can embed it into your game by following steps:
Add Coda SDK Prefab
Handle the payment result
Step 1: Add Coda SDK Prefab
Adding the Coda SDK Prefab into your game allows the SDK to initialize at runtime. One way to do this is by adding the Prefab to a scene.
Make sure to add the Coda SDK Prefab to the first scene that loads when the game starts
Once the required scene is open, you can view objects in the hierarchy panel and add the Coda SDK Prefab using either of the following methods:
Using the Coda menu:
Coda → Create Prefab
Drag from the Project panel into the Hierarchy panel: Navigate to
Assets > Plugins > Coda > Prefabs
Step 2: Handle the Payment Result
After adding the Coda SDK Prefab to your scene, you need to handle payment result events. There are two ways to register event listeners to the Coda SDK:
Through the Inspector window
Programmatically
Register your event listeners through the Inspector Window
To register event listeners via the Inspector window:
Create a script to handle callbacks from the event listeners. For example:
Create an Empty GameObject in the scene: Right-click in the “Hierarchy” window → Select Create Empty. Rename the object and attach your script to it.


Select the Coda SDK Prefab in your scene (Hierarchy panel). In the Inspector panel, you will see the
On Payment Success,On Payment Failure, andOn Price Updateevents under the PaymentSDK script. This is where you register your GameObject methods as callbacks.

Click the “+” button under the
On Payment Successevent to add a callback slot.

Drag your GameObject from the Hierarchy panel into the callback slot.

Select the method to be called when payment is successful.

Register event listeners for failure and price update events in the same way. Once registered, your Inspector window for the Coda prefab should look like this:

Register your event listeners programmatically
You can also register event listeners programmatically:
Implement the
Coda.IPaymentEventListenerinterface in your script.Register event listeners when your script is loaded:
Unregister event listeners when your script is unloaded:
AddListener should be called in either Start or Awake, and RemoveListener in onDestroy
Only call AddListener once to avoid duplicate triggers for a single event
Example implementation:
You can check full list of available event listeners here.
Initiate a Payment
Once everything is set up, you can initiate a payment flow. A payment flow can be triggered from anywhere in your game—typically when a user taps a Buy, Purchase, or Upgrade button.
To start the payment flow, call Coda.PaymentSDK.InitiatePayment()
You can use the same script that handles callbacks or create a new one (e.g., TestCodaSDKHandler) with the InitiatePayment function, then attach it to an Empty GameObject in the scene (see step 2).
This launches the payment UI, allowing users to complete their purchase through Codapay’s network.
Example code:
You can check full list of parameters here.
If you haven’t built the UI yet, create a basic Purchase/IAP screen.
Call OnPurchaseButtonClick() on the OnClick event of your Buy/Purchase/Upgrade button.

Last updated
Was this helpful?