[ic] Using [item-list] on a callpage back??

interchange at tvcables.co.uk interchange at tvcables.co.uk
Sun Mar 20 18:47:22 EST 2005


Quoting Jonathan Clark <jonc at webmaint.com>:

> > I have almost completed my implementation of Worldpay but I am
> > stuck trying to
> > use the [item-list] tag on the callback page.
> >
> > I send the item-code(s) to the worldpay server using:-
> >
> > [item-list]
> > <input type=hidden name="MC_item-code[item-increment]"
> > value="[item-code]">
> > [/item-list]
> >
> > So if there are two items with codes os1234 and os5678 they get
> > sent as variable
> > MC_item-code1=os1234 and MC_item-code2=os5678.
> >
> > I can then display these two items on the callback page using:-
> >
> > Item1 = [cgi MC_item-code1]
> > Item2 = [cgi MC_item-code2]
> >
> > What I want to do is use the [item-list] tag on the callback page
> > though eg:-
> >
> > [item-list]
> > [cgi MC_item-code[item-increment]]
> > [/item-list]
> >
> > In theory this should display the two item codes, it works
> > perfectly when the
> > page is called from my server with the cgi variables in the
> > browser line, but
> > when called from Worldpay it returns no item codes. I therefore
> > presume that
> > [item-list] requires some other variable which I have not sent to
> > Worldpay,
> > maybe something to do with the cart, can anyone help me out here please??
>
> [item-list] is for looping the cart.

Hi Jonathan,

Yes I realised that is was for looping for the cart, I was trying to transfer
the whole cart in a variable and then hoping to loop it, maybe it's not
possible though?


> in your callback page, you just need an incrementing number which goes up to
> the number of lines in the cart, right?

Yes, that would also work, I guess I would need a perl routine to determine the
number of lines as it would not necessarily be the same as nitems, do you have
such a routine? I am not good with Perl.

> As has been said before, the WorldPay callback requests a page from IC in a
> completely different session and so there are no items in _its_ cart.

The session can be easily maintained by sending a variable with [data session
id], I can use the callback page to write the transaction and userdb tables but
I am struggling with the orderline table as I cannot use [item-list] on the
callback page.

> Why don't you pass the number of lines in the cart to WorldPay and then use
> this with the [loop] tag on your callback page?

That might work if I can determine the number of order lines and then how to use
the loop tag.

Thanks,
Andy.




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


More information about the interchange-users mailing list