Developer's Guide

14 July 2011 PayPal Mobile Payments Developer Guide and Reference Android OS Edition
public MEPAmounts adjustAmount(MEPAddress address, String currency,
String amount, String tax, String shipping);
Parameter
Description
address
The buyer's address that should be used when calculating adjusted tax
and shipping amounts.
currency
The currency of the payment.
amount
The current subtotal amount.
tax
The current tax amount.
shipping
The current shipping amount.
Your method must return a new MEPAmounts object (see Custom Objects section). This object
contains the new currency and amounts.
public Vector<MEPReceiverAmounts> adjustAmountsAdvanced(MEPAddress
address, String currency, Vector<MEPReceiverAmounts> receivers);
Parameter
Description
address
The buyer's address that should be used when calculating adjusted tax
and shipping amounts.
currency
The currency of the payment.
receivers
A collection of current receivers and the amounts associated with each
receiver.
Your method must return a new Vector<MEPReceiverAmounts> to update the library with
adjusted amounts for each receiver. (See Custom Objects section).
Applications may cancel a payment during the PaymentAdjust callback by returning 'null'.
Returning null will cancel the entire payment. A dialog will be presented to the user indicating
that the adjustment failed and the payment is being cancelled. Applications may also call
PayPal.setAdjustPaymentError(String message) to establish the message that will be presented.
Otherwise a standard message will be used. The error message should be established prior to
failing the the payment adjust.
When you create the PayPal Activity, you must pass through the PaymentAdjuster class to
another form of the checkout method. For example, if you created an “AdjustAmounts” class
that implements PaymentAdjuster and contains the adjustAmount method, your code could
be:
AdjustAmounts adjustClass = new AdjustAmounts();
Intent paypalIntent = PayPal.getInstance().checkout([your payment
object], this, adjustClass);
this.startActivityForResult(paypalIntent, 1);