[ic] help with recalling a session and finishing an order.

Dan interchange-users@interchange.redhat.com
Wed Feb 20 02:50:00 2002


Hi All,

First, many thanks to the people who have allowed me to get this far.

I am trying to recall a session and then finish its processing after
taking a brief jaunt outside of IC to a payment/gateway. Most of the
posts I have seen on this issue assume that the payment/gateway
automatically returns the user to IC. Unfortuantely, this is not the
case for me. It does however offer a "silent post" which occurs outside
of userspace. Sort of on the backend as it were.

I have searched the archives and found some reference to this issue.
Most particularly a post by Mike Heins [1] refering to the possibility
of calling a URL containing the mv_session_id parameter as a means of
getting to the session from an external source (ie a wrapper script).
Other people have also suggested this as a way to do it. However I do it
it appears that IC is just allocating a session anew. 

Attempts to test this using a generated URL similar to:
http://localhost.fake/cgi-bin/ic/purebio/process?mv_session_id=ViLqJY5J&mv_pc=4
&mv_todo=submit&mv_payment=Credit%20Card&mv_order_route=log%20main%20copy_user &mv_order_report=ord%2freport&mv_order_receipt=ord%2freceipt

yield an error in my logs:

#### begin TEST0054 #####
Auto-create of user failed.
Add main order TEST0054 to transactions: 1
Logout auto-created user: 1
#### end TEST0054 #####
Email copy of order TEST0054 NOT REQUESTED for .

and

h5scIK68:nobody - [20/February/2002:01:25:01 -0600] purebio
/cgi-bin/ic/purebio/process Safe: Auto-create of user failed. at (eval
357) line 1.
>
>  die errmsg("Auto-create of user failed.");
>

Since i am using a silent post from the payment gateway to determine
approval i do not have access to the users browser and can't pass the
session with [bounce].

Any help is greatly appreciated as I am getting to be up against some
time restraints here. 

Here is the external wrapper script which is supposed to translate the
payment variables into IC variables and then call IC to finish its
processing.
========================================
#!/usr/bin/perl
# called with http://localhost.fake/trans.pl?USER1=xxx&RESPMSG=xxx
#
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
use CGI::Request;

my $query = new CGI::Request;

# get the mv_session_id from payment gateway
# get the response code from the gateway
#
my $sid = $query->param('USER1');
my $RESPMSG = $query->param('RESPMSG');

$ua = LWP::UserAgent->new();
push @{ $ua->requests_redirectable }, 'POST';

my $req = POST 'http://localhost.fake/cgi-bin/ic/purebio/ord/process',
                [ mv_session_id => "$sid",
                        RESPMSG =>"$RESPMSG" ,
                        mv_todo =>'submit',
                        mv_payment =>'Credit%20Card',
                        mv_order_route=>'log%20main%20copy_user',
                        mv_order_report=>'ord%2freport',
                        mv_order_receipt=>'ord%2freceipt'
                ];
$content = $ua->request($req)->as_string;
print "\n";
exit;
========================================

Many Thanks,

-dan

[1]
http://interchange.redhat.com/pipermail/interchange-users/2000-August/000085.html