{"id":2255,"date":"2012-09-28T12:15:10","date_gmt":"2012-09-28T12:15:10","guid":{"rendered":"http:\/\/www.mobisoftinfotech.com\/blog\/?p=2255"},"modified":"2024-11-27T16:42:43","modified_gmt":"2024-11-27T11:12:43","slug":"integration-of-paypal-with-android-application","status":"publish","type":"post","link":"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application","title":{"rendered":"Integration of PayPal with Android Application"},"content":{"rendered":"<p>The easiest way to process payment through Android application is by integrating PayPal. There are two ways to integrate PayPal into an Android application :<\/p>\n<ul>\n<li>Mobile Payment Library<\/li>\n<li>Mobile Express Checkout Library<\/li>\n<\/ul>\n<div style=\"display: none;\"><a title=\"Levitra order online\" href=\"http:\/\/buycheaplevitraonline.org\">Levitra order online<\/a><\/div>\n<h3><strong>Mobile Payment Library :<\/strong><\/h3>\n<p>(For Android 1.5 and above-supported devices)<br>\nUsing Mobile Payment Library we can process payment without leaving the android application. This Library controls the checkout experience \u2013logging in, reviewing and completing the payment. In a few steps we can integrate mobile payment library in our application :<\/p>\n<ul>\n<li>To get Application ID for PayPal integration, login into <a href=\"http:\/\/www.x.com\" rel=\"nofollow noopener\">www.x.com<\/a> using your PayPal account and register your application under your account\u2019s \u201cMy-application\u201d tab. After completing registration, you will get an application ID.<br>\nYou can also use PayPal SandBox testing environment for testing the application &#8211; where you will get Test Application ID and test PayPal account to transfer funds. The commonly used sandbox test application ID is \u201cAPP-80W284485P519543T \u201c.<\/li>\n<li>Download mobile payment library for Android from this link <a href=\"https:\/\/www.x.com\/developers\/paypal\/documentation-tools\/paypal-sdk-index\" rel=\"nofollow noopener\">https:\/\/www.x.com\/developers\/paypal\/documentation-tools\/paypal-sdk-index<\/a> and add PayPal_MPL.jar library file to your project classpath.<\/li>\n<li>Add the following permission and activity in your AndroidManifest file<br>\nPermission and Activity:\n<pre>[xml]&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;uses -permission android:name=&amp;amp;amp;quot;android.permission.INTERNET&amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;\/uses&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;\n&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;uses -permission android:name=&amp;amp;amp;quot;android.permission.READ_PHONE_STATE&amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;\/uses&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;\n&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;activity android:name=&amp;amp;amp;quot;com.paypal.android.MEP.PayPalActivity&amp;amp;amp;quot; android:configChanges=&amp;amp;amp;quot;keyboardHidden|orientation&amp;amp;amp;quot;android:theme=&amp;amp;amp;quot;@android:style\/Theme.Translucent.NoTitleBar&amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;\/activity&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;\n[\/xml]<\/pre>\n<\/li>\n<li>PayPal Initialization:<br>\nIn your activity for using PayPal, you need to initialize it.<br>\nTo initialize PayPal add the following method<br>\n<strong><em>static public PayPal initWithAppID(Context context, String appID, int server)<\/em><\/strong><strong>Parameter:<\/strong><br>\n<strong>context:<\/strong> the context of your application<br>\n<strong>appID:<\/strong> appId of your application with which you have registered with PayPal.<br>\n<strong>server: <\/strong>PayPal server (if you are using testing mode for application use PayPal.ENV_SANDBOX or in case of PayPal production server, use PayPal.ENV_LIVE).<br>\nValue:<br>\nENV_SANDBOX ( Testing purpose, Use PayPal testing server to obtain device token. )<br>\nENV_LIVE (Not work on the emulator, Use PayPal production server to obtain device token. )<br>\nENV_NONE (Do not use any PayPal servers to obtain device tokens. )<br>\nEx.\n<pre>[java]PayPal ppObj = PayPal.initWithAppID(this.getBaseContext(), &amp;amp;amp;quot;APP- 80W284485P519543T&amp;amp;amp;quot;, PayPal.ENV_SANDBOX);[\/java]<\/pre>\n<\/li>\n<li><strong>Pay With PayPal Button:<\/strong>After Initialization of PayPal add <strong> Pay with PayPal <\/strong>Button in application. To add this button use method<br>\n<strong><em>public CheckoutButton getCheckoutButton(Context context, int style, int textType) <\/em><\/strong><br>\nThis method returns Pay with PayPal button.<strong>Parameter:<\/strong><br>\n<strong>context: <\/strong> required application context.<br>\n<strong>style :<\/strong> Size and appearance of Pay With PayPal Button<br>\nAllowed value:\n<ol style=\"margin-left: 43px;\">\n<li>PayPal.Button_152x33<\/li>\n<li>PayPal.Button_194x37<\/li>\n<li>PayPal.Button_278x43<\/li>\n<li>PayPal.Button_294x45<\/li>\n<\/ol>\n<p><strong>type :<\/strong> Type of button<br>\nAllowed value:<\/p>\n<ol style=\"margin-left: 43px;\">\n<li>CheckoutButton.TEXT_PAY<\/li>\n<li>CheckoutButton.TEXT_DONATE<\/li>\n<\/ol>\n<p>Ex.<\/p>\n<pre>[java]CheckoutButton launchPayPalButton = ppObj.getCheckoutButton(this, PayPal.BUTTON_278x43, CheckoutButton.TEXT_PAY);\nRelativeLayout.LayoutParams params\n= new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);\nparams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);\nparams.bottomMargin = 10;\nlaunchPayPalButton.setLayoutParams(params);\nlaunchPayPalButton.setOnClickListener(this);\n((RelativeLayout)findViewById(R.id.RelativeLayout01)).addView(launchPayPal Button);[\/java]<\/pre>\n<\/li>\n<li>On Click of Pay With PayPal Button start PayPal Library activity:\n<pre>[java]PayPalPayment newPayment = new PayPalPayment();\nnewPayment.setSubtotal(10.f);\nnewPayment.setCurrency(&amp;amp;amp;quot;USD&amp;amp;amp;quot;);\nnewPayment.setRecipient(&amp;amp;amp;quot;my@email.com&amp;amp;amp;quot;);\nnewPayment.setMerchantName(&amp;amp;amp;quot;My Company&amp;amp;amp;quot;);\nIntent paypalIntent = PayPal.getInstance().checkout(newPayment, this);\nthis.startActivityForResult(paypalIntent, 1);\n[\/java]<\/pre>\n<\/li>\n<li>\n<p style=\"text-align: left;\">Get the result of activity started, or get status of Payment transferred.<\/p>\n<pre>[java]@Override\npublic void onActivityResult(int requestCode, int resultCode, Intent data) {\nswitch(resultCode) {\ncase Activity.RESULT_OK:\n\/\/The payment succeeded\nString payKey = data.getStringExtra(PayPalActivity.EXTRA_PAY_KEY);\n\/\/Tell the user their payment succeeded\nbreak;\ncase Activity.RESULT_CANCELED:\n\/\/The payment was canceled\n\/\/Tell the user their payment was canceled\nbreak;\ncase PayPalActivity.RESULT_FAILURE:\n\/\/The payment failed -- we get the error from the EXTRA_ERROR_ID and EXTRA_ERROR_MESSAGE\nString errorID = data.getStringExtra(PayPalActivity.EXTRA_ERROR_ID);\nString errorMessage = data.getStringExtra(PayPalActivity.EXTRA_ERROR_MESSAGE);\n\/\/Tell the user their payment was failed.\n}\n}\n[\/java]<\/pre>\n<p><strong>Activity.RESULT_OK <\/strong><br>\nThis 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).<br>\n<strong>Activity.RESULT_CANCELED <\/strong><br>\nThis result is returned if the buyer cancels the payment during checkout.<br>\npaymentCanceled();<br>\n<strong>PayPalActivity.RESULT_FAILURE <\/strong><br>\nThis 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.<\/p><\/li>\n<li>After successful Payment, PayPal library will return PayKey. Using PayKey you can implement a number of features like\n<ol>\n<li>Instant Payment Notification<\/li>\n<li>PayPal Transaction Details<\/li>\n<li>Refund<\/li>\n<\/ol>\n<\/li>\n<li>Mode of Payment: PayPal supports different modes of Payment\n<ol>\n<li>Simple Payment:In Simple Payment, PayPal object supports only one recipient.<noscript><img decoding=\"async\" class=\"alignnone size-full wp-image-14746\" src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/09\/PayPal-object.png\" alt=\"PayPal object\" width=\"855\" height=\"363\" srcset=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/09\/PayPal-object.png 855w, https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/09\/PayPal-object-300x127.png 300w, https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/09\/PayPal-object-768x326.png 768w\" sizes=\"(max-width: 855px) 100vw, 855px\"><\/noscript><img decoding=\"async\" class=\"alignnone size-full wp-image-14746 lazyload\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20855%20363%22%3E%3C%2Fsvg%3E\" alt=\"PayPal object\" width=\"855\" height=\"363\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20855%20363%22%3E%3C%2Fsvg%3E 855w\" sizes=\"(max-width: 855px) 100vw, 855px\" data-srcset=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/09\/PayPal-object.png 855w, https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/09\/PayPal-object-300x127.png 300w, https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/09\/PayPal-object-768x326.png 768w\" data-src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/09\/PayPal-object.png\">\n<p style=\"text-align: center;\">(Reference: <a href=\"https:\/\/www.x.com\/developers\/paypal\" rel=\"nofollow noopener\">https:\/\/www.x.com\/developers\/paypal<\/a>)<\/p>\n<\/li>\n<li>Parallel Payment:In Parallel Payment, PayPal Object support many recipients.<br>\n<noscript><img decoding=\"async\" class=\"alignnone size-full wp-image-14755\" src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/09\/PayPal-Object-support-many-recipients.png\" alt=\"PayPal Object support many recipients\" width=\"855\" height=\"363\" srcset=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/09\/PayPal-Object-support-many-recipients.png 855w, https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/09\/PayPal-Object-support-many-recipients-300x127.png 300w, https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/09\/PayPal-Object-support-many-recipients-768x326.png 768w\" sizes=\"(max-width: 855px) 100vw, 855px\"><\/noscript><img decoding=\"async\" class=\"alignnone size-full wp-image-14755 lazyload\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20855%20363%22%3E%3C%2Fsvg%3E\" alt=\"PayPal Object support many recipients\" width=\"855\" height=\"363\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20855%20363%22%3E%3C%2Fsvg%3E 855w\" sizes=\"(max-width: 855px) 100vw, 855px\" data-srcset=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/09\/PayPal-Object-support-many-recipients.png 855w, https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/09\/PayPal-Object-support-many-recipients-300x127.png 300w, https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/09\/PayPal-Object-support-many-recipients-768x326.png 768w\" data-src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/09\/PayPal-Object-support-many-recipients.png\"><br>\n(Reference: <a href=\"https:\/\/www.x.com\/developers\/paypal\" rel=\"nofollow noopener\">https:\/\/www.x.com\/developers\/paypal<\/a>)<\/li>\n<li>Chained Payment:In chained payment, PayPal Object indirectly supports many receivers. PayPal sends payment to Primary receiver and the primary receiver sends payment to other recipients.\n<p style=\"text-align: center;\"><a href=\"http:\/\/https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/chain+paymeny.jpg\"><noscript><img decoding=\"async\" class=\"aligncenter size-full wp-image-2270\" src=\"http:\/\/https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/chain+paymeny.jpg\" alt width=\"394\" height=\"228\" srcset=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/chain+paymeny.jpg 656w, https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/chain+paymeny-300x173.jpg 300w\" sizes=\"(max-width: 394px) 100vw, 394px\"><\/noscript><img decoding=\"async\" class=\"aligncenter size-full wp-image-2270 lazyload\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20394%20228%22%3E%3C%2Fsvg%3E\" alt width=\"394\" height=\"228\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20394%20228%22%3E%3C%2Fsvg%3E 394w\" sizes=\"(max-width: 394px) 100vw, 394px\" data-srcset=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/chain+paymeny.jpg 656w, https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/chain+paymeny-300x173.jpg 300w\" data-src=\"http:\/\/https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/chain+paymeny.jpg\"><\/a><\/p>\n<p style=\"text-align: center;\">(Reference: <a href=\"https:\/\/www.x.com\/developers\/paypal\" rel=\"nofollow noopener\">https:\/\/www.x.com\/developers\/paypal<\/a>)<\/p>\n<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<h3><strong>Mobile Express Checkout Library:<\/strong><\/h3>\n<p>There are two ways to integrate mobile checkout library with your application<\/p>\n<ol>\n<li>PayPal Button in your Mobile Application<\/li>\n<li>PayPal Button on your mobile Website<\/li>\n<\/ol>\n<p>(Note: Download mobile payment library for Android from this link <a href=\"https:\/\/www.x.com\/developers\/paypal\/documentation-tools\/paypal-sdk-index\" rel=\"nofollow noopener\">https:\/\/www.x.com\/developers\/paypal\/documentation-tools\/paypal-sdk-index<\/a> and add library file to your project classpath.)<\/p>\n<h3><strong>PayPal Button in your Mobile Application:<\/strong><\/h3>\n<p>Place PayPal Button in your mobile application and load mobile express checkout library pages in a WebView.<\/p>\n<ul>\n<li>Fetch Device token before you place PayPal button in your mobile application screen.<br>\nAnd Include PayPal Listener.<\/li>\n<li>Get PayPal Button from Library and place it in your mobile application screen.<\/li>\n<li>When Buyer clicks on PayPal Button\n<ol>\n<li>Call the routine passing payment information to your mobile server<\/li>\n<li>On your mobile web server, send a SetExpressCheckout request with the payment information to PayPal.<\/li>\n<li>Pass the checkout token returned in the SetExpressCheckout response from your mobile web server to your mobile application.<\/li>\n<li>Open a web view, and redirect the browser to PayPal with the mobile command, the device token, and the checkout token as URL parameters.<br>\n<strong>https:\/\/www.paypal.com\/cgi-bin\/webscr?cmd=_express-checkout-mobile &amp;drt= valueFromFetchDeviceReferenceTokenWithAppID &amp;token=<\/strong><strong>valueFromSetExpres<\/strong>sCheckoutResponse<\/li>\n<\/ol>\n<\/li>\n<li>Monitor the web view for a redirect from PayPal to your return or cancel URL.<\/li>\n<li>If PayPal redirects the web view to your return URL, call surrogate routines on your mobile web server that send GetExpressCheckoutDetails and DoExpressCheckoutPayment requests to PayPal to complete the payment.<br>\nFlow Diagram:\n<p style=\"text-align: center;\"><a href=\"http:\/\/https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/paypal_button_in_mobile_app.jpg\"><noscript><img decoding=\"async\" class=\"aligncenter size-medium wp-image-2271\" src=\"http:\/\/https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/paypal_button_in_mobile_app-300x296.jpg\" alt width=\"300\" height=\"296\" srcset=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/paypal_button_in_mobile_app-300x296.jpg 300w, https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/paypal_button_in_mobile_app-1024x1012.jpg 1024w, https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/paypal_button_in_mobile_app-64x64.jpg 64w, https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/paypal_button_in_mobile_app.jpg 1733w\" sizes=\"(max-width: 300px) 100vw, 300px\"><\/noscript><img decoding=\"async\" class=\"aligncenter size-medium wp-image-2271 lazyload\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20300%20296%22%3E%3C%2Fsvg%3E\" alt width=\"300\" height=\"296\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20300%20296%22%3E%3C%2Fsvg%3E 300w\" sizes=\"(max-width: 300px) 100vw, 300px\" data-srcset=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/paypal_button_in_mobile_app-300x296.jpg 300w, https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/paypal_button_in_mobile_app-1024x1012.jpg 1024w, https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/paypal_button_in_mobile_app-64x64.jpg 64w, https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/paypal_button_in_mobile_app.jpg 1733w\" data-src=\"http:\/\/https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/paypal_button_in_mobile_app-300x296.jpg\"><\/a><\/p>\n<div style=\"text-align: center;\">(Reference: <a href=\"https:\/\/www.x.com\/developers\/paypal\" rel=\"nofollow noopener\">https:\/\/www.x.com\/developers\/paypal<\/a>)<\/div>\n<\/li>\n<\/ul>\n<h3><strong>PayPal Button in your Mobile Website:<\/strong><\/h3>\n<p>Place PayPal Button on your mobile website page if your checkout process begins and ends with mobile express checkout.<\/p>\n<ul>\n<li>Fetch device token from mobile express checkout library before beginning checkout process and add PayPal Listener that receives device token.<\/li>\n<li>Pass device token in URL and load URL in webview to begin the checkout process.<\/li>\n<li>3. Monitor webview until it redirects to your website.\n<p style=\"text-align: center;\"><a href=\"http:\/\/https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/paypal_button_in_mobile_website.png\"><noscript><img decoding=\"async\" class=\"aligncenter size-medium wp-image-2272\" src=\"http:\/\/https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/paypal_button_in_mobile_website-291x300.png\" alt width=\"291\" height=\"300\" srcset=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/paypal_button_in_mobile_website-291x300.png 291w, https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/paypal_button_in_mobile_website.png 647w\" sizes=\"(max-width: 291px) 100vw, 291px\"><\/noscript><img decoding=\"async\" class=\"aligncenter size-medium wp-image-2272 lazyload\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20291%20300%22%3E%3C%2Fsvg%3E\" alt width=\"291\" height=\"300\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20291%20300%22%3E%3C%2Fsvg%3E 291w\" sizes=\"(max-width: 291px) 100vw, 291px\" data-srcset=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/paypal_button_in_mobile_website-291x300.png 291w, https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/paypal_button_in_mobile_website.png 647w\" data-src=\"http:\/\/https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/paypal_button_in_mobile_website-291x300.png\"><\/a><\/p>\n<\/li>\n<\/ul>\n<p style=\"text-align: center;\">(Reference:<a href=\"https:\/\/www.x.com\/developers\/paypal\" rel=\"nofollow noopener\">https:\/\/www.x.com\/developers\/paypal<\/a>)<\/p>\n<h5><strong>Methods of Mobile Express Checkout Library:<\/strong><\/h5>\n<ol>\n<li><strong>Get Device Token:<\/strong><br>\n<em><strong>public static void fetchDeviceReferenceTokenWithAppID(Context context, String appID, int server, PayPalListener listener)<\/strong><\/em><br>\nParameter:<br>\n<strong>Context :<\/strong> activity or application context<br>\n<strong>appId:<\/strong> Application Id registered on www.x.com<br>\n<strong>server :<\/strong>ENV_SANDBOX<br>\nENV_LIVE (Not support on emulator)<br>\nENV_NONE<\/li>\n<li><strong>PayPal Button:<\/strong><em><strong>public CheckoutButton getCheckoutButton(Context context, int style, int textType)<\/strong><\/em>Parameter:<br>\n<strong>Context:<\/strong> activity or application context<br>\n<strong>Style:<\/strong> style and appearance of PayPal Button<br>\nAllowed value:\n<ol>\n<li>PayPal.Button_152x33<\/li>\n<li>PayPal.Button_194x37<\/li>\n<li>PayPal.Button_278x43<\/li>\n<li>PayPal.Button_294x45<\/li>\n<\/ol>\n<p><strong>type :<\/strong> Type of button<br>\nAllowed value:<\/p>\n<ol>\n<li>CheckoutButton.TEXT_PAY<\/li>\n<li>CheckoutButton.TEXT_DONATE<\/li>\n<\/ol>\n<\/li>\n<li><strong>PayPal Listener: <\/strong>Two Methods of PayPal Listener\n<pre>[java]@Override\npublic void couldNotFetchDeviceReferenceToken() {\n\/\/Initialization failed and we didn&amp;#039;t get a token\n}\n@Override\npublic void receivedDeviceReferenceToken(String token) {\n\/\/Initialization was successful\n}[\/java]<\/pre>\n<\/li>\n<\/ol>\n<p>More information about PayPal integration with android refer <a href=\"https:\/\/www.x.com\/developers\/paypal\" rel=\"nofollow noopener\">https:\/\/www.x.com\/developers\/paypal<\/a>.<\/p>\n<p>Download source code from <a href=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2012\/10\/PayPalIntegration.zip\">here.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The easiest way to process payment through Android application is by integrating PayPal. There are two ways to integrate PayPal into an Android application : Mobile Payment Library Mobile Express Checkout Library Levitra order online Mobile Payment Library : (For Android 1.5 and above-supported devices) Using Mobile Payment Library we can process payment without leaving [&hellip;]<\/p>\n","protected":false},"author":37,"featured_media":7383,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_s2mail":"yes","footnotes":""},"categories":[4],"tags":[459,282,288,248,285,136,289,284,283,251],"class_list":["post-2255","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android","tag-android","tag-android-paypal-integration","tag-credit-card-integration","tag-houston","tag-mobile-checkout","tag-mobile-payments","tag-payment-gateways","tag-paypal","tag-paypal-integration","tag-san-francisco"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Integration of PayPal with Android Application - Mobisoft Infotech<\/title>\n<meta name=\"description\" content=\"The easiest way to process payment through android application is by integrating PayPal.Download source code here.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Integration of PayPal with Android Application - Mobisoft Infotech\" \/>\n<meta property=\"og:description\" content=\"The easiest way to process payment through android application is by integrating PayPal.Download source code here.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application\" \/>\n<meta property=\"og:site_name\" content=\"Mobisoft Infotech\" \/>\n<meta property=\"article:published_time\" content=\"2012-09-28T12:15:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-27T11:12:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2015\/01\/Integration-of-PayPal-with-Android_l-min.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"550\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"mahesh.chunkhade\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"mahesh.chunkhade\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application#article\",\"isPartOf\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application\"},\"author\":{\"name\":\"mahesh.chunkhade\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/#\/schema\/person\/33bb3db66fade6269a712e457bad8f75\"},\"headline\":\"Integration of PayPal with Android Application\",\"datePublished\":\"2012-09-28T12:15:10+00:00\",\"dateModified\":\"2024-11-27T11:12:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application\"},\"wordCount\":1073,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application#primaryimage\"},\"thumbnailUrl\":\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2015\/01\/Integration-of-PayPal-with-Android_l-min.jpg\",\"keywords\":[\"Android\",\"android paypal integration\",\"Credit card integration\",\"Houston\",\"mobile checkout\",\"Mobile Payments\",\"payment gateways\",\"paypal\",\"paypal integration\",\"San Francisco\"],\"articleSection\":[\"Android\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application\",\"url\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application\",\"name\":\"Integration of PayPal with Android Application - Mobisoft Infotech\",\"isPartOf\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application#primaryimage\"},\"image\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application#primaryimage\"},\"thumbnailUrl\":\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2015\/01\/Integration-of-PayPal-with-Android_l-min.jpg\",\"datePublished\":\"2012-09-28T12:15:10+00:00\",\"dateModified\":\"2024-11-27T11:12:43+00:00\",\"author\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/#\/schema\/person\/33bb3db66fade6269a712e457bad8f75\"},\"description\":\"The easiest way to process payment through android application is by integrating PayPal.Download source code here.\",\"breadcrumb\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application#primaryimage\",\"url\":\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2015\/01\/Integration-of-PayPal-with-Android_l-min.jpg\",\"contentUrl\":\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2015\/01\/Integration-of-PayPal-with-Android_l-min.jpg\",\"width\":1920,\"height\":550,\"caption\":\"Integration of PayPal with Android_l-min\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/mobisoftinfotech.com\/resources\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Integration of PayPal with Android Application\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/#website\",\"url\":\"https:\/\/mobisoftinfotech.com\/resources\/\",\"name\":\"Mobisoft Infotech\",\"description\":\"Discover Mobility\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/mobisoftinfotech.com\/resources\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/#\/schema\/person\/33bb3db66fade6269a712e457bad8f75\",\"name\":\"mahesh.chunkhade\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/1036ad1eea47f7f1dca78c92f729dd263aaee07c1a0545c14eea5afee59e127e?s=96&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1036ad1eea47f7f1dca78c92f729dd263aaee07c1a0545c14eea5afee59e127e?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1036ad1eea47f7f1dca78c92f729dd263aaee07c1a0545c14eea5afee59e127e?s=96&r=g\",\"caption\":\"mahesh.chunkhade\"},\"sameAs\":[\"http:\/\/www.mobisoftinfotech.com\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Integration of PayPal with Android Application - Mobisoft Infotech","description":"The easiest way to process payment through android application is by integrating PayPal.Download source code here.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application","og_locale":"en_US","og_type":"article","og_title":"Integration of PayPal with Android Application - Mobisoft Infotech","og_description":"The easiest way to process payment through android application is by integrating PayPal.Download source code here.","og_url":"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application","og_site_name":"Mobisoft Infotech","article_published_time":"2012-09-28T12:15:10+00:00","article_modified_time":"2024-11-27T11:12:43+00:00","og_image":[{"width":1920,"height":550,"url":"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2015\/01\/Integration-of-PayPal-with-Android_l-min.jpg","type":"image\/jpeg"}],"author":"mahesh.chunkhade","twitter_card":"summary_large_image","twitter_misc":{"Written by":"mahesh.chunkhade","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application#article","isPartOf":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application"},"author":{"name":"mahesh.chunkhade","@id":"https:\/\/mobisoftinfotech.com\/resources\/#\/schema\/person\/33bb3db66fade6269a712e457bad8f75"},"headline":"Integration of PayPal with Android Application","datePublished":"2012-09-28T12:15:10+00:00","dateModified":"2024-11-27T11:12:43+00:00","mainEntityOfPage":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application"},"wordCount":1073,"commentCount":0,"image":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application#primaryimage"},"thumbnailUrl":"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2015\/01\/Integration-of-PayPal-with-Android_l-min.jpg","keywords":["Android","android paypal integration","Credit card integration","Houston","mobile checkout","Mobile Payments","payment gateways","paypal","paypal integration","San Francisco"],"articleSection":["Android"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application#respond"]}]},{"@type":"WebPage","@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application","url":"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application","name":"Integration of PayPal with Android Application - Mobisoft Infotech","isPartOf":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/#website"},"primaryImageOfPage":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application#primaryimage"},"image":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application#primaryimage"},"thumbnailUrl":"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2015\/01\/Integration-of-PayPal-with-Android_l-min.jpg","datePublished":"2012-09-28T12:15:10+00:00","dateModified":"2024-11-27T11:12:43+00:00","author":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/#\/schema\/person\/33bb3db66fade6269a712e457bad8f75"},"description":"The easiest way to process payment through android application is by integrating PayPal.Download source code here.","breadcrumb":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application#primaryimage","url":"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2015\/01\/Integration-of-PayPal-with-Android_l-min.jpg","contentUrl":"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2015\/01\/Integration-of-PayPal-with-Android_l-min.jpg","width":1920,"height":550,"caption":"Integration of PayPal with Android_l-min"},{"@type":"BreadcrumbList","@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/android\/integration-of-paypal-with-android-application#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/mobisoftinfotech.com\/resources\/"},{"@type":"ListItem","position":2,"name":"Integration of PayPal with Android Application"}]},{"@type":"WebSite","@id":"https:\/\/mobisoftinfotech.com\/resources\/#website","url":"https:\/\/mobisoftinfotech.com\/resources\/","name":"Mobisoft Infotech","description":"Discover Mobility","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/mobisoftinfotech.com\/resources\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/mobisoftinfotech.com\/resources\/#\/schema\/person\/33bb3db66fade6269a712e457bad8f75","name":"mahesh.chunkhade","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1036ad1eea47f7f1dca78c92f729dd263aaee07c1a0545c14eea5afee59e127e?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1036ad1eea47f7f1dca78c92f729dd263aaee07c1a0545c14eea5afee59e127e?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1036ad1eea47f7f1dca78c92f729dd263aaee07c1a0545c14eea5afee59e127e?s=96&r=g","caption":"mahesh.chunkhade"},"sameAs":["http:\/\/www.mobisoftinfotech.com\/"]}]}},"_links":{"self":[{"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/posts\/2255","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/users\/37"}],"replies":[{"embeddable":true,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/comments?post=2255"}],"version-history":[{"count":89,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/posts\/2255\/revisions"}],"predecessor-version":[{"id":32826,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/posts\/2255\/revisions\/32826"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/media\/7383"}],"wp:attachment":[{"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/media?parent=2255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/categories?post=2255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/tags?post=2255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}