Zen Cart Logo
Forums / Bug Reports / [Done v1.3.8] Paypal Express Checkout DB Bug - V1.3.7 Fresh

[Done v1.3.8] Paypal Express Checkout DB Bug - V1.3.7 Fresh

Locked

Views: 8,223

Results 1 to 20 of 23
This thread is locked. New replies are disabled.
6 Jan 2007, 3:09 PM
#1
leighbee avatar

leighbee

New Zenner

Join Date:
Jan 2007
Posts:
41
Plugin Contributions:
0

[Done v1.3.8] Paypal Express Checkout DB Bug - V1.3.7 Fresh

Get this error after returning from Paypal (running in sandbox mode at the moment, but cant see it would be any different in Live)

1406 Data too long for column 'payment_type' at row 1
in:
[INSERT INTO paypal (zen_order_id, txn_type, reason_code, payment_type, payment_status, pending_reason, invoice, first_name, last_name, payer_business_name, address_name, address_street, address_city, address_state, address_zip, address_country, address_status, payer_email, payer_id, payer_status, payment_date, business, receiver_email, receiver_id, txn_id, parent_txn_id, num_cart_items, mc_gross, mc_fee, mc_currency, settle_amount, settle_currency, exchange_rate, notify_version, verify_sign, date_added, memo) VALUES ('5', 'cart', 'None', 'PayPal Express Checkout (instant)', 'Completed', 'None', 'EC-741011165V964753K', 'leigh', 'Bee', '', 'leigh Bee', 'xxxx', 'xxxx', 'xxxx', 'xxxx', '', 'Confirmed', '[email protected]', 'ZPL8N67Q3LD5L', 'verified', '2007-01-06T15:03:07Z', '', 'sales.domain.co.uk', '', '87742182XA955612R', '', '1', '4.34', '0.35', 'GBP', '', 'GBP', '', '', '', now(), '')]

Payment Type is currently a Varchar(7) I've updated my table to 35 to cater for this, but may need to be looked at a bit more closely.

L.

6 Jan 2007, 4:04 PM
#2
leighbee avatar

leighbee

New Zenner

Join Date:
Jan 2007
Posts:
41
Plugin Contributions:
0

Re: [Done v1.3.8] Paypal Express Checkout DB Bug - V1.3.7 Fresh

I get an error that says 'Transaction refused because of an invalid argument. See additional error messages for details.' and throws me back to Shipping page. The reason is the Order Total amount does not take into account our low order fee and so is £1 under. Hope that helps, I've just hard coded and extra £1 until I can get the module working from beginning to end.

Extract from debug report:

Request Headers: array (
0 => 'Content-Type: text/namevalue',
1 => 'X-VPS-Timeout: 45',
2 => 'X-VPS-VIT-Client-Type: PHP/cURL',
3 => 'X-VPS-VIT-Integration-Product: PHP::Zen Cart WPP-NVP',
4 => 'X-VPS-VIT-Integration-Version: 0.1',
)

Request Parameters: array (
'ITEMAMT' => '10.75',
'SHIPPINGAMT' => '5.31',
'AMT' => '16.06',
'L_NUMBER0' => '0',
'L_QTY0' => '5',
'L_NAME0' => 'productDesc',
'L_AMT0' => '1.95',
'L_TAXAMT0' => '0.00',
'SHIPTONAME' => 'xxxxx',
'SHIPTOSTREET' => 'xxxxx',
'SHIPTOSTREET2' => 'xxxxx',
'SHIPTOCITY' => 'xxxxx',
'SHIPTOSTATE' => 'xxxxx',
'SHIPTOZIP' => 'xxxxx',
'SHIPTOCOUNTRY' => 'GB',
'BUTTONSOURCE' => 'ZenCart-EC_us',
'TOKEN' => 'EC-2MY42117FG594260F',
'PAYERID' => 'ZPL8N67Q3LD5L',
'PAYMENTACTION' => 'Sale',
'NOTIFYURL' => 'http://xxxxx/zencart/ipn_main_handler.php',
'METHOD' => 'DoExpressCheckoutPayment',
'CURRENCYCODE' => 'GBP',
'USER' => 'sales_api1.xxxxx.co.uk',
'PWD' => '****************',
'VERSION' => '2.3',
'SIGNATURE' => '****************************************************T.L7',
)

