PP MPL Developer Guide and Reference Android
PP MPL Developer Guide and Reference Android
PayPal Mobile Payments Developer Guide and Reference Android OS Edition Document Number 10116.en_US-201101
2011 PayPal, Inc. All rights reserved. PayPal is a registered trademark of PayPal, Inc. The PayPal logo is a trademark of PayPal, Inc. Other trademarks and brands are the property of their respective owners. The information in this document belongs to PayPal, Inc. It may not be used, reproduced or disclosed without the written approval of PayPal, Inc. Copyright PayPal. All rights reserved. PayPal S. r.l. et Cie, S.C.A., Socit en Commandite par Actions. Registered office: 22-24 Boulevard Royal, L-2449, Luxembourg, R.C.S. Luxembourg B 118 349 Consumer advisory: The PayPal payment service is regarded as a stored value facility under Singapore law. As such, it does not require the approval of the Monetary Authority of Singapore. You are advised to read the terms and conditions carefully. Notice of non-liability: PayPal, Inc. is providing the information in this document to you AS-IS with all faults. PayPal, Inc. makes no warranties of any kind (whether express, implied or statutory) with respect to the information contained herein. PayPal, Inc. assumes no liability for damages (whether direct or indirect), caused by errors or omissions, or resulting from the use of this document or the information contained in this document or resulting from the application or use of the product or service described herein. PayPal, Inc. reserves the right to make changes to any information herein without further notice.
Contents
Preface ............................................................................................................... 5
Purpose ........................................................................................................................ 5 Scope ............................................................................................................................ 5 OS and Hardware Support ........................................................................................... 5 Revision History ............................................................................................................ 5 Where to Go for More Information ................................................................................ 7
July 2011
3. Submitting Your Application to PayPal ................................................... 38 A. Currencies Supported by PayPal ............................................................. 39 B. Countries and Regions Supported by PayPal......................................... 41
July 2011
Preface
The PayPal Mobile Payments library provides secure, extensible, and scalable PayPal payment functionality to the Android platform.
Purpose
The PayPal Mobile Payments Library provides an easy way for you to integrate payments into your Android applications. You can download the library from X.com and include it in your application. With the library, you need only a few lines of code to integrate the payments library with your application. When a buyer makes a payment, the library controls the checkout experience logging in, reviewing, and completing the payment. After buyers complete their payments, the library returns the buyer to your application.
Scope
This document describes how to integrate the PayPal Mobile Payments Library with your application. You must create and provide your build to PayPal so PayPal can review your application before it is approved to accept payments via the library. The approval process is described later in the document.
Revision History
The following table lists revisions made to the Mobile Payments Library Developer Guide and Reference.
Version 1.5.5 Date Published July 2011 Description Initialization is recallable and completes within 3 sec down from 20-30 sec. Keep Me Logged in functionality reinstated. Merchant has the ability cancel transaction from dynamic amount calculation. Improved Tablet Support Eliminated Keep Me Logged In functionality
1.5 1.1.1
July 2011
Description Added information about preapproval; dropped support for the enumeration value BUTTON_118x24 Adaptive Payments Support First publication
July 2011
July 2011
July 2011
android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.paypal.android.MEP.PayPalActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:configChanges="keyboardHidden|orientation/> </application> <uses-sdk android:minSdkVersion="3" /> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.READ_PHONE_STATE"/> </manifest>
July 2011
The initWithAppID method creates and returns the PayPal object. You must pass in the context and the unique application ID (appID) that PayPal has provided. You can choose whether to use the live or sandbox server, or use non-networked (Demo) mode (see below).
static public PayPal initWithAppID(Context context, String appID, int server)
Description (Required) The context. (Required) PayPal Application ID from X.com. This will be different for each server. Thus, the appID will be different for Stage and Sandbox. Any appID value can be used when testing on none since the library does not contact the server when set to this.
server:
(Required) Sets the PayPal server to Live, Sandbox, or None. Allowable values are: ENV_LIVE Use the PayPal production servers. (does not support simulators) 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.
NOTE:
The initWithAppID method should only be invoked once. After initialization, reference the PayPal object using the getInstance method instead. Calling the initWithAppID method more than once will throw an IllegalStateException. If you do not set the optional parameter forEnvironment, the library defaults to use the PayPal production the servers. When testing your application, PayPal recommends that you initialize the library to use the PayPal test servers, instead. 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
PayPal Mobile Payments Developer Guide and Reference Android OS Edition
NOTE:
NOTE:
10
July 2011
account for each of your devices. If you try to login with a different account on a device after binding, you will get 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, login 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 get the Pay with PayPal payment button from the Mobile Payments Library. Use this method, which returns a CheckoutButton (a subclass of LinearLayout), which you can place in your application.
public CheckoutButton getCheckoutButton(Context context, int style, int textType);
Example code of getting the Payment button from the Library is:
CheckoutButton launchPayPalButton = ppObj.getCheckoutButton(this, PayPal.BUTTON_278x43, CheckoutButton.TEXT_PAY); RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); params.bottomMargin = 10; launchPayPalButton.setLayoutParams(params); launchPayPalButton.setOnClickListener(this); ((RelativeLayout)findViewById(R.id.RelativeLayout01)).addView(lau nchPayPalButton);
July 2011
11
Parameter style:
Description (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 28.
context: textType:
(Required) The context (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 only affects the button itself. Allowable values are: CheckoutButton.TEXT_PAY CheckoutButton.TEXT_DONATE
The Library uses the native Android Activity mechanism to start the checkout flow, and to communicate completion back to you. In addition to the onActivityResult callback, you can implement PayPalResultDelegate to be informed immediately upon successful completion of a payment. To start the PayPal payment, you must start the Library activity, using the Android method startActivityForResult. Do this when buyers touch the Pay with PayPal button (which you placed on your page with the getCheckoutButton method) You must first create the PayPal intent and give it the Payment object. There are two types of payment objects. PayPalPayment handles simple payments, which support single receivers of payments with one transaction and a few details. PayPalAdvancedPayment handles parallel and chained payments, which support multiple receivers of payment with one transaction and with additional details, such as invoice data. In the following example, the buyer checks out with a simple payment for a single recipient:
PayPalPayment newPayment = new PayPalPayment(); newPayment.setSubtotal(10.f); newPayment.setCurrency("USD"); newPayment.setRecipient("[email protected]"); newPayment.setMerchantName("My Company"); Intent paypalIntent = PayPal.getInstance().checkout(newPayment, this); this.startActivityForResult(paypalIntent, 1);
12
July 2011
In the following example, the buyer checks out with a parallel or chained payment for multiple recipients:
PayPalReceiverDetails receiver0, receiver1; receiver0 = new PayPalReceiverDetails(); //setup receiver details PayPalAdvancedPayment advPayment = new PayPalAdvancedPayment(); advPayment.setCurrency("USD"); advPayment.getReceivers().add(receiver0); advPayment.getReceivers().add(receiver1); Intent paypalIntent = PayPal.getInstance().checkout(advPayment, this); this.startActivityForResult(paypalIntent, 1);
For more information on receivers and how to use them, see Custom Objects in the Mobile Payments Library on page 23.
Parameter intent: Description (Required) A PayPalPayment object that contains information about the payment. Create this intent with the following code: Intent checkoutIntent = new Intent(this, PayPalActivity.class); For the properties of this object type, see PayPalPayment on page 24. (Required) Use any integer for the request code. When you get the onActivityResult() callback from the Library Activity, you can use this request code to know that the results are coming from the Library activity.
requestCode:
Note: On older devices and/or firmware, starting the activity may take significant time to complete, resulting in an Activity is not responding popup if the user attempts to enter input during this time. It is recommended to create a loading thread with an animation of some sort if you witness this regularly.
Dynamic Amount Calculation
The Mobile Payments Library allows you to modify the payment based on the buyers shipping address. For instance, you might want to recalculate the tax amount based on the buyers location. To enable this, use the optional method enableDynamicAmountCalculation() (see Optional Methods below. You must provide the logic that creates the new payment values based on the buyers address. The library includes a PaymentAdjuster class for this. To use this feature, one of your classes (not an Activity) must implement PaymentAdjuster, as well as implement Serializable. For simplicity, we recommend creating a new class that does this. This class must include the following methods:
July 2011
13
public MEPAmounts adjustAmount(MEPAddress address, String currency, String amount, String tax, String shipping); Parameter address currency amount tax shipping Description The buyer's address that should be used when calculating adjusted tax and shipping amounts. The currency of the payment. The current subtotal amount. The current tax amount. 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 address currency receivers Description The buyer's address that should be used when calculating adjusted tax and shipping amounts. The currency of the payment. 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);
14
July 2011
Method Sequence
The following diagram illustrates the sequence of methods required to implement the checkout experience.
July 2011
15
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:
payPal.setDynamicAmountCalculationEnabled(boolean enabled);
16
July 2011
Activity.RESULT_OK
This result is returned when a PayPal payment succeeds. The pay key is available in the Intent data as PayPalActivity.EXTRA_PAY_KEY. The code to get the pay key as a string is: data.getStringExtra(PayPalActivity.EXTRA_PAY_KEY).
Activity.RESULT_CANCELED
This result is returned if the buyer cancels the payment during checkout.
paymentCanceled(); PayPalActivity.RESULT_FAILURE
This result is returned if the payment fails for any reason other than a buyer who cancels the payment during checkout. The error id and the buyer-friendly error message are available from the Intent data as PayPalActivity.EXTRA_ERROR_ID and PayPalActivity.EXTRA_ERROR_MESSAGE. Example code on handling the response is:
@Override public void onActivityResult(int requestCode, int resultCode, Intent data) { switch(resultCode) { case Activity.RESULT_OK: //The payment succeeded String payKey = data.getStringExtra(PayPalActivity.EXTRA_PAY_KEY); //Tell the user their payment succeeded break; case Activity.RESULT_CANCELED: //The payment was canceled //Tell the user their payment was canceled break; case PayPalActivity.RESULT_FAILURE: //The payment failed -- we get the error from the EXTRA_ERROR_ID and EXTRA_ERROR_MESSAGE String errorID = data.getStringExtra(PayPalActivity.EXTRA_ERROR_ID); String errorMessage = data.getStringExtra(PayPalActivity.EXTRA_ERROR_MESSAGE); //Tell the user their payment was failed. } }
For a list of error types, see Enumerated Values in the Mobile Payments Library on page 24.
July 2011
17
The interface for providing details on when a payment is completed is defined in com.paypal.android.MEP.PayPalResultDelegate. This interface provides you with a way to be notified immediately when a payment has completed:
public interface PayPalResultDelegate{ void onPaymentSucceeded(String payKey, String paymentStatus); void onPaymentFailed(String paymentStatus, String correlationID, String payKey, String errorID, String errorMessage); void onPaymentCanceled(String paymentStatus); }
PayPal recommends that you implement this interface to be immediately informed upon the completion of a payment, rather than waiting to receive the transaction details upon the completion of the PayPal MPL Activity.
Refunds Refunds can be supported by manual refund via the PayPal account interface or via the Refund API. More details and documentation are available at:
https://cms.paypal.com/cms_content/US/en_US/files/developer/PP_AdaptivePayments.pdf
18
July 2011
Simple payments use the PayPalPayment object which only supports a payment to a single recipient.
Parallel Payments
Parallel Payments allow you to make payments for any amount to any number of recipients. A parallel payment is created by making a payment with multiple recipients with no primary recipient. From the end-user's standpoint, a parallel payment will affect the UI by showing the details for each recipient. Contrary to chained payments, the recipients of a parallel payment are not linked together in terms of amount.
July 2011
19
Chained Payments
A chained payment is a payment from a sender that is indirectly parallel among multiple receivers. It is an extension of a typical payment from a sender to a receiver; however, a receiver, known as the primary receiver, passes part of the payment to other receivers, who are called secondary receivers.
NOTE: Chained payments require a specific permission level on the part of the API caller and
merchant. For information, refer to the section "Adaptive Payments Permission Levels" in the Adaptive Payments Developer Guide. You can have at most one primary receiver and from 1 to 5 secondary receivers. Chained payments are useful in cases when the primary receiver acts as an agent for other receivers. The sender deals only with the primary receiver and does not know about the secondary receivers, including how a payment is parallel among receivers. The following example shows a sender making a payment of $100:
In this example, the primary receiver receives $100 from the senders perspective; however, the primary receiver actually receives only $10 and passes a total of $90 to secondary receivers Receiver 2 and Receiver 3.
NOTE: The scenario above is an example only and does not take PayPal fees into account.
20
July 2011
Preapprovals
The PayPal Mobile Payments Library lets you set up obtain authorization in advance from buyers for future payments to you without requiring buyers to authorize each payment individually. For example, you might use the library to establish preapproval agreements for subscriptions to mobile content, such as mobile streaming audio or video. Or, you might use the library to establish preapproval agreements for payments to gain access to higher levels of difficulty in mobile games. How Preapprovals Work There are 3 steps to setting up and using preapprovals. 1. Obtain a pending preapproval key from PayPal. From your web server, send a Preapproval request to PayPal with the terms of your preapproval agreement. 2. Obtain authorization from the buyer for the preapproval agreement. From your mobile application, start the Library activity by using the Android method startActivityForResult with the preapproval key and the merchants name. The library launches the preapproval checkout experience and returns a confirmed preapproval key. 3. Take payments from the buyer under the terms of the preapproval agreement. From your web server, send a Pay request to PayPal with the buyers confirmed preapproval key. For more information about the Preapproval and Pay requests, see the Adaptive Payments Developer Guide. About Preapproval Keys Preapproval keys uniquely identify preapproval your agreements. Preapproval keys that you obtain by using the Preapproval API identify your pending preapproval agreements. No buyers have yet agreed to them. Pending approval keys remain valid for 3 hours before expiring without confirmation from buyers. Call the preapprovalWithKey method to launch the preapproval checkout experience to confirm a buyers agreement to a pending preapproval. If the buyer completes the preapproval checkout, the library returns a confirmed preapproval key. Maintain a record of buyers and their confirmed preapproval keys on your web server. Later on your web server, take payments from buyers by sending Pay requests with buyers preapproval keys to PayPal.
July 2011
21
About Preapproval Pins Confirmed preapproval keys let you take payments from buyers without requiring them to log in to PayPal to authorize payments individually. Depending on your business model, you may want to obtain consent quickly from buyers before you take individual payments. Preapproval PINs are special codes that buyers enter to authorize preapproved payments individually without logging in to PayPal. For example, you might have a mobile game that requires payment from buyers to enter a higher level of difficulty. You could take the payment, without notice, when the buyer enters the higher level. However, the buyer might dispute the payment later, despite the preapproval agreement and the automatic payment notice from PayPal. Obtain a buyers consent before you take the entrance fee to help improve the buying experience. Specify that you want your preapprovals to use preapproval PINs when you send Preapproval requests from your web server to PayPal. Set the PreapprovalRequest.pinType to REQUIRED. PayPal returns preapproval keys that require buyers to create preapproval PINs during preapproval checkout. Later, when you take payments by using a buyers confirmed preapproval key, prompt the buyer for the preapproval PIN. Pass the buyers PIN to PayPal when you send the Pay request from your web server. PayPal recommends that you display the payment reason and payment amount when you prompt buyers for their preapproval PINs. Sample Call After you obtain a pending approval key, construct a PayPalPreapproval object that includes the key and the merchants name. Then, use the preapprove() method to create an Intent and pass it in the Android startActivityForResult() method. PayPalPreapproval preapproval = new PayPalPreapproval(); preapproval.setCurrencyType("USD"); preapproval.setMerchantName("Preapproval Merchant");
Intent preapproveIntent = PayPal.getInstance().preapprove(preapproval, this); startActivityForResult(preapproveIntent, request);
NOTE: See
22
July 2011
This object is passed to your PaymentAdjuster class in the AdjustAmounts method. Use this address to update the payment amount, tax, currency, and shipping values of the payment. Then, the buyer continues to check out with the new amounts.
Method String getStreet1() String getStreet2() String getCity() String getState() String getPostalcode)() String getCountrycode() String getCountry() Description First line of the street address. Second line of the street address. Name of the city. Name of the state or province. U.S. ZIP code or other country-specific postal code. The 2-character country code. The name of the country.
MEPAmounts
This object is returned to the Library by the AdjustAmounts method of your PaymentAdjuster class. This object contains the values for the updated payment.
Property setCurrency(String currency) setPaymentAmount(String paymentAmount) or setPaymentAmount(BigDecimal paymentAmount) setTax(String tax) or setTax(BigDecimal tax) setShipping(String shipping) or setShipping(BigDecimal Description (Optional) Currency code of the amount. Defaults to USD. (Required) Amount of the payment before tax or shipping.
July 2011
23
Property shipping)
Description
MEPReceiverAmounts
Similarly to MEPAmounts and MEPAddress, this object is used in dynamic amount calculation for advanced payments.
Property public MEPAmounts amounts; public String receiver; Description Amounts for this receiver. The receiver for this amount calculation.
PayPalPayment
This object is passed to the library through extra data in the Intent when the Library Activity is started. This object contains all the values for a payment
Method setCurrencyType(String currency) setSubtotal(BigDecimal amount) setRecipient(String recipient) setMerchantName(String name) setInvoiceData(PayPalInvo iceData) setCustomId(String customId) setIpnUrl(String IPNURL) setDescription(String description) setMemo(String memo) Description (Required) - Currency code for the payment. Defaults to USD if not set. (Required) Subtotal for the payment. (Required) - The email address or phone number of the payments recipient. (Optional) - Displayed at the top of the library screen. If not set, displays the recipient email or phone number string instead. (Optional) The InvoiceData holds information such as tax and shipping amounts as well as an optional breakdown of the items included. (Optional) The merchant's custom ID. (Optional) The IPN URL. (Optional) - Description of the item. Defaults to Item if not set. (Optional) Note for the payment.
24
July 2011
PayPalAdvancedPayment
This object is passed to the library through extra data in the Intent when the Library Activity is started. This object contains all the values for a payment
Method setCurrencyType(String currency) setReceivers(ArrayList<Pa yPalReceiverDetails> receivers) or getReceivers() setIpnUrl(String IPNRUL) setMemo(String memo) Description (Required) - Currency code for the payment. Defaults to USD if not set. (Required) Your payment must have at minimum one receiver. The receiver itself should be set up before adding it to the payment. See Receiver below for more details. The getReceivers() call can be used to alter the current ArrayList. (Optional) The IPN URL (Optional) Note for the payment.
July 2011
25
PayPalPreapproval
This object is passed to the library through extra data in the Intent when the Library Activity is started. This object contains all the values for a payment
Method setCurrencyType(String currency) setType(int type) Description (Required) - Currency code for the payment. Defaults to USD if not set. (Optional) The type of button to display, either TYPE_AGREE or TYPE_AGREE_AND_PAY. Defaults to TYPE_AGREE_ANDPAY. (Optional) The IPN URL (Optional) Note for the payment.
PayPalInvoiceData
This is an optional object to be set for any receiver. The PayPalPayment (simple payment) has only one receiver and the InvoiceData is added directly to the payment object itself. The PayPalAdvancedPayment can support multiple receivers, each of which can have an invoice data added to it. While InvoiceData is an optional parameter for any given receiver, once added the InvoiceData must be populated with certain required parameters (see below).
Method setTax(BigDecimal shipping) setShipping(BigDecimal shipping) setInvoiceItems(ArrayList <PayPalInvoiceItem> items) Description (Required) Tax amount to be used for the payment. This can be updated after the checkout flow has been started if dynamic amount calculation is enabled. The amount can be 0. (Required) Shipping amount to be used for the payment. This can be updated after the checkout flow has been started if dynamic amount calculation is enabled. The amount can be 0. (Required) Sets the list of items in the invoice. See InvoiceItem below for more details.These items do not affect the total amount of the payment but must equal the subtotal.
26
July 2011
PayPalInvoiceItem
The UnitPrice and Quantity must multiply together correctly to equal the TotalPrice. The TotalPrices of all invoiceItems of a PayPalPayment or a PayPalAdvancedPayment must equal the subtotal of the payment.
Description (Optional) The name of the item. (Optional) A unique ID for the item. (Requiredl) The total cost of this item (unit cost * quantity). (Required) The cost of a single unit of this item. (Required) The quantity of this item.
Method setName(String name) setID(String ID) setTotalPrice(BigDecimal price) setUnitPrice(BigDecimal price) setQuantity(int qty)
PayPalReceiverDetails
setPaymentType(int paymentType) setPaymentSubType(int paymentSubtype) setInvoiceData(PayPalInvo iceData invoice) setCustomID(String ID) setMerchantName(String name)
July 2011
27
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.
NOTE:
PAYPAL_BUTTON_TYPE BUTTON_152x33
BUTTON_194x37
BUTTON_278x43
BUTTON_294x45
NOTE:
If the buttonTextType parameter is set to 'TEXT_DONATE, the word Pay in the above buttons is replaced by Donate. The language of the button will also change based on the language you pass into the setLang method or the auto detected language on the phone.
For Personal payment types, the PayPal Checkout experience differs slightly from other payment types. Additionally for Personal payment types, senders in some cases can
28
July 2011
choose who pays any fees the sender or the recipient. In India and Germany, recipients always pay any fees. For more information, see setFeesPayer Method on page 16.
PAYPAL_FAILURE SYSTEM_ERROR RECIPIENT_ERROR APPLICATION_ERROR CONSUMER_ERROR
These failures are returned by the PayPalActivity.RESULT_FAILURE result from the PayPal Library activity.
July 2011
29
Language (Country or Region) English (Spain) English (Switzerland) English (Taiwan) English (United States) French (Belgium) French (Canada) French (France) French (Switzerland) German (Austria) German (Germany) German (Switzerland) Italian (Italy) Japanese (Japan) Spanish (Argentina) Spanish (Mexico) Spanish (Spain) Polish (Poland) Portuguese (Brazil)
Locale Code en_ES en_CH en_TW en_US fr_BE fr_CA fr_FR fr_CH de_AT de_DE de_CH it_IT ja_JP es_AR es_MX es_ES pl_PL pt_BR
30
July 2011
In the preceding experience, buyers enter their PayPal log-in credentials in the Log In To PayPal screen. Then, they can review details of the payment in the second screen and change funding source or shipping address. If satisfied, buyers click Pay to complete the payment.
July 2011
31
In the case, shipping is not required (i.e. manual pick up of goods or services). Shipping is disabled by a call to the setShippingEnabled() library method. Buyers enter their PayPal log-in credentials and directly pay by clicking the Pay button on the first screen. Buyers can review funding choices by clicking the Review button on the same page.
32
July 2011
In the preceding experience, buyers make a donation to a charity or other cause. In this context the charity or cause wants to leverage PayPal members addresses as mailing addresses for donation receipts. By enabling shipping in the library, buyers are presented with their primary mailing address can choose another mailing address from the ones in their PayPal accounts.
July 2011
33
In the preceding experience, PayPal members make personal payments to other PayPal members. There are no transaction fees when it is funded by PayPal balance or by a bank account on file. The transaction carries a fee when it is funded by payment card debit or credit or PayPal Credit cards. In some cases, senders choose who pays any fees sender or recipient. In India and Germany, recipients always pay any fees. For more information on PayPal Send Money and pricing, refer to: https://cms.paypal.com/us/cgi-bin/?cmd=_rendercontent&content_ID=marketing_us/send_money
34
July 2011
In the preceding experience, a PayPal member has just completed a payment and does not currently have a PIN associated with his/her account. By following the on-screen instructions, the user can associate his/her account with a phone number and PIN for easier login in the future. Upon successful creation of the PIN, the user will be returned to your application triggering the paymentSuccess() delegate callback.
July 2011
35
During a preapproval checkout, the buyer agrees to the terms of a preapproval agreement. The agreement authorizes you to take payments without requiring the buyer to log in to PayPal to authorize the payments individually. After the buyer completes the checkout, PayPal returns the buyers confirmed preapproval key to your mobile application. Use the buyers confirmed preapproval key to take the preapproved payments. The library does not take the payments for you. After UI control returns to your mobile application, store the buyers preapproval key on you web server. Then, take your first preapproved payment by sending a Pay request with the buyers preapproval key from your web server to PayPal.
36
July 2011
Creating Preapproval PINs During Preapproval Checkout Depending on your business model, you may require buyers to create preapproval PINs during preapproval checkout. Preapproval PINs are special codes that buyers specify during checkout to let them consent quickly later to individual payments. If your preapproval agreements require PINs, PayPal displays the optional Create a Code screen during preapproval checkout. Login Screen Create a Code Screen Agree and Pay Screen
After logging in to PayPal, the buyer enters a code that only the buyer and PayPal know. Later, before you take a preapproved payment, prompt the buyer to enter the preapproval PIN. Then from your web server, include the PIN that the buyer entered with the Pay request that you send to PayPal. PayPal recommends that you display the payment reason and payment amount when you prompt the buyer for the preapproval PIN.
July 2011
37
Result: For those using simple or parallel payments, PayPal reviews your application within 24 hours and responds by sending you your PayPalApplicationID. Reviewers at PayPal follow up by email with questions, should they arise, before they approve your mobile application. For those using chained payments or preapprovals, the review may take longer. After completing this task: Wait until PayPal sends you your application ID. Then, make sure that you update your software with the following changes before you submit your mobile application to Apple: Application ID: in your calls to initWithApplicationId Environment: in your calls to initWithApplicationId Recipient: in the PayPalPayment object
38
July 2011
and a currency balance for in-country PayPal accounts only. Canadian Dollar Czech Koruna Danish Krone Euro Hong Kong Dollar Hungarian Forint Israeli New Shekel Japanese Yen Malaysian Ringgit
NOTE:This currency is supported as a payment currency
and a currency balance for in-country PayPal accounts only. Mexican Peso Norwegian Krone New Zealand Dollar Philippine Peso Polish Zloty Pound Sterling Singapore Dollar Swedish Krona Swiss Franc Taiwan New Dollar Thai Baht U.S. Dollar MXN NOK NZD PHP PLN GBP SGD SEK CHF TWD THB USD
July 2011
39
40
July 2011
AF AX AL DZ AS AD AO AI AQ AG AR AM AW AU AT AZ BS BH BD BB BY BE BZ BJ BM BT BO BA BW BV BR
July 2011
41
Country or Region BRITISH INDIAN OCEAN TERRITORY BRUNEI DARUSSALAM BULGARIA BURKINA FASO BURUNDI CAMBODIA CAMEROON CANADA CAPE VERDE CAYMAN ISLANDS CENTRAL AFRICAN REPUBLIC CHAD CHILE CHINA CHRISTMAS ISLAND COCOS (KEELING) ISLANDS COLOMBIA COMOROS CONGO CONGO, THE DEMOCRATIC REPUBLIC OF COOK ISLANDS COSTA RICA COTE D'IVOIRE CROATIA CUBA CYPRUS CZECH REPUBLIC DENMARK DJIBOUTI DOMINICA DOMINICAN REPUBLIC ECUADOR EGYPT EL SALVADOR EQUATORIAL GUINEA ERITREA ESTONIA ETHIOPIA FALKLAND ISLANDS (MALVINAS)
IO BN BG BF BI KH CM CA CV KY CF TD CL CN CX CC CO KM CG CD CK CR CI HR CU CY CZ DK DJ DM DO EC EG SV GQ ER EE ET FK
42
July 2011
Country or Region FAROE ISLANDS FIJI FINLAND FRANCE FRENCH GUIANA FRENCH POLYNESIA FRENCH SOUTHERN TERRITORIES GABON GAMBIA GEORGIA GERMANY GHANA GIBRALTAR GREECE GREENLAND GRENADA GUADELOUPE GUAM GUATEMALA GUERNSEY GUINEA GUINEA-BISSAU GUYANA HAITI HEARD ISLAND AND MCDONALD ISLANDS HOLY SEE (VATICAN CITY STATE) HONDURAS HONG KONG HUNGARY ICELAND INDIA INDONESIA IRAN, ISLAMIC REPUBLIC OF IRAQ IRELAND ISLE OF MAN ISRAEL ITALY JAMAICA
FO FJ FI FR GF PF TF GA GM GE DE GH GI GR GL GD GP GU GT GG GN GW GY HT HM VA HN HK HU IS IN ID IR IQ IE IM IL IT JM
July 2011
43
JP JE JORDAN JO KAZAKHSTAN KZ KENYA KE KIRIBATI KI KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF KP KOREA, REPUBLIC OF KR KUWAIT KW KYRGYZSTAN KG LAO PEOPLE'S DEMOCRATIC REPUBLIC LA LATVIA LV LEBANON LB LESOTHO LS LIBERIA LR LIBYAN ARAB JAMAHIRIYA LY LIECHTENSTEIN LI LITHUANIA LT LUXEMBOURG LU MACAO MO MACEDONIA, THE FORMER YUGOSLAV MK
REPUBLIC OF MADAGASCAR MALAWI MALAYSIA MALDIVES MALI MALTA MARSHALL ISLANDS MARTINIQUE MAURITANIA MAURITIUS MAYOTTE MEXICO MICRONESIA, FEDERATED STATES OF MOLDOVA, REPUBLIC OF MONACO MONGOLIA MONTSERRAT MOROCCO
MG MW MY MV ML MT MH MQ MR MU YT MX FM MD MC MN MS MA
44
July 2011
Country or Region MOZAMBIQUE MYANMAR NAMIBIA NAURU NEPAL NETHERLANDS NETHERLANDS ANTILLES NEW CALEDONIA NEW ZEALAND NICARAGUA NIGER NIGERIA NIUE NORFOLK ISLAND NORTHERN MARIANA ISLANDS NORWAY OMAN PAKISTAN PALAU PALESTINIAN TERRITORY, OCCUPIED PANAMA PAPUA NEW GUINEA PARAGUAY PERU PHILIPPINES PITCAIRN POLAND PORTUGAL PUERTO RICO QATAR REUNION ROMANIA RUSSIAN FEDERATION RWANDA SAINT HELENA SAINT KITTS AND NEVIS SAINT LUCIA SAINT PIERRE AND MIQUELON SAINT VINCENT AND THE GRENADINES
MZ MM NA NR NP NL AN NC NZ NI NE NG NU NF MP NO OM PK PW PS PA PG PY PE PH PN PL PT PR QA RE RO RU RW SH KN LC PM VC
July 2011
45
WS SM SAO TOME AND PRINCIPE ST SAUDI ARABIA SA SENEGAL SN SERBIA AND MONTENEGRO CS SEYCHELLES SC SIERRA LEONE SL SINGAPORE SG SLOVAKIA SK SLOVENIA SI SOLOMON ISLANDS SB SOMALIA SO SOUTH AFRICA ZA SOUTH GEORGIA AND THE SOUTH SANDWICH GS
ISLANDS SPAIN SRI LANKA SUDAN SURINAME SVALBARD AND JAN MAYEN SWAZILAND SWEDEN SWITZERLAND SYRIAN ARAB REPUBLIC TAIWAN, PROVINCE OF CHINA TAJIKISTAN TANZANIA, UNITED REPUBLIC OF THAILAND TIMOR-LESTE TOGO TOKELAU TONGA TRINIDAD AND TOBAGO TUNISIA TURKEY TURKMENISTAN TURKS AND CAICOS ISLANDS TUVALU UGANDA
ES LK SD SR SJ SZ SE CH SY TW TJ TZ TH TL TG TK TO TT TN TR TM TC TV UG
46
July 2011
Country or Region UKRAINE UNITED ARAB EMIRATES UNITED KINGDOM UNITED STATES UNITED STATES MINOR OUTLYING ISLANDS URUGUAY UZBEKISTAN VANUATU VENEZUELA VIET NAM VIRGIN ISLANDS, BRITISH VIRGIN ISLANDS, U.S. WALLIS AND FUTUNA WESTERN SAHARA YEMEN ZAMBIA ZIMBABWE
UA AE GB US UM UY UZ VU VE VN VG VI WF EH YE ZM ZW
July 2011
47
48
July 2011