Developer's Guide

Mobile Payments Library Developer Guide & Reference Blackberry OS Edition 9
NOTE: The Mobile Payments Library binds specific devices to specific application IDs, for
enhanced security. For each of your application IDs, you must use a different sandbox
account for each of your devices. If you log in with a different account on a device
after binding, you receive the following error: This app is attached to another PayPal
account. To remove it, the account holder must visit PayPal.com and select Mobile
Applications from the profile.”
To switch a device or simulator to use a different sandbox account, go to the PayPal
Sandbox website on your computer, log in with the account that was used on the device,
select Profile > Mobile Applications, and then unbind the device from the application ID.
getCheckoutButton Method
You must obtain the Pay with PayPal payment button from the Mobile Payments Library.
Create a local instance of CheckoutButtonclass (a subclass of ButtonField), which you can
place in your application, and retrieve the button from the PayPal instance. As precondition,
library should be initialized before a call to this method can be made (e.g. initWithAppId
method should be called) or an exception will be thrown.
public synchronized Field getCheckoutButton(String fieldClassName,
FieldSize buttonSize, TextType textType)
Example code of adding the Payment button to your application:
CheckoutButtoncheckoutButton = (CheckoutButton)
payPal.getCheckoutButton(PayPal.BUTTON_152x33,
CheckoutButton.TEXT_DONATE);
add(checkoutButton);
Parameter Description
fieldSize:
(Required) Size and appearance of the Pay with PayPal button.
Allowable values
are:
PayPal.BUTTON_152x33
PayPal.BUTTON_194x37
PayPal.BUTTON_278x43
PayPal.BUTTON_294x45
For images of the different button types, see Enumerated Values in the
Mobile Payments Library on page 24
textType:
(Required) The type of button to be used. The type will determine the
text that is to be used on the button. This has no bearing on the payment
and affects only the button itself. Allowable values are:
CheckoutButton.TEXT_PAY
CheckoutButton.TEXT_DONATE
Implement the Delegate
If you want to be informed about payment status and payment result and take custom actions
(e.g. display custom views) you should implement the delegate classes. The Library
communicates back with your application using Java event listeners and delegates. When adding a