Developer's Guide
Mobile Payments Library Developer Guide & Reference – Blackberry OS Edition 7
1. PayPal Mobile Payments Library
This section provides details about the Mobile Payments Library API, and it provides
instructions and examples for integrating the library with your Blackberry application.
Mobile Payments Library API Reference
The flow of the library is:
1. Your application initializes the PayPal instance with your unique PayPal application ID.
2. You retrieve the PayPal instance.
3. You retrieve the PayPal button from the instance using the
getCheckoutButton method. You can place the button on the screen.
4. You create and fill the
PayPalPayment
object to store the payment information.
5. (Optional) Your application enables Dynamic Amount Calculation (see step 7) to
recalculate the payment amount, tax, currency, and shipping values depending on
the shipping address. The recalculation occurs when the address is first received
from the server and any time it is changed.
6. When buyers select the Pay with PayPal button, the library takes them through the
PayPal Checkout experience.
7. (Optional) If you enabled dynamic amount calculation (step 5 above):
a. When a buyer chooses an address for the payment, the library returns a call
back to your application with the address information.
b. Your application recalculates the payment and other amounts, based on the
address.
c. The library continues the buyer with the checkout experience, which uses
the updated
payment amount, tax, currency, and shipping values. This
might include returning to library should point a) presents a custom view
for address information.
8. After buyers complete their payments, the library triggers the corresponding event in
the object implementing the PayPalPaymentDelegate interface, returning
control to you with the results of the payment.
Adding the Library Jar File and Importing Classes in Eclipse
1. Right-click on your project and select “Properties”.
2. Select “Configure Build Path”.
3. Select the “Libraries” tab.
4. Select the “Add External JARs…” button.
5. Choose the “PayPal_MPL.jar” file from your folder structure and click “OK”.