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

BlackBerry® World™ Development

Reply
Contributor
abhilogix
Posts: 14
Registered: ‎08-09-2012
My Device: 9790

Urgent: Payment SDK API

Hello,
I am using Payment SDK v1.8 in my app. I have uploaded the test app on App world with list of digital goods and their SKUs.
Now I am trying to retrieve the list of Digital Goods using: DigitalGoods.get(digitalGoodsListener); and I am getting callback in public void success( DigitalGood[] digitalGoods ).
But I am not getting anything in digitalGoods.length.
Can anyone please help?
-Thanks in Advance.
 

 

Please use plain text.
Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: Urgent: Payment SDK API

Hi and welcome to the forums!

Is the digitalGoods array null?
How was the application installed to your device?
Are you able to make purchases from within your application using hard-coded values that match those set in your Digital Goods?
Garett
@garettBeuk
--
Goodbye everybody!
Please use plain text.
Developer
mapleleafs90
Posts: 374
Registered: ‎02-12-2011
My Device: Bold 9780

Re: Urgent: Payment SDK API

sucess only returns the digital goods owned by the user. If you dont own any goods from your app, it will be zero.
Please use plain text.
Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: Urgent: Payment SDK API

Success should return all DigitalGoods available on the system, PurchaseHistory is the call to retrieve purchases made by the user.

Garett
@garettBeuk
--
Goodbye everybody!
Please use plain text.
Developer
mapleleafs90
Posts: 374
Registered: ‎02-12-2011
My Device: Bold 9780

Re: Urgent: Payment SDK API

Are you sure. In my app i use the success function to retrieve OWNED goods.

 

For example I only have 1 good, so I do

 

if (goods.length > 0)

fullversion = true //they bought the good and have full access to my app

 

This has worked fine, I am assuming if it retrieved all the goods offered by the App then it would always allow everyone to be able to access my app full version.

Please use plain text.
Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: Urgent: Payment SDK API

I am positive, I have tested this several times and it is exactly how it is explained in the Release Notes:

DigitalGoods.get() returns a list of digital goods available for purchase in the application.

PurchaseHistory.get()

 returns the user's purchase history for an application.

 

http://docs.blackberry.com/en/developers/deliverables/40142/New_in_this_release_1935050_11.jsp

Garett
@garettBeuk
--
Goodbye everybody!
Please use plain text.
Developer
mapleleafs90
Posts: 374
Registered: ‎02-12-2011
My Device: Bold 9780

Re: Urgent: Payment SDK API

[ Edited ]

My apologies I was unaware of DigitalGoods.get();

 

In fact I am using PurchaseHistory.get() to retrieve my purchases when I checked my source now.

 

In regards to the original question. make sure you have created the digital goods first of all, are they in draft status?

 

Perhaps the goods will only be listed once they are submitted and approved. This is just a guess of course, perhaps someone else could chime in on this thought.

Please use plain text.
Contributor
abhilogix
Posts: 14
Registered: ‎08-09-2012
My Device: 9790

Re: Urgent: Payment SDK API

Thank You for the reply and Sorry for the late reply.

Finally I got the correct digitalGoods array by uploading the app in draft state.

I have another question:

I want to test Purchase request: i.e. PurchaseResult purchaseResult = engine.purchase(arguments.build());

I do not want to do actual money transaction. Can you please tell me how can I do this? 

-Thanks again. 

 

Please use plain text.
Developer
mapleleafs90
Posts: 374
Registered: ‎02-12-2011
My Device: Bold 9780

Re: Urgent: Payment SDK API

[ Edited ]

Good to hear.

 

All you need to do is run the line that you've done to process a purchase, then if you want to test it just go to sandbox in your developer portal and add your BBID e-mail that you are testing with. Once you do this, just run the purchase on your phone and use the same BBID to login for the payment, purchase it and it will not charge you (Even if it does have the price on the checkout screen).

 

You can check to see if the payment was successful directly after by checking the method purchaseResult.isSuccessful();

Please use plain text.