in reply to best modules for Google checkout

MIME::Base64 is the obvious choice for doing base-64 encoding. You've got lots of choices for writing XML but my favorite is XML::Writer.

-sam

Replies are listed 'Best First'.
Re^2: best modules for Google checkout
by dshahin (Pilgrim) on Jun 30, 2006 at 02:34 UTC
    I ended up using MIME::Base64 and since I was using HTML::Template anyway, I used it to generate my XML.

    Here's what I ended up with:

    #!/usr/bin/perl use HTML::Template; use MIME::Base64; use Digest::HMAC_SHA1 qw(hmac_sha1); my $template = HTML::Template->new(filename => 'cart.tmpl'); my @items; my $key = '1234567899'; my $num; while ($num < 10){ my %item = (item_name => "Bone Volume $num", item_descrip +tion => "good stuff", quantity => "1", unit_price => "40.00"); push (@items, \%item); $num++; } $template->param(items => \@items); my $cart = $template->output; my $ecart = encode_base64($template->output,''); my $signature = encode_base64(hmac_sha1($cart, $key),$eol); print "cart:$cart\nencoded cart:$ecart\nsignature:$signature\n";

    It seems to do the job, thanks for the tip.