Jump to:

2082 Posts in 1002 Topics by 452 members

E-Commerce Modules

SilverStripe Forums » E-Commerce Modules » Paypal Integration NOT working...

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba, simon_w

Page: 1 2 3 4
Go to End
Author Topic: 6486 Views
  • motoservo
    Avatar
    Community Member
    24 Posts

    Re: Paypal Integration NOT working... Link to this post

    I've got Paypal Payments Pro (where the buyer never leaves the site) working. It's pretty easy to set up without using any modules whatsoever. If anyone needs to know how let me know.

  • Patrick
    Avatar
    Community Member
    11 Posts

    Re: Paypal Integration NOT working... Link to this post

    I had the same issue and then upgraded to the latest SilverStripe RC (2.3.3rc2) and the error changed (see below). Is there anything I can do in the short term to fix this (as in, before waiting for a formal release)? This happened with eCommerce 0.6-Beta1/Payment-Beta1 and with the latest trunks downloaded today.

    No rush for me (I had some time today and thought I'd see how far along had the paypal integration gone). Wish I could contribute code, but I'm not a programmer (yet ).

    Thanks!

    Here's the error:

    [Notice] Undefined variable: fields
    POST /checkout/OrderForm

    Line 208 in C:\wamp\www\payment\code\PayPalPayment.php
    Source

    199       $inputs['email'] = $member->Email;
    200
    201       if($member->hasMethod('getState'))   $inputs['state'] = $member->getState();
    202       if($member->hasMethod('getZip')) $inputs['zip'] = $member->getZip();
    203
    204       // 8) Form Creation
    205
    206       foreach($inputs as $name => $value) {
    207          $ATT_value = Convert::raw2att($value);
    208          $fields .= "<input type=\"hidden\" name=\"$name\" value=\"$ATT_value\" />";
    209       }
    210
    211       return <<<HTML
    212          <form id="PaymentForm" method="post" action="$url">
    213             $fields
    214             <input type="submit" value="Submit" />

    Trace

    * PayPalPayment->PayPalForm()
    Line 131 of PayPalPayment.php
    * PayPalPayment->processPayment(Array,OrderForm)
    Line 190 of OrderForm.php
    * OrderForm->processOrder(Array,OrderForm,HTTPRequest)
    Line 246 of Form.php
    * Form->httpSubmission(HTTPRequest)
    Line 129 of RequestHandler.php
    * RequestHandler->handleRequest(HTTPRequest)
    Line 143 of RequestHandler.php
    * RequestHandler->handleRequest(HTTPRequest)
    Line 122 of Controller.php
    * Controller->handleRequest(HTTPRequest)
    Line 29 of ModelAsController.php
    * ModelAsController->handleRequest(HTTPRequest)
    Line 277 of Director.php
    * Director::handleRequest(HTTPRequest,Session)
    Line 121 of Director.php
    * Director::direct(/checkout/OrderForm)
    Line 118 of main.php

  • Nicolaas
    Avatar
    Forum Moderator
    213 Posts

    Re: Paypal Integration NOT working... Link to this post

    Hi Patrick

    Your error can be fixed easily by adding the following at the top of the method (function) where the error occured.

    $field = '';

    The error tells us that we can not find the variable $field, that is all.

    Cheers

    Nicolaas

  • Patrick
    Avatar
    Community Member
    11 Posts

    Re: Paypal Integration NOT working... Link to this post

    Thanks Nicolaas.

    It worked with

    $fields = '';
    ("s" was missing from your suggestion).

    I'll test the transactions tomorrow.

    P.

  • datago
    Avatar
    Community Member
    5 Posts

    Re: Paypal Integration NOT working... Link to this post

    I am able to add items to the ecommerce cart just fine.
    This is what I get when I click place order & make payment.
    Silverstripe 2.3.2rc4
    ecommerce 0.6beta1
    payment 0.1beta1

    If there's anything else that would be helpful...let me know & I'll try to get it!

    [User Error] Uncaught Exception: Object->__call(): the method 'order' does not exist on 'PayPalPayment'
    POST /checkout/OrderForm

    Line 515 in /var/www/web25/web/sapphire/core/Object.php
    Source

    506             case isset($config['function']) :
    507                return $config['function']($this, $arguments);
    508             
    509             default :
    510                throw new Exception (
    511                   "Object->__call(): extra method $method is invalid on $this->class:" . var_export($config, true)
    512                );
    513          }
    514       } else {
    515          throw new Exception("Object->__call(): the method '$method' does not exist on '$this->class'");
    516       }
    517    }
    518    
    519    // -----------------------------------------------------------------------------------------------------------------
    520    
    521    /**

    Trace

    * Object->__call(Order,Array)
    * PayPalPayment->Order()
    Line 145 of PayPalPayment.php
    * PayPalPayment->PayPalForm()
    Line 131 of PayPalPayment.php
    * PayPalPayment->processPayment(Array,OrderForm)
    Line 190 of OrderForm.php
    * OrderForm->processOrder(Array,OrderForm,HTTPRequest)
    Line 245 of Form.php
    * Form->httpSubmission(HTTPRequest)
    Line 129 of RequestHandler.php
    * RequestHandler->handleRequest(HTTPRequest)
    Line 143 of RequestHandler.php
    * RequestHandler->handleRequest(HTTPRequest)
    Line 122 of Controller.php
    * Controller->handleRequest(HTTPRequest)
    Line 29 of ModelAsController.php
    * ModelAsController->handleRequest(HTTPRequest)
    Line 277 of Director.php
    * Director::handleRequest(HTTPRequest,Session)
    Line 121 of Director.php
    * Director::direct(/checkout/OrderForm)
    Line 118 of main.php

  • ryanwachtl
    Avatar
    Community Member
    46 Posts

    Re: Paypal Integration NOT working... Link to this post

    Also getting same error as above with PayPalPayments. See attached file.

    SilverStripe 2.3.2, Trunk of Ecommerce and Payments from July 29th.

    Any other information I can provide to help?

    Attached Files
  • Patrick
    Avatar
    Community Member
    11 Posts

    Re: Paypal Integration NOT working... Link to this post

    Try 2.3.3-rc2:

    http://www.silverstripe.org/assets/downloads/SilverStripe-v2.3.3-rc2.tar.gz

    That did the trick for me (plus the modification mentioned in mine and Nicolaas' posts above).

    P.

  • ryanwachtl
    Avatar
    Community Member
    46 Posts

    Re: Paypal Integration NOT working... Link to this post

    Thanks Patrick,

    So far all is working good with 2.3.3rc2

    Will continue more testing with PayPal now.

    6486 Views
Page: 1 2 3 4
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.