Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: best modules for Google checkout

by dshahin (Pilgrim)
on Jun 30, 2006 at 02:34 UTC ( [id://558499]=note: print w/replies, xml ) Need Help??


in reply to Re: best modules for Google checkout
in thread best modules for Google checkout

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://558499]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2024-04-23 09:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found