Testing your application

The Payment Service supports live testing with the Payment Service server. To test an application, you must have access to the Payment Service server. You must also have the BlackBerry World storefront 3.1 or later installed on the BlackBerry device, the BlackBerry PlayBook tablet or the BlackBerry Smartphone Simulator.

Local testing

Local testing permits you to test the purchase of digital goods without making any network calls to the Payment Service server. During local testing, the Payment Service enables your application to simulate the purchase process. Testing your application locally is useful for verifying that your application deals with the results of a purchase the way you intend it to. To enable local testing, you must invoke PaymentSystem.setConnectionMode(PaymentSystem.CONNECTION_MODE_LOCAL) in your application.

Purchase attempts are always successful unless you manually change the result. You can use the following dialog box to test different purchase results, and to see the error messages that PaymentSystem throws. For details about the error messages, see Error messages.


You can use the following dialog box to specify whether or not a digital good has a subscription.


Keep in the mind the following when you test your application locally:
  • paymentSystem.getPrice() always returns a price of $3.99 for a digital good, and the digital good does not have a subscription.
  • You can buy a subscription for a digital good more than once. During live testing, you can buy a subscription for a digital good only once.

Live testing

You can test the purchase of digital goods on the live Payment Service server without being charged money. Make sure that you have access to the Payment Service server, then install the BlackBerry App World storefront on a BlackBerry device or a BlackBerry PlayBook tablet. To test your applications live, perform the following actions:

  • Add your application to the vendor portal for BlackBerry App World (the application can remain in the Draft state).
  • Add digital goods and a release bundle to your application in the vendor portal.
  • Register for a BlackBerry ID account at http://na.blackberry.com/id.
  • Create a sandbox account by registering your BlackBerry ID in the vendor portal.

After you add your application and digital goods, you can download your application from BlackBerry App World and start testing the purchase process on the live Payment Service server.

By registering the BlackBerry ID with the vendor portal, you can use the BlackBerry ID to perform test purchases of applications and the digital goods in those applications. When you log in using your BlackBerry ID, you initiate and simulate a purchase without incurring charges to your account. You can use your BlackBerry ID to purchase only the digital goods associated with your BlackBerry App World vendor account.

You cannot test reconciliation of purchased digital goods because live testing does not generate a purchase history.

For more information about submitting applications and creating sandbox accounts, see the BlackBerry App World vendor documentation at http://www.blackberry.com/go/appworld/vendordocs.

Create a sandbox account

  1. On the vendor portal for the BlackBerry App World storefront, click Sandbox.
  2. Click Add New User.
  3. In the Email field, type the email address associated with a BlackBerry ID.
  4. In the Description field, type a description for the sandbox account.
  5. Click Create.

Download an application before you make it available for distribution

Before you begin:
  • Add your application, a release bundle, and digital goods in the vendor portal for the BlackBerry App World (the application status can remain as Draft).
  • Create a sandbox account in the vendor portal using a BlackBerry ID.
If your application has any distribution restrictions (such as the BlackBerry device models or BlackBerry Device Software versions that it supports), make sure that the BlackBerry device that you download the application to is compatible with your application, otherwise you won't be able to locate your application in the BlackBerry App World storefront.

If you purchase another vendor's application or digital goods using your BlackBerry ID account that is configured for testing, the transaction is real, not simulated, and your account is charged. You can simulate only the purchases of your own applications and digital goods.

  1. On the Home screen of the device, click the BlackBerry App World icon.
  2. Press and hold the alt key while pressing t, s, and t.
  3. Provide the Content ID or SKU for your application.
  4. Click OK.
  5. Provide your BlackBerry ID login information.
  6. On the Details screen for your application, click Purchase.
  7. Complete the instructions on the screen to download the application.
After you finish: You can use the same BlackBerry ID login information to purchase the digital goods that your application offers.