This documentation is for the submodule of the Commerce PayPal project. Support / feature requests and module or documentation feedback should not be posted to these comments. Please use the project issue tracker instead.

Setup

  1. Install Commerce PayPal and enable the PayPal WPP submodule
  2. Go PayPal Developer https://developer.paypal.com/developer/accounts/
  3. Login with the account details of the PayPal account details that you will be using to process the payments on the website.
  4. Click on account on the left navigation menu and then click on your account and then click on profile.
  5. Now you should have a window displaying all your account details click on the API Credentials.
  6. Enable the default Rule for the payment method at Store > Configuration > Payment methods.
  7. Edit the Rule and configure the default action that enables the payment method to use your PayPal API credentials.

Testing

  1. During development, you should use the sandbox if possible and may also want to turn on full IPN logging to log all IPN activity to the watchdog.
  2. Make sure that Sandbox option is selected under PayPal option and the options for Log the following messages for debugging are checked before you proceed with testing.
  3. Perform payment tests in the sandbox to ensure you're receiving and processing IPNs as expected. This requires a public server for testing and should result in payment transactions being created for your orders.
  4. Here is a link to a page explaining all the PayPal error codes should you find any in the watchdog during debugging https://developer.paypal.com/docs/classic/api/errorcodes/
  5. Here is a link to some fake credit card numbers that you can use for testing. https://www.paypalobjects.com/en_US/vhelp/paypalmanager_help/credit_card.... You may also want to create several seller and/or buyer accounts in your paypal sandbox and use those if you encounter any trouble with the test credit card numbers. For instance, using the test CC# 4111 1111 1111 1111 doesn't work if currency is GBP, you have to use the other Visa # on that page, and sometimes that doesn't even work, but the accounts created in the sandbox developer account seem to be more consistent.
  6. When testing is complete to your satisfaction, simply edit the checkout rule above and switch to Live

Misc notes

  • If you get a watchdog error simply says "A PayPal WPP transaction failed because the order did not have a value for the default billing address field. Your order or checkout configuration may need to be adjusted to support credit card payment via PayPal WPP." In order to use WPP (based on the WPP module's code), you must have one of the two possible Name lines enabled on your Billing Profile's addressfield.
       if (empty($address_value['name_line']) && empty($address_value['first_name'])) {
          $valid_billing_address = FALSE;
        }
    

    The above code (around line 279 in commerce_paypal/modules/wpp/commerce_paypal_wpp.module, as of this update) requires either the single line name field or the First/Last name field on the billing profile's address field to be enabled and provided to PayPal for a WPP transaction.

Comments

scotwith1t’s picture

While it may be fairly obvious, since WPP is basically a credit card processor and every CC processor requires a name to go with the CC, because we were upgrading from WPS and hadn't needed the Name fields on our form before, it wasn't exactly clear why it wasn't working for us initially. Adding more details to docs above, but you must have either the Full Name or the First/Last Name line enabled on your billing profile.

Road Kill’s picture

There is so much documentation on Drupal by people in the community with good intentions but most of the material is always vague or incomplete. I spent considerable time trying to find out how to setup PayPal WPP in commerce but could not find any reliable detailed step by step instructions which I found surprising and frustrating.
So to save the next person the frustration and time here is step by step process.
1. Install Commerce PayPal and enable the PayPal WPP submodule
2. Go to store >configuration>payment methods and enable the PayPal WPP - Credit Card rule.
3. Go PayPal Developer https://developer.paypal.com/developer/accounts/
4. Login with the account details of the PayPal account details that you will be using to process the payments on the website.
5. Click on account on the left navigation menu and then click on your account and then click on profile.
6. Now you should have a window displaying all your account details click on the API Credentials.
7. Go back to the website and then go to PayPal WPP - Credit Card rule and click edit and add the API Credentials.
8. Make sure that Sandbox option is selected under PayPal option and the options for Log the following messages for debugging are checked before you proceed with testing.

Here is a link to a page explaining all the PayPal error codes should you find any in the watchdog during debugging https://developer.paypal.com/docs/classic/api/errorcodes/

You are also going to have a joyous time find any information in PayPal’s mess [PayPal Developer] about using or obtaining fake credit card details so here is a link to some fake credit card numbers that you can use for testing.

https://www.paypalobjects.com/en_US/vhelp/paypalmanager_help/credit_card...

N.B if you going to document anything try and be thorough and detailed. Make sure that you are clear about every step. It will save the next person some time and frustration.

scotwith1t’s picture

Moved comments to actual documentation above. Would be nice if we could just delete our own comments...

Road Kill’s picture

Firstly this comment was not directly addressed to mshepherd, rszrama or any of the guys at commerce guys I did not name anybody. It was addressed to the community. My profile which you pointed out has really nothing to do with this and the mention of it is just unprofessional and pointless. I may not be contributing hours into modules but I have contributed hundreds of hours by helping people in issues queues.

Secondly no one was winning/complaining here except you and if you felt the need to call me out then maybe you should have done this directly by contacting me through my profile as I don’t think the documentation page is the right place to do this. If anything maybe we should be discussing how we can improve on this page considering that you have found fault with my process.

On a final note I am a developer myself and very much appreciate and respect the hard work that the guys at commerce have done and that is why I took the time out of my busy day to write a step by step process. I know it’s not a piece of code but it is a contribution.

It is obvious that my comment has got you fired up so I apologies for offending you or anybody else.

Enjoy your day further.

scotwith1t’s picture

.

Road Kill’s picture

Your comment about processing payments in the sandbox account using personal rather than pro was good advice but I still find that the PayPal sandbox is very buggy. It was down last week for two days but working now.