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
JimmyO
Posts: 93
Registered: ‎02-03-2011
My Device: Not Specified

payment system, id vs sku, in-app purchases

Hello - I am a little confused by the payment system documentation.  The 'basic app' example for AIR

 

https://bdsc.webapps.blackberry.com/air/documentation/ww_air_services/Creating_basic_application_ms_...

 

shows the following arguments for paymentSystem.purchase:

 

paymentSystem.purchase(null,digitalGoods.getItemAt(index).sku, digitalGoods,getItemAt(index).name, digitalGoods.getItemAt(index).metadata, digitalGoods,getIteamAt(index).appName, digitalGoods,getItemAt(index).icon);

 

In that same article, there is a link showing "Arguments for purchases", and that link lists the following (in this order):

https://bdsc.webapps.blackberry.com/air/documentation/ww_air_services/Purchase_arguments_1320194_11....

 

digitalGoodSKU, digitalGoodID, digitalGoodName, metadata, purchaseAppName, purchaseAppIcon.

 

In the definitiions on that page it says that either sku or id are required, and if both are provided then id is used.  It further defines the sku as an alphanumeric string but does not specify anything for the id (which I assume is the id provided in the app world - in my case a 6 digit number).

 

I have tried numerous combinations and permutations, but no luck in getting my in-app purchase to work. My questions:

1. Is the order of arguments (i) sku then id, or (ii) id then sku?

2. If I choose to use id and leave sku as null or blank, is id alphanumeric (eg Paymentsystem.purchase("123456")), or an int (eg paymentsystem.purchase(123456) )

 

Thanks for any info anyone can provide. Right now my potential purchasers are getting an error code 30242 which is triggered by trying to purchase a good that is not associated with the app.

 

...Jim

 

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

Re: payment system, id vs sku, in-app purchases

I use

purchase( null, id, name, null, "myappname", "http_url_to _image.png" );
Regular Contributor
JimmyO
Posts: 93
Registered: ‎02-03-2011
My Device: Not Specified

Re: payment system, id vs sku, in-app purchases

[ Edited ]

Thanks John.  This is different than the documentation, or at least the example.  For greater clarity:

 

What is id / where do you find it? is it a String or Int?

 

What is name?  String?  Is this the name of the digital good? 

 

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

Re: payment system, id vs sku, in-app purchases

id is a string that is the same in the digital goods in the vendor portal. The "name" is a human readable version of the goods.