Paypal provide us their own library for payment so it is now much secure and easy to implement in our application. Below are the important step to do.
Setup paypal in your android code
1)First go through Paypal Developer web site and create an application.
2)Now open your manifest file and give the below permissions
3)And some required Activity and Services-
4)Open your Activity class and set Configuration for your app-
5)Now set client id from the Paypal developer account-
private static final String CONFIG_CLIENT_ID = "PUT YOUR CLIENT ID";
6)Inside onCreate method call the Paypal service-
Intent intent = new Intent(this, PayPalService.class);
7)Now you are ready to make a payment just on button press call the Payment Activity-
8)And finally from the onActivityResult get the payment response-
This modified text is an extract of the original Stack Overflow Documentation created by following contributors and released under CC BY-SA 3.0