When testing out Google Checkout (sandbox version, don't have an official merchant account to test), I get multiple errors.

Google gets a big wall of errors according to Drupal's log:

  • PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '9' for key 1: INSERT INTO {uc_gc_orders} (order_id, gc_order_number, gc_total) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => SimpleXMLElement Object ( [0] => 9 ) [:db_insert_placeholder_1] => SimpleXMLElement Object ( [0] => 929758401836987 ) [:db_insert_placeholder_2] => SimpleXMLElement Object ( [@attributes] => Array ( [currency] => USD ) [0] => 10.0 ) ) in uc_google_checkout_new_order() (line 909 of /home/content/i/h/a/ihammerhands/html/other/testing.highwow1.com/sites/all/modules/ubercart/payment/uc_google_checkout/uc_google_checkout.module).
  • Notice: Undefined index: attributes in include() (line 21 of /home/content/i/h/a/ihammerhands/html/other/testing.highwow1.com/sites/all/modules/ubercart/uc_order/templates/uc-order--admin.tpl.php).
  • Notice: Undefined index: attributes in include() (line 218 of /home/content/i/h/a/ihammerhands/html/other/testing.highwow1.com/sites/all/modules/ubercart/uc_order/templates/uc-order--customer.tpl.php).
  • Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /home/content/i/h/a/ihammerhands/html/other/testing.highwow1.com/includes/entity.inc).
  • Notice: Undefined offset: 1 in uc_google_checkout_send_request() (line 742 of /home/content/i/h/a/ihammerhands/html/other/testing.highwow1.com/sites/all/modules/ubercart/payment/uc_google_checkout/uc_google_checkout.module).
  • Notice: Undefined property: stdClass::$error in uc_google_checkout_send_request() (line 720 of /home/content/i/h/a/ihammerhands/html/other/testing.highwow1.com/sites/all/modules/ubercart/payment/uc_google_checkout/uc_google_checkout.module).
  • PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '9' for key 1: INSERT INTO {uc_gc_orders} (order_id, gc_order_number, gc_total) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => SimpleXMLElement Object ( [0] => 9 ) [:db_insert_placeholder_1] => SimpleXMLElement Object ( [0] => 929758401836987 ) [:db_insert_placeholder_2] => SimpleXMLElement Object ( [@attributes] => Array ( [currency] => USD ) [0] => 10.0 ) ) in uc_google_checkout_new_order() (line 909 of /home/content/i/h/a/ihammerhands/html/other/testing.highwow1.com/sites/all/modules/ubercart/payment/uc_google_checkout/uc_google_checkout.module).
  • Notice: Undefined index: attributes in include() (line 21 of /home/content/i/h/a/ihammerhands/html/other/testing.highwow1.com/sites/all/modules/ubercart/uc_order/templates/uc-order--admin.tpl.php).
  • Notice: Undefined index: attributes in include() (line 218 of /home/content/i/h/a/ihammerhands/html/other/testing.highwow1.com/sites/all/modules/ubercart/uc_order/templates/uc-order--customer.tpl.php).
  • Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /home/content/i/h/a/ihammerhands/html/other/testing.highwow1.com/includes/entity.inc).
  • Notice: Undefined offset: 1 in uc_google_checkout_send_request() (line 742 of /home/content/i/h/a/ihammerhands/html/other/testing.highwow1.com/sites/all/modules/ubercart/payment/uc_google_checkout/uc_google_checkout.module).
  • Notice: Undefined property: stdClass::$error in uc_google_checkout_send_request() (line 720 of /home/content/i/h/a/ihammerhands/html/other/testing.highwow1.com/sites/all/modules/ubercart/payment/uc_google_checkout/uc_google_checkout.module).
  • Notice: Undefined index: attributes in include() (line 21 of /home/content/i/h/a/ihammerhands/html/other/testing.highwow1.com/sites/all/modules/ubercart/uc_order/templates/uc-order--admin.tpl.php).
  • Notice: Undefined index: attributes in include() (line 218 of /home/content/i/h/a/ihammerhands/html/other/testing.highwow1.com/sites/all/modules/ubercart/uc_order/templates/uc-order--customer.tpl.php).
  • Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /home/content/i/h/a/ihammerhands/html/other/testing.highwow1.com/includes/entity.inc).

