How to Integrate the Paypal in Android Application

H

Hi,

Everybody know about paypal in real time . and this post may be helpful for you in you want to integrate paypal in your android application for any payment processes.
Paypal REleased an API and Library for MObile Integration.

You can integrate by using PAYPAL Mobile Libaraies.
PayPal Mobile Library =>http://www.mediafire.com/?87sdrw49oo82xn0
PayPal MerchantSetupAdministrationGuide
PayPal sandBOX Document =>http://www.mediafire.com/?el5fqbcc61e8o11

PayPal MOBILE library API document=>https://docs.google.com/file/d/1hLlPVThyBitCi_Lj5HicxXnmxnxmINzRxZp6jKbqtT-ekGB6KnNogbtfFSBE/edit?hl=en_US&authkey=COns1MoE

First to Create the Account to the paypal
By this link https://developer.paypal.com/

Then Add this code in your Project
Add this method
invokeSimplePayment(); in which

PayPalPayment newPayment = new PayPalPayment();
newPayment.setSubtotal(BigDecimal.valueOf(Totalprice));
newPayment.setCurrencyType("USD");
//.setCurrency("USD");
newPayment.setRecipient("my@email.com");
newPayment.setMerchantName("Nutri-ForeFronT");
PayPal pp = PayPal.getInstance();
if(pp==null)
pp = PayPal.initWithAppID(this, "APP-80W284485P519543T", PayPal.ENV_SANDBOX);
Intent paypalIntent = pp.checkout(newPayment,this);
this.startActivityForResult(paypalIntent, 1);

Override the OnActivityResult method and get response


@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch(resultCode) {

case Activity.RESULT_OK:
Toast.makeText(this,"ok" , 1).show();
}
break;

case Activity.RESULT_CANCELED:
Toast.makeText(this,"Cancel" , 1).show();
break;

case PayPalActivity.RESULT_FAILURE:
Toast.makeText(this,"faluare", 1).show();
}
}

About the author

abhijit.kurlekar
By abhijit.kurlekar

Category