Response: array (
'TIMESTAMP' => '2007-01-06T15:57:48Z',
'CORRELATIONID' => '95ff626e2e363',
'ACK' => 'SuccessWithWarning',
'L_ERRORCODE0' => '10413',
'L_SHORTMESSAGE0' => 'Transaction refused because of an invalid argument. See additional error messages for details.',
'L_LONGMESSAGE0' => 'The totals of the cart item amounts do not match order amounts.',
'VERSION' => '2.300000',
'BUILD' => '1.0006',
)

DoExpressCheckoutPayment, Elapsed: 4710ms; SuccessWithWarning

6 Jan 2007, 4:19 PM
#3
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,615
Plugin Contributions:
0

Re: [Done v1.3.8] Paypal Express Checkout DB Bug - V1.3.7 Fresh

If you turn off the low order fee, things function correctly?

6 Jan 2007, 5:27 PM
#4
leighbee avatar

leighbee

New Zenner

Join Date:
Jan 2007
Posts:
41
Plugin Contributions:
0

Re: [Done v1.3.8] Paypal Express Checkout DB Bug - V1.3.7 Fresh

Running 1.3.7 Fresh Install

Ok, nearly there I think!

I'm still getting errors through the checkout_process stage concerning missing values for the script that inserts into the paypal table, here's the latest:

1366 Incorrect decimal value: '' for column 'exchange_rate' at row 1
in:
[INSERT INTO paypal (zen_order_id, txn_type, reason_code, payment_type, payment_status, pending_reason, invoice, first_name, last_name, payer_business_name, address_name, address_street, address_city, address_state, address_zip, address_country, address_status, payer_email, payer_id, payer_status, payment_date, business, receiver_email, receiver_id, txn_id, parent_txn_id, num_cart_items, mc_gross, mc_fee, mc_currency, settle_amount, settle_currency, exchange_rate, notify_version, verify_sign, date_added, memo) VALUES ('16', 'cart', 'None', 'PayPal Express Checkout (instant)', 'Completed', 'None', 'EC-1XW697513L665122Y', 'leigh', 'xxxx', '', 'xxxx', 'xxxx', 'xxxx', 'xxxx', 'xxxx', '', 'Confirmed', '[email protected]', 'ZPL8N67Q3LD5L', 'verified', now(), '', 'sales.xxxx.co.uk', '', '5KL37273GW438694M', '', '1', '4.34', '0.35', 'GBP', '0', 'GBP', '', '', '', now(), '')]This has also happened for Settle_amount, and I dare say it will also happen to notify_version as that's a decimal field.

Also to this take a look at the bugs section for a varchar field that was too short for the payment method type

I have now replaced the following lines in paypalwpp.php in the modules section
line 693 I inserted:

