Prime 31 In App Billing Android

Hi, i have been integrating IAB for android with prime 31’s plugin. So far its been working great, but when a user purchases a product, what function call do I use to return that value? This is my purchase code.

IABAndroid.purchaseProduct( "150_coins" );

What function would I use to return if the purchase worked?
I tried:

void purchaseSucceededEvent( string productId )
{
if(productId == "150_coins")
	{
	oldCoins += 150;
	}
}

But this doesn’t work.

Thanks in advance for any help!

Probably because the purchaseSucceededEvent takes a GooglePurchase object as a parameter, not a string.

void purchaseSucceededEvent( GooglePurchase purchase )
{
    swtich( purchase.productId )
    {
        case "idString1":
            // do stuff
            break;
        
        default:
            break;
    }
}