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

Native Development

Trusted Contributor
Posts: 195
Registered: ‎03-12-2012
My Device: PlayBook
My Carrier: None

Does paymentservice_get_existing_purchases_request work in sandbox mode?

Does paymentservice_get_existing_purchases_request work in sandbox?


I am testing in-app purchase using my draft version in sandbox.  However, even though the "purchase" went through successfully, paymentservice_get_existing_purchases_request keeps returning 0 as the number of purchases.  In other words, my app in draft has been unable to get into an unlocked mode.


However, everythings works fine in local testing mode.  Has something changed with the BB payment server?  I have never had such problems before.

Sweet Apps for the Fans
New Developer
Posts: 14
Registered: ‎11-28-2013
My Device: BlackBerry Z30
My Carrier: BlackBerry

Re: Does paymentservice_get_existing_purchases_request work in sandbox mode?

[ Edited ]

Hi, recently I've been working on restore purchases as well.


I can say that u must test this function on sandbox mode, else it wont work.


I'm googling and found your post even though this question has been around for more than half years and no one is replying. I'm really disappointed with all the official BB support engineers. It's such a painful process to develop apps in BB rather than Android/iOS as BB is really lack of supports.


Anyway I'm facing a similar issue, which is whenever I call this function, then the app will crash. (It will not crash if the user has purchased something before, it only crash if the user hasn't purchase anything). Just wonder do u know or did u encountered something like this before?


I've opened a post in this forum as well

Posts: 285
Registered: ‎08-06-2010
My Device: Z10

Re: Does paymentservice_get_existing_purchases_request work in sandbox mode?

It doesn't work unless you export your app as a full release BAR. 

Follow me on twitter @RileyGB - https://twitter.com/RileyGB
View my BB10 OpenSource projects - https://github.com/RileyGB/BlackBerry10-Samples
Posts: 1,066
Registered: ‎03-20-2013
My Device: Red LE Developer Z10
My Carrier: Fido

Re: Does paymentservice_get_existing_purchases_request work in sandbox mode?

No, this won't work either. If you do a sandbox test of the payment system, no real purchases ever take place, so there is no history to retrieve. The documentation makes this very clear.


What I do to test my payment code is to simulate the existing purchases call in my debug code, triggering the existing payments handler slot directly with simulated purchases, which allows me to test what my app will do when there are existing purchases.

RileyGB wrote:

It doesn't work unless you export your app as a full release BAR. 

Developer of Built for BlackBerry certified multiFEED RSS/Atom feed reader and aggregator.  multiFEED Icon

Play nice: Clicking Like Button on posts that helped you not only encourages others to continue sharing their experience, but also improves your own rating on this board. Also, don't forget to accept a post if it solves your problem or answers your question.