Integration eCommerce Payment Gateway ( Direct Post Method New! )

These steps assume that your web server is on the public internet and can be accessed via a domain name or IP address.
Step 1:Sign up for a Test Account.
Sign up for a test account to obtain an API Login ID and Transaction Key. These keys will authenticate requests to the payment gateway.

Step 2: Download the Authorize.Net C# SDK and include it in your project
Download the SDK

Create a new ASP.NET MVC application and add a reference to the AuthorizeNET.dll from the SDK

Step 3: Modify web.config.
Add the AuthorizeNET.Helpers namespace to the web.config, under system.web/pages:

Step 4: Create a checkout form that posts directly to Authorize.Net
Add the following code to the Home/Index View - this will create a form which will submit a test transaction to Authorize.Net (with hardcoded values). This code uses the SDKs CheckoutFormBuilder to create the form for you - just include your API login and Transaction Key:

In this code, the CheckoutFormBuilder is creating the form that will post to AuthorizeNET, setting the "TestMode" to true. We're sending along an additional piece of information here as well: an order id. This isn't required by the API, but let's you identify the order when we get the response.

Step 5: Create an Action to handle the response from Authorize.Net.
This example uses ASP.NET MVC - if you're using ASP.NET WebForms, you can put this code on PageLoad().

In the above code we passed in the URL "", so we need to create an Action called "Sim" in our application's HomeController. The form POST from Authorize.Net will include all the transaction information including an MD5 hash which we can use to validate the post's origin.

Open up the HomeController and paste the code below:

[HttpPost] public ActionResult Sim(FormCollection post) { var response = new AuthorizeNET.SIMResponse(post); //first order of business - validate that it was that posted this using the //MD5 hash that was passed back to us var isValid = response.Validate("YOUR_API_LOGIN_ID", "YOUR_API_LOGIN_ID"); //if it's not valid - just send them to the home page. Don't throw - that's how //hackers figure out what's wrong :) if (!isValid) return Redirect("/"); //the URL to redirect to- this MUST be absolute var returnUrl = ""+response.Message; return Content(AuthorizeNET.Helpers.CheckoutFormBuilders.Redirecter(returnUrl)); }This uses SDK classes to parse the response and validate it's origin using the MD5 hash.

An important thing to understand at this point is that Authorize.Net will take whatever content we respond with and it will display it on their server, to our user. So if we simply returned the string "Thank You!" - that's what would be displayed to the user. This response, however, is sent from the Authorize.Net server - not our own - and you can see this if you look at the URL in the address bar upon completion of the transaction. Since that's not what we want, we send a response that causes the user to be redirected to a url on our sever.

It's important to keep in mind that this whole process is "out of session" - which means your user session no longer exists in this response context. The user, in this case, is the Authorize.Net server in that it's notifying our server of a transaction - it has no notion of your current user's session - so our next task is to return the information from Authorize.Net to the current user - and we do this by redirecting away from Authorize.Net using some javascript. In the last line, we're using the SDK to generate this javascript.

For the simplicity of this example, we're redirecting back to the home page of our application so we can see the result.

There are a few considerations here that you will need to manage as a developer - specifically how you manage the order data, and how you display the response from Authorize.Net to the user.

Step 6: Add some code to handle the redirect from Authorize.Net
Add some code to receive the message in the HomeController, Index action. The sample application provides a more complete way of handling the response from Authorize.Net - here we just show the response. To do that, add some code to the Index action to pull the message from the URL:

public ActionResult Index () { ViewData["message"] = Request.QueryString["m"] ?? ""; return View (); }Step 7: Test your HTML form and verify the transaction.

Visit the new payment experience you've just built. Complete the payment form.

Select "Visa" and enter the test credit card number 4111111111111111, any expiration date (MMYY) in the future (such as "1120"), and hit "Submit".

Verify payment transaction success on your transaction report.

Learn More
To accept real payments, you'll need a merchant account. Learn more or apply for a merchant account


Anonymous said…
There are many other payment softwares and in all this method of payment was quite secured.
Shopping Cart Software Solutions
Unknown said…
Wow, Excellent post. This article is really very interesting and effective. I think its must be helpful for us. thanks for sharing your informative.
Unknown said…
This comment has been removed by the author.
Unknown said…
Yasmin hat eine Effizienzrate von beinahe 100% bei der Schwangerschaftsverhütung und ist eines der beliebtesten Empfängnis verhütenden Kombinationspräparate.

yasmin Kaufen
Unknown said…
Phenq PhenQ is a all-natural dietary supplement for fat burning that combines the best qualities of many other supplements into a single pill.
Unknown said…
streaming TV Learn how convenient streaming TV services are for households compared to traditional cable & satellite TV services.
jems khan said…
Montville project was won in a bidding war by an astonishing tender of $ 301.2 million that was a real statement of the confidence they have in the project. Space is set for not only the residential condos but also complimentary commercial areas that will make Montville a hybrid project second to none. The Montville is located at the heart of Singapore’s district 23 and just a stone’s throw away from the vibrant and ever growing Jurong East Regional center which has a host of every amenity needed by man.
Unknown said…
Foldable WheelchairDependable Website Management is a concierge website management service for businesses who will accept nothing but the best.

asifjanjoa said…
Naples Court Reporter With CourtScribes' Private Online Repository, you are able to acesss all of your transcripts, exhibits and videos no matter where you are.....
Nice blog, very interesting to read
I have bookmarked this article page as i received good information from this.

Cloud Based ERP Software in India | ERP Software Companies in Hyderabad

ERP Hyderabad | ERP Software Providers in Hyderabad
Receap said…
Minecraft Premium sizlere çok daha uygun fiyatlı bir şekilde minecraft premium hesap satmak amacıyla kurulmuş bir şirkettir. Şirketimizde çalışan bütün kişiler konular hakkında yeterli bilgiye sahiptir ve Minecraft Premium hesabınızla ilgili bir sorun olduğu zaman 7/24 ulaşabilmeniz için hazır beklemektedirler.
Hero said…
hepsibahis Yüksek bahis oranları sunan en güncel canlı bahis şirketi olan hepsibahis firmasına buradan direk giriş yapın. Youwin adı ile tanınan ve Türkiye deki ismi hepsi bahis olarak kullanılan iddaa firması ile ilgili detaylı bilgileri öğrenin.
Unknown said…
bahis siteleri Avrupa da yasal olarak faaliyet gösteren bir çok güvenilir bahis sitesi için güncel giriş adresleri Bahis5XL sitemizde. ile bir çok yabancı bahis şirketi hakkında tanıtım yazılarını inceleyerek, size uygun en iyi iddaa sitesini seçebilirsiniz. Canlı bahis siteleri için en çok bedava deneme bonusu veren Kıbrıs ve Malta lisanslı Türkçe bahis sitelerini Bahis5XL ile inceleyin. Türkiye nin en güncel 2020 bahis siteleri listesi burada.
Hero said…
1xbet yeni adresi 1xbet Türkiye, online bahis şirketi hakkında giriş ve inceleme bilgileri. Onebahis firması için 2020 güncel yeni giriş adresi, ödemeler ve üyelik işlemleri için detaylı bilgiler, 1xbahis sayfamızda yer almakta.
Aslam said…

meal kits Making cooking a little easier. It's hard, it takes time and who's got the time after a long day of work, looking after kids and being on your feet all day ? I bet you don't and neither do I.. making cheap and tasty modern day meal kits the new normal among all the changes going on in our world today.
Hero said…
Making cooking a little easier. It's hard, it takes time and who's got the time after a long day of work, looking after kids and being on your feet all day ? I bet you don't and neither do I.. making cheap and tasty modern day meal kits the new normal among all the changes going on in our world today. meal kits
Hero said…
less than one dollar web hosting Domain hosting can be hit and miss when it comes to finding it cheap. Don’t get me wrong there are cheap web hosting options, but how about “super cheap and affordable” web hosting. Less than a dollar is “truly” affordable web hosting and this is a chance to get access to web hosting that is consistent and reliable when it comes to affordable web hosting.
Receap said…

We will promote your tracks and give you very good promotion Buy spotify plays
Haider said…
Aslam said…
best new diet pill Authentic Option LLC offers collection of natural herbal products for skincare, hair care, and weight loss. We specialize in thermal weight loss, electrostimulation for muscle toning, cellulite removal, under-eye bags treatment and skincare products. We have an amazing range of beard growing products.
Receap said…
white xanax bars On the other hand, if one is experiencing more chronic and frequent anxiety, they may usually be prescribed Xanax 2mg. This dosage is stronger and helps treat insomnia. This dosage provides relief for 11 hours, making it suitable to use at night in order to enjoy a restful and uninterrupted sleep.
James said…

Reputation Management Reputation Repair Service removes criminal history information and deletes criminal records. Creates positive content that replaces negative search results.
Unknown said…
Addictions facts Addiction stands as the top public health problem in America outstanding all other major diseases including stroke, heart diseases and even cancer. The population of addicts is far larger than the patients suffering from the three mentioned diseases in America with sufferers ranging in millions.
Haider said…
Crunchyroll Crunchyroll is a dedicated anime streaming service that uploads over 30,000 episodes of top-rated anime episodes to subscribe members to it. Crunchyroll offers a comprehensive selection of high-quality dubbed anime series available for viewing no matter what time of day or night. All users can enjoy streaming live anime trailers, latest episodes, and popular anime show in the Crunchyroll catalog.
SEOM2 said…
Organic Smart Cart Are you thinking that it would be better if a vape pen had in your hand? If you are; then take a deep breath and be cool. Keep reading this article till the end to get all information about a vape store near you. As you know that smoking hurts your health especially it is too dangerous for your lung. But the Vape Store is here to give you something better solution.
Unknown said…
British shorthair for sale We have been branded as the best cattery for breeding healthy kittens and puppies ready for a home.
Aslam said…
canim sohbet Android Dear ChatCanım chat is growing day by day with the android chat service it has given to you and serves you, dear chat lovers, free of charge. You can connect and chat online at any time of the day with your smart devices on our chat site. Anonymous chat is a free chat site that allows you to chat randomly and does not charge any fee or money from our valued chat users.
James said…
legit online casinos that pay real money Compare the best legit online casinos that pay real money including the best crypto casinos, best mobile casinos and the best online casinos in 2021
Hero said…
SEO Packages India We offer the best SEO packages across the world. We are the best SEO Company and we dare you to beat us
wdm said…
"Widest Digital Media is Delhi Based Digital Marketing Company, Serving all over the globe Since 2014. our Headquarter is in Laxmi Nagar Delhi, & other offices are in 3 More Locations. we have team of experts in software design & development, Digital marketing & Mobile Apps Solutions OUR SERVICES: 1. Enterprise software development 2. Mobile app development 3. Software development 4. website Design 5. Web Development 6. Search Engine Optimization 7. Search Engine Marketing 8. Facebook Advertisement 9. WordPress Design & Development 10. CRM Development 11. Logo Design 12. Social Media Marketing & Social Media Management 13. Personal Reputation Management 14. Ecommerce Website Design & Development"
Haider said…
buy saxenda online we focus on developing clients and improvement in healthcare. Our leading solutions include a predictive and action-oriented business intelligence platform, fully integrated retail, specialty and outpatient pharmacy solutions, and much more. Our products and services are designed to help drive operational results for our customers while improving outcomes for patients.
Aslam said…
motherhood CO.MOM is a fun new online magazine and social network community created by moms for moms. Read interesting articles, get advice from our agony aunt, aunt\y anne, learn how to earn an income online with our guru debbie or you can even seek medical advice from our resident physician dr samantha and relax while checking out the latest horoscopes from our trained mystic. Theres even a thriving forum community where moms of the world can get together and enjoy good conversation along with lots of other fun ways to kill some time with a cuppa when taking a break from being super mom at
Haider said…
polyuria As a worldwide leader in industrial coatings and spray-on truck bed liners, ArmorThane offers a full line of top-quality polyurethane and polyurea coatings and high-tech spraying equipment and supplies. Our professionally applied pure and hybrid polyurethane and polyurea formulas are extremely durable, flexible and safe.
Get office for rent in Dubai With Ejari. Spider Business Center provide fully furnished & Cheap 200 sqft office space for rent in Dubai's Sheikh Zayed Road.
Haider said…
polyurea As a worldwide leader in industrial coatings and spray-on truck bed liners, ArmorThane offers a full line of top-quality polyurethane and polyurea coatings and high-tech spraying equipment and supplies. Our professionally applied pure and hybrid polyurethane and polyurea formulas are extremely durable, flexible and safe.
Want to Do New Company Setup in Dubai? Contact UAE #1 Company Setup Consultants for business setup services and company formation in Dubai.
Najaf Qureshi said…
I just visit your website and I found it very informative. Please share more content just like that. I want to read more content so please upload more articles. Thanks in advanced.

Packaging Host

Die Cut Stickers

Static Cling

Cheap Latest Products

Property Saga

Lahore Smart City

Nova City Islamabad

Park View City Islamabad

Al Noor Orchard Lahore
Chosen One said…

Totally loved your article. Looking forward to see more more from you. Meanwhile feel free to surf through my website while i give your blog a read.
welcome to Newsome frenchies
where to buy french bulldog puppies
frenchies bulldog puppies
in Australia

Nice & Informative Blog ! We offer welcome to Mila bulldogs. Check it out!...
puppies for sale near me
British bulldog puppies for sale
where to buy

Popular posts from this blog

Use WinMerge for compare / merge in StarTeam