In-App Payments Support

in-app_payments_android_api

 

The BlackBerry Runtime for Android supports in-app payments through BlackBerry World. You can add digital goods in the BlackBerry World vendor portal and then offer them for sale in your application. You can use the same digital goods SKUs that you used as the item ID in the Android payment system. Users who purchased goods in your Android app won’t have to do anything to access those goods on their BlackBerry device.

 

There are a few things to keep in mind when adding this functionality to your ported Android app:

  1. To test your in-app purchases, follow the steps outlined here.
  2. Only one purchase may be made at a time; concurrent transactions are not currently supported.
  3. Refunds are not supported from the APIs.
  4. Subscriptions are not supported. However, you can offer users an alternative way to buy the content that is available through subscriptions. For example, you could create standard in-app products (one-time purchases) that give access to similar content as your subscriptions for longer intervals, such as a year.
  5. Transaction responses are not signed, so they cannot be checked.

Transaction Responses Are Not Signed

If your application attempts to verify the transaction response signature, then you will need to make a change to disregard this value if testing on a BlackBerry 10 device. The easiest way to tell if your application is running on a BlackBerry device is to use the following code:

java.lang.System.getProperty("os.name").equals("qnx")

If the above check is true then you should skip the transaction signature verification.

Terminology

There are a few differences in how components will be referred to when switching to the BlackBerry World Payment system. Below is a list of some of the most common changes:

 

Android BlackBerry

ItemId

digitalSKU

Managed transactions

  • Equivalent to Not Consumable transactions on the BlackBerry platform.

  • Can be bought only once.

  • BlackBerry World keeps track of the purchases and they will be preserved through device switches.

Unmanaged transactions

  • Equivalent to Consumable transactions on the BlackBerry platform.

  • BlackBerry World keeps track of purchased consumable items. The Android Market does not.

Optional developer payload

Metadata