in reply to Re^2: CGI and web services
in thread CGI and web services

Google checkout is going to send you a POST to your CGI script. It has to be a name/value pair. One of those name value pairs is going to contain your XML document.

This should dump any data that you receive from a POST request. Use this as your script that Google Checkout will call; it will tell you what name/values you are receiving from them.

#!/usr/bin/perl use CGI; my $q = new CGI; my @names = $q->param(); for my $name (@names) { warn "$name => " . $q->param($name) . "\n"; }

Note:This data will be sent to the Apache error_log file.

Replies are listed 'Best First'.
Re^4: CGI and web services
by dshahin (Pilgrim) on Jan 30, 2007 at 05:19 UTC
    Your technique worked great! I guess there's a param called POSTDATA that contains what I need. I've written a client and a server that seem to be talking to each other.

    Now I need to perform basic HTTP authentication. Any pointers there?

    dan shahin

      So you need to fetch a URL that uses a username & password? LWP::UserAgent and WWW::Mechanize can both handle this.

      just another cpan module author
      Now I need to perform basic HTTP authentication. Any pointers there?
      That depends, what is the source of the usernames/passwords? Some kind of local database you control, or do you authenticate them through google?

      Addendum: for those monks (ie: me) who dont usually care to go looking for proprietary API docs, it would help to include a link to them :)

      __________
      The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it.
      - Terry Pratchett

        it's my own username and password sent back to me from google. I'm trying to access the Authorization header but it seems to have been stripped by the time it gets to my script. Any tips?

        dan shahin

Re^4: CGI and web services
by dshahin (Pilgrim) on Jan 30, 2007 at 05:05 UTC
    from the Google documentation:

    Google sends you the new-order-notification to inform you that it has started processing an order. The new-order-notification includes the order's shopping cart, shipping method, tax, shipping address, and various other information. Google sends this and all other notifications as raw POST data, not as name/value pairs. You need to reply to the notification with a notification-acknowledgment message via HTTP response. See New Order Notifications for a complete description.

    That's what's confusing me. How can I access the raw Post data?