Jump to content

Google Checkout - Fatal error when processing payment


Recommended Posts

Hi,

 

I have recently upgraded to Prestashop 1.5 and I am having a problem connecting to google checkout from my website. I receive this error when I click pay through google checkout :

 

Fatal Error : Cannot access protected property GCheckout::$context in /home2/indiscr1/public_html/tickets/modules/gcheckout/payment.php on line 38

 

 

Can anyone shed any light on this?

 

Thanks

Andy

Link to comment
Share on other sites

  • 2 weeks later...

Hi, in Prestashop 1.5.1 :

 

The context variable is defined in /classes/module/Module.php, unfortunately, this variable is declared as protected (line 117). A quick fix is to change protected by public.

 

But after have fixed this, I got

 

Oops! PrestaShop has sent Google a shopping cart with errors in it. We'll contact them to ask that they fix this problem. As this could be a temporary issue, you can go back in your browser to try checking out again.

 

Debugging information

 

If you are acting on behalf of the merchant, more information about this error has been made available in the Integration Console under the Tools section. You can access the details of this error directly by logging into your merchant account and then pasting the following url:

https://checkout.goo...48-25309146d9fd

Edited by Prestadget (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
  • 2 weeks later...
  • 2 weeks later...
  • 3 weeks later...
  • 2 weeks later...
  • 5 weeks later...

this work great on v:1.5.2

 

Hi, in Prestashop 1.5.1 :

 

The context variable is defined in /classes/module/Module.php, unfortunately, this variable is declared as protected (line 117). A quick fix is to change protected by public.

 

But after have fixed this, I got

 

Oops! PrestaShop has sent Google a shopping cart with errors in it. We'll contact them to ask that they fix this problem. As this could be a temporary issue, you can go back in your browser to try checking out again.

 

Debugging information

 

If you are acting on behalf of the merchant, more information about this error has been made available in the Integration Console under the Tools section. You can access the details of this error directly by logging into your merchant account and then pasting the following url:

https://checkout.goo...48-25309146d9fd

Link to comment
Share on other sites

  • 4 weeks later...

Same here, the current version of 1.5 and when customer is choosing Google Checkout as Payment method, all you can see is:

 

Fatal error: Cannot access protected property GCheckout::$context in /home/admin/domains/xxxxxx/public_html/modules/gcheckout/payment.php on line 37

 

I've noticed there is a .httaccess file in gcheckout module folder, I don't know if this is causing the issue. Anyone know how to fix it?

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

please up vote for fix bug reported at http://forge.prestas...browse/PNM-1093

 

Just an update

 

1st:

Tools::redirect('index.php?co:q:q:qntroller=authentication&back=order.php');

 

should be:

 

Tools::redirect('index.php?controller=authentication&back=order.php');

 

and it looks like the errors is caused by

 

Context::getContext()->customer->isLogged()

 

I am going to try to wright a new payment function with ModuleFrontController

 

http://doc.prestashop.com/display/PS15/New+Developers+Features+In+PrestaShop+1.5#NewDevelopersFeaturesInPrestaShop1.5-NewFile-treeAndOperations

Edited by HA!*!*Y (see edit history)
Link to comment
Share on other sites

Its a step backwards but it works

 

<?php
include(dirname(__FILE__).'/../../config/config.inc.php');
include(dirname(__FILE__).'/../../init.php');
include(dirname(__FILE__).'/gcheckout.php');

if (!$cookie->isLogged(true))
Tools::redirect('authentication.php?back=order.php');
elseif (!$cart->getOrderTotal(true, Cart::BOTH))
Tools::displayError('Error: Empty cart');

$gcheckout = new GCheckout();
/*
//this code was causing error
if (_PS_VERSION_ >= '1.5' && !Context::getContext()->customer->isLogged(true))
Tools::redirect('index.php?controller=authentication&back=order.php');
else if (_PS_VERSION_ < '1.5' && !$cookie->isLogged(true))
Tools::redirect('authentication.php?back=order.php');
else if (!$gcheckout->context->cart->getOrderTotal(true, Cart::BOTH))
Tools::displayError('Error: Empty cart');
*/
// Prepare payment
$gcheckout->preparePayment();
include(dirname(__FILE__).'/../../header.php');
// Display
echo $gcheckout->display('gcheckout.php', 'confirm.tpl');
include_once(dirname(__FILE__).'/../../footer.php');

Link to comment
Share on other sites

Its a step backwards but it works
 isLogged(true)) Tools::redirect('authentication.php?back=order.php'); elseif (!$cart->getOrderTotal(true, Cart::BOTH)) Tools::displayError('Error: Empty cart'); $gcheckout = new GCheckout(); /* //this code was causing error if (_PS_VERSION_ >= '1.5' && !Context::getContext()->customer->isLogged(true)) Tools::redirect('index.php?controller=authentication&back=order.php'); else if (_PS_VERSION_ < '1.5' && !$cookie->isLogged(true)) Tools::redirect('authentication.php?back=order.php'); else if (!$gcheckout->context->cart->getOrderTotal(true, Cart::BOTH)) Tools::displayError('Error: Empty cart'); */ // Prepare payment $gcheckout->preparePayment(); include(dirname(__FILE__).'/../../header.php'); // Display echo $gcheckout->display('gcheckout.php', 'confirm.tpl'); include_once(dirname(__FILE__).'/../../footer.php'); 

 

