Developer's Guide

Mobile Payments Library Developer Guide & Reference Blackberry OS Edition 8
Also, import the appropriate classes into your application classes. The following classes
must be imported:
import com.paypal.blackberry.ui.CheckoutButton;
import com.paypal.
blackberry
.PayPal;
import com.paypal.blackberry. components.PayPalReceiverDetails;
import com.paypal.blackberry.PayPalPayment;
or
import com.paypal.blackberry.AdvancedPayPalPayment;
import com.paypal.blackberry.util.BigDecimal;
NOTE: Since the PayPal Mobile Payments Library uses restricted APIs such as networking,
all applications implementing it will need to include RIM signing.
Required Methods in the Mobile Payments Library
initWithAppID Method
The
initWithAppID
method creates and returns the PayPal object. You must pass in the unique
application ID (appId) that PayPal has provided and the context. You can choose whether to use
the live or sandbox server, or use non-networked (Demo) mode (see below).
static public PayPal initWithAppID(String appId,
PayPalEnvironmentType environmentType)
An example of initializing the Library with this method is:
try{
PayPal ppObj = PayPal.initWithAppID("App-80W284485P519543T",
PayPal.ENV_SANDBOX);
}catch(PayPalBlackberryLibraryException e) {}
Parameter Description
appId:
(Required) PayPal Application ID from X.com.
This is different for each server; thus, the appId is different for Live
and Sandbox. Any appId value can be used when testing on None
since the library does not contact the server when set to this.
environmentType:
(Required) Sets the PayPal environment to Live, Sandbox, or None.
Allowable values
are:
ENV_LIVE Use the PayPal production servers.
ENV_SANDBOX
Use the PayPal testing servers.
ENV_NONE
Do not use any PayPal servers. Operate in
demonstration mode, instead. Demonstration mode lets you view
various payment flows without requiring production or test
accounts on PayPal servers. Network calls within the library are
simulated by using demonstration data held within the library.