Ok ill try to be clearer in this post. My problem is number 2, What i am
doing is in perl, i am creating the following xml precdurally with perl,
this is the actual output of the script as i have logged it when it is
created.
<?xml version="1.0" encoding="UTF-8"?>
<merchant-calculation-results xmlns="http://checkout.google.com/schema/
2">
<results>
<result shipping-name="Standard Delivery (3-5 Days)" address-
id="H-7538">
<shipping-rate currency="GBP">0</shipping-rate>
<shippable>true</shippable>
<total-tax currency="GBP">0</total-tax>
</result>
<result shipping-name="Next Working Day" address-id="H-7538">
<shipping-rate currency="GBP">3.45</shipping-rate>
<shippable>true</shippable>
<total-tax currency="GBP">0.52</total-tax>
</result>
<result shipping-name="Standard Delivery (3-5 Days)" address-
id="3414912">
<shipping-rate currency="GBP">0</shipping-rate>
<shippable>true</shippable>
<total-tax currency="GBP">0</total-tax>
</result>
<result shipping-name="Next Working Day" address-id="3414912">
<shipping-rate currency="GBP">3.45</shipping-rate>
<shippable>true</shippable>
<total-tax currency="GBP">0.52</total-tax>
</result>
</results>
</merchant-calculation-results>
This is returned to a page which has a content-type of text/xml in the page
header. However google is not updatting the pages. As far as i can tell the
xml is correct according to the api, so there is something i must be
overlooking in my code which is as follows.
my $addresses = $callback->get_addresses;
my $return .= qq|<?xml version="1.0" encoding="UTF-8"?>\n<merchant-
calculation-results xmlns="http://checkout.google.com/schema/2">
\n<results>\n|;
for my $address (@$addresses)
{
$ret = <<__ADDRESS__;
Address: $address->{id}
Country code: $address->{country_code}
City: $address->{city}
Postal code: $address->{postal_code}
Region: $address->{region}
__ADDRESS__
$return .= qq|<result shipping-name="Standard Delivery (3-5 Days)"
address-id="$address->{id}">\n<shipping-rate currency="GBP">0</
shipping-rate>\n<shippable>true</shippable>\n<total-tax
currency="GBP">0</total-tax>\n</result>\n<result shipping-name="Next
Working Day" address-id="$address->{id}">\n<shipping-rate
currency="GBP">3.45</shipping-rate>\n<shippable>true</shippable>
\n<total-tax currency="GBP">0.52</total-tax>\n</result>\n|;
}
$return .= qq|</results>\n</merchant-calculation-results>|;
As stated before google is calling the page with this code as i can see the
xml output in the logs but it does not update the shiipping prices.
Hopefully this post is a bit clearer.
Graham Hadgraft
On Thu, Jul 2, 2009 at 5:42 PM, Jerry Krinock <je...@sheepsystems.com>wrote:
> On 2009 Jul 02, at 08:58, g_hadgraft wrote:
> Hello, Graham. I read your message twice but still don't understand
> what the problem is. I believe you should clarify, first of all, what
> type of problem it is. There are, I would say, three such types:
> Type 1. The API seems to be not behaving as documented. (GCO should
> fix bug.)
> Type 2. I don't know how to use the API. (Developer needs to fix
> code.)
> Type 3. Not sure if Type 1, Type 2 or both. This really shouldn't
> happen very much here since you can easily log what you're getting
> from GCO.
> The following:
> > A log however show that the xml being returned to google actually
> > contains the information sent by google.
> seems to indicate that this problem is Type 2, that you need help with
> your perl code, since it is your code which returns xml to GCO. Is
> that true?
> Maybe it's just me, but I believe you should try and state the problem
> more succinctly.
> Sincerely,
> Jerry Krinock
--
====================================
http://www.8bitscraps.co.uk - Tech Tips & tools