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

Native Development

Reply
Super Contributor
JeffLemon
Posts: 440
Registered: ‎01-13-2011
My Device: Playbook

Get Existing Payments?

Im trying to get existing payments but it's always coming back with an error.

 

Also I can only try this in the live version of my app as Get existing purchases (network) not supported in test mode. is there a way to test it in development mode?

 

Here is the get existing purchases code that comes back with an error from the server:

 

const ExistingPurchasesReply *reply = paymentManager->requestExistingPurchases(refresh);
    connect(reply, SIGNAL(finished()), SLOT(existingPurchasesResponse()));

 This works but comes back with an error. I set refresh to true, should it be false?

 

Thanks for any help

--------------------------------------------------------------------------------------------------
BlackBerry Apps: Instruments | ARTPAD | Piano | Drums | Xylophone
Developer
mzex
Posts: 368
Registered: ‎06-30-2012
My Device: Playbook, Z10LE, DevAlpha C

Re: Get Existing Payments?

I think that doesn't work if app is not dwnloaded from BBWorld. So, if you are debugging locally, that is not working.

Developer
Ebscer
Posts: 875
Registered: ‎08-31-2009
My Device: 9530, 9630, 9800, 8530, 9900, 9810, 9930, PlayBook, Dev Alpha

Re: Get Existing Payments?

This does not work in test mode...


Read my thoughts on BlackBerry Development at news.ebscer.com
Super Contributor
JeffLemon
Posts: 440
Registered: ‎01-13-2011
My Device: Playbook

Re: Get Existing Payments?

Yes, I know this does not work in test mode. But how am I supposed to test it? There's an error in the code becuase it does not work in the live version of the app, but I am following exactly how the documentation states.

 

I can't exactly keep submitting a new version to debug this.

 

Could someone shed light on how to fix this or test it easily?

--------------------------------------------------------------------------------------------------
BlackBerry Apps: Instruments | ARTPAD | Piano | Drums | Xylophone
Developer
slashkyle
Posts: 820
Registered: ‎10-16-2012
My Device: Red Z10

Re: Get Existing Payments?

I have yet to test this in release mode, but in test mode this works to check for existing purchases

 

onExistingPurchasesResponseSuccess: {
     if (receiptsString == "(No purchases)"){
          console.log("Unable to find existing purchase")
     } else {
          console.log("Existing purcahse found - receipt: " + receiptsString)
   }
}