Skip to main content
Inspiring
July 2, 2007
Question

how to hand-code a repeat region? (ASP/VBScript) WorldPay workaround.

  • July 2, 2007
  • 7 replies
  • 1521 views
Hi,
So far I've been using the standard Dreamweaver Repeat Region behaviour to
add a database repeat region to my page. However, the code this produces
doesn't work with WorldPay's callback script and I need to know if it's
possible to hand code a repeat region. My repeat region data includes
images etc so, as well as creating/displaying the repeat region, I also need
to know how to incorporate some basic HTML.

Would appreciate any advice or links to a tutorial.
Thanks
nath.


This topic has been closed for replies.

7 replies

Inspiring
July 2, 2007
Have you looked at the page without going to Worldpay. The main point is
that the error is not directly related to Worldpay.

--
Jules
http://www.charon.co.uk/charoncart
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004


Inspiring
July 2, 2007
Hi Jules,

In a round-about way, I've done that. It is the repeat region code that has
the bug, I just don't know what to do about it.

Regards
Nath.


"Julian Roberts" <nospam@charon.co.uk> wrote in message
news:f6bc4e$rt7$1@forums.macromedia.com...
> You need to look at this objectively. For you to think that the DW repeat
> region doesn't work with Worldpay is probably confusing the issue. What
> you need to think is - there's a bug in my code and I need to fix it. So
> think what you can do to debug the page. One method would be to run the
> callback page in the browser independant of Worldpay. Pass parameters to
> it.
>
> mycallback.asp?cartid=1&transstatus=y
>
> From there you can deduce what is going wrong.
>
> --
> Jules
> http://www.charon.co.uk/charoncart
> Charon Cart 3
> Shopping Cart Extension for Dreamweaver MX/MX 2004
>
>
>


Inspiring
July 2, 2007
You need to look at this objectively. For you to think that the DW repeat
region doesn't work with Worldpay is probably confusing the issue. What you
need to think is - there's a bug in my code and I need to fix it. So think
what you can do to debug the page. One method would be to run the callback
page in the browser independant of Worldpay. Pass parameters to it.

mycallback.asp?cartid=1&transstatus=y

From there you can deduce what is going wrong.

--
Jules
http://www.charon.co.uk/charoncart
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004



Inspiring
July 2, 2007
My apologies Joe...some detail...

To use WorldPay callback you have to upload a page to your server and
reference this page URL in your WorldPay account. However, this page is
interpreted by a WorldPay "script" and is actually displayed on the WorldPay
SSL space (or it, at least, appears as if it is at the WorldPay SSL URL).
I'm not entirely sure how this works, but I was concerned that I wouldn't be
able to get ANY database integration working on this page, but it does seem
to allow me to display recordset data etc.

If I had to guess, I would say that there is either a symbol, or something,
within the DW repeat region code that the WorldPay script cannot interpret,
or is perhaps not allowed on the WorldPay system (like I say, WorldPay
support won't tell you whether it is or isn't! - helpful!).

WorldPay returns the unique order ID (int field) to my callback page as a
form variable. I initially submit this value to WorldPay via their standard
Junior Integration form.

Really appreciate the help.
Regards
nath.

"Joe Makowiec" <makowiec@invalid.invalid> wrote in message
news:Xns996182320E599makowiecatnycapdotrE@216.104.212.96...
> On 02 Jul 2007 in macromedia.dreamweaver.appdev, tradmusic.com wrote:
>
>> I have database content on my WorldPay callback page, which is fed
>> by a form variable sent back from WorldPay. I can therefore call up
>> order details, in my database, by ID.
>
> Now:
> - What's the WorldPay code?
> - What value does WorldPay send back?
>
> --
> Joe Makowiec
> http://makowiec.net/
> Email: http://makowiec.net/contact.php


Inspiring
July 2, 2007
On 02 Jul 2007 in macromedia.dreamweaver.appdev, tradmusic.com wrote:

> I have database content on my WorldPay callback page, which is fed
> by a form variable sent back from WorldPay. I can therefore call up
> order details, in my database, by ID.

Now:
- What's the WorldPay code?
- What value does WorldPay send back?

--
Joe Makowiec
http://makowiec.net/
Email: http://makowiec.net/contact.php
Inspiring
July 2, 2007
Hi Joe,

I have database content on my WorldPay callback page, which is fed by a form
variable sent back from WorldPay. I can therefore call up order details, in
my database, by ID.
Anyway, I have two recordsets displaying correctly on my callback page;
Order Summary and Order Items. Because a customer may purchase more than
one item, I need to show all records in the Order Items table that match the
order ID. I therefore need a repeat region for the Order Items recordset to
show all products, so I've inserted the standard DW repeat region:

<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
rsItems_numRows = rsItems_numRows + Repeat1__numRows
%>

...(above the head tag) and....

<%
While ((Repeat1__numRows <> 0) AND (NOT rsItems.EOF))
%>
...Recordset Data...
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsItems.MoveNext()
Wend
%>

...within my page where I want the repeat region to be.

If I DON'T include this code, both recordsets display data, however the
Order Items recordset only shows 1 item (obviously, because there is no
repeat region). When I add the repeat region code, as above, WorldPay
fails.

WorldPay support can't actually tell you what's wrong, nor do you receive an
error line or anything, however I know it's the repeat region because both
recordsets display correctly WITHOUT the repeat region code.

Any way around this? I really need this to work because otherwise I'm going
to have to force a re-direct and an auto-submission of a form value
(nasty!), in order to be able to display the customers order summary, and
order items, on one page.

Hope you can help. Thanks Joe.

Regards
Nath.

"Joe Makowiec" <makowiec@invalid.invalid> wrote in message
news:Xns99617DEDEA9E9makowiecatnycapdotrE@216.104.212.96...
> On 02 Jul 2007 in macromedia.dreamweaver.appdev, tradmusic.com wrote:
>
>> So far I've been using the standard Dreamweaver Repeat Region
>> behaviour to add a database repeat region to my page. However, the
>> code this produces doesn't work with WorldPay's callback script and
>> I need to know if it's possible to hand code a repeat region. My
>> repeat region data includes images etc so, as well as
>> creating/displaying the repeat region, I also need to know how to
>> incorporate some basic HTML.
>
> Before you go re-inventing the wheel, what doesn't work?
>
> --
> Joe Makowiec
> http://makowiec.net/
> Email: http://makowiec.net/contact.php


Inspiring
July 2, 2007
On 02 Jul 2007 in macromedia.dreamweaver.appdev, tradmusic.com wrote:

> So far I've been using the standard Dreamweaver Repeat Region
> behaviour to add a database repeat region to my page. However, the
> code this produces doesn't work with WorldPay's callback script and
> I need to know if it's possible to hand code a repeat region. My
> repeat region data includes images etc so, as well as
> creating/displaying the repeat region, I also need to know how to
> incorporate some basic HTML.

Before you go re-inventing the wheel, what doesn't work?

--
Joe Makowiec
http://makowiec.net/
Email: http://makowiec.net/contact.php