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.

We've moved the forum!

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.

E-Commerce Modules /

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, Ed, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba

Paypal Integration NOT working...


Go to End


28 Posts   11437 Views

Avatar
motoservo

Community Member, 27 Posts

29 July 2009 at 5:32pm

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.

Avatar
Patrick

Community Member, 11 Posts

30 July 2009 at 1:13pm

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

Avatar
Nicolaas

Forum Moderator, 224 Posts

30 July 2009 at 1:27pm

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

Avatar
Patrick

Community Member, 11 Posts

30 July 2009 at 1:46pm

Thanks Nicolaas.

It worked with

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

I'll test the transactions tomorrow. :)

P.

Avatar
datago

Community Member, 5 Posts

31 July 2009 at 10:43am

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

Avatar
ryanwachtl

Community Member, 46 Posts

31 July 2009 at 12:17pm

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
Avatar
Patrick

Community Member, 11 Posts

31 July 2009 at 12:19pm

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.

Avatar
ryanwachtl

Community Member, 46 Posts

31 July 2009 at 1:12pm

Thanks Patrick,

So far all is working good with 2.3.3rc2

Will continue more testing with PayPal now.