Tuesday, September 30, 2008

Can't Login Paypal Sandbox with Test Email

I created an account in the sandbox both seller / bussiness now i am trying to use it on the site and developer test site which i have to select an account and press the "Enter sandbox test site" but still wont work. did it on the site but still no movement keep getting the Message.
Email: Please enter a valid email address. It must be in the format: username@domain.com. Your email address is different from your eBay ID.

Solution :

1. Log in to https://developer.paypal.com, click the Test Accounts tab, select the desired test
account, and click Enter Sandbox Test Site.
2. Open the HTML file containing the Buy Now Button.
3. Click the Buy Now Button.
4. Log in using your test buyer account.
5. Follow the on-screen instructions to complete your test payment.



For the step 1, I was initially logged into a seller account, but this didn't work. You need to login as a buyer for step 1, then click the Buy Now Button on your website, then login as a buyer again.



Hope this helps. If you find this is helpful to you plz mark this post as solution

Kudo

Tuesday, September 23, 2008

Paypal Configuration Samle Code - Instant Payment Notification

Instant Payment Notification

IPN can be used to manage and customize a variety of PayPal-enabled APIs and communications, including:

  • Customize your website's response to customer purchases in real-time
  • Track customers via IPN "pass through" variables
  • Deliver access keys for software downloads and other digital goods
  • Automate your fulfillment operations
  • Track affiliate sales and commissions
  • Store transaction information in your own database.

Instant Payment Notification allows you to integrate your PayPal payments with your website's back-end operations, so you get immediate notification and authentication of the PayPal payments you receive.

How It Works


When a customer makes a payment to you, PayPal will post a notification to your server at a URL you specify. Included in this notification will be all of your customer's payment information (e.g. customer name, amount) as well as a piece of encrypted code. When your server receives a notification, it will then post the information, including the encrypted code, back to a secure PayPal URL. PayPal will authenticate the transaction by checking the encrypted string. This post-back of the IPN data to PayPal prevents "spoofing," so you can be sure that the IPN came from PayPal. Upon verification, PayPal will send confirmation of its validity back to your server.

Note: To activate Instant Payment Notification, you will need to enter the URL at which you would like to receive the notification posts from your Profile.

After you have activated Instant Payment Notification, your server will be sent a notification every time you receive a payment, this notification will be sent as a hidden "FORM POST" to the URL you specified, and will include all of the payment information. The FORM variables for the notification are listed at the bottom of this page.

Each time you receive an IPN from PayPal, you must complete the Notification Validation process described below before fulfilling the order. Verifying the information listed will ensure that the transaction is legitimate.


Notification Validation

To ensure that a payment has been made into your PayPal account, you must verify that the email address used as your "receiver_email" has been registered and confirmed in your PayPal account.

Once your server has received the Instant Payment Notification, you will need to confirm it by constructing an HTTP POST to PayPal. Your POST should be sent to https://www.paypal.com/cgi-bin/webscr

You must post all of the form variables you received exactly as you received them. You will also need to append a variable named "cmd" with the value "_notify-validate" (e.g. cmd=_notify-validate) to the POST string.

PayPal will respond to the post with a single word, "VERIFIED" or "INVALID", in the body of the response. When you receive a VERIFIED response, you need to perform several checks before fulfilling the order:

  • Confirm that the "payment_status" is "Completed," since IPNs are also sent for other results such as "Pending" or "Failed"
  • Check that the "txn_id" is not a duplicate to prevent a fraudster from using reusing an old, completed transaction
  • Validate that the "receiver_email" is an email address registered in your PayPal account, to prevent the payment from being sent to a fraudster's account
  • Check other transaction details such as the item number and price to confirm that the price has not been changed

Once you have completed the above checks, you may update your database with the IPN data and process the purchase.

If you receive an "INVALID" notification, it should be treated as suspicious and be investigated.

IPN Variables

For a complete list of all IPN variables and detailed instructions on how to use Instant Payment Notification, please refer to the Website Payments Standard Integration Guide (PDF, 4.6 MB, March 2008)

CREATE JSP PAGE - SHOPPING CART
Create jsp called submitToPaypal.jsp Copy below jsp code page. Call this page at time of checkout.

submitToPaypal.jsp


Create PaypalIPN action .java file or page .jsp and call below method on return from paypal for Notification Validation