This doesn't fix the issue properly (well, not for me)

 

You can now click Google Checkout and you are able to see the confirmation page, but as soon as you click I CONFIRM MY ORDER, you are redirected to the Google Wallet page which throws the error:

 

Oops! PrestaShop has sent Google a shopping cart with errors in it. We'll contact them to ask that they fix this problem. As this could be a temporary issue, you can go back in your browser to try checking out again.

 

Debugging information

 

If you are acting on behalf of the merchant, more information about this error has been made available in the Integration Console under the Tools section. You can access the details of this error directly by logging into your merchant account and then pasting the following url:

https://checkout.google.com/sell/settings?section=IntegrationConsole&returnURL=https%3A%2F%2Fcheckout.google.com%2Fsell%2Fsettings%3Fsection%3DIntegrationConsole&serialNumber=8ae6...

Link to comment
Share on other sites

Where can I find the 1.5 version of google checkout module - can't seem to find it on any download now! Can anyone attach the zip file here please?

 

go to your back office Modules page and search for "gcheckout"

 

 

...

Oops!

PrestaShop has sent Google a shopping cart with errors in it. We'll contact them to ask that they fix this problem. As this could be a temporary issue, you can go back in your browser to try checking out again.

....

 

It's working for me i get to the Google payment screen with out error.

 

1st could you check your: /modules/gcheckout/error_log (if your server saves php errors)

 

2nd Log in to your Google checkout: https://checkout.google.com/sell/

 

Than go to Tools ->Integration Console (https://checkout.google.com/sell/settings?section=IntegrationConsole)

 

Send the error log as PM or post it on the forum to see what PS is sending to Google

 

also did you read the file /modules/gcheckout/htaccessBugInformation.php to see if this bug applies to your server.

Link to comment
Share on other sites

It's working for me i get to the Google payment screen with out error.

 

1st could you check your: /modules/gcheckout/error_log (if your server saves php errors)

 

2nd Log in to your Google checkout: https://checkout.google.com/sell/

 

Than go to Tools ->Integration Console (https://checkout.goo...egrationConsole)

 

Send the error log as PM or post it on the forum to see what PS is sending to Google

 

also did you read the file /modules/gcheckout/htaccessBugInformation.php to see if this bug applies to your server.

 

Thank you for the message,

 

Ok, I've noticed this error in Integration Console:

 

Error parsing XML; message from parser is: Invalid value for attribute name in checkout-shopping-cart/checkout-flow-support/merchant-checkout-flow-support/shipping-methods/flat-rate-shipping: Required field must not be blank
More documentation for this error.
Warnings: XML failed to validate against the schema at line: 20, column 20, with error: cvc-minLength-valid: Value '' with length = '0' is not facet-valid with respect to minLength '1' for type '#AnonType_nameFlatRateShipping'.
XML failed to validate against the schema at line: 20, column 20, with error: cvc-attribute.3: The value '' of attribute 'name' on element 'flat-rate-shipping' is not valid with respect to its type, 'null'.

 

Looks like something to do with the shipping, let me play around...

Edited by charlie123 (see edit history)
Link to comment
Share on other sites

I can't find the solution...

 

I provide free shipping. I am using SSL. The USE GOOGLE SHIPPING FEES is unticked on my side. Oh, and I am using one page checkout instead of four steps

 

 

Integration error details:

 

scr.hu/0gkm/s6yir

 

Looks like Google is moaning about this bit:

 

<flat-rate-shipping name="">

 

How I can get it to work? Thank you

Edited by charlie123 (see edit history)
Link to comment
Share on other sites

@charlie123

 

try editing file /modules/gcheckout/library/googleshipping.php

 

from:

   function GoogleFlatRateShipping($name, $price) {
  $this->name = $name;
  $this->price = $price;
   }

 

To:

   function GoogleFlatRateShipping($name, $price) {
  $this->name = 'FreeShipping';
  $this->price = $price;
   }

  • Like 1
Link to comment
Share on other sites

@charlie123

 

try editing file /modules/gcheckout/library/googleshipping.php

 

from:

function GoogleFlatRateShipping($name, $price) {
  $this->name = $name;
  $this->price = $price;
}

 

To:

function GoogleFlatRateShipping($name, $price) {
  $this->name = 'FreeShipping';
  $this->price = $price;
}

 

Thanks! It worked, managed to get on the Wallet Checkout page, will need to test it now if everything work fine :) Thank you!

Link to comment
Share on other sites

  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...