The user on the other hand gets this when clicking "Return to site" on the last page in Google Checkout

  • Notice: Undefined offset: 1 in uc_google_checkout_send_request() (line 742 of /home/content/i/h/a/ihammerhands/html/other/testing.highwow1.com/sites/all/modules/ubercart/payment/uc_google_checkout/uc_google_checkout.module).
  • Notice: Undefined property: stdClass::$error in uc_google_checkout_send_request() (line 720 of /home/content/i/h/a/ihammerhands/html/other/testing.highwow1.com/sites/all/modules/ubercart/payment/uc_google_checkout/uc_google_checkout.module).

Because of the SQL errors I tried deleting all existing orders, but it didn't change anything. I then opened up the database and cleared uc_gc_orders, but it still didn't change anything.

This renders the Google Checkout module useless. Is there anything I'm missing or can provide to help?

CommentFileSizeAuthor
#3 1107402.patch1.17 KBtr

Comments

tr’s picture

Status: Active » Postponed (maintainer needs more info)

Please upgrade to the 7.x-3.x-dev version of Ubercart, where a bunch of those PHP notices have been fixed already. Then please report back with a list of the errors/messages that are still present.

LordQuackstar’s picture

Status: Postponed (maintainer needs more info) » Active

Sorry for the long wait, haven't worked on Ubercart for a while

When using the most recent repository dev version aaea4cf4dceb294ca0bfeb3eacff5ea224c6e4ef I got these errors (in order)

After receiving authorization-amount-notification

  • Notice: Undefined offset: 1 in uc_google_checkout_send_request() (line 742 of /home/content/i/h/a/ihammerhands/html/other/testing-dev.highwow1.com/sites/all/modules/ubercart/payment/uc_google_checkout/uc_google_checkout.module).
  • Notice: Undefined property: stdClass::$error in uc_google_checkout_send_request() (line 720 of /home/content/i/h/a/ihammerhands/html/other/testing-dev.highwow1.com/sites/all/modules/ubercart/payment/uc_google_checkout/uc_google_checkout.module).

After receiving risk-information-notification

  • Notice: Undefined offset: 1 in uc_google_checkout_send_request() (line 742 of /home/content/i/h/a/ihammerhands/html/other/testing-dev.highwow1.com/sites/all/modules/ubercart/payment/uc_google_checkout/uc_google_checkout.module).
  • Notice: Undefined property: stdClass::$error in uc_google_checkout_send_request() (line 720 of /home/content/i/h/a/ihammerhands/html/other/testing-dev.highwow1.com/sites/all/modules/ubercart/payment/uc_google_checkout/uc_google_checkout.module).

After receiving order-state-change-notification

  • Notice: Undefined offset: 1 in uc_google_checkout_send_request() (line 742 of /home/content/i/h/a/ihammerhands/html/other/testing-dev.highwow1.com/sites/all/modules/ubercart/payment/uc_google_checkout/uc_google_checkout.module).
  • Notice: Undefined property: stdClass::$error in uc_google_checkout_send_request() (line 720 of /home/content/i/h/a/ihammerhands/html/other/testing-dev.highwow1.com/sites/all/modules/ubercart/payment/uc_google_checkout/uc_google_checkout.module).
  • Attempted to e-mail an invoice with no recipient.
  • Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /home/content/i/h/a/ihammerhands/html/other/testing-dev.highwow1.com/includes/entity.inc).

After receiving new-order-notification

  • Notice: Undefined offset: 1 in uc_google_checkout_send_request() (line 742 of /home/content/i/h/a/ihammerhands/html/other/testing-dev.highwow1.com/sites/all/modules/ubercart/payment/uc_google_checkout/uc_google_checkout.module).
  • Notice: Undefined property: stdClass::$error in uc_google_checkout_send_request() (line 720 of /home/content/i/h/a/ihammerhands/html/other/testing-dev.highwow1.com/sites/all/modules/ubercart/payment/uc_google_checkout/uc_google_checkout.module).

Returning to the site the User sees

  • Notice: Undefined offset: 1 in uc_google_checkout_send_request() (line 742 of /home/content/i/h/a/ihammerhands/html/other/testing-dev.highwow1.com/sites/all/modules/ubercart/payment/uc_google_checkout/uc_google_checkout.module).
  • Notice: Undefined property: stdClass::$error in uc_google_checkout_send_request() (line 720 of /home/content/i/h/a/ihammerhands/html/other/testing-dev.highwow1.com/sites/all/modules/ubercart/payment/uc_google_checkout/uc_google_checkout.module).
tr’s picture

Status: Active » Needs review
StatusFileSize
new1.17 KB