// store the PayPal order meta data -- used for later matching and back-end processing services
if (urldecode($this->responsedata['SETTLEAMT'])=='')
{
$SettleAMT = '0' ;
} else {
$SettleAMT = urldecode($this->responsedata['SETTLEAMT']);
}line 720 to:
'payment_date' => 'now()',(because of a datetime conversion error)
line 731 to:
'settle_amount' => $SettleAMT,line 733 to:
'exchange_rate' => '1.00',(as I'm running single currency)

The site is currently on an IIS6/PHP4.4(Zend Build)/W2k3Server but the line environment is an Apache/Linux box so maybe these issues will disappear in the future.

Nearly There!

6 Jan 2007, 6:19 PM
#5
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,615
Plugin Contributions:
0

Re: [Done v1.3.8] Paypal Express Checkout DB Bug - V1.3.7 Fresh

Please don't start a new thread for every post related to your PayPal Problem. The threads have all been merged here.

7 Jan 2007, 3:21 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [Done v1.3.8] Paypal Express Checkout DB Bug - V1.3.7 Fresh

As you mentioned, setting the payment_type field to varchar(35) will overcome the existing varchar(7) limitation.
It will be set to varchar(40) in the next release.

I'm attaching an updated version of the paypalwpp.php module, which should overcome all the empty-field problems as well as the amount subtotal problems which you encountered due to the low-order fee module etc.

Please try it and let us know if it handles all of the things you've mentioned here.

NOTE: Attachment moved to:
http://www.zen-cart.com/forum/showpost.php?p=309246&postcount=19

7 Jan 2007, 1:37 PM
#7
leighbee avatar

leighbee

New Zenner

Join Date:
Jan 2007
Posts:
41
Plugin Contributions:
0

Re: [Done v1.3.8] Paypal Express Checkout DB Bug - V1.3.7 Fresh

kim:

Please don't start a new thread for every post related to your PayPal Problem. The threads have all been merged here.
Sorry Kim, splitting the bugs into separate entries helps for me, but no probs.

kim:

If you turn off the low order fee, things function correctly?
Yes, Turning off low order fee fixed things for me (I've incorporated the additional charge into the products themselves as its actually a "handling fee" I charge), I have come across this problem with the Nochex APC payment module in osc.
DrByte:

Please try it and let us know if it handles all of the things you've mentioned here.
I'll try the update later on.

As a side issue, my particular install of IIS6/php/curl/home broadband causes a lot of unexplained issues. Primarily ipn_main_handler.php returning a blank page after returning from PPEx - despite the handler receiving data from the Paypal servers -although the paypal logs (IPN*** log file) on the windows box say:

Jan 06 2007 17:29 -- IPN FATAL ERROR::Could not find stored session in DB, cannot re-create session as PayPal IPN transaction.

Jan 06 2007 17:29 -- IPN FATAL ERROR::No saved session data available

Jan 06 2007 17:29 -- IPN NOTICE::ipn_application_top -> language files okay

I moved the site over to an add-on domain on my 'nix box and all works fine now. I've not had the PPex Log folder writable on my 'nix box, however I'm going to check if the above message occurs on the now working module (nothing has changed except server environment)

8 Jan 2007, 1:19 PM
#8
aharper78 avatar

aharper78

New Zenner

Join Date:
Jan 2007
Posts:
18
Plugin Contributions:
0

Re: [Done v1.3.8] Paypal Express Checkout DB Bug - V1.3.7 Fresh

ok I just tried the new updated paypalWPP.php file and it's still not working. It goes to an error 400 page and this is what the email log says.

Email log:

Subject:ec step 1_1

 
Checking to see if we are in markflow
cart contents: physical
 
NOTE: $this->showPaymentPage = 0
Customer ID: 1
Session Data: Array
(
    [customers_host_address] => c-68-52-232-87.hsd1.tn.comcast.net
    [cartID] => 
    [cart] => shoppingcart Object
        (
            [observers] => Array
                (
                )
 
            [contents] => Array
                (
                    [8:89eba7319f9e7bf128c85407454294cf] => Array
                        (
                            [qty] => 1
                            [attributes] => Array
                                (
                                    [1] => 0
                                )
 
                            [attributes_values] => Array
                                (
                                    [1] => vizions
                                )
 
                        )
 
                )
 
            [total] => 35.18
            [weight] => 0
            [cartID] => 
            [content_type] => physical
            [free_shipping_item] => 0
            [free_shipping_weight] => 0
            [free_shipping_price] => 0
        )
 
    [navigation] => navigationhistory Object
        (
            [observers] => Array
                (
                )
 
            [path] => Array
                (
                    [0] => Array
                        (
                            [page] => checkout_shipping
                            [mode] => NONSSL
                            [get] => 
                            [post] => Array
                                (
                                )
 
                        )
 
                    [1] => Array
                        (
                            [page] => checkout_payment
                            [mode] => NONSSL
                            [get] => 
                            [post] => Array
                                (
                                )
 
                        )
 
                    [2] => Array
                        (
                            [page] => checkout_confirmation
                            [mode] => NONSSL
                            [get] => 
                            [post] => Array
                                (
                                )
 
                        )
 
                    [3] => Array
                        (
                            [page] => index
                            [mode] => NONSSL
                            [get] => Array
                                (
                                    [type] => ec
                                    [markflow] => 1
                                    [clearSess] => 1
                                    [stage] => final
                                )
 
                            [post] => Array
                                (
                                )
 
                        )
 
                )
 
            [snapshot] => Array
                (
                )
 
        )
 
    [check_valid] => true
    [language] => english
    [languages_id] => 1
    [languages_code] => en
    [currency] => USD
    [updateExpirations] => 1
    [session_counter] => 1
    [customers_ip_address] => 68.52.232.87
    [new_products_id_in_cart] => 
    [valid_to_checkout] => 1
    [cart_errors] => 
    [customer_id] => 1
    [customer_default_address_id] => 1
    [customers_authorization] => 0
    [customer_first_name] => Aaron
    [customer_country_id] => 223
    [customer_zone_id] => 56
    [sendto] => 1
    [payment] => paypalwpp
    [shipping] => Array
        (
            [id] => freeshipper_freeshipper
            [title] => Online Delivery (Online Delivery Only)
            [cost] => 0
        )
 
    [billto] => 1
    [cot_gv] => 0
    [comments] => 
    [paypal_ec_markflow] => 1
)
 

Email #2 subject:getoverrideaddress - 1

 
Now in markflow mode.
SESSION[sendto] = 1
 

Email#3 subject: getoverrideaddress - 2

 
$address_arr->fields = Array

Email #4 subject: ec_step1 - 2 -submit

 
Array
(
    [RETURNURL] => [URL]http://www.*****.com/ipn_main_handler.php?type=ec[/URL]
    [CANCELURL] =>
[URL]http://www.*****.com/index.php?main_page=checkout_shipping&ec_cancel=1[/URL]
    [LOCALECODE] => US
    [CURRENCY] => USD
    [PAYMENTACTION] => Sale
    [ADDROVERRIDE] => 1
    [SHIPTONAME] => AaronHarper
    [SHIPTOSTREET] => 1307 *****
    [SHIPTOSTREET2] => 
    [SHIPTOCITY] => *****
    [SHIPTOZIP] => *****
    [SHIPTOSTATE] => TN
    [SHIPTOCOUNTRY] => US
    [REQCONFIRMSHIPPING] => 1
    [email] => [EMAIL="aharper78@*****.com"]aharper78@*****.com[/EMAIL]
)
 

Did I miss somthing else in the fix?

8 Jan 2007, 3:34 PM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [Done v1.3.8] Paypal Express Checkout DB Bug - V1.3.7 Fresh

Error 400 is an odd duck. Can you tell me what your webserver's errorlogs are saying when the 400 error is triggered ?

14 Jan 2007, 8:25 AM
#10
futurewebs avatar

futurewebs

New Zenner

Join Date:
Jan 2007
Posts:
3
Plugin Contributions:
0

Re: [Done v1.3.8] Paypal Express Checkout DB Bug - V1.3.7 Fresh

**I downloaded the update and it seemed to make the issue worse. Here is what I getting previous to the update::sleepy: **

Warning: reset(): Passed variable is not an array or object in /usr/local/4admin/apache/vhosts/XXXXXXX.com/httpdocs/zencart/includes/modules/order_total/ot_tax.php on line 38

Warning: Variable passed to each() is not an array or object in /usr/local/4admin/apache/vhosts/XXXXXXX.com/httpdocs/zencart/includes/modules/order_total/ot_tax.php on line 39

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/4admin/apache/vhosts/XXXXXXX.com/httpdocs/zencart/includes/modules/order_total/ot_tax.php:38) in /usr/local/4admin/apache/vhosts/XXXXXXX.com/httpdocs/zencart/includes/functions/functions_general.php on line 44

**and here is what I am getting now::wacko: **

Warning: in_array(): Wrong datatype for second argument in /usr/local/4admin/apache/vhosts/XXXXXXX.com/httpdocs/zencart/includes/modules/payment/paypalwpp.php on line 1317
Warning: in_array(): Wrong datatype for second argument in /usr/local/4admin/apache/vhosts/XXXXXXX.com/httpdocs/zencart/includes/modules/payment/paypalwpp.php on line 1317
Warning: in_array(): Wrong datatype for second argument in /usr/local/4admin/apache/vhosts/XXXXXXX.com/httpdocs/zencart/includes/modules/payment/paypalwpp.php on line 1317
Warning: Cannot modify header information - headers already sent by (output started at /usr/local/4admin/apache/vhosts/XXXXXXX.com/httpdocs/zencart/includes/modules/payment/paypalwpp.php:1317) in /usr/local/4admin/apache/vhosts/XXXXXXX.com/httpdocs/zencart/includes/functions/functions_general.php on line 44

I have done 3 fresh installs thus far and tried the PayPal express without changing anything.:bored:

Please let me know when you get good news.

15 Jan 2007, 6:46 AM
#12
futurewebs avatar

futurewebs

New Zenner

Join Date:
Jan 2007
Posts:
3
Plugin Contributions:
0

Re: [Done v1.3.8] Paypal Express Checkout DB Bug - V1.3.7 Fresh

I will try it again.
Thanks for you assistance.

I will let you know iether way

15 Jan 2007, 10:50 AM
#13
futurewebs avatar

futurewebs

New Zenner

Join Date:
Jan 2007
Posts:
3
Plugin Contributions:
0

Re: [Done v1.3.8] Paypal Express Checkout DB Bug - V1.3.7 Fresh

:laugh: IT WORKED!!!!
THAT'S WHAT I'M TALKING ABOUT!!!:D

THAAAAAAAAANK YOU!!!

29 Jan 2007, 9:23 PM
#14
tjthecat3 avatar

tjthecat3

New Zenner

Join Date:
Jan 2007
Posts:
19
Plugin Contributions:
0

Re: [Done v1.3.8] Paypal Express Checkout DB Bug - V1.3.7 Fresh

this is an error i am getting right now:

Response: array (
'ACK' => 'Failure',
'L_ERRORCODE0' => '10004',
'L_SHORTMESSAGE0' => 'Transaction refused because of an invalid argument. See additional error messages for details.',
'L_LONGMESSAGE0' => 'HandlingTotal Amt : Invalid parameter',
'L_SEVERITYCODE0' => 'Error',
)

DoExpressCheckoutPayment, Elapsed: 444ms; Failure

i don't charge any extra handling, just the shipping (which is calculated via USPS).

thanks for your help in advance!
tom

29 Jan 2007, 9:31 PM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [Done v1.3.8] Paypal Express Checkout DB Bug - V1.3.7 Fresh

What were the "request" details from that same debug log ?

29 Jan 2007, 10:37 PM
#16
tjthecat3 avatar

tjthecat3

New Zenner

Join Date:
Jan 2007
Posts:
19
Plugin Contributions:
0

Re: [Done v1.3.8] Paypal Express Checkout DB Bug - V1.3.7 Fresh

DrByte:

What were the "request" details from that same debug log ?

i think this is what you're looking for:


2007-01-29 12:28:26

(live transaction) --> https://api-3t.paypal.com/nvp
Request Headers: array (
0 => 'Content-Type: text/namevalue',
1 => 'X-VPS-Timeout: 45',
2 => 'X-VPS-VIT-Client-Type: PHP/cURL',
3 => 'X-VPS-VIT-Integration-Product: PHP::Zen Cart WPP-NVP',
4 => 'X-VPS-VIT-Integration-Version: 0.1',
)

Request Parameters: {DoExpressCheckoutPayment} array (
'ITEMAMT' => '40.00',
'SHIPPINGAMT' => '5.70',
'HANDLINGAMT' => '-0.00',
'AMT' => '45.70',
'L_NUMBER0' => '0',
'L_QTY0' => '1',
'L_NAME0' => 'Sa*****s',
'L_AMT0' => '12.00',
'L_TAXAMT0' => '0.00',
'L_NUMBER1' => '1',
'L_QTY1' => '1',
'L_NAME1' => 'Sa
Size: X-Large',
'L_AMT1' => '28.00',
'L_TAXAMT1' => '0.00',
'SHIPTONAME' => 'xxxx',
'SHIPTOSTREET' => 'xxxxx',
'SHIPTOSTREET2' => '',
'SHIPTOCITY' => 'Fort Worth',
'SHIPTOSTATE' => 'TX',
'SHIPTOZIP' => '76137',
'SHIPTOCOUNTRY' => 'US',
'BUTTONSOURCE' => 'ZenCart-EC_us',
'TOKEN' => 'EC-1XW93549MC1042204',
'PAYERID' => 'SS43Q6V9KMH34',
'PAYMENTACTION' => 'Sale',
'NOTIFYURL' => 'http://www./ipn_main_handler.php',
'METHOD' => 'DoExpressCheckoutPayment',
'CURRENCYCODE' => 'USD',
'USER' => 'xxx',
'PWD' => '
***',
'VERSION' => '2.3',
'SIGNATURE' => '****************************************************22Z1',
)

Response: array (
'ACK' => 'Failure',
'L_ERRORCODE0' => '10004',
'L_SHORTMESSAGE0' => 'Transaction refused because of an invalid argument. See additional error messages for details.',
'L_LONGMESSAGE0' => 'HandlingTotal Amt : Invalid parameter',
'L_SEVERITYCODE0' => 'Error',
)

DoExpressCheckoutPayment, Elapsed: 444ms; Failure

30 Jan 2007, 12:26 AM
#17
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [Done v1.3.8] Paypal Express Checkout DB Bug - V1.3.7 Fresh

I guess a -0.00 is kinda invalid....

'HANDLINGAMT' => '-0.00',

Lemme work up a fix for that ...

30 Jan 2007, 3:38 AM
#18
tjthecat3 avatar

tjthecat3

New Zenner

Join Date:
Jan 2007
Posts:
19
Plugin Contributions:
0

Re: [Done v1.3.8] Paypal Express Checkout DB Bug - V1.3.7 Fresh

DrByte:

I guess a -0.00 is kinda invalid....

'HANDLINGAMT' => '-0.00',

Lemme work up a fix for that ...

haha yeah that might be it!
thanks so much!

5 Feb 2007, 7:06 AM
#19
tjthecat3 avatar

tjthecat3

New Zenner

Join Date:
Jan 2007
Posts:
19
Plugin Contributions:
0

Re: [Done v1.3.8] Paypal Express Checkout DB Bug - V1.3.7 Fresh

tjthecat3:

haha yeah that might be it!
thanks so much!

does anybody have any idea on how to fix this?

9 Feb 2007, 5:40 AM
#20
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [Done v1.3.8] Paypal Express Checkout DB Bug - V1.3.7 Fresh

I think the new patch posted here fixes this:
http://www.zen-cart.com/forum/showthread.php?t=56216

I'd be grateful if you could test and confirm.