1) On form on my secure (https://) server, I collect data such as name, address, credit card number, etc.

2) data must be sent using server-to-server form post, and LWP::UserAgent seems the best candidate.

3) The receiving page (which is my credit card gateway) then returns a page like this:

NAME=Joe Blow ADDRESS=123 Street Blvd. CARDNUM=1234xxxxxxxxxxxx

etc. Each attribute on it's own line, separated by <br>.

I know all of the attribute's names, so I don't need a code that will automatically turn any attribute given into a new scalar, I want to manualling convert each attribute into a scalar, does that make sense? In my limited experience, this seems safer.

Once I have the data returned, I can take it from there, using the data in the scalars to finish the transaction for the customer. I just need help creating a CGI PERL code to use LWP::UserAgent to send my form data, and then receive from the IONGATE credit card gateway.

I've played with the lwpcook samples, but I don't know enough of this to make it work! Any code samples to accomplish the above would be greatly appreciated.

After some badgering, the gateway (IONGATE) provided these instructions. I hope someone can help me with this!

Code

All you need to do is build a hash of keys/values, create a user agent with the LWP library, and then post a hash reference to Iongate:

#!/usr/bin/perl -w

use strict; use HTTP::Request::Common qw(POST); use LWP::UserAgent; $|=1;

What I need is that code put into a working .cgi file - I frankly can't get it working! For testing, just printing a parameter to the screen would let me know it's working, and I can't even get that to work! I've tried this to test:

Code

#!/usr/bin/perl -w

use strict; use CGI; use HTTP::Request::Common qw(POST); use CGI::Carp qw/fatalsToBrowser/; use LWP::UserAgent; $|=1;