Zen Cart Logo
Forums / PayPal Express Checkout support / Paypal seems to remove tax!

Paypal seems to remove tax!

Locked

Views: 7,306

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
15 Oct 2007, 08:22
#1
bobface avatar

bobface

New Zenner

Join Date:
Aug 2007
Posts:
10
Plugin Contributions:
0

Paypal seems to remove tax!

Hello there,

My zencart site (1.3.7 plus paypal patchs from http://www.zen-cart.com/forum/showthread.php?p=390776#post390776) has started behaving really oddly.

Products display correctly (with VAT) on the site, i add to my cart, checkout with PPE and when the order goes to PPE, it shows without tax on the products (flat rate shipping is there), which means its not charging vat. When i continue back to my site, all the product prices start displaying without VAT!

Any thoughts on this? I have my store configured as

Tax Decimal Places 2
Display Prices with Tax true
Display Prices with Tax in Admin true
Basis of Product Tax Billing
Basis of Shipping Tax Shipping
Sales Tax Display Status 1

As i said, it shows correctly until i go to paypal, and back out again. Not sure what paypal is doing! Currency in GBP.

Any thoughts?

Shaun

16 Oct 2007, 10:33
#2
bobface avatar

bobface

New Zenner

Join Date:
Aug 2007
Posts:
10
Plugin Contributions:
0

Re: Paypal seems to remove tax!

I've checked the paypal debug logs and it appears as if ZenCart is sending the item amount to paypal without the product tax attached (. Shipping (Flat-rate) is going through correctly.

What i dont quite get is the Action Logs. The orders that work create Paypal_Action_Date_wxyz.log, the ones that dont create Paypal_Action_EC_guidorsomething_wxyz.log

Why is the logfile name different, is paypal/zencart doing something different here?

Any thoughts? It seems to have only started doing this in the last few days.

Shaun

16 Oct 2007, 11:11
#3
bobface avatar

bobface

New Zenner

Join Date:
Aug 2007
Posts:
10
Plugin Contributions:
0

Re: Paypal seems to remove tax!

Further digging, it seems that i misunderstood the action/debug logs.

The first log - the Paypal_Action_Log - has the correct prices (our website prices are inclusive of VAT). (17.75)

The next log - the Paypal_Debug_log - has SetExpressCheckout [AMT] is now appearing without VAT. (15.11)

-- Action

Customer ID: 0
Session Data: Array
(
[customers_host_address] => x.x.x.x
[cartID] =>
[cart] => shoppingCart Object
(
[contents] => Array
(
[1:204103309af54471671eab147a03e408] => Array
(
[qty] => 1
[attributes] => Array
(
[1] => 5
[2] => 8
)

                    )

            )

        [total] => 17.75
        [weight] => 0
        [cartID] => 10891
        [content_type] => physical
        [free_shipping_item] => 0
        [free_shipping_weight] => 0
        [free_shipping_price] => 0
        [observers] => Array
            (
            )

    ) <snip>

[check_valid] => true
[language] => english
[languages_id] => 1
[languages_code] => en
[currency] => GBP
[updateExpirations] => 1
[session_counter] => 1
[customers_ip_address] => x.x.x.x
[new_products_id_in_cart] =>
[valid_to_checkout] => 1
[cart_errors] =>
[payment] => paypalwpp

-- 1st Debug

2007-10-16 12:00:52

(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: {SetExpressCheckout}
Array
(
[LOCALECODE] => GB
[PAYMENTACTION] => Sale
[AMT] => 15.11
[RETURNURL] => https://www.x.com/store/ipn_main_handler.php?type=ec
[CANCELURL] => https://www.x.com/store/index.php?main_page=login&ec_cancel=1
[PAGESTYLE] => Primary
[METHOD] => SetExpressCheckout
[CURRENCYCODE] => GBP
[USER] => sales_api1.x.com
[PWD] => ****************
[VERSION] => 2.3
[SIGNATURE] => ****************************************************Dgho
)

Response:
Array
(
[TIMESTAMP] => 2007-10-16T11:00:50Z
[CORRELATIONID] => dff8cb55288f1
[ACK] => Success
[VERSION] => 2.300000
[BUILD] => 1.0006
[TOKEN] => EC-35D95008A9183764K
[CURL_ERRORS] =>
)

Everything seems to be marked up UK and GBP, not sure what's going on here!

Shaun

16 Oct 2007, 17:56
#5
bobface avatar

bobface

New Zenner

Join Date:
Aug 2007
Posts:
10
Plugin Contributions:
0

Re: Paypal seems to remove tax!

Almost. I did have currency set to GBP, i've tried it with GBP and Default.

I've patched in that snippet but no difference.

Its still sending the correct amount [total] = x (free_shipping_xxx => 0 too) in the first action log, but it seems the call to SetExpressCheckout is still going in without tax on the item.

I think your snippet patch refers to Tax on the shipping, whereas i'm suffering tax on the item problems.

Thanks for your help tho Dr!

S

18 Oct 2007, 09:55
#6
bobface avatar

bobface

New Zenner

Join Date:
Aug 2007
Posts:
10
Plugin Contributions:
0

Re: Paypal seems to remove tax!

Is nobody else having a similar problem? Looks like i'm getting my PHP mining hat on later today then :)

19 Oct 2007, 08:51
#7
bobface avatar

bobface

New Zenner

Join Date:
Aug 2007
Posts:
10
Plugin Contributions:
0

Re: Paypal seems to remove tax!

Okay - perhaps i didn't RTFM at some point but here's the problem and solution.

If paypalwpp can't match your state id coming back from paypal (a UK county in my customers case) it's substitute '0' instead into the state_id which eventually corrupts the $_SESSION["customer_zone_id"] which buggers all the zen_get_tax_rate() calls etc.

The function function ec_step2_finish() sets some defaults arbitrarily (which if i'd RTFM'd i'd probably have found some instruction to change) at the start, which are used if a zone match isn't found (ZC doesn't have a UK county list in it by default).

Set these by hand and you're away, any unknown state will come back to be these. Perhaps these should be looked up against your Stores country and zone, i don't know.

Anyhow, all works for me now, for UK customers, not quite sure what'll happen if it picks up a foreign customer. I still want to charge VAT etc on products shipping outside the UK, so perhaps i should remove all the code that tries to find an appropriate zone_id for the customers request, and always force mine on them.

19 Oct 2007, 12:24
#8
drbyte avatar

drbyte

Sensei

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

Re: Paypal seems to remove tax!

bobface:

I still want to charge VAT etc on products shipping outside the UK, so perhaps i should remove all the code that tries to find an appropriate zone_id for the customers request, and always force mine on them.

... or maybe you could create Zone Definitions for all those countries where you plan to charge VAT so that a match can be made for those addresses. If you list the country and select All Zones, it should pick it up instead of choosing 0 as you stated earlier, making it unnecessary to change the default in the code.

19 Oct 2007, 13:46
#9
bobface avatar

bobface

New Zenner

Join Date:
Aug 2007
Posts:
10
Plugin Contributions:
0

Re: Paypal seems to remove tax!

Thanks Dr,

Is the problem with the countries or the states within those countries? In the uk County=State, there is no state list (although i could obviously create one). Is this case wouldn't i need to create a state list for every country?

Maybe i'm missing what you're saying when you mention 'If you list the country and select all zones'. My PayPal payment zone is set to --none--.

19 Oct 2007, 16:41
#10
drbyte avatar

drbyte

Sensei

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

Re: Paypal seems to remove tax!

Don't get caught up in terminology. State = county = province = region.

If you look back to what I said, I was referring to the Zone Definitions screen. If you have a zone related to your european countries to whom you charge VAT, if you click on the Details button, you can add each of the countries which are affected. In there, you can select the country and state/province/county/region combinations that you want to affect. If a country has no state/province/county/region options, you can select "All Zones". That's what I meant.

20 Oct 2007, 13:04
#11
bobface avatar

bobface

New Zenner

Join Date:
Aug 2007
Posts:
10
Plugin Contributions:
0

Re: Paypal seems to remove tax!

Gotcha, thanks doc!

24 Apr 2008, 20:01
#12
keon avatar

keon

New Zenner

Join Date:
Feb 2008
Posts:
3
Plugin Contributions:
0

Re: Paypal seems to remove tax!

I have the same problem and it doesn't get fixed selecting any zone in the country list as suggested by doc.

I see VAT in ZC, but once I proceed my payment in

here's my setup:

A fresh installation of Zen Cart 1.3.8

  • Configuration - My Store - Country: Belgium
  • Configuration - My Store - Zone: <blank>
  • Configuration - My Store - Display Prices with Tax: true
  • Configuration - My Store - Display Prices with Tax in Admin: true
  • Configuration - My Store - Basis of Product Tax: shipping
  • Configuration - My Store - Basis of Shipping Tax: shipping
  • Configuration - My Store - Sales Tax Display Status: 1
  • Configuration - Customer Details - State: false
  • Location / Taxes - Zone Definitions: BE (Contains Belgium - All Zones)
  • Location / Taxes - Zone Definitions: EU (Contains all other EU countries - All Zones)

PayPal Express Checkout (rev1.3.8a)

  • Transaction Currency: Only EUR

Attached two transaction log files. In the first one you can see the amount with VAT included ([total] => 18,15 EUR). In the second one you see [AMT] => 15.00

Any idea what's wrong?