Hi,
I have D6.8, MySQL 5.0.45, PHP 5.2.4 (on my Win XP dev pc).
Trying to set up payments via PayPal (eg Website Payments Standard). I have a working PayPal account and API key etc that I've been using previously with a non-Drupal solution.
On my Receipt Types > PayPal pages I've filled in the details for Settings and the 'Allow payments' option is un-greyed and set to 'yes'.
So anyway, when I go to my site and either 'Buy Now', or 'Add to Cart' then 'Checkout'
1. the billing address form shows up even though I had set that to 'Only with shippable' and this is a generic
2. when I click 'Place your order' button it just loads my front page without ever trying to contact PayPal as far as I can tell from the address bar
In the drupal log I have the following entry:
Field 'token' doesn't have a default value query: INSERT INTO dr_ec_customer (type, exid) VALUES ('anonymous', '913155c0348bb7990e462847287eaee6') in D:\My Documents\design\paul-garner.com\drupal.htdocs\includes\common.inc on line 3418.
Having a look in MySQL the token field is set to 'not null' and no default.
So for now I have fixed it for myself by changing the field in the db to accept null values.
Looks like you need a small code change to either set up the db table that way in the install script, or to supply an empty string for the value in the insert query on line 3418 if the token isn't ready to be set yet.
cheers
Comments
Comment #1
blueskiwi commentednow that I mention that, there's a few more places with a similar problem - this is probably down to different behaviour of MySQL version/platform where you're not seeing the problem.
When I go to Admin > e-commerce > Products I get several of these 'no default value' errors:
* user warning: Field 'allocation' doesn't have a default value query: INSERT INTO dr_ec_transaction (ecid, type, mail, payment_method, workflow, currency, gross, created, changed, duedate, token) VALUES (1, 'ec_buynow', 'paul@blues.co.nz', 'paypal_basic', 1, 'GBP', 11.99, 1230837999, 1230837999, 0, '') in D:\My Documents\design\paul-garner.com\drupal.htdocs\includes\common.inc on line 3418.
* warning: Invalid argument supplied for foreach() in D:\My Documents\design\paul-garner.com\drupal.htdocs\sites\all\modules\ecommerce\ec_checkout\ec_checkout.module on line 129.
* user warning: Field 'txn_id' doesn't have a default value query: INSERT INTO dr_ec_receipt_paypal (erid) VALUES (1) in D:\My Documents\design\paul-garner.com\drupal.htdocs\includes\common.inc on line 3418.
Comment #2
blueskiwi commentedagain, 'fixed' by allowing null value on those fields in the db. hopefully no side effects
Comment #3
gordon commentedI have fixed this issue in -dev.