Arguments for purchases

The following table describes the arguments that you can pass to PaymentEngine.purchase().

Argument

Description

digitalGoodSKU

  • Required argument (can be substituted with the ID).
  • An identifier that you assign to digital goods when you register the digital goods in the BlackBerry App World vendor portal.
  • An alphanumeric string that can contain hyphens (-) and underscores (_), must not contain only numbers, and is 5 to 100 characters in length.
  • If specified along with the ID, the SKU is ignored.

digitalGoodID

  • Required argument (can be substituted with the SKU).
  • An identifier that the vendor portal assigns to your digital goods after you register the digital goods in the vendor portal.
  • If specified along with the SKU, the SKU is ignored.

digitalGoodName

  • Optional argument.
  • A name that overrides the name that you specified for the digital goods when you registered the digital goods in the vendor portal (the registered name might be a generic name that describes an entire batch of digital goods).
  • Appears on the purchase confirmation dialogs in your application to provide users with context for what they are purchasing.

metadata

  • Optional argument.
  • A unique identifier that is required if you need to differentiate between the digital goods that reference the same SKU (for example, if your application sells eBooks, the identifier could be an ISBN number).
  • Returned with each Purchase object when you make a getExistingPurchases() call.

purchaseAppName

  • Optional argument.
  • Overrides the application name retrieved from the application descriptor.
  • Should always be specified if the name of the application, as it appears on the Home screen of the device, can change dynamically (for example, if the application name changes when the icon for the application receives focus).
  • Appears on the purchase confirmation dialogs in your application to provide users with context for what they are purchasing.

purchaseAppIcon

  • Optional argument
  • Overrides the icon for the application that the purchase request originates from
  • Should always be specified if the icon for the application, as it appears on the Home screen of the device, can change dynamically (for example, if the icon changes when new content is available in the application).
  • Appears on the purchase confirmation dialogs in your application to provide users with context for what they are purchasing.

Related links

Creating a basic application