Zinfandel:
Does anyone know how to post the XML sitting in the response_message.log that didn't get processed?
Hi,
I just had the same problem (had a misconfigured Google Checkout level 2 integration URL while processing orders) and so I wrote this Perl script to re-post a failed order back into the Zen-Cart order queue.
You have to put the XML in a file in the same directory and then run this from a Unix/Linux machine (probably -- have not tested it on Windows, but maybe it will work if you have a decent Perl install)
Here is the script:
#!/usr/bin/perl -w
########################################################################
# resend-order.pl
# resend failed gcheckout order
# License: MIT License <http://en.wikipedia.org/wiki/MIT_License>
# You are free to do whatever you wish with this code,
# but I'm not responsible for anything that happens because of it
# Copyright (c) 2007 Mike Percy
########################################################################
use strict;
use LWP::UserAgent;
my $file = shift @ARGV or die "Usage: $0 <filename> (where filename is a file containing the XML of the failed order)\n";
my $content = '';
open(FILE, "< $file")
or die "error: cannot open file ($file) for read: $!";
read(FILE, $content, -s FILE)
or die "error: cannot read file ($file): $!";
close FILE;
my $ua = LWP::UserAgent->new;
# modify the below two lines to point to your domain and use your own google checkout id & key
my $req = HTTP::Request->new(POST => 'https://www.mydomain.com/shop/googlecheckout/responsehandler.php');
$req->authorization_basic('google_merchant_id', 'google_merchant_key');
$req->content_type('application/x-www-form-urlencoded');
$req->content($content);
my $res = $ua->request($req);
print $res->as_string;
exit 0;
You will have to modify a couple of lines in that script to point to your web server in the HTTP::Request->new() line and put in your google checkout id and merchant key as the username/password in the $req->authorization_basic() line.
You run it like this:
./resend-order.pl failed-order.xml
It works for me. Hope this helps!
Mike