Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » new paypal payment code for ecommerce

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

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

Page: 1 2 3
Go to End
Author Topic: 34710 Views
  • BIMMAN
    Avatar
    Community Member
    8 Posts

    Re: new paypal payment code for ecommerce Link to this post

    Hi ak,

    I'm new to SS and PHP etc - can i pls get some more detailed instructions on how to setup the paypal extensions - i've tried to copy and paste the code samples but all i've managed to do is to break my ecommerce install

    any help would be greatly appreciated

    thx

    J

  • Flea
    Avatar
    Community Member
    1 Post

    Re: new paypal payment code for ecommerce Link to this post

    I would love to see some step by step ( line by line ) instructions also...
    Would be great for many who are new to SS.

    Cheers.

  • BigB
    Avatar
    Community Member
    9 Posts

    Re: new paypal payment code for ecommerce Link to this post

    Hi Nicolaas, Thanks for all the great work and advice with SS. We are beginning to develop some really dynamic sites on this platform. This post is the most relevant to our needs now... in the states, most small to midsize businesses utilize paypal opposed to other costly merch ant services. So, we are about to follow your lead with the code posted... have there been any updates or developments to paypal integration since your last post in March which asked for a code review. Wondering if you or anyone in the community have had continued success or have needed/added any tweaks.

    Thanks in advance. Also, if you are ever searching for design/dev work, please contact me, all of the team that works with me are freelance.

    Brian
    www.designbstudios.com

  • WorldNZ
    Avatar
    Community Member
    7 Posts

    Re: new paypal payment code for ecommerce Link to this post

    Hi All

    Hope this helps

    Yes we have implemented the paypal plugin successfully into Silverstripe

    First of all download the paypal.rar file from here http://open.silverstripe.com/ticket/1760

    Copy PayPalPayment.php from the archive to [yoursite]/ecommerce/code

    Open up this file and set self::$payPalRealAccount to the paypal email address of the merchant account

    Copy PaypalPaymentPage.ss to [yoursite]/ecommerce/templates/Includes

    Go to your _config.php file for your site....usually located under the mysite folder and add the following code to it

    // Define which payment methods your site uses.
    Payment::set_supported_methods(array(
    'ChequePayment' => 'Cheque',
    'PayPalPayment' => 'Credit Card'
    ));

    If you aren't going to accept offline payments then remove the chequepayment line

    Finally run db/build?flush=1 and that should be it

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: new paypal payment code for ecommerce Link to this post

    we've got a paypal class in ecommerce trunk that romain currently works on.
    looks like its a mod of nicolaas' class, not sure what the story behind that is - but have a look at:
    http://open.silverstripe.com/browser/modules/ecommerce/trunk/code/payments/PayPalPayment.php

    i've asked romain to have a look at this thread as well.

  • BigB
    Avatar
    Community Member
    9 Posts

    Re: new paypal payment code for ecommerce Link to this post

    We were able to successfully integrate the PayPal code for the eCommerce module. The help Nicolass provided on this thread as well as the links were right on track. I think the only think left is a quick fix for a "View My Cart" button on each preliminary product without having to click through to that product page. Easy enough. You can take a look at our client's site/store/checkout on our server at http://www.ucfi.designbstudios.com... we are still in beta, but it is fully operation besides all of the content. Thanks again to all, great instruction Nicolass... saved us from going to a third party solution.

  • cindycin
    Avatar
    Community Member
    20 Posts

    Re: new paypal payment code for ecommerce Link to this post

    in your steps you mention to...

    Copy PayPalPayment.php from the archive to [yoursite]/ecommerce/code

    Open up this file and set self::$payPalRealAccount to the paypal email address of the merchant account

    is this where I'm suppose to make the changes

    [ code]
    protected static $payPalRealAccount; static function setPayPalRealAccount($payPalRealAccount) { self::$payPalRealAccount = [ b]$payPalRealAccount;[ /b] }
    [ /code]

    is this how it should be...

    [ code]
    protected static $payPalRealAccount; static function setPayPalRealAccount($payPalRealAccount) { self::$payPalRealAccount = [ b]MY EMAIL ADDRESS GOES HERE;[ /b] }
    [ /code]

    is this the only place I need to change the code?

  • Nicolaas
    Avatar
    Forum Moderator
    213 Posts

    Re: new paypal payment code for ecommerce Link to this post

    The idea is that the class are not altered and that you create configuration in the /ecommerce/_config.php file using something like

    {name of class here}::setAccount($yourPPEmailHere);

    where setAccount is the static function in the class

    e.g. class could contain something like:

    class {
    static function setAccount($name) {

    }
    }

    34710 Views
Page: 1 2 3
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.