Can I call this in a function or does it have to be multi HTTP pos

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm coding credit card functionality for a custom system used by a major
university. The only means they have of doing this charge is thus:

You post a HTTP request to their site, including in a form field the "return
page."

They process the information and POST back to your return page with
success/failure.

Is there any way to call this in a inline-function style using the
HTTPWebRequest object or something similar? Due to the fact that they POST
back to you I don't believe it is. Please, prove me wrong, or else we will
only be able to supply them with very limited functionality due to this
process.
 
www.regonline.com said:
I'm coding credit card functionality for a custom system used by a major
university. The only means they have of doing this charge is thus:

You post a HTTP request to their site, including in a form field the
"return
page."

They process the information and POST back to your return page with
success/failure.

Is there any way to call this in a inline-function style using the
HTTPWebRequest object or something similar? Due to the fact that they
POST
back to you I don't believe it is. Please, prove me wrong, or else we
will
only be able to supply them with very limited functionality due to this
process.

Yes, but it's a bit of a trick. You must code your postback page to put the
response somewhere where your code can get to it. Then you just post the
request to the other server and wait for your response to appear.

Here's what you do. You have a page, say, PostBack.aspx, and you ask for a
postback to PostBack.aspx?ticket=198173827378.

PostBack.aspx is coded to take the information and stuff it into a
application-level (or static) hashtable keyed by the ticket.

So in your code you send the request, and wait for some information to
appear in the hashtable. You can easilly just Thread.Sleep for a short
period of time before checking if the response is in.

You can make it even slicker by using an event or something so that your
code can wait, and PostBack.aspx can wake it up.

David
 
Back
Top