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

Adobe AIR Development

Reply
Regular Contributor
Posts: 93
Registered: ‎02-03-2011
My Device: Not Specified

in-app purchase error code 30242

Hi Folks - I am at my wit's end. I have developed an app in Adobe AIR that requires in-app purchases, followed all the appropriate instructions to upload to App World for testing.  When I try to make the in-app purchase, I receive an error message stating: error code 30242.  From another post in webworks (http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Payment-API-PlayBook-quot-There-...) , error code 30242 is thrown: 

  1. If you try to purchase a virtual good belonging to another application; or
  2. If the purchasing application was not installed through App World and you are attempting to buy virtual goods.

I know that 1 is not applicable, because if I change the price of the digital good that is registered within the app that I am testing, the price change shows up in the 'confirm purchase' dialog box (and then the error is shown AFTER I confirm the purchase).

 

I know that 2 is not applicable because the app has been downloaded from the app store (in sandbox mode, using 'tst' in the app world, etc just as the testing instructions say).

 

Has anyone had a similar problem?  Any ideas on how to fix?  Thanks.

 

...Jim

 

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: in-app purchase error code 30242

[ Edited ]

I've been dealing with this issue for over a month with RIM. Either the directions are not clear or there is a problem as you describe. Did you purchase the original app, or did you download it via App World and your sandbox? Or did you side load it? Is your BBID still in your sandbox?

It seems from what I have found (and I am still trying to confirm this) that once the app is installed via the sandbox, is that you cannot seem to delete this from App World and even deleting the app, you can no longer "purchase" it and you start getting the error. My app gets this error on one device but is fine on another device that has a different BBID and was purchased normally. Once I get the app upgraded and will be able to put it in a trace mode to dump what App World is thinking with the previous purchases.

Regular Contributor
Posts: 93
Registered: ‎02-03-2011
My Device: Not Specified

Re: in-app purchase error code 30242

In my case, I am following the instructions to 'test' the purchase live on the app world (per the instructions).  So:

- the app is only 'draft' right now and downloaded via App World using sandbox.  The app itself is free, but not yet approved so I know that I am getting it only because it is in my sandbox (and the bbid is still in my sandbox).

- as I mention in my post, I know that the app is finding the digital purchase because it shows different prices for the digital purchase whenever I change the price in app world via the portal ... so it is getting to it, and the digital good is linked properly to the right app

 

 

Regular Contributor
Posts: 93
Registered: ‎02-03-2011
My Device: Not Specified

Re: in-app purchase error code 30242

Well - not that this helps narrow the problem ... but I just created a brand new app in the app world portal, uploaded the exact same .bar as my app that doesn't work ... and the sandbox test case allows a purchase of a digital good in this new app, but still does not allow it in the original app.  Could this be an 'order' issue of what I may have done to create the first app, vs what I did in the second? (eg created the app and the digital good, then uploaded the .bar? vs created the app, uploaded the .bar then created the digital good?)  Just a hunch.

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: in-app purchase error code 30242

You cannot really "test" digital goods. You can put the mode into "local" and it will show you a dialog that you can then select varied responses for testing, but there is no real way to actually test in-app purchases (just fake ones with no charges). You have to release the app at risk and assume everything will work as described in the API. For me, it seems that this works for everyone else but me. It has to do something with testing the app that screws up in-app purchases later on. Like I mentioned, I still need to test things once the version is released normally to App World. But you can only test in "local" "mode" when in "test" mode in App World.
Regular Contributor
Posts: 93
Registered: ‎02-03-2011
My Device: Not Specified

Re: in-app purchase error code 30242

That's not been my experience.  I have created an app in the app world, uploaded a bar, left it as Draft, created a digital good (which was also left as Draft), set the app world to 'tst', downloaded the app from app world using my sandbox bbid (it was a free app) then successfully 'purchased' the digital good from that app (using the same sandbox bbid).  Also, I double checked ... the code did NOT have: 

PaymentSystem.setConnectionMode(PaymentSystem.CONNECTION_MODE_LOCAL)

Furthermore, when I change the price of the digital good in app world, the price change shows up in the in-app purchase so it is definitely not in LOCAL mode.

 

I have also done the above a second time with an identical bar (different sku for the digital good) but when went to test the purchase of the digital good I got an error code 30242.  Same bbid, same playbook, etc. So that is what leads me to believe the issue (or at least the issue I am having) is somehow associated with the app world and/or how the app is created in app world or uploaded.

 

In the documentation for testing the purchase systems, it does specifically say that a digital good can be test purchased (right at the bottom):

https://developer.blackberry.com/air/documentation/ww_air_services/Testing_your_application_AIR_ms_1...

"You can use the same BlackBerry ID login information to purchase the digital goods that your application offers."


 

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: in-app purchase error code 30242

Interesting. I have a recent draft version as well and the mode is set to network and I get the same error. The trace on the error was something like that the app had to be downloaded from App World. It might be from that the test mode of App World is not considered a normal download and that is why the error is being thrown.
Regular Contributor
Posts: 93
Registered: ‎02-03-2011
My Device: Not Specified

Re: in-app purchase error code 30242

I have now created 5 test apps in app world with digital goods.  2 give me error 30242 when "live testing" a digital good purchase, and 3 work properly.  Code for all is the same, so I know the issue is not with my app.  The only item that I can determine that is consistent with the ones that work is that I create the app descriptions in app world, and then upload the .bar and then create the digital good.  For those that do not work, I know the app is 'reaching' the digital good because the digital good price is correctly reflected in the in-app purchase (ie when I change the price in the app world, the new price is reflected in the purchase request on the PB) ... however strangely enough the ones that do not work do now show the app icon for the purchase.  So my complete guess here is that when you create an app in app world, it takes a while for all the info to populate the appropriate servers ... then you can create a digital good for that app and all will be linked up properly.  If you create an app and then quickly create a digital good .. perhaps the digital good does not get properly registered as the app info is not fully saved/stored.  Again just a complete guess on my part given my limited testing here ... but from now I when I create an app, I will wait a while, then upload the .bar, and then wait a bit and then create the digital good.  

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: in-app purchase error code 30242

So you are saying the error goes away with time?
I still get errors and the digital goods have been there for months.
Regular Contributor
Posts: 93
Registered: ‎02-03-2011
My Device: Not Specified

Re: in-app purchase error code 30242

No, sorry my description was not more clear.  Once the error is there, it stays.  I have even created new digital goods on an app that gives the error and the app cannot properly purchase that new digital good either.

 

What I was trying to say was: in the limited testing I did to try to narrow down the problem: if the digital good is created for an app "a while" after that app has been created in the app world portal (in my case this was overnight but that's just the way I happened to do my testing) then the digital good purchase works, whereas in the instance where I created the digital good as quickly as possible after creating the app in the app world portal it gave me this error.  As bizarre as that might seem I believe I did everything else identical (ie steps were the same, code in the app was the same, calls to the purchase api the same, toolset the same, etc) so my only recommendation to others is to wait a while after creating an app before creating a digital good for that app...?