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 http://www.mysite.com/ecommerce/code/PayPalPayment.php).
However there is an updated version of the file and can be obtained here:
http://open.silverstripe.com/ticket/1760
Upload that over your existing http://www.mysite.com/ecommerce/code/PayPalPayment.php
The next step is to configure your http://www.mysite.com/ecommerce/_config.php to add the paypal information you need.
This is what I added
Payment::set_supported_methods(array(
'PayPalPayment' => 'Credit Card (Paypal)'
));
// Set the email of the admin who looks after receiving the order emails.
Order::set_email('ross@3point7designs.com');
//Real account for paypal
PayPalPayment::setPayPalRealAccount('info@3point7designs.com');
//Test account for paypal
PayPalPayment::setPayPalTestAccount('info@3point7designs.com');
//Who to send test payment from
PayPalPayment::setPayPalUseTestAccount('info@3point7designs.com');
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 http://www.mysite.com/checkout/?flush=1 paypal showed up