Try changing:
Payment::set_supported_methods(array(
'WorldpayPayment' => 'Credit card (Paypal)'
));
to
Payment::set_supported_methods(array(
'PayPalPayment' => 'Credit Card'
));
That should do the trick.
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Try changing:
Payment::set_supported_methods(array(
'WorldpayPayment' => 'Credit card (Paypal)'
));
to
Payment::set_supported_methods(array(
'PayPalPayment' => 'Credit Card'
));
That should do the trick.
Thanks grilldan. That solved half my problem. It now recognises Paypal but when you hit 'place order and make payment' the following error appears:
Fatal error: Call to a member function validate() on a non-object in C:\wamp\www\isa\sapphire\forms\CompositeField.php on line 213
Also if i add the following code into the _config.php file:
// Check if the site is in 'live' mode, use the live credentials.
// otherwise, use test credentials instead to be careful.
if(Director::isLive()) {
PayPalPayment::set_account_email('mymail@mydomain.com');
} else {
PayPalPayment::set_test_mode('mymailtest@mydomaintest.com');
}
I get the following error:
Fatal error: Call to undefined method PayPalPayment::set_account_email() in C:\wamp\www\isa\mysite\_config.php on line 48
Hope you can help. Thanks again.
Instead of using mysite/_config.php try using ecommerce/_config.php.
Thanks grilldan. Tried that with no luck. Same error is appearing. Any other ideas?
Ok, so it looks like the Paypal instructions page is out-of-date. For anyone else having this same issue, the answer can be found here:
http://www.silverstripe.com/extending-hacking-silverstripe-forum/flat/42312?start=16