I'm using a bastardized version of DPM found here because my site was completely built without MVC before looking into Authorize.Net.
I've got the entire thing working, except for the client redirect at the end of the transaction. After peeling through some
of the source code and reviewing the documentation, I've put this together:
public void Page_Load(object sender, EventArgs e) { AuthorizeNet.SIMResponse response = new AuthorizeNet.SIMResponse(Request.Form); bool isValid = response.Validate("hashinfo", "xxxxxxxxx"); if (!isValid) { //put inValid response here } else { if (response.Approved) { try { //the transaction went through--this is what my site does upon order completion responseString = webHelper.completeTransaction(response.InvoiceNumber, this); //This generates the JavaScript that is supposed to redirect the client
string returnUrl = AuthorizeNet.Helpers.CheckoutFormBuilders.Redirecter(webHelper.webHome + "orderComplete.aspx"); //From what I understand, this should use the javascript generated above to redirect the client, but it doesn't work
Response.Write(returnUrl); } catch (Exception exp) { int afsd = 0; }
}
Any ideas?
05-16-2011 08:24 PM
I just did a bare bone test. an order page, a relay response page and a redirect page. And it work fine for me.
It the address url still said 'https://test.authorize.net/gateway/transact.dll'?
Have you try just do
string returnUrl = AuthorizeNet.Helpers.CheckoutFormBuilders.Redirecter(webHelper.webHome + "orderComplete.aspx"); Response.Write(returnUrl);
on the relay response page without anything else?
05-18-2011 08:43 AM