Having a small problem with trying to integrate google checkout into a current ASP.NET website.
It seemed such a simple task at the start - either use the .NET API for google checkout (which I can't easily do, will explain) or a bog standard html form with hidden fields and a submit button. Its being a pain though as you may expect.
I'll briefly explain the page and why I can't use the .NET api first, then get to the real problem. The page as currently designed supports multiple views - eg 'Please Pay' 'You have Already Paid' and 'You have been deleted'. This is done by checking the state passed to the page on load, followed by some processing before control is passed to a 'getHTML()' method which generates and outputs the correct HTML via a literal. This is all done in a C# codebehind file, with the aspx file only contining an <asp:literal /> tag. Its a nice, flexible structure which works well..or did until now
My preferred method of adding Google checkout support would be to simple add an asp:button or which would fire a 'payGoogleCheckout()' method on the server, create + sign the XML file and send it to google, finally redirecting the client to googles server. The problem I have here is that (unless anyone knows how) you can't add asp.net controls directly through a literal control - that is I can't add <asp:Button .. /> to the literal and expect a button to appear - it just doesn't. There are possibly ways around this by using a html button with its onClick set to a javascript function which can do the job, but thats very dirty and not what I want to be doing.
A much simpler way I figured would be to just use a HTML form, as shown by Google on their website. Problem is it doesnt work, and in fact, no forms seem to work on this page. All they do is simply postback to the same page - totally ignoring the action. Eg if my page is called 'Games.aspx' and I want to post to 'Google.aspx', I would do something like:
<form action="Google.aspx' method="Post" > <input type="Submit" ..etc /> </form>
and I would expect it to go to Google.aspx - but it just sits on Games.aspx.
If I can get this figured out via forms I'll be happy, but even better if someone knows a better way round the API problem..that doesn't involve me re-designing the whole site hah!.
After typing this out I think its something to do with the auto-postbacks for this site, so i'm going to see if theres anything there that could be causing a problem..but any ideas/suggestions would be nice