Hello,
Here is what I am rtying to achieve and have no clues...
1. The user comes to our website and browse some artcile titles.
2. If they wish they can purchase the article.
3. This is where the user is sent to authorize.net
4. After payment, we would like to save the transaction Id for the user in our database and redirect the user so that he/she can access the article.
Any step-by-step instructions would be greatly appreciated.
Thanks!
Solved! Go to Solution.
08-20-2012 07:33 AM
Do you have any example of javascript redirect code?
This is c#
string _jscript = "<script type=\"text/javascript\">window.location = 'http://www.yourwebsite.com?invoice="+ "12345"+"';</script>"; ClientScript.RegisterClientScriptBlock("".GetType(), "s", _jscript);
Also, can I send some additional parameters to Authorize.net that will be returned as well, so that I know where to redierct the user after successful payment?
Yes you can send as many merchant defined fields as you like, just make sure it is not the same fields name(they all start with x_) from authorize.net.
08-20-2012 09:01 AM - edited 08-20-2012 09:02 AM
First pick an API Choose an API
Then read up on the documentation of that API and try the sample code
Also, you might not need silent post. There relay response for SIM, DPM. And AIM is a direct code behind call, so you will have the response from the webrequest call.
08-20-2012 07:50 AM - edited 08-20-2012 07:54 AM
Thanks. I already have a test account. I also have the VB.Net version of the sample code for SIM. However, I am not sure how to come back to my webpage after the payment is processed and how to redirect my user to access the article.
08-20-2012 08:13 AM
You can use the relay response. Once it relay response, you can then redirect the user to the whatever page(success/declined).
08-20-2012 08:23 AM
Thanks again. Based on all my reading on this site, it says that the relay reponse will just display the form fields on the Authorize.Net page. How can I save the transaction ID on my server and then redirect a user to a completely new site? And like I said, when I tried the relay response, it did show the form of my webpage on Authorize.Net and taht is all.
Thanks for your help here. I appreciate it.
08-20-2012 08:36 AM
How can I save the transaction ID on my server and then redirect a user to a completely new site? And like I said, when I tried the relay response, it did show the form of my webpage on Authorize.Net and taht is all.
You say it show the from of your webpage on authorize.net, that mean the info is post back to your webpage, which you can save the transactionID and all the other info that post back.
On your webpage, do a javascript redirect to the next page you want to go to so it will leave the authorize.net url.
08-20-2012 08:41 AM
Do you have any example of javascript redirect code? Also, can I send some additional parameters to Authorize.net that will be returned as well, so that I know where to redierct the user after successful payment? Once again thanks!
08-20-2012 08:52 AM
Do you have any example of javascript redirect code?
This is c#
string _jscript = "<script type=\"text/javascript\">window.location = 'http://www.yourwebsite.com?invoice="+ "12345"+"';</script>"; ClientScript.RegisterClientScriptBlock("".GetType(), "s", _jscript);
Also, can I send some additional parameters to Authorize.net that will be returned as well, so that I know where to redierct the user after successful payment?
Yes you can send as many merchant defined fields as you like, just make sure it is not the same fields name(they all start with x_) from authorize.net.
08-20-2012 09:01 AM - edited 08-20-2012 09:02 AM
Thanks for all your help. However, I am not sure where do I define fields? Do I just add any field name, ex. articleid, context and then add values to it? And on the relay page, just retrieve the values for those two fields?
08-20-2012 09:38 AM
I am not sure where do I define fields? Do I just add any field name, ex. articleid, context and then add values to it?
You just need to pass it with the post to the SIM. (where you post the x_loginID, x_fp_hash, etc).
And on the relay page, just retrieve the values for those two fields?
It will post back to the relay page, just check the Request.Form for the values.
You can see what being post back by add this to the valid relay url and set the SIM to use it.
08-20-2012 09:46 AM