Skip to main content
New Participant
December 13, 2022

In-app purchase failed. errorCode=0

Hi, I have been trying to integrate IAPs into a Unity VR project using the Oculus SDK. I have a free consumable add-on defined in the developer console (I haven't set up payment info) and then in my C# code I have:

IAP.LaunchCheckoutFlow(product.Sku).OnComplete((res) => {
   LaunchCheckoutFlowCallback(res, callback);
});

Everything up to this point - retrieving the add-on etc. - works perfectly, but then when I try to run this, a popup opens and instantly closes and then I get this error in the android logcat 

[AndroidPlatformIntegration] In-app purchase failed. errorCode=0, httpStatusCode=0, errorMessage={"category":"user_canceled","code":0,"message":"The purchase has been canceled."}

and the Message<Purchase> (res) IsError is set to true in the LaunchCheckoutFlowCallback function, But I am not sure why. 

This is a build from Unity, not an uploaded build and I haven't tested if that would work. But other than that I don't know why I am getting this error.

Thanks for any help!

11 replies

New Participant
December 14, 2022

ellioteserin I'm having the exact same issue. The IAP was working fine and then suddenly stopped, so I suspect It's something on their side... I'm going to open a support ticket and I'll let you know if they find a way to solve the issue. Please do the same if you figure it out! 😊

New Participant
December 14, 2022

Ah ok, good to know I'm not the only one! And ok that's great thank you, and will do! 

Thanks!

cheesepantz
Inspiring
December 20, 2022

I am having the same problem. Is so weird. We have 2 app submission pages to test this. We have one page that has the payment information in the developer section. But even then it didn't fix the issue. We have been approved for app lab too and still it doesn't work. How are we suppose to launch without this working? There is no documentation about error code 0 either. Would be nice to have an idea what each error means so we can fix the issue. 

New Participant
December 21, 2022

Yeah, so I got this response from the Meta team, and to be honest, I don't know what else to do...:

"We recommend checking our developer documentation for possible solutions. If you are unable to resolve your issue or have additional questions, please let us know in the VR Developer Forum."

[Edit]
I've just created a thread in the Unity Forum as well to see if someone else stumbles into this problem and sees it there. Here's the link:
https://forum.unity.com/threads/oculus-integration-package-iap-error-code-0.1377210/

Participant
December 21, 2022

Also having this issue

New Participant
December 23, 2022

Disclaimer - I do not have expertise in this area. Please don't take this answer without verification.

This error message could be returned if the user who attempted to purchase this IAP was already entitled to the Consumable item but hadn't consumed that yet. This doc https://developer.oculus.com/documentation/native/ps-iap-s2s/ has details on how to retrieve it and consume.

cheesepantz
Inspiring
December 24, 2022

I think you are onto something. Weird that the examples don't show this line of process for consumables. 

Consumable purchases must be ingested by your app before they can be made available for purchase again.

Launch the checkout flow for a SKU

To launch the checkout flow for a user to complete the purchase of a specified SKU, use the following method.

ovr_IAP_LaunchCheckoutFlow()

Consume a purchased item

To consume a purchased item on behalf of a user, which then marks the item as used, in-app, use the following method.

ovr_IAP_ConsumePurchase()

Will check it on my end see if player already has these items, but has not consumed it. So, the first time this checkout flow is called, it should return no error? Then, the second time, if its not consumed, it should return an error? We had errors happen always no matter what.

My thought is that we would want to consume it when the check out flow returns success message. But I never got a return message before. Will test some more.

 

Participant
April 26, 2024

anyone was able to resolve this issue?
we are having the same 

 

 

 

New Participant
July 15, 2024

is there anyone who gets the solution?