PayPal Website Payments Standard

Last updated on
11 March 2021

Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites

This documentation needs work. See "Help improve this page" in the sidebar.

Edit: 2013-08-16
In general this page works for D7 / UC3. Follow what's here and translate from D6 to D7 and you should be good. Additional instructions on IPN are found in comment [Drupal 7.23, Ubercart 7.x-3.5].

INTRO - How this works behind the scenes

PayPal Website Payments Standard (WPS) works as follows:

  1. Customer fills in name, email, billing and shipping info on the checkout form.
  2. Customer selects to pay with Credit Card (WPS) on the checkout form.
  3. Customer clicks "Review Order" and then "Submit Order."
  4. UC automatically "packages up" the customer's order (either as an itemized list or as a sum total depending on your WPS settings), along with the name, email, and shipping / billing addresses and redirects the customer along with that information to a secure payment form at PayPal.
  5. Customer fills in credit card info on the PayPal site. The form already contains all of the information passed to it by UC so the customer only needs to enter the CC details in the PayPal form.

    * The customer may choose to create a PayPal account at checkout time depending on how you configured "Website Payment Preferences" in your PayPal account (see configuration steps below).

  6. Customer is either approved or denied by PayPal.
  7. Customer is manually or automatically redirected back to UC site.
  8. A user account is created automatically and the order tables updated appropriately when Ubercart receives the IPN from PayPal.

CONFIGURATION - How to make it work

PayPal Account Settings:

  1. Signup for a PayPal account.

    Before you can use WPS you need to sign up for a PayPal account.

  2. Open a business account (optional).

    Although this step is optional, it is recommended for you to keep your personal and business PayPal accounts separate. Opening a business account is preferable because it allows you to use a business name on the PayPal checkout pages and in theory allows you to keep your private name separate. Presenting a business name to customers will help build customer confidence.

  3. Go through the approval process to verify your account. This will require a bank account and correct contact information,
    possibly more. You can always contact their customer service if you get stumped here.
  4. Configure PayPal account settings.

    Login to your PayPal account and go to the profile page/tab. There are many options here but only a few are required to
    get WPS working with UC.

    Setting up WPS:

    • Click on "Website Payment Preferences" under the
      "Selling Preferences" section.
    • Enable "Auto Return".
    • Set the "Return URL" to http://www.example.com/cart/checkout/complete
    • Enable "Paypal Account Optional" (optional). This will make it so customers are not forced to create a PayPal account during
      checkout.
    • Save your settings.

    Setting up IPN:

    • Click on "Instant Payment Notification Preferences" under the "Selling Preferences" section.
    • Make sure that "Instant Payment Notification (IPN)" is checked.
    • Make sure that the IPN URL is set to http://example.com/uc_paypal/ipn. Where of course, instead of "example.com" you should use the actual domain name of your site.

* Note: When you login to PayPal, you may get taken to a "Getting Started Steps" page. Steps 1 and 2 are required and involve
opening your business account and getting verified. However, step 3 is not required. You do not have to create any buttons or links as UC handles redirecting users to PayPal automatically.

Ubercart PayPal Settings

  1. Enable uc_payment and uc_paypal modules at "admin/build/modules".
  2. Configure PayPal WPS settings at admin/store/settings/payment/edit/methods:
    • Click the "Enable" checkbox for WPS.
    • Expand the "PayPal Website Payments Standard settings" fieldset and make the following changes:
      1. Enter your PayPal account e-mail address in the appropriate field.
      2. Set the "PayPal server" to "Live" (versus Sandbox) when you're ready to process orders.
      3. The other fields are self-explanatory and based upon your requirements. Be sure to set them per your needs.
  3. Configure your Checkout Settings at admin/store/settings/checkout. You probably want to make sure you've enabled the following two options:
    • New customers receive an e-mail with their account details.
    • Anonymous checkout.
  4. Enable Automatic order update in WorkFlow-NG module by going to "admin/build/workflow-ng":
    • Click "Edit" for the Update order status on full payment
    • Tick "Active" checkbox.
    • Click "Submit"
  5. For using Report module first you have to enable Statistics module by going to "admin/build/modules":
    • Now enable Report feature by going to "admin/store/settings/reports"
    • Choose "Payment Received" under "Report Statuses"

FINISHED

That's it! Everything should be working now.

TIP: PayPal automatically checks your billing and shipping addresses to see if they are valid when you submit the order from UC. It must use a national address database to do this. This is a great feature for security reasons. You can test it yourself and see how it works.

However, you need to remember that if you are testing your site and entering bogus address info, PayPal will not bring you to checkout page but instead spit out an error similar to following:

"Unable to process payment. Please contact the merchant as the shipping address provided by the merchant is invalid, and the merchant has requested that your order must be shipped to that address."

So, test with valid addresses. You CAN enter in bogus name, email and phone number for testing purposes but you MUST enter in a valid postal address or you never get to see how this works in real life!

Testing in the PayPal Sandbox (optional)

In order to test WPS without actually submitting real CC data, you can create a PayPal Sandbox account. This requires that you go to an entirely separate PayPal site and create a new and separate account from your main PayPal business or WPS account. Here's the site: href="http://developer.paypal.com"
title="http://developer.paypal.com" rel="nofollow">http://developer.paypal.com

This process isn't for the faint of heart, but you may find some help in href="https://www.paypaldeveloper.com/pdn/board/message?board.id=sandbox&threa..."
rel="nofollow">this thread on PayPal's site.

When testing in the sandbox, make sure you've configured WPS in your UC settings form to process payments in the Sandbox.

Troubleshooting

If you have problems getting PayPal WPS to work properly, here are some things you should check:

  • Is your site in "offline" mode? If so, PayPal will not be able to send you an IPN to confirm the order, so orders will always stay in a "Payment pending" state.
  • Do you have HTTP authentication enabled on your site? You'll have the same problem as above.

Help improve this page

Page status: Needs work

You can: