cancel
Showing results for 
Search instead for 
Did you mean: 

IAP - "Already Purchased" but is consumable

TrevJT
Level 4
Hi, I'm testing my app with a test user and the test Credit Card given, but it won't let me purchase twice... 

The item shows up in my platform settings as a consumable purchase, below is a copy from the TSV file I uploaded.

Has anyone else experienced this issue? Do I need to specify in the code that you are purchasing a consumable item?

TSV:
















SKU Name Description Currency Amount Item Type
MILLION 1 Million dollars This will give you 1 Million dollars to spend on upgrades! USD 1.99 Consumable

using Unity 5.4.1f1 

code: 
        IAP.LaunchCheckoutFlow("MILLION").OnComplete(LaunchCheckoutFlowCallback);

    void LaunchCheckoutFlowCallback(Message msg)
    { // If the purchase was successful, this block of code will run 
        if (!msg.IsError)
        {
            gamedata.gdata.bank += 1000000;
}
}
1 ACCEPTED SOLUTION

Accepted Solutions

juanoldinho
Level 7
Hi 

Have a look at the documentation regarding In App Purchases, specifically Consuming an IAP:
https://developer3.oculus.com/documentation/platform/latest/sdk-reference/request-iap-consume-purcha...

Here is some additional documentation regarding In App Purchases:
https://developer3.oculus.com/documentation/platform/latest/concepts/dg-iap/

Let me know if this answers your question.
Please tag me, @juanoldinho, in your forum post/response if you need immediate assistance or want additional support or context on an issue you are having with our software or integrations.

Having an issue with our platform, services, or integrations?

Try using our new bug tool to report this and receive emailed updates as we proceed to address it internally.

View solution in original post

5 REPLIES 5

juanoldinho
Level 7
Hi,

I am currently looking into this and will advise you on what information I find that is applicable to your situation.
Please tag me, @juanoldinho, in your forum post/response if you need immediate assistance or want additional support or context on an issue you are having with our software or integrations.

Having an issue with our platform, services, or integrations?

Try using our new bug tool to report this and receive emailed updates as we proceed to address it internally.

juanoldinho
Level 7
Hi 

Have a look at the documentation regarding In App Purchases, specifically Consuming an IAP:
https://developer3.oculus.com/documentation/platform/latest/sdk-reference/request-iap-consume-purcha...

Here is some additional documentation regarding In App Purchases:
https://developer3.oculus.com/documentation/platform/latest/concepts/dg-iap/

Let me know if this answers your question.
Please tag me, @juanoldinho, in your forum post/response if you need immediate assistance or want additional support or context on an issue you are having with our software or integrations.

Having an issue with our platform, services, or integrations?

Try using our new bug tool to report this and receive emailed updates as we proceed to address it internally.

TrevJT
Level 4
@juanoldinho Thanks! I forgot to consume the purchase.

        IAP.ConsumePurchase("MILLION");

handsomeguoguo
Level 2
@TrevJT

Hi,
I met the same problem currently.
So Just Add this code  "" IAP.ConsumePurchase("MILLION");" just in the purchase method like this:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~the code is added to a button~~~~~~~~~~~~~~~~~~~~~~~~~

    private void LaunchCheckoutFlowCallback(Message<Purchase> msg)
    {
        if (msg.IsError)
        {
            PlatformManager.TerminateWithError(msg);
            return;
        }

        Purchase p = msg.GetPurchase();
        IAP.ConsumePurchase(CONSUMABLE_1);  //这一句是后来加上来的。试试看
        Debug.Log("purchased " + p.Sku);
        m_gameController.AddPowerballs(3);
    }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Am i right?

handsomeguoguo
Level 2
 public void BuyPowerBallsPressed()
{

#if UNITY_EDITOR
m_gameController.AddPowerballs(1);
#else
IAP.LaunchCheckoutFlow(CONSUMABLE_1).OnComplete(LaunchCheckoutFlowCallback);
#endif

IAP.ConsumePurchase(CONSUMABLE_1); //Added the IAP.ConsumePurchase() Method
}

private void LaunchCheckoutFlowCallback(Message<Purchase> msg)
{
if (msg.IsError)
{
PlatformManager.TerminateWithError(msg);
return;
}

Purchase p = msg.GetPurchase();
Debug.Log("purchased " + p.Sku);
m_gameController.AddPowerballs(3);
}

Above is my new code. Finally it can buy the product multi-times.
While the problem is:If I buy it again immediately after the last time buy action without doing anythings else, it still tell me that
"You already own this item. You have purchased this item before.''  
So do you met with this problem before and how to handle it?