Hello All ...
In my personal experience integration of PayPal is very confusing because of various API's available by which we can integrate PayPal with the website. The chances of getting diverted while implementation of one of them is very high.
Instant Payment Notification(IPN) is a message service that notifies you of events related to PayPal transactions (Introduction)
Lets see how to integrate PayPal IPN service with java web-application.
For that first you need to create Business account at PayPal Developer site which will accept payment.
After sign up and confirmation via Email you are ready to go to next step to generate Payment Button.
We will select here the first option "On your website"
Now create button as per your choice(e.g. BuyNow, Donate, Pay Now etc.) to be integrated within your application
After completing this process you have to select and copy the button code that you have to put in your application.
After that you can see button like below within your webpage
Login again to PayPal site and go to Applicaion > SandboxAccounts . At there get facilitator account credentials.
Login with facilitator account credentials into sandbox.paypal.com
Under My selling tools select Instant payment notification and update IPN url
After that select "choose IPN settings" and update notification URL. This URL will be the controller of your web application which will receive messages from PayPal
Now its time to create app in PayPal on behalf of which application will receive payments,For that Login again to PayPal Developer site and go to Applications > MyApps > Create App
Now you are ready to test payment transactions using PayPal ...
Change form parameters within you web page ( update generated "Buy Now" button code with following changes )
This is how final form looks(You can un-comment needed parameters)
After clicking on
button and on successful payment (Payment can be done with different test account created through paypal) you will receive payment status,transaction Id and custom parameters
String txn_id = request.getParameter("txn_id"); //e.g. 3EM711.....804011F
String payment_status = request.getParameter("payment_status"); //e.g. Completed
String custom = request.getParameter("custom"); // parameters that you pass and get back
That's it..!! Your Payment has been Successful... :D
In my personal experience integration of PayPal is very confusing because of various API's available by which we can integrate PayPal with the website. The chances of getting diverted while implementation of one of them is very high.
Instant Payment Notification(IPN) is a message service that notifies you of events related to PayPal transactions (Introduction)
Lets see how to integrate PayPal IPN service with java web-application.
For that first you need to create Business account at PayPal Developer site which will accept payment.
After sign up and confirmation via Email you are ready to go to next step to generate Payment Button.
We will select here the first option "On your website"
Now create button as per your choice(e.g. BuyNow, Donate, Pay Now etc.) to be integrated within your application
After completing this process you have to select and copy the button code that you have to put in your application.
Login again to PayPal site and go to Applicaion > SandboxAccounts . At there get facilitator account credentials.
Login with facilitator account credentials into sandbox.paypal.com
Under My selling tools select Instant payment notification and update IPN url
Now its time to create app in PayPal on behalf of which application will receive payments,For that Login again to PayPal Developer site and go to Applications > MyApps > Create App
Now you are ready to test payment transactions using PayPal ...
Change form parameters within you web page ( update generated "Buy Now" button code with following changes )
- Add parameter business with facilitator account Id
- change form action from "https://www.paypal.com/cgi-bin/webscr" to "https://www.sandbox.paypal.com/cgi-bin/webscr" for test mode
- change cmd valut to "_xclick"
- Put notifyurl and returnurl same as you mentioned while choosing IPN Notification settings
- You can use Custom parameter by which you can pass and get back values while using PayPal
This is how final form looks(You can un-comment needed parameters)
After clicking on
button and on successful payment (Payment can be done with different test account created through paypal) you will receive payment status,transaction Id and custom parametersString txn_id = request.getParameter("txn_id"); //e.g. 3EM711.....804011F
String payment_status = request.getParameter("payment_status"); //e.g. Completed
String custom = request.getParameter("custom"); // parameters that you pass and get back
That's it..!! Your Payment has been Successful... :D