Try this patch. I don't have a Google checkout account so I can't reproduce the errors or verify the patch works, but I think it will take care of all of them except for the "Attempted to e-mail an invoice with no recipient." message, which I think is probably because you don't have a store e-mail address set at admin/store/settings/store.

Status: Needs review » Needs work

The last submitted patch, 1107402.patch, failed testing.

LordQuackstar’s picture

Well that fixed those errors and I got Charged and Delivered notifications in the log but broke other things

This occurs before every XML notification

  • Notice: Undefined variable: _SESSION in uc_google_checkout_send_request() (line 746 of /home/content/i/h/a/ihammerhands/html/other/testing-dev.highwow1.com/sites/all/modules/ubercart/payment/uc_google_checkout/uc_google_checkout.module).

After receiving new-order-notification

  • Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /home/content/i/h/a/ihammerhands/html/other/testing-dev.highwow1.com/includes/entity.inc).
  • Attempted to e-mail an invoice with no recipient. (Haven't updated the email yet)

    Thanks for the patch though!

LordQuackstar’s picture

Hmm, my webhost has been acting up and didn't record all the errors it encountered.

Before every XML notification there is also

  • Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /home/content/i/h/a/ihammerhands/html/other/testing-dev.highwow1.com/includes/entity.inc).

After new-order-notification there is (!)

  • PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '3' for key 1: INSERT INTO {uc_gc_orders} (order_id, gc_order_number, gc_total) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => SimpleXMLElement Object ( [0] => 3 ) [:db_insert_placeholder_1] => SimpleXMLElement Object ( [0] => 546342434480863 ) [:db_insert_placeholder_2] => SimpleXMLElement Object ( [@attributes] => Array ( [currency] => USD ) [0] => 10.0 ) ) in uc_google_checkout_new_order() (line 908 of /home/content/i/h/a/ihammerhands/html/other/testing-dev.highwow1.com/sites/all/modules/ubercart/payment/uc_google_checkout/uc_google_checkout.module).

Later I'll do a quick rollback just to make sure I'm on as a vanilla ubercart installation as possible

LordQuackstar’s picture

On a vanilla Drupal installation I also got this

Notice: Undefined offset: 1 in uc_google_checkout_send_request() (line 742 of /home/content/i/h/a/ihammerhands/html/other/testing-dev.highwow1.com/sites/all/modules/ubercart/payment/uc_google_checkout/uc_google_checkout.module).

I'm thinking that the SQL exception I posted in #6 is due to these errors not inserting things correctly in the database because they only appear when doing the second purchase, not the first.

For the record I'm currently on revision e68b8f5ddd827f532fee68a8d25d0fdc23535a9a

chrispk2’s picture

Does the patch resolve this issue?

Error parsing XML; message from parser is: cvc-minLength-valid: Value '' with length = '0' is not facet-valid with respect to minLength '1' for type '#AnonType_nameMerchantCalculatedShipping'.

It occurs when Flat Shipping is an option.

LordQuackstar’s picture

No, but it might as well be all in one patch. Wait until someone decides to fix this issue.

tr’s picture

Version: 7.x-3.0-beta2 » 7.x-3.x-dev
Status: Needs work » Fixed

I committed patch #3 to the 7.x-3.x and 6.x-2.x branches. The error in #8 is being handled by #1116344: Google Checkout Error when Flat Rate Shipping is Selected. If you still have any other problems please report each bug separately in its own issue after first verifying that the bug exists in the most current -dev release and that there are no other issues that have reported that bug.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

m.j.laarman’s picture

I made some changes in code to get rid of the errors.
In uc_google_checkout_new_order i added string typcast for orderid.

function uc_google_checkout_new_order($new_order) {
  $order_id = (string) $new_order->{'shopping-cart'}->{'merchant-private-data'}->{'order-id'};

In uc_google_checkout_init i moved the code for unsetting session vars.

function uc_google_checkout_init() {
  // When an order comes in from Google Checkout, we need to unset some
  // $_SESSION data. Since this isn't done under the customer's user, we
  // do it when they next load a page.
  global $user;

if (isset($_SESSION['cart_order'])) {
    unset($_SESSION['uc_checkout'][$_SESSION['cart_order']]['do_complete']);
    unset($_SESSION['cart_order']);
  }

  $users = variable_get('uc_google_checkout_order_users', array());
  if (isset($users[$user->uid])) {
    unset($users[$user->uid]);

    variable_set('uc_google_checkout_order_users', $users);
  }
tr’s picture

Removing tag.

m.j.laarman’s picture