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?
Comments
Comment #1
tr commentedPlease 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.
Comment #2
LordQuackstar commentedSorry 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
After receiving risk-information-notification
After receiving order-state-change-notification
After receiving new-order-notification
Returning to the site the User sees
Comment #3
tr commentedTry 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.
Comment #5
LordQuackstar commentedWell that fixed those errors and I got Charged and Delivered notifications in the log but broke other things
This occurs before every XML notification
After receiving new-order-notification
Thanks for the patch though!
Comment #6
LordQuackstar commentedHmm, my webhost has been acting up and didn't record all the errors it encountered.
Before every XML notification there is also
After new-order-notification there is (!)
Later I'll do a quick rollback just to make sure I'm on as a vanilla ubercart installation as possible
Comment #7
LordQuackstar commentedOn 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
Comment #8
chrispk2 commentedDoes 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.
Comment #9
LordQuackstar commentedNo, but it might as well be all in one patch. Wait until someone decides to fix this issue.
Comment #10
tr commentedI 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.
Comment #12
m.j.laarman commentedI made some changes in code to get rid of the errors.
In uc_google_checkout_new_order i added string typcast for orderid.
In uc_google_checkout_init i moved the code for unsetting session vars.
Comment #13
tr commentedRemoving tag.
Comment #14
m.j.laarman commented