15

How to create paypal donate button in android application and how to do the donation throw that

please help me with some source code

BenMorel
  • 34,448
  • 50
  • 182
  • 322
Krishna
  • 4,892
  • 18
  • 63
  • 98

4 Answers4

7

PayPal donate can be considered as just a HTTP GET request to a specific URL. You can set a ImageView and bind URL opening through the standard Android browser via an onClick event.

Kasisnu
  • 239
  • 5
  • 16
Olegas
  • 10,349
  • 8
  • 51
  • 72
  • 3
    For this it requires to be a registered charity organization otherwise paypal has the right to block the account and also hold the money for sure. -- From Paypal website about Donate (button) Link: This button is intended for fundraising. If you are not raising money for a cause, please choose another option. Nonprofits must verify their status to withdraw donations they receive. Users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. – hB0 Aug 31 '13 at 21:04
  • 9
    Careful, Google Play has suspended several apps (including my own) for having a PayPal donate button inside the app (even though it is not required / gives no benefit to the user) since they are not getting a share of the profits. It is against their Distribution Agreement. http://www.madhur.co.in/blog/2014/05/26/hermesremoved.html – Elad Nava Nov 18 '14 at 20:21
6

There is an alternative way of integrating Paypal to your android app without leaving it.

Paypal integration for android becomes fairly simple if you follow their developer site. You will need to download and integrate the library provided by Paypal, which is available on Paypal developer site.

Sample Pizza application built using Eclipse demonstrate how to do actual integration which is quite simple. Although paypal seems forgot to use relative path for library. So you will have to change library path and application is ready to go.

Rudey
  • 4,717
  • 4
  • 42
  • 84
Atul Kaushik
  • 5,181
  • 3
  • 29
  • 36
  • 4
    The link is expired. This is the new one: https://developer.paypal.com/webapps/developer/docs/classic/mobile/gs_MPL/ and doc for Android is here: https://www.paypalobjects.com/webstatic/en_US/developer/docs/pdf/pp_mpl_developer_guide_and_reference_android.pdf – Paul May 17 '14 at 23:21
  • I strongly discourage integrating PayPal for in-app purchases as it violates the [Google Play Developer Policy for monetization](https://play.google.com/intl/en/about/monetization-ads/). – Paul Lammertsma Apr 21 '20 at 09:29
6

I use this for my donation buttons and have it set as a picture button:

Donate.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.paypal.com/your_paypal"));
                startActivity(browserIntent);
            }
        });

to get the link version click the email version when setting up the button

Lucifer
  • 29,392
  • 25
  • 90
  • 143
turokevie
  • 95
  • 2
  • 8
1

You can also use android-donations-lib which is a donations Library for Android.

This library supports donations by Google Play Store, PayPal, and Flattr. They provide a full documentation and installation guide.

istovatis
  • 1,408
  • 14
  • 27
  • I strongly discourage using such libraries as it violates the [Google Play Developer Policy for monetization](https://play.google.com/intl/en/about/monetization-ads/). – Paul Lammertsma Apr 21 '20 at 09:30