Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.


Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

How I got PayPal and Ecommerce module to work


7 Posts   5689 Views


9 October 2008 at 2:23am Community Member, 19 Posts

I had a hell of a time getting paypal and ecommerce to work, and it seems all the documentation is spread out so I figured I would post what worked for me. Seem others had the same issues.

I was not able to get paypal to work with the supplied PayPalPayment.php which is located in the ecommerce/code directory (so it would be

However there is an updated version of the file and can be obtained here:

Upload that over your existing

The next step is to configure your to add the paypal information you need.

This is what I added

'PayPalPayment' => 'Credit Card (Paypal)'

// Set the email of the admin who looks after receiving the order emails.

//Real account for paypal

//Test account for paypal

//Who to send test payment from

Then you must edit the /ecommerce/code/CheckoutPage.php

and change this:

class CheckoutPage extends Page{
   static $db = array(
      "PurchaseComplete" => "HTMLText",
      "ChequeMessage" => "HTMLText"


to this

class CheckoutPage extends Page{

   static $db = array(
      "PurchaseComplete" => "HTMLText",
      "PayPalInstructions" => "HTMLText", //add paypal instructions
      "ChequeMessage" => "HTMLText"

Hope this helps those who had/have similar problems. After doing these changes and going to paypal showed up


10 October 2008 at 5:03am Community Member, 901 Posts

Sounds like something that should be put into the documentation wiki. It will surely get lost here.


16 October 2008 at 3:05am (Last edited: 16 October 2008 3:27am), Community Member, 17 Posts

Thank you so much for posting this. I've been struggling with the PayPal issue for a client. I've implemented everything you've outlined. PayPal shows up in my cart, but when I get to I have the following choices: Credit Card (Paypal) AND preferred payment method (select one) VISA, MASTERCARD, AMEX, PayPal.

If I select PayPal in either case as the payment option, when I click place order and make payment I simply get a blank screen the following url:

Do you have any thoughts/advice on this?


17 October 2008 at 4:15am Community Member, 19 Posts

Hmm, I don't have that problem but I usually select paypal AND a credit card I wish to pay with... maybe try that and see how it works?

Corrie Sloot

31 October 2008 at 7:10am (Last edited: 31 October 2008 7:54am), Community Member, 2 Posts

You need to create a template the template file:


It should be a regular template page, with $PayPalInstructions and $Content in the content area.

I made mine just say "Redirecting to PayPal", and then used JavaScript to submit the PayPal form.


4 November 2008 at 10:21am Community Member, 9 Posts

Thanks so much for the very helpful guide. I have PayPal up and running with Ecommerce. I did run into a problem coming back from a successful payment, though. in PayPalPament.php on lines #230 and #233, the code calls a view that does not exist: ConfirmPayPal. By changing line 230 to be OrderSuccessful instead and 233 to be OrderIncomplete, I get proper returns from payments.


8 December 2008 at 4:38pm Community Member, 215 Posts

Hey there, i am following this thread trying to set up paypal as well but now, after iv made those changes no pages are able to load and it is saying

"Fatal error: Access to undeclared static property: PayPalPayment_Handler::$URLSegment in /home/howardgr/public_html/ on line 31"

If I remove "PayPalPayment_Handler::$URLSegment . '/$Action/$ID' => 'PayPalPayment_Handler'" from my ecommerce/_mysite.php file then the site loads but I when I process payment it errors and doesn't get as far as paypal.

Any help would be appreciated!!