Reply
Contributor
Posts: 45
Registered: ‎02-17-2015
Accepted Solution

Questions about DPM relay page code

Since I’m having a hard time with the DPM relay page I would like to post a few questions hoping to get an answer from you guys.

 

Question #1: The Authorize.net manual reads like this: When you use DPM, Authorize.Net sends a POST of the transaction result to the relay URL. Your relay response page then redirects the client’s browser to the merchant’s server. Therefore, the URL in the client’s browser shows the merchant’s server and not Authorize.Net’s server.

Since this is the case, why after I redirect my browser still show Authorize.net URL? It shows this: https://test.authorize.net/gateway/transact.dll

 

Question #2: When Authorize.net send a Post of the transaction result to my relay URL, my relay URL redirect this to the merchant’s server, that is not other than my own server, the question now is, in this redirection, the data or values that came from Authorize.net transaction are carry over to the redirected page or my relay page have to do the redirection and send the data attached as well?  

 

All of these is very confusing to me since the manual is very poor in it explanation. I’m using asp.net with VB and this is a sample of my redirection coding page for testing purpose only

 

 'These variables hold values from Authorize.net

    Dim x_response_code As String

   

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)

 

        If Not IsNothing(Request.Form("x_response_code")) Then

            x_response_code = Request.Form("x_response_code")

                    

            If x_response_code = 1 Then

                Response.Redirect("http://www.bglocal.com/AdPrograms/FinalAuthoAnswer.aspx")

           Else

                Response.Redirect("http://www.bglocal.com")

            End If

        Else

            Response.Redirect("http://www.bglocal.com")

        End If

 

    End Sub

 

Thanks is advance for your help

 


Accepted Solutions
Solution
Accepted by topic author AuthComm25
‎08-21-2015 01:58 AM
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: Questions about DPM relay page code

https://msdn.microsoft.com/en-us/library/system.web.httprequest%28v=vs.110%29.aspx?cs-save-lang=1&cs...

 

You can use simplified syntax for accessing data from the QueryString, Form, Cookies, or ServerVariables collections. You can write Request["key"].

 

View solution in original post


All Replies
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: Questions about DPM relay page code

1)It not a form post, but like a post in code, something like webrequest in .net

https://msdn.microsoft.com/en-us/library/system.net.webrequest%28v=vs.110%29.aspx

 

2)response.redirect is not going to work, because it will process in authorize.net, so the url will stay at authorize.net

that why they said to use javascript redirect because it run on the client browser.

 

 

 

 

Contributor
Posts: 45
Registered: ‎02-17-2015

Re: Questions about DPM relay page code

Thanks for your help

May you please answer these questions

 

1) So what you mean is that instead of x_response_code = Request.Form("x_response_code") 

I should use: x_response_code = Request("x_response_code") ?

 

2) What about this question: Question #2: When Authorize.net send a Post of the transaction result to my relay URL, my relay URL redirect this to the merchant’s server, that is not other than my own server, the question now is, in this redirection, the data or values that came from Authorize.net transaction are carry over to the redirected page or my relay page have to do the redirection and send the data attached as well?

 

Thanks 

Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: Questions about DPM relay page code

1)To your relay response page. whichever from code or form, it the same.

 

2)redirect don't carry over to another page, my suggestion is save all the values on your original relay response url page to a database, get a key from the insert, pass it with the javascript redirect, and on that redirect page read the key and display whatever result you need for your customer.

Contributor
Posts: 45
Registered: ‎02-17-2015

Re: Questions about DPM relay page code

I understand your answer for the second question but I do not for the first one that reads: 

1)To your relay response page. whichever from code or form, it the same.

 

I'm sorry, may you please explain this one. Thanks a lot.  

Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: Questions about DPM relay page code

Your page won't know the different. Request.Form("x_response_code")  or Request("x_response_code")  would do the same thing.

Highlighted
Contributor
Posts: 45
Registered: ‎02-17-2015

Re: Questions about DPM relay page code

[ Edited ]

Due to this that you wrote first: 

1)It not a form post, but like a post in code, something like webrequest in .net

https://msdn.microsoft.com/en-us/library/system.net.webrequest%28v=vs.110%29.aspx

 

I'm still confuse.

This is my last question and you can answer with a yes or no.

 

Question: In the response that come from authorize.net to my relay page, the  x_response_code value, I can get this value with both, Request.Form("x_response_code")  or Request("x_response_code"), yes or no?

 

Sorry, thanks

Solution
Accepted by topic author AuthComm25
‎08-21-2015 01:58 AM
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: Questions about DPM relay page code

https://msdn.microsoft.com/en-us/library/system.web.httprequest%28v=vs.110%29.aspx?cs-save-lang=1&cs...

 

You can use simplified syntax for accessing data from the QueryString, Form, Cookies, or ServerVariables collections. You can write Request["key"].