[ic] Hidden fields mapping

J.-P. Parent interchange-users@lists.akopia.com
Thu May 31 20:11:01 2001


Thanks Ed for replying to my posts...

I'll explain to you what is my problem:

We have been accepted at www.worldpay.com for the "Select" service.

Their setup is not really what I anticipated. Basically they host the CC and
billing info and place cookies on clients site so that they dont have to
re-enter their info again.

Now, if you want, they can trigger a CGI on your site so that you actually
know if the transaction was succesfull.

So at first you send a POST containing a few hidden fields (i.e.: instId,
cartId, amount, and other custom fields if you want) like this:

(this is the GET method its just for illustration purpose)
https://select.worldpay.com/wcc/purchase?instId=xxx&cartId=xxxx&amount=xxxx&
currency=xxx

Then, you are presented with a page containing billing info (*****if you
passed it*****) and input fields for CC info.

Problem #1
To pass the billing info, I need to map the values to the names they need.
Not the fields i have in my db. This is tricky as I can't change the names
of the db and the info does not really exist yet (its being entered).

Problem #2
I need a callback that will get the status sent back by WorldPay to know if
the orders are valid. And from there I'm completely lost...I dont even know
where to start. I could pass the session Id and cartId and they would send a
post on one of my pages parsed by interchange and i could even set a
password from their admin section to make sure the response comes from them.

I hope someone can at least give me some tips as very few people are able to
help me right now.

J.-P.

----- Original Message -----
From: "Ed LaFrance" <edl@newmediaems.com>
To: <interchange-users@developer.akopia.com>
Sent: Thursday, May 31, 2001 7:30 PM
Subject: Re: [ic] Hidden fields mapping


> At 07:00 PM 05/31/2001 -0400, you wrote:
> >Ed,
> >
> >I dont understand how the following code affect the URL request?!
>
> Sorry, I didn't really understand your question - I just saw 'map one
value
> to another name while submitting the form', I didn't know you were looking
> for the actual code to send the values in the bargain.
>
> It sounds like you have a bit more on your hands than just a line or two
of
> code; do you have any code for the form post?  What happens during and
> after the post, is the browser redirected.  Do you have to coordinate with
> the order submission?  Is anything predicated on a return value?  These
are
> some of the things you have to consider. There are several ways you could
> do it; the best will be determined by your specific needs.
>
>
>
>
> >You are telling me that when the person will submit the form, the
mv_check
> >will execute this code. I follow you there I've worked a bit with
mv_check
> >but that the return value of this code is actually the URL is out of my
> >understanding...I think the variables that will be created will be
session
> >vars wouldnt they? I need em to be hidden posts.
> >
> >Besides, it doesnt seem to work. Is there any way i could see if the
values
> >have been modified?
> >
> >Here's what i tried:
> >
> >[set map_fields]
> >[perl]
> >          my $out;
> >          $out = "name=$CGI->{fname}%40$CGI->{lname}\n";
> >          $out .= "address=$CGI->{address1}\n";
> >          return $out;
> >[/perl]
> >[/set]
> >
> >and by setting the hidden mv_check to map_fields of course.
> >
> >J.P.
> >
> >----- Original Message -----
> >From: "Ed LaFrance" <edl@newmediaems.com>
> >To: <interchange-users@developer.akopia.com>
> >Sent: Thursday, May 31, 2001 4:58 PM
> >Subject: Re: [ic] Hidden fields mapping
> >
> >
> > > At 02:10 PM 05/31/2001 -0400, you wrote:
> > > >Hiya folks
> > > >
> > > >I've been  trying to map the checkout hidden fields to some other
name
> >when
> > > >submitting a form.
> > > >Is there any way to do that as i think the value isn't known yet and
> >can't
> > > >be assigned via variables yet.
> > > >
> > > >I tried to use the mv_check and then assign the value of the form to
a
> > > >session var but the payment host cannot access the session vars...it
> >needs
> > > >hidden fields sent by a POST.
> > > >
> > > >I'd rather avoid the javascript...
> > > >
> > > >Thank you
> > > >
> > > >J.P. Parent
> > >
> > > One way would go something like this:
> > >
> > > <form action=....>
> > > <input type=hidden name=value1 value="something">
> > > <input type=hidden name=value2 value="something2">
> > > ...
> > > <input type hidden name=mv_check value=map_fields>
> > >
> > > </form>
> > >
> > > [set map_fields]
> > > [perl]
> > >          my $out;
> > >          $out = "map_value1=$CGI->{value1}\n";
> > >          $out .= "map_value2=$CGI->{value2}\n";
> > >          return $out;
> > > [/perl]
> > > [/set]
> > >
> > > When you submit the form, the CGI data structure will be updated, then
> > > map_fields will be executed.  The Perl just outputs assignments of the
raw
> > > values of value1 and value2 to your 'map' variables.  There are no
doubt
> > > many other perfectly good ways to do this...
> > >
> > > - Ed L.
> > >
> > >
> > > >_______________________________________________
> > > >Interchange-users mailing list
> > > >Interchange-users@lists.akopia.com
> > > >http://lists.akopia.com/mailman/listinfo/interchange-users
> > >
> > > ===============================================================
> > > New Media E.M.S.               Software Solutions for Business
> > > 463 Main St., Suite D          eCommerce | Consulting | Hosting
> > > Placerville, CA  95667         edl@newmediaems.com
> > > (530) 622-9421                 http://www.newmediaems.com
> > > (866) 519-4680 Toll-Free       (530) 622-9426 Fax
> > > ===============================================================
> > >
> > > _______________________________________________
> > > Interchange-users mailing list
> > > Interchange-users@lists.akopia.com
> > > http://lists.akopia.com/mailman/listinfo/interchange-users
> >
> >
> >_______________________________________________
> >Interchange-users mailing list
> >Interchange-users@lists.akopia.com
> >http://lists.akopia.com/mailman/listinfo/interchange-users
>
> ===============================================================
> New Media E.M.S.               Software Solutions for Business
> 463 Main St., Suite D          eCommerce | Consulting | Hosting
> Placerville, CA  95667         edl@newmediaems.com
> (530) 622-9421                 http://www.newmediaems.com
> (866) 519-4680 Toll-Free       (530) 622-9426 Fax
> ===============================================================
>
> _______________________________________________
> Interchange-users mailing list
> Interchange-users@lists.akopia.com
> http://lists.akopia.com/mailman/listinfo/interchange-users