Payment Service SDK v1.8 for BlackBerry Java has been released!

Java Development

I am pleased to announce that the Payment Service SDK version 1.8 (“Version 1.8”) is now available for download. This update is specifically for BlackBerry® Java® development and adds three new features:

  1. Asynchronous Retrieval of Purchase History
  2. The DigitalGood Class
  3. Asynchronous Retrieval of Digital Goods Available for Purchase

Asynchronous Retrieval of Purchase History

In the previous Payment Service SDK version 1.5 (Version 1.5), only synchronous retrieval of purchase history was possible. This meant that when retrieval was occurring, the user interface would be unusable – a busy indicator would be displayed. This was acceptable for some situations but it could really impede usability of the application. With Version 1.8, you can now program your application to perform this pull request asynchronously using the following line of code:

PurchaseHistory.get(PurchaseHistoryListingListener purchaseHistoryListingListener);

The PurchaseHistoryListingListener interface has only 2 methods:

PurchaseHistoryListingListener(){
public void error(String message, int errorCode) {
}
public void success(Purchase[] goods) {
 }
};

The huge benefit here is that it is very easy to retrieve the purchase history of a user in the background without causing any impact to the user interface.

The DigitalGood Class

In Version 1.5, digital goods existed only in the BlackBerry App World™ storefront client. There are no actual classes in the Payment Service SDK to encapsulate what a digital good object actually is. Version 1.8 adds a DigitalGood class to do just this. The new DigitalGood class allows the application to retrieve information about the goods hosted on BlackBerry App World available for purchase by the user, where the Purchase class previously used only provides information about the actual purchase. The big benefit of this class: a developer can add new items to the Vendor Portal without needing to release a new version of their application. This new addition is also greeted with a way to retrieve all available digital goods asynchronously (continued in the next section).

Asynchronous Retrieval of Digital Goods Available for Purchase

The method to retrieve a list of digital goods available for purchase by the user is very similar to that used above to retrieve the PurchaseHistory. First, call the DigitalGoods#get() method passing in your DigitalGoodsListingListener:

DigitalGoods.get(DigitalGoodsListingListener digitalGoodsListingListener);

In your DigitalGoodsListingListener implement the 2 defined methods:

DigitalGoodsListingListener(){
public void error(String message, int errorCode) {
}
public void success(DigitalGood[] goods) {
}
};

This is virtually identical to the PurchaseHistoryListingListener implementation; however, the success() method receives an array of DigitalGood objects as opposed to Purchase.

The above three new features are easy to implement and should help simplify the development logic as well as improve the overall user experience of your application. You can find the new Payment Service SDK version 1.8 available for download here. The download includes full JavaDocs, and additional documentation (developer’s guide, release notes) can be viewed here.

About garett

Garett is a member of the Developer Relations team and has been with BlackBerry since 2008. He specializes in app monetization (Payment, Advertising, Analytics SDKs) and Push development. He is one of the individuals involved with the forums (gbeukeboom), Issue Tracker and can be found tweeting from @BlackBerryDev with the ^GB signature.

Join the conversation

Show comments Hide comments
+ -
blog comments powered by Disqus