Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Payment Service

Reply
Developer
Posts: 654
Registered: ‎10-08-2009
My Device: Bold 9900
My Carrier: Telus

Get Existing Purchase Error

Hi, I am testing getting existing purchases and I am running into an error that I have no idea what it's talking about. Without further ado, here's the error:

 

Error Code: 3

Error: The parent application could not be located within the reconcile cache

 

Here's how I implemented the getting existing purchase.

 

1. User first opens the app and the app checks for existing purchase request to the server

2. With onExistingPurchasesResponseSuccess, I awknowledge that successful restore request have been made and save a value to use so that next time the app opens, it doesn't check the server again.

 

The problem is, with the above error occuring when the existing purchase request have been made, #2 doesn't get initiated and as a result, the app sends request to the server every time. Then, everytime it fails, it pops that message to the user again.

 

Is that error occuring because the app is still "Under review" in app world and I've downloaded via BlackBerry World via sandboxed account? Once the app is downloaded after it's approved, will the error go away?

----------------------------------------------------------
Twitter: @gyubok
Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Get Existing Purchase Error

Which OS are you using for testing? There was an issue where if no purchases existed then an error would be returned, error 3 to be specific. 

 

This should not affect external users once the app goes live. To verify your logic is correct you can make purchases in sandbox mode then make the call to requestExistingPurchases(false) to query the cache, the purchase receipts will be returned in the same manner as if passing in 'true'.

Garett
@garettBeuk
--
Goodbye everybody!
Developer
Posts: 78
Registered: ‎12-12-2012
My Device: playbook
My Carrier: free

Re: Get Existing Purchase Error

Then, we cannot test really the get existing purchases?

 

If I test in sandbox with first param of paymentservice_get_existing_purchases_request to true, then my game crash.

 

I will update to SDK 10.2 and try again.

Developer
Posts: 78
Registered: ‎12-12-2012
My Device: playbook
My Carrier: free

Re: Get Existing Purchase Error

Then with 10.2 native SDK I have again the same crash when I call

 

unsigned request_id = 0;
        if(paymentservice_get_existing_purchases_request(true, get_window_group_id(), &request_id) != BPS_SUCCESS)
        {
            STD_Printf("Error: restore transaction failed.\n");
        }
        STD_Printf("Purchase restore request ID %d\n", request_id);

 

 

Note that game crash only in sandbox mode. If I test in local mode an error occured but no crash. If I use the cache with the false first params then I have an error.

 

Will be crash when released?

Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Get Existing Purchase Error

The game should not crash, it sounds like a bug in your app logic...

Garett
@garettBeuk
--
Goodbye everybody!
Developer
Posts: 78
Registered: ‎12-12-2012
My Device: playbook
My Carrier: free

Re: Get Existing Purchase Error

Yes it should not.

 

I initiate all the payment service and when I purchase an item all is ok.

 

But if I call the code above then my game crash (only in draft mode in sandbox). Then I hope in release not.

 

In local mode with or without debug test mode then I only have an error and enter in the if statement (but this seems normal because local mode does not support real transaction).

Contributor
Posts: 38
Registered: ‎09-06-2013
My Device: BlackBerry Z10
My Carrier: Claro

Re: Get Existing Purchase Error

you can look for saving the purchase with the object QSettings, that is the easiest way to save your user's settings and leave the request to the server as an "else" option



_______________________________________________________
If you've been helped click on Like Button, if you've been saved download the app.

Developer of Easy Memes