name1=value1&name2=value2&name3=value3...
Also, this URL may take a number of seconds to reply. So, what I need is that when the client enters his credit card details (on a secure server) and clicks "Checkout", the "action" of the payment form should take him to "process.cgi". This script sends a POST request and awaits for the response from the payment provider. In the meantime, the client should recieve a "Please wait" message on his browser. When the response is recieved from the payment provider, the browser should automatically redirect to "done.cgi?=mode=success" or "done.cgi?mode=fail" according to the response from the server. Is that possible?
$result = `curl -d 'send=your¶ms=here' $secureGateway`;
-d means to manage the quoted text as data.
The string returned by the gateway will be in $result.
Also you may get a blank value in $result if you're not curling from a secure server, that is, your gateway won't respond with data of any value.
-d means to manage the quoted text as data.
The string returned by the gateway will be in $result.
Based on how you parse out the response, you just return the appropriate browser response. You should do this anyway to manage error checking. And I don't know of a way to do the "please wait" without multiple refreshes.
#---------
use LWP::UserAgent;
my $ua = new LWP::UserAgent;
my $response
= $ua->post('https://www.example.com/submit.cgi',
{ param1 => 'value1',
param2 => 'value2',
});
my $content = $response->content;
#---------
Then $content should contain whatever the server gave back to you, and you can then print it to the browser or whatever you want.
Ref: [search.cpan.org...]
Best of luck.
-Jer