[thelist] Server2Server Communication

Johnson Borja See jbs at palindrome.ph
Fri Apr 21 06:53:59 CDT 2006


Hi,

I'm new to server2server sites. I'm using ASP, VBScript and JScript. 
The site is hosted on an IIS running in a Windows 2003 server.

What had to be done is something like this

1. When the user press the submit button on the order form from the 
ecommerce website (which in this context is also the requesting server, 
or merchant server), the merchant server sends a initialisation request 
to the recipient server (a payment gateway) using the format specified 
by the gateway.

2. The payment gateway will recive the initialisation request, 
and "respond" back to the requesting server with a success/fail reply 
through a variable named "errorcode".

3. If the variable "errorcode" is 0, then requesting gateway will 
redirect the browser of the client to the payment gateway's credit card 
payment form, or if the errorcode is not 0, then show an error message 
on the client browser

The manual of the payment gateway describes it as an interaction 
between the merchant server and the payment gateway, and it is the 
responsibility of the merchant gateway to redirect the user to the 
payment gateway only if it received the appropriate response from the 
payment gateway.


The situation

4. I've done step 1, send initialisation request to the payment gateway 
using a redirect command, something like

    dim Gateway, InitParam, ErrorCode
   
    Gateway = "https://www.somepaymentgateway.com/init"
    InitParam = "merchant=12345&amount=1.00&currency=USD ..."

    Response.Redirect(Gateway + "?" + InitParam)

5. I don't know how to receive the "response" from the server, so I put 
a querystring request right after the redirect statement, e.g.

    InitParam = "merchant=12345&amount=1.00&currency=USD ..."

    Response.Redirect(Gateway + "?" + InitParam)

    ErrorCode = Request.Querystring("errorcode")

    if Errorcode = 0 then

       Response.Redirect("https://somepaymentgateway.com/ccard?id=abc")

    endif

6. I doubt that this portion would be executed as it follows a 
redirect, but this is actually the brunt of my problem, i.e., how do I 
get something back from the other site after I redirected the control 
to it?

7. I tried this by logging to our site, accessing the order form, and 
submitting the form

- The initialisation request was sent to the payment gateway
- The payment gateway received it properly, and returned an errorcode=0 
- However, I only know that an errorcode=0 is received because it 
showed on my browser (I was testing it and therefore seeing it from the 
client browser)
- Our site which sent the request to the server did not even see the 
reply.

8. My Question:

How do I get the response back from the payment gateway. When I emailed 
the payment gateway technical people, the reply that I got was that it 
was a Server2Server transaction. 

Am I missing something? Is there a protocol that describes this 
Server2Server transaction?

I save the source html of the reply I got from the payment gateway, and 
it looks like this (some portions of the html was changed to maintain 
confidentiality):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0590)https://pay1.somepaymentgateway.com/init?
merchantid=12345&amount=1.00&currency=USD&orderid=204200652734-
5287&language=en&salutation=Mr.&firstname=Jones&lastname=Jonesy&street=A
BC&zip=1029&city=Makati%
20City&state=NCR&country=PHL&email=jbs at palindrome.ph&phone=123456789&url
_success=https%3A%2F%2Fwww.oursite.com%
2Folp_success.asp&url_failed=https%3A%2F%2Fwww.oursite.com%
2Folp_failed.asp&url_cancel=https%3A%2F%2Fwww.oursite.com%
2Folp_cancel.asp&url_internal=https%3A%2F%2Fwww.oursite.com%
2Folp_internal.asp&signature=1104473112249e2b0f3bacfbba9322e3338eb3c8 --
>
<HTML>

<HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="Microsoft FrontPage 5.0" name=GENERATOR></HEAD>
<BODY>
errorcode=0&amp;errorcodes=&amp;errormessage=&amp;sessionid=33f3b7bdeab3
3ed859cb02b5578750ec9f0dfa89&amp;transactionid=8470210&amp;
user_id=1113198&amp;start_url=https%3A%2F%2Fpay1.somepaymentgateway.com%
2F33f3b7bdeab33ed859cb02b5578750ec9f0dfa89%2Fpayment%2Fstart%
3Ftransactionid%3D8470210

</BODY>

</HTML>

Any help on this will be greatly appreciated.

Regards,

Jones



More information about the thelist mailing list