Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
|
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 19th, 2005, 04:33 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default Fatal Error Message

Has anybody ever come across an error like this I am not sure what it means in order to track it down

Fatal error: Call to a member function on a non-object in c:serverpath\paypal_dp.php on line 236

if(!Services_PayPal::isError($response))
 {
$errors = $response->getErrors();
$error_code = $errors->getErrorCode(); ----line 236
}

Peace
Mike
http://www.eclecticpixel.com
http://www.homegrownmusicjam.com
__________________
Peace
Mike
http://www.eclecticpixel.com
 
Old October 19th, 2005, 04:39 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

It means $errors is not an object. Do a var_dump() on $errors to see what $response->getErrors() is returning.

Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
 
Old October 19th, 2005, 05:01 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It's returning this.

array(2) {
[0]=> &object(errortype)(9) {
["_elements"]=> array(5) {
["ShortMessage"]=> array(3) {
["required"]=> bool(true)
["type"]=> string(6) "string"
["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" }
["LongMessage"]=> array(3) {
["required"]=> bool(false)
["type"]=> string(6) "string"
["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" }
["ErrorCode"]=> array(3) {
["required"]=> bool(true)
["type"]=> string(5) "token"
["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" }
["SeverityCode"]=> array(3) {
["required"]=> bool(true)
["type"]=> string(16) "SeverityCodeType"
["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" }
["ErrorParameters"]=> array(3) {
["required"]=> bool(false)
["type"]=> string(18) "ErrorParameterType"
["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" } }
["_attributes"]=> array(0) { }
["_attributeValues"]=> array(0) { }
["_namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents"
["ShortMessage"]=> string(37) "The Billing Address State is invalid."
["LongMessage"]=> string(125) "The field Billing Address State is in an invalid format. For US states and territories, enter a valid two letter state code."
["ErrorCode"]=> string(5) "10751"
["SeverityCode"]=> string(5) "Error"
["ErrorParameters"]=> NULL }
[1]=> &object(errortype)(9) {
["_elements"]=> array(5) {
["ShortMessage"]=> array(3) {
["required"]=> bool(true)
["type"]=> string(6) "string"
["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" }
["LongMessage"]=> array(3) {
["required"]=> bool(false)
["type"]=> string(6) "string"
["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" }
["ErrorCode"]=> array(3) {
["required"]=> bool(true)
["type"]=> string(5) "token"
["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" }
["SeverityCode"]=> array(3) {
["required"]=> bool(true)
["type"]=> string(16) "SeverityCodeType"
["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" }
["ErrorParameters"]=> array(3) {
["required"]=> bool(false)
["type"]=> string(18) "ErrorParameterType"
["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" } }
["_attributes"]=> array(0) { }
["_attributeValues"]=> array(0) { }
["_namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents"
["ShortMessage"]=> string(38) "The Shipping Address State is invalid."
["LongMessage"]=> string(126) "The field Shipping Address State is in an invalid format. For US states and territories, enter a valid two letter state code."
["ErrorCode"]=> string(5) "10750"
["SeverityCode"]=> string(5) "Error"
["ErrorParameters"]=> NULL } }
 
Old October 20th, 2005, 11:39 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Resolution to the problem, from paypal. They grab more information than just the ErrorCode.

for ($i=1; $i < count($response->Errors); $i++) {
echo "Error #: " . $i . "<br>";
echo "The error code was :<b> " . $response->Errors[$i]->ErrorCode. "</b><br>";
echo "Short Message:<b> " . $response->Errors[$i]->ShortMessage. "</b><br>";
echo "Long Message:<b> " . $response->Errors[$i]->LongMessage. "</b><br>";
echo "Correlation ID:<b> " . $response->CorrelationID. "</b><br><p />";
}

Peace
Mike
http://www.eclecticpixel.com
http://www.homegrownmusicjam.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
fatal error LNK1120: Yomero C++ Programming 0 November 11th, 2008 05:35 PM
FATAL ERROR. Help me please??? steviej1 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 11 February 27th, 2007 08:05 AM
Fatal Error?? dparsons ASP.NET 1.0 and 1.1 Professional 0 December 18th, 2006 01:55 PM
fatal error!!!! Ashleek007 Beginning PHP 6 October 9th, 2004 10:25 AM
Fatal error: singhzubin BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 2 April 11th, 2004 04:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.