forked from AuthorizeNet/sdk-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDefault.aspx.cs
22 lines (19 loc) · 979 Bytes
/
Default.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using System;
using System.Configuration;
using CoffeeShopWebApp.Model;
namespace CoffeeShopWebApp {
public partial class Default : System.Web.UI.Page {
protected void Page_Load(object sender, EventArgs e) {
string apiLogin = ConfigurationManager.AppSettings["ApiLogin"];
string transactionKey = ConfigurationManager.AppSettings["TransactionKey"];
if ((string.IsNullOrEmpty(apiLogin)) || (apiLogin.Trim().Length == 0) || (apiLogin == "ApiLogin")
|| (string.IsNullOrEmpty(transactionKey)) || (transactionKey.Trim().Length == 0) || (transactionKey == "TransactionKey"))
{
CoffeeOrder order = new CoffeeOrder("");
order.OrderMessage = "Please replace the ApiLogin and TransactionKey values in Web.config file with your Authorize.Net account!";
Session["order"] = order;
Response.Redirect("Error.aspx");
}
}
}
}