Developer's Guide

16 July 2011 PayPal Mobile Payments Developer Guide and Reference Android OS Edition
Optional Methods in the Mobile Payments Library
getInstance Method
This method returns the singleton PayPal object.
PayPal payPal = PayPal.getInstance();
setLanguage Method
payPal.setLanguage(String emailOrPhone);
Enable / Disable Shipping Method
This method lets buyers include display of shipping addresses in the Library. With shipping
enabled, buyers can choose an address from the list available in their PayPal accounts. The
chosen shipping address is then used for the payment. Shipping is enabled by default.
payPal.setShippingEnabled(boolean isEnabled);
setFeesPayer Method
This method is valid only for Personal payments only. Call this method to set who pays any fees,
by default. If you do not call this method, the receiver pays any fees by default.
payPal.setFeesPayer (int feesPayer);
setDynamicAmountCalculationEnabled Method
This method lets you recalculate the payment amount, tax, currency, and shipping values based
on the shipping address chosen by a buyer. If you use this method to enable dynamic amount
calculation before the checkout starts, the library will dynamically update the payment based on
logic you provide (see above).
NOTE: If shipping is not enabled, this method is ignored.
payPal.setDynamicAmountCalculationEnabled(boolean enabled);
Activity Results for the Mobile Payments Library
You will receive the payment results through the onActivityResult method. This method
must be overridden in the same class in which you called startActivityForResult. There
are three possible results. The first two are native Android Activity results. The third result is a
custom result for the Library.
In addition to these activity results, a successful payment callback is provided to note when the
payment is successfully completed. These Activity results are only posted when the library
Activity has terminated and control of the UI has passed back to the host Application: