views:

38

answers:

2

The WorldPay payment gateway suggests using this HTML to take the customer to the payment page:

<form action="https://select-test.wp3.rbsworldpay.com/wcc/purchase" name="BuyForm" method="POST">
<input type="hidden" name="instId"  value="211616">
<input type="hidden" name="cartId" value="abc123">
<input type="hidden" name="currency" value="GBP">
<input type="hidden" name="amount"  value="0">
<input type="hidden" name="desc" value="">
<input type="hidden" name="testMode" value="100">
<input type="submit" value="To Payment!">
</form>

How to I put this form on my page? The problem is I have a master page which wraps the content pages content in the ASP.net form, I can't nest the forms.

A: 

You can customize the HtmlForm to get this to work. I gave a code sample here:

http://stackoverflow.com/questions/3320966/how-to-get-past-embedding-a-html-form-for-paypal-buttons-asp-net/3431566#3431566

http://www.codersbarn.com/post/2008/03/08/Solution-to-ASPNET-Form-PayPal-Problem.aspx

I've used this several times with master pages :-)

IrishChieftain
+1  A: 

Hi,

This is a bit of a hack, but I have used this with paypal in the past. Basiscally just put and extra form above the form you are attempting to post as in the following:

<form>
</form>
<form action="https://select-test.wp3.rbsworldpay.com/wcc/purchase" name="BuyForm" method="POST">
<input type="hidden" name="instId"  value="211616">
<input type="hidden" name="cartId" value="abc123">
<input type="hidden" name="currency" value="GBP">
<input type="hidden" name="amount"  value="0">
<input type="hidden" name="desc" value="">
<input type="hidden" name="testMode" value="100">
<input type="submit" value="To Payment!">
</form>

Enjoy!

Doug