Android and Paypal API integration

0 votes
asked Aug 27, 2010 by john-moeller

I'm trying to integrate the Paypal API to make my app donation based. I have two questions:

  1. I can see the button, I click it but it doesn't do anything! (the activity for checkoutIntent doesn't fire?)

  2. What are your experiences with donation based android apps? I want to make about $250 a month of this thing, is that even possible?

public class Donate extends Activity implements OnClickListener {

     PayPal ppObj = PayPal.initWithAppID(this.getBaseContext(), "APP-80W284485P519543T", PayPal.ENV_SANDBOX);

     public void onCreate(Bundle savedInstanceState) {
      LinearLayout mainLayout = (LinearLayout)findViewById(;
      if (ppObj == null) ppObj = PayPal.initWithAppID(this.getBaseContext(), "APP-80W284485P519543T", PayPal.ENV_SANDBOX);
      CheckoutButton payPalButton = (CheckoutButton) ppObj.getPaymentButton(PayPal.BUTTON_294x45, this, PayPal.PAYMENT_TYPE_HARD_GOODS);

     public void onClick(View arg0) {
      PayPalPayment newPayment = new PayPalPayment();
      newPayment.setAmount((float) 1.00);
      Intent checkoutIntent = new Intent(this, PayPalActivity.class);
      checkoutIntent.putExtra(PayPalActivity.EXTRA_PAYMENT_INFO, newPayment);

      this.startActivityForResult(checkoutIntent, 1);

        public void onBackPressed() {
      Intent menuIntent = new Intent(Donate.this, MTGTools.class);

1 Answer

0 votes
answered Aug 1, 2011 by ozmank

In onclick:


// Should do like this to start paypal activity
PayPalPayment newPayment = new PayPalPayment();

Intent paypalIntent=pp.checkout(newPayment, test.this);
startActivityForResult(paypalIntent, 1);
Welcome to Q&A, where you can ask questions and receive answers from other members of the community.
Website Online Counter