Home

PayPal Mobile Payments Library - 2012 Android Developer's Guide

image

Contents

1. Country or Region Country or Region Code AFGHANISTAN AF ALAND ISLANDS AX ALBANIA AL ALGERIA DZ AMERICAN SAMOA AS ANDORRA AD ANGOLA AO ANGUILLA Al ANTARCTICA AQ ANTIGUA AND BARBUDA AG ARGENTINA AR ARMENIA AM ARUBA AW AUSTRALIA AU AUSTRIA AT AZERBAIJAN AZ BAHAMAS BS BAHRAIN BH BANGLADESH BD BARBADOS BB BELARUS BY BELGIUM BE BELIZE BZ BENIN BJ BERMUDA BM BHUTAN BT BOLIVIA BO BOSNIA AND HERZEGOVINA BA BOTSWANA BW BOUVET ISLAND BV BRAZIL BR Mobile Payments Library Developer Guide and Reference Android OS Edition July 2011 41 42 Country or Region Couniry or Region Code 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 July 2011 PayPal Mobile Payments Developer Guide and Reference Android OS Edition IO BN BG BF B KH CM CA CV KY CF OM ve Sle ho hee I a ETS Country or Region Couniry or Region Code
2. eccceeseeeeeeeeeeeeeeeseeeeeeeeeeenees 16 After the Payment racic cctees coatesccctesdacanis n N neediness 18 Instant Payment Notification eeceeeesneeeeeenneeeeeenaeeeeeeaaeeeeeeaaeeeeeeaeeeeeeaeeeeeeaas 18 Transaction Details sesen T 18 PROTOS sea orxs E E E E E E E E E E E ec aetaee 18 Simple Parallel and Chained Payments cccccsccccessseceeessneeeeessneeeeessneeeeesseeeeees 19 Preapproval erroria a nia E dusts Ghaadibean Gana 21 How Preapproval WOrK sississsissakksansanas iaaa aS aa SS 21 ADouUt Preapproval Keys vii cust eeeccunctcecteit NAE a AREAN ENKA KAANANE 21 About Preapproval PING estiss issnin anaa SS KA es 22 Sample Call icenian aana candies ai 22 Custom Objects in the Mobile Payments Library sssseeseeseesresrssresrresrresrrssrresens 23 Enumerated Values in the Mobile Payments Library cccccecesseeeeeeneeeeeeeneeeeeeaes 28 Localization Support in the Mobile Payments Library ccccceeeeeeeeeeeeeteeteeeees 29 2 The Checkout Experience with the Mobile Payments Library 31 Checkout Experience 1 Goods or Services with Shipping cceseeeeeeeees 31 Checkout Experience 2 Goods or Services without Shipping cceeeeeees 32 Checkout Experience 3 Donations ccccecececeeeeeeeceeeeeaeeeeneeseeeeesaeeesaeeeeeeeenaees 33 Checkout Experience 4 Personal Send Money Payments 34 Checkout Experience 5 Create Pin
3. ccccceesceeeeeeeceeeeeeaeeeeeeeseeeeesaeeesaeseeneeseaees 35 Checkout Experience 6 Preapproval ccccccceeceeceeeeeeeaeeeeeeeseeeeeseaeeesaeeeeneeseaees 36 Basic Preapproval CheCkout ccccccccceeseeeeeneeceeeeeceaeeesaaeeseeeeseaeeesaeeeeaaeeenneeseas 36 Creating Preapproval PINs During Preapproval Checkout cseeeseeeereees 37 Mobile Payments Library Developer Guide and Reference Android OS Edition July 2011 3 Submitting Your Application to PayPal seeeeeeeeeeeeeeeeees 38 A Currencies Supported by PayPal cccccccceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeees 39 B Countries and Regions Supported by PayPal ccssssssseeeeeeeeeeeeeees 41 4 July 2011 PayPal Mobile Payments Developer Guide and Reference Android OS Edition 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 libr
4. 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 _render content amp content_ D marketing_us send_money 34 July 2011 PayPal Mobile Payments Developer Guide and Reference Android OS Edition Checkout Experience 5 Create Pin D BME 11 40 pm Send to recipient email com Y Total paid 10 00 B Payment made PayPal Create a PIN to check out faster next time Enter phone Create a 4 8 digit PIN Re enter PIN 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 Mobile Payments Library Developer Guide and Reference Android OS Edition July 2011 35 Checkout Experience 6 Preapproval In this experience you started the Android Activity with the preapproval intent as discussed under Preapprovals on page 21 Basic Preapproval Checkout Login Screen Agree and Pay Screen m AM 12 09 am BM 12 33
5. D BMS 11 04PM a BME 11 06 pm Merchant Name Merchant Name E My total 10 00 B amp My total 10 00 a Login PayPal Review a Log in with email and password Funding Balance CAD Can 11 44 buyer gmail com 1 CAD 0 874542 USD LE Cancel Cancel 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 Mobile Payments Library Developer Guide and Reference Android OS Edition July 2011 33 Checkout Experience 4 Personal Send Money Payments Payment type Personal payments Shipping disabled a AME 11 09 pm a BME 11 10 pm Send to recipient email com Send to recipient email com E My total 10 00 B amp My total 10 00 B Login PayPal Review CA Log in with email and password Fee Free buyer gmail com Funding Balance CAD Can 11 44 1 CAD 0 874542 USD Cancel 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
6. 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 th rror 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 Mobile Payments Library Developer Guide and Reference Android OS Edition 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 St
7. the library returns a callback to your application with the status of the payment and the pay key Note at this time the library is still in control of the UI and has not returned control to your application After the library flow is complete an activity result will be posted to be received by your application Declaring the Library and Permissions in AndroidManifest xml Since the Mobile Payments Library is an Activity you must declare it in the AndroidManifest xml file of your application You must also declare Internet and Phone State permissions that the Library requires Below is an example AndroidManifest xml Sections specifically relevant to the Library are in bold lt xml version 1 0 encoding utf 8 gt lt manifest xmlns android http schemas android com apk res android package com paypal MobilePayments Pizza android versionCode 1 android versionName 1 0 gt lt application android icon drawable icon android label string app name gt lt activity android name PizzaMain 8 July 2011 PayPal Mobile Payments Developer Guide and Reference Android OS Edition android label string app name gt lt intent filter gt lt action android name android intent action MAIN gt lt category android name android intent category LAUNCHER gt lt intent filter gt lt activity gt lt activity android name com paypal android MEP PayPalActivity android theme android style Theme Transl
8. Adaptive Payments Developer Guide e Sandbox User Guide e Merchant Setup and Administration Guide e PayPal X Developer Network x com Mobile Payments Library Developer Guide and Reference Android OS Edition July 2011 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 Android application Mobile Payments Library API Reference The flow of the library is 1 Your application initializes the library 2 The library creates a Pay with PayPal Button and returns it to you so you can place it on the screen 3 Optional Your application enables Dynamic Amount Calculation see step 4 below to recalculate the payment amount tax currency and shipping values when buyers change the shipping address for the payment When buyers select the Pay with PayPal button the library takes them through the PayPal Checkout experience Optional If you enabled dynamic amount calculation in step 1 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 returns the buyer to the checkout experience which uses the updated payment amount tax currency and shipping values After buyers complete their payments
9. BigDecimal price setQuantity int qty PayPalReceiverDetails 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 This object is used in the PayPalAdvancePayment to identify a single recipient Method Description setRecipient String recipient setSubtotal BigDecimal amount setIsPrimary boolean isPrimary setPaymentType int paymentType setPaymentSubType int paymentSubtype setInvoiceData PayPalInvo iceData invoice setCustomID String ID setMerchantName String name Mobile Payments Library Developer Guide and Reference Android OS Edition Required The email address or phone number of this recipient Required The subtotal of the payment to this recipient Optional Whether or not the receiver is a the primary receiver of the payment A payment with multiple recipients may specify the primary recipient of the payment to denote a chained payment Payments with multiple recipients but no primary receivers are parallel payments See the section Chained Parallel and Simple Payments for more details Optional If this value is not set the value passed into getPaymentButton will be used instead Optional If this value is not set the value passed
10. TV UGANDA UG July 2011 PayPal Mobile Payments Developer Guide and Reference Android OS Edition Country or Region Couniry or Region Code UKRAINE UA UNITED ARAB EMIRATES AE UNITED KINGDOM GB UNITED STATES US UNITED STATES MINOR OUTLYING ISLANDS U URUGUAY UY UZBEKISTAN UZ VANUATU VU VENEZUELA VE VIET NAM VN VIRGIN ISLANDS BRITISH VG VIRGIN ISLANDS U S VI WALLIS AND FUTUNA VF WESTERN SAHARA EH YEMEN YE ZAMBIA ZM ZIMBABWE ZW Mobile Payments Library Developer Guide and Reference Android OS Edition July 2011 47 48 July 2011 PayPal Mobile Payments Developer Guide and Reference Android OS Edition
11. en_IN English Japan en _ JP English Mexico en_MX English Netherlands en_NL English Poland en PL English Singapore en SG Mobile Payments Library Developer Guide and Reference Android OS Edition July 2011 29 Language Country or Region Locale Code English Spain en ES English Switzerland en CH English Taiwan en_TW English United States en_US French Belgium fr_BE French Canada fri CA French France fr FR French Switzerland fr CH German Austria de AT German Germany de DE German Switzerland de CH Italian Italy Lt IT Japanese Japan ja_JP Spanish Argentina es AR Spanish Mexico es MX Spanish Spain es ES Polish Poland pl PL Portuguese Brazil pt_BR 30 July 2011 PayPal Mobile Payments Developer Guide and Reference Android OS Edition 2 The Checkout Experience with the Mobile Payments Library The following screen shots illustrate several different PayPal Checkout experiences that occur after buyers click the PayPal button that your application obtains from the library by using the getPayPalButton method Checkout Experience 1 Goods or Services with Shipping Payment type Hard Goods or Services Shipping enabled m Ga Mi 10 43PM a AMES 10 51 pm Merchant Name Merchant Name W My total 10 00 W My total 10 00 Login PayPal Review EA Log in with email and password Funding Balance CAD Can 11 44 1 CAD 0 874542 USD buyer
12. gmail com Test User 1 Maire Victorin Toronto Ontario M5A 1E1 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 Mobile Payments Library Developer Guide and Reference Android OS Edition July 2011 31 Checkout Experience 2 Goods or Services without Shipping Payment type Hard Goods or Services Shipping disabled a BM 10 56 pm Merchant Name 10 00 Recipient 2 40 00 Total USD 50 00 Login o PayPal EA Log in with email and password buyer gmail com B Le a AMS 10 57 pm Merchant Name My total 50 00 B Merchant Name 10 00 Recipient 2 40 00 Total USD 50 00 Review Funding Bank x6239 Cancel 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 PayPal Mobile Payments Developer Guide and Reference Android OS Edition Checkout Experience 3 Donations Payment type Donations Shipping enabled
13. 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 merchant s 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 buyer s 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 buyer s agreement to a pending preapproval If the buyer completes the preapproval checkout the library returns a confirmed preapproval key Maint
14. FAROE ISLANDS FO FIJI FJ FINLAND FI FRANCE FR FRENCH GUIANA GF FRENCH POLYNESIA PF FRENCH SOUTHERN TERRITORIES LE GABON GA GAMBIA G GEORGIA GE GERMANY DE GHANA GH GIBRALTAR GI GREECE GR GREENLAND GL GRENADA GD GUADELOUPE GP GUAM GU GUATEMALA GT GUERNSEY GG GUINEA GN GUINEA BISSAU GW GUYANA GY HAITI HT HEARD ISLAND AND MCDONALD ISLANDS H HOLY SEE VATICAN CITY STATE VA HONDURAS HN HONG KONG HK HUNGARY HU ICELAND S INDIA IN INDONESIA ID IRAN ISLAMIC REPUBLIC OF IR IRAQ IQ IRELAND E ISLE OF MAN ISRAEL ITALY IT JAMAICA JM Mobile Payments Library Developer Guide and Reference Android OS Edition July 2011 43 Country or Region Couniry or Region Code JAPAN JP JERSEY 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 TT LITHUANIA LT LUXEMBOURG LU MACAO MO MACEDONIA THE FORMER YUGOSLAV MK REPUBLIC OF MADAGASCAR MG MALAWI IW MALAYSIA X MALDIVES V MALI ML MALTA MT MARSHALL ISLANDS IH MARTINIQUE Q MAURITANIA IR MAURITIUS U MAYOTTE YT MEXICO MX MICRONESIA FEDERATED STATES OF FM MOLDOVA REPUBLIC OF AD MONACO C MONGOLIA MN MONTSERRAT MS MOROCCO MA July 2011 PayPal Mobile Payments Developer Guide and Reference Android OS Edition Country or Regio
15. ID Context context String appID int server An example of initializing the Library with this method is PayPal ppObj PayPal initWithAppID this getBaseContext APP 80W284485P519543T PayPal ENV_ SANDBOX Parameter Description context Required The context appID Required PayPal Application ID from X com e 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 e 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 get Instance method instead Calling the initWithAppID method more than once will throw an Illegal StateException Note If you do not set the optional parameter forEnvironment the library defaults to use the PayPal production the servers
16. Pal recommends that you display the payment reason and payment amount when you prompt the buyer for the preapproval PIN Mobile Payments Library Developer Guide and Reference Android OS Edition July 2011 37 3 Submitting Your Application to PayPal Before you distribute your mobile application publicly you need an authorized application ID from PayPal PayPal tests all mobile applications before issuing application IDs Test your mobile application thoroughly in the PayPal Sandbox by using APP 80W284485P519543T as your test application ID Then submit your test application to PayPal 1 Log in or sign up on PayPal s developer website x com 2 After logging in successfully click the My Apps tab 3 Click SUBMIT NEW APP 4 Fill in the 2 page Submit New App form If you need more time you can save your form as a draft and return later to complete it 5 Click Submit 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 e Appli
17. PayPal Mobile Payments Library Developer Guide and Reference Android OS Edition 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 Soci t 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 result
18. PayPal Object getPaymentButton style CheckoutButton startActivityForResult PayPal Pa yment Username password entry PayPal Checkout Experience onActivityResult resultCode Mobile Payments Library Developer Guide and Reference Android OS Edition July 2011 15 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 prov
19. 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 Description setTax BigDecimal Required Tax amount to be used for the payment This can be shipping updated after the checkout flow has been started if dynamic amount calculation is enabled The amount can be 0 setShipping BigDecimal Required Shipping amount to be used for the payment This shipping can be updated after the checkout flow has been started if dynamic amount calculation is enabled The amount can be 0 setInvoiceItems ArrayList Required Sets the list of items in the invoice See InvoiceItem lt PayPaliInvoicelItem gt below for more details These items do not affect the total items amount of the payment but must equal the subtotal 26 July 2011 PayPal Mobile Payments Developer Guide and Reference Android OS Edition PayPallinvoiceltem These items can be added to any InvoiceData Note 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 Method Description setName String name setID String ID setTotalPrice BigDecimal price setUnitPrice
20. T TYPE SERVICE PAYMENT TYPE PERSONAL Note For Personal payment types the PayPal Checkout experience differs slightly from other payment types Additionally for Personal payment types senders in some cases can July 2011 PayPal Mobile Payments Developer Guide and Reference Android OS Edition 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 Localization Support in the Mobile Payments Library To change the language in the Library call setLanguage String localeCode on the PayPal object Pass through the desired locale code e g for US English use en_US If you do not use this method the Library defaults to the locale to which the device is set The Library supports the following regions Language Country or Region Locale Code Chinese Hong Kong zh_HK Chinese Taiwan zh_TW Dutch Belgium nl BE Dutch Netherlands nl NL English Australia en AU English Belgium en BE English Canada en CA English France en FR English Germany en DE English Great Britain en_GB English Hong Kong en HK English India
21. When testing your application PayPal recommends that you initialize the library to use the PayPal test servers instead Note 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 July 2011 PayPal Mobile Payments Developer Guide and Reference Android OS Edition 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 gt 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 LayoutPa
22. ain 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 Mobile Payments Library Developer Guide and Reference Android OS Edition 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 buyer s 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 usi
23. all the values for a payment Method Description setCurrencyType String Required Currency code for the payment Defaults to USD if currency not set setReceivers ArrayList lt Pa Required Your payment must have at minimum one receiver yPalReceiverDetails gt The receiver itself should be set up before adding it to the receivers payment See Receiver below for more details or getReceivers The getReceivers call can be used to alter the current ArrayList setIpnUrl String IPNRUL Optional The IPN URL setMemo String memo Optional Note for the payment Mobile Payments Library Developer Guide and Reference Android OS Edition 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 Description setCurrencyType String Required Currency code for the payment Defaults to USD if currency not set setType int type Optional The type of button to display either TYPE_AGREE or TYPE_AGREE_ AND_PAY Defaults to TYPE_AGREE ANDPAY setIpnUrl String IPNRUL Optional The IPN URL setMemo String memo Optional Note for the payment PayPallnvoiceData 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
24. am Send to Preapproval Merchant Send to Preapproval Merchant E Billing Summary a Billing Summary Login PayPal a Review amp g Payment method Primary PayPal Balance Log in with email and password I allow Preapproval Merchant to automatically buyer gmail com charge my PayPal account If my PayPal Balance cannot complete a transaction PayPal will try using other payment methods with my account To change or cancel go to your Profile page View PayPal policies j Cancel 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 buyer s confirmed preapproval key to your mobile application Use the buyer s 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 buyer s preapproval key on you web server Then take your first preapproved payment by sending a Pay request with the buyer s preapproval key from your web server to PayPal 36 July 2011 PayPal Mobile Payments Developer Guide and Reference Android OS Edition Creating Preapproval PINs During Preapproval Checkout Depending on your business model you may require buyers to create preapprova
25. ary 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 OS and Hardware Support The PayPal Mobile Payments Library supports Android OS 1 5 and higher All Android devices are supported Revision History The following table lists revisions made to the Mobile Payments Library Developer Guide and Reference Version Date Published Description 1 5 5 July 2011 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 1 5 February 2011 Improved Tablet Support 1 1 1 January 2011 Eliminated Keep Me Logged In functionality Mobile Payments Library Developer Guide and Reference Android OS Edition July 2011 5 6 Version Date Published Description 1 1 December 2010 Added information about preapproval dropped support for the enumeration value BUTTON _118x24 1 0 September 2010 Adaptive Payments Support 0 7 May 2010 First publication July 2011 PayPal Mobile Payments Developer Guide and Reference Android OS Edition Where to Go for More Information e
26. cation ID in your calls to initWithApplicationId e Environment in your calls to initWithApplicationId e Recipient in the PayPalPayment object 38 July 2011 PayPal Mobile Payments Developer Guide and Reference Android OS Edition Mobile Payments Library Developer Guide and Reference Android OS Edition Currencies Supported by PayPal PayPal uses 3 character ISO 4217 codes for specifying currencies in fields and variables Currency Currency Code Australian Dollar Brazilian Real Note This currency is supported as a payment currency 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 NotTeE 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 AUD BRL CAD CZK MYR H JQ g Oo jm H um wW G Nn J July 2011 39 40 July 2011 PayPal Mobile Payments Developer Guide and Reference Android OS Edition B Countries and Regions Supported by PayPal PayPal uses 2 character ISO 3166 1 codes for specifying countries and regions that are supported in fields and variables
27. eivers add receiver0O advPayment getReceivers add receiverl Intent paypaliIntent 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 Description intent 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 requestCode 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 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 buyer s shipping address For instance you might want to recalculate the tax amount based on the buyer s location To enable this use the optional method enableDynamicAmou
28. ide 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 July 2011 PayPal Mobile Payments Developer Guide and Reference Android OS Edition 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
29. ing 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 Prelate iccaicccicusd ccucunieasssucdcacnducdeusdeucdgasucuedcusdduedcusudued asicucdeususaniousueusicusagucdcusuaucun 5 PULPOSG wadeeccdsiedcneretec cd cate Lisventeceh cated hagecieet adeedaavedieeteatel aasatid esate aaentee ated aametie see 5 SCOPE niiata aia ee ee eee aa adaa 5 OS and Hardware Support cccccceeeeeeeeeeeeeeeeeeee senses eeaeeeeaaeeseaeeseeeeeseeeesaeeseeeeeneees 5 PROVISION PISTO co ddeg ecg dec ctiidecee ges dec tedduet en dncwusanrddee iecdans tetanetasbndeed antdecthsoesedes Sedsewt oes 5 Where to Go for More Information cc ccceeceeeceeeeeneeeeeeeeceaeeeseaeeeeeeeseeeesaeeneaeeseeeees 7 1 PayPal Mobile Payments Library ccccccssseeeseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeees 8 Mobile Payments Library API Reference 0 cc eceeeeeeeeeeeeeeeeeaeeeeeeeaeeeseeaaeeeeeeaaeeeeeeaas 8 Declaring the Library and Permissions in AndroidManifest xml cseeeeeeeeeees 8 Adding the Library Jar File and Importing Classes cccccccseeeeeeeeeeeeeeeeeeeneeeeeeeees 9 Required Methods in the Mobile Payments Library eeeeeeeeeeeeereersrrenrrrssrnnn 10 Optional Methods in the Mobile Payments Library cccccsceceeeeeseeeeeeeeeeeneeeeees 16 Activity Results for the Mobile Payments Library
30. into getPaymentButton will be used instead Optional The InvoiceData holds information such as tax and shipping amounts as well as an optional breakdown of the items included See InvoiceData above for more details Optional The recipient s custom ID Optional Displayed at the top of the library screen If not set displays the recipient email or phone number string instead July 2011 27 Enumerated Values in the Mobile Payments Library 28 The enumerated values supported by various methods in the library are PAYPAL ENVIRONMENT NOTE 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 ENV_ LIVE does not support simulators 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 PayPalPaymentType PAYMENT TYPE HARD GOODS PAYMEN
31. l 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 a BM e 12 09 am BM 12 29 am BM e 12 33 am Send to Preapproval Merchant Send to Preapproval Merchant Send to Preapproval Merchant L Billing Summary a Billing Summary a J Billing Summary a Login PayPal Create a code PayPal Review amp g Once you set up preapproved payments Payment method Preapproval Merchant will ask for this code the RETEN s F 3 next time you pay Primary PayPal Balance Log in with email and password p I allow Preapproval Merchant to automatically A charge my PayPal account If my PayPal Balance Enter a 4 8 d igit code cannot complete a transaction PayPal will try using other payment methods with my account To change or cancel go to your Profile page View Re enter code PayPal policies Cancel buyer gmail com Cancel Cancel 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 Pay
32. le Payments Developer Guide and Reference Android OS Edition Simple Parallel and Chained Payments Simple payments have a single recipient Parallel and Chained payments have multiple recipients and differ in the how the payments are split Simple Payments Simple payments use the PayPalPayment object which only supports a payment to a single recipient Simple Payment ws Sender Receiver 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 Parallel Payment S Receiver 1 10 ia N m Sender Receiver 2 100 N 45 Receiver 3 45 Mobile Payments Library Developer Guide and Reference Android OS Edition 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 merchan
33. n Couniry or Region Code MOZAMBIQUE MZ MYANMAR MM NAMIBIA NA NAURU NR NEPAL NP NETHERLANDS NL NETHERLANDS ANTILLES AN NEW CALEDONIA Nc NEW ZEALAND NZ NICARAGUA NI NIGER NE NIGERIA NG NIUE NU NORFOLK ISLAND NF NORTHERN MARIANA ISLANDS MP NORWAY NO OMAN OM PAKISTAN PK PALAU PW PALESTINIAN TERRITORY OCCUPIED PS PANAMA PA PAPUA NEW GUINEA PG PARAGUAY PY PERU PE PHILIPPINES PH PITCAIRN PN POLAND PL PORTUGAL PT PUERTO RICO PR QATAR QA REUNION RE ROMANIA RO RUSSIAN FEDERATION RU RWANDA RW SAINT HELENA SH SAINT KITTS AND NEVIS KN SAINT LUCIA LC SAINT PIERRE AND MIQUELON P SAINT VINCENT AND THE GRENADINES vC Mobile Payments Library Developer Guide and Reference Android OS Edition July 2011 45 Country or Region Couniry or Region Code SAMOA ws SAN MARINO 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 ES SRI LANKA LK SUDAN SD SURINAME SR SVALBARD AND JAN MAYEN SJ SWAZILAND SZ SWEDEN SE SWITZERLAND CH SYRIAN ARAB REPUBLIC SY TAIWAN PROVINCE OF CHINA TW TAJIKISTAN TJ TANZANIA UNITED REPUBLIC OF TZ THAILAND TH TIMOR LESTE TL TOGO TG TOKELAU TK TONGA TO TRINIDAD AND TOBAGO TT TUNISIA TN TURKEY TR TURKMENISTAN TM TURKS AND CAICOS ISLANDS TC TUVALU
34. ng a buyer s confirmed preapproval key prompt the buyer for the preapproval PIN Pass the buyer s 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 PayPal Preapproval object that includes the key and the merchant s 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 Activity Results for the Mobile Library for callback details 22 July 2011 PayPal Mobile Payments Developer Guide and Reference Android OS Edition Custom Objects in the Mobile Payments Library The Mobile Payments Library includes custom objects for passing information between the library and your application during checkout Use these objects if you enable dynamic amount calculation by calling the DynamicAmountUpdate method MEPAddress This object is passed to your PaymentAdjuster class inthe AdjustAmounts method Use this address to update the payment amount tax currency and shipping
35. ntCalculation see Optional Methods below You must provide the logic that creates the new payment values based on the buyer s 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 Mobile Payments Library Developer Guide and Reference Android OS Edition July 2011 13 14 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 anew MEPAmounts object see Custom Objects section This object contains the new currency and amounts public Vector lt MEPReceiverAmounts gt adjustAmountsAdvanced MEPAddress address String currency Vector lt MEPReceiverAmounts gt 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 as
36. ounts for this receiver public String 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 Description setCurrencyType String Required Currency code for the payment Defaults to USD if currency not set setSubtotal BigDecimal Required Subtotal for the payment amount setRecipient String Required The email address or phone number of the recipient payment s recipient setMerchantName String Optional Displayed at the top of the library screen If not set name displays the recipient email or phone number string instead setInvoiceData PayPalInvo Optional The InvoiceData holds information such as tax and iceData shipping amounts as well as an optional breakdown of the items included setCustomId String Optional The merchant s custom ID customId setIpnUrl String IPNURL Optional The IPN URL setDescription String Optional Description of the item Defaults to Item if not set description setMemo String memo Optional Note for the payment 24 July 2011 PayPal Mobile Payments Developer Guide and Reference Android OS Edition PayPalAdvancedPayment This object is passed to the library through extra data in the Intent when the Library Activity is started This object contains
37. rams 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 RelativeLayout0l1 addView lau nchPayPalButton Mobile Payments Library Developer Guide and Reference Android OS Edition July 2011 11 12 Parameter Description style Required Size and appearance of the Pay with PayPal button Allowable values are e PayPal BUTTON 152x33 e PayPal BUTTON 194x37 e PayPal BUTTON 278x43 e PayPal BUTTON 294x45 For images of the different button types see Enumerated Values in the Mobile Payments Library on page 28 context Required The context textType 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 e CheckoutButton TEXT PAY e CheckoutButton TEXT DONATE Start the Library Activity 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 mus
38. ring 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 After the Payment After the payment is completed the Mobile Payments Library will return the payKey There are also a number of other features available to you to further deal with the payment Instant Payment Notification Transaction Details and Refunds Instant Payment Notification Instant Payment Notification IPN is PayPal s message service that sends a notification when a transaction is affected You can integrate IPN with your systems to automate and manage your back office More details and documentation are available at www paypal com ipn Transaction Details You can integrate with the PayPal PaymentDetails API to retrieve details on a payment based on the payKey More details and documentation are available at https cms paypal com cms_content US en_US files developer PP_AdaptivePayments pdf 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 PayPal Mobi
39. sociated with each receiver Your method must return a new Vector lt MEPReceiverAmounts gt 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 paypaliIntent PayPal getInstance checkout your payment object this adjustClass this startActivityForResult paypalIntent 1 July 2011 PayPal Mobile Payments Developer Guide and Reference Android OS Edition Method Sequence The following diagram illustrates the sequence of methods required to implement the checkout experience PayPal Mobile Payments Buyer Your Mobile App Library initWithApp ID appID server
40. t 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 Chained Payment Receiver 2 45 ss Mi in m t are diag iia my ow Receiver 3 45 In this example the primary receiver receives 100 from the sender s 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 PayPal Mobile Payments Developer Guide and Reference Android OS Edition 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
41. t 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 my email com newPayment setMerchantName My Company Intent paypaliIntent PayPal getInstance checkout newPayment this this startActivityForResult paypalIntent 1 July 2011 PayPal Mobile Payments Developer Guide and Reference Android OS Edition In the following example the buyer checks out with a parallel or chained payment for multiple recipients PayPalReceiverDetails receiver0O receiverl receiver0 new PayPalReceiverDetails setup receiver details PayPalAdvancedPayment advPayment new PayPalAdvancedPayment advPayment setCurrency USD advPayment getRec
42. ucent NoTitleBar android configChanges keyboardHidden orientation gt lt application gt lt uses sdk android minSdkVersion 3 gt lt uses permission android name android permission INTERNET gt lt uses permission android nam android permission READ PHONE _STATE gt lt manifest gt Adding the Library Jar File and Importing Classes 1 Right click on your project and select Properties 2 Select Java Build Path 3 Select the Libraries tab 4 Select the Add Jars button 5 Choose the PayPal MPL jar file from your folder structure and click OK Also import the appropriate classes into your application classes The following classes must be imported import com paypal android MEP CheckoutButton import com paypal android MEP PayPal import com paypal android MEP PayPalReceiverDetails eal go import com paypal android M or import com paypal android M PayPalPayment eal 4e PayPalAdvancedPayment Mobile Payments Library Developer Guide and Reference Android OS Edition July 2011 9 Required Methods in the Mobile Payments Library initWithAppID Method 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 initWithApp
43. values of the payment Then the buyer continues to check out with the new amounts Method Description String getStreetl1 First line of the street address String getStreet2 Second line of the street address String getCity Name of the city String getState Name of the state or province String U S ZIP code or other country specific postal code getPostalcode String The 2 character country code getCountrycode String getCountry 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 Description setCurrency String currency Optional Currency code of the amount Defaults to USD setPaymentAmount String Required Amount of the payment before tax or shipping paymentAmount or setPaymentAmount BigDecimal paymentAmount setTax String tax Optional Tax amount associated with the item or setTax BigDecimal tax setShipping String shipping Optional Shipping amount for the item or setShipping BigDecimal Mobile Payments Library Developer Guide and Reference Android OS Edition July 2011 23 Property Description shipping MEPReceiverAmounts Similarly to MEPAmounts and MEPAddress this object is used in dynamic amount calculation for advanced payments Property Description public MEPAmounts amounts Am

Download Pdf Manuals

image

Related Search

Related Contents

2707-801, DTAM Programming Software Programming Manual  Guía del usuario - Support  Dell Vizioncore Tutorial  DCサーボモータドライバ 取扱説明書  図 面 1  Mode d`emploi  NAD Electronics C320 User's Manual  1 - Back  user's manual - Eki'p Dental  優良住宅部品(BL部品) 申請図書作成要領  

Copyright © All rights reserved.
Failed to retrieve file