x252618759 / google-checkout-dotnet-sample-code

Automatically exported from code.google.com/p/google-checkout-dotnet-sample-code
0 stars 0 forks source link

Tax rates entered in UI aren't applied #36

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Log in to the Merchant Center and set the tax rate for CA to 10%.
2. Post a cart without tax tables.
3. As a buyer, enter a CA shipping address.

Expected behavior: 10% sales tax should be displayed.
Actual behavior: Zero sales tax is shown.

Why does this happen?

When you don't set any tax rates with the .NET sample code, it generates an
empty tax table in the cart XML, see below. The Google Checkout server
interprets this empty table as overriding any taxes entered in the UI,
setting all taxes to zero.

So we need to change the .NET sample code to suppress the <tax-tables> tag
and its sub-tags. How is his done?

<?xml version="1.0" encoding="utf-8"?>
<checkout-shopping-cart
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://checkout.google.com/schema/2">
  <shopping-cart>
    <items>
      <item>
        <item-name>Mars bar</item-name>
        <item-description>Yummy</item-description>
        <unit-price currency="USD">1</unit-price>
        <quantity>100</quantity>
      </item>
    </items>
  </shopping-cart>
  <checkout-flow-support>
    <merchant-checkout-flow-support>
      <tax-tables>
        <default-tax-table>
          <tax-rules />
        </default-tax-table>
      </tax-tables>
      <shipping-methods />
    </merchant-checkout-flow-support>
  </checkout-flow-support>
</checkout-shopping-cart>

Original issue reported on code.google.com by moman...@google.com on 30 Apr 2008 at 6:09

GoogleCodeExporter commented 9 years ago

Original comment by moman...@google.com on 30 Apr 2008 at 6:10

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by martin.o...@gmail.com on 30 Apr 2008 at 6:11

GoogleCodeExporter commented 9 years ago
I will be out of town until Sunday. I will look at this next week.

Original comment by joseph.f...@gmail.com on 30 Apr 2008 at 6:18

GoogleCodeExporter commented 9 years ago
Is this code in one of our samples that is causing this error?

I just want to test the correct code so it can be fixed.

Joe

Original comment by joseph.f...@gmail.com on 8 May 2008 at 1:59

GoogleCodeExporter commented 9 years ago
Any example code that does not set any tax rules is affected. For example, if 
you run
this code, you will see the empty tax table in the cart XML:

CheckoutShoppingCartRequest Req = GCheckoutButton1.CreateRequest();
Req.AddItem("Mars bar", "Packed with peanuts", 0.75m, 2);
Response.Write(EncodeHelper.Utf8BytesToString(Req.GetXml()));
Response.End();

We'd like to suppress the empty tax table if no calls have been made to set 
taxes.

Original comment by martin.o...@gmail.com on 8 May 2008 at 4:00

GoogleCodeExporter commented 9 years ago
Code has been checked in.

Please verify

Original comment by joseph.f...@gmail.com on 8 May 2008 at 5:26

GoogleCodeExporter commented 9 years ago
The bug-fix works, woo-hoo!

I just submitted a cart without setting any tax rates. In the UI, I had set 10% 
tax
for my home state. Before the bug-fix, the 10% tax set in the UI would not get
applied. Now it does get applied.

Thanks for fixing this so quickly, Joe!

Original comment by martin.o...@gmail.com on 8 May 2008 at 7:19