summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo.khan <mo.khan@a0a4a051-f042-0410-9e78-9fae330bdb64>2008-01-05 05:07:34 +0000
committermo.khan <mo.khan@a0a4a051-f042-0410-9e78-9fae330bdb64>2008-01-05 05:07:34 +0000
commitd5d25c233470ca848178c560ee9ef0e4b5a4cb37 (patch)
treef4473101d771f7a2dc99efaf0c0c6e4b55e843f6
parentf6dc97408239620a485d2ad16304fb375c205a38 (diff)
git-svn-id: http://mokhan.googlecode.com/svn/trunk@6 a0a4a051-f042-0410-9e78-9fae330bdb64
-rw-r--r--CreateReceipt/CreateReceipt.sln20
-rw-r--r--CreateReceipt/CreateReceipt/CreateReceipt.csproj53
-rw-r--r--CreateReceipt/CreateReceipt/MonerisParameters.cs22
-rw-r--r--CreateReceipt/CreateReceipt/Program.cs58
-rw-r--r--CreateReceipt/CreateReceipt/Properties/AssemblyInfo.cs35
-rw-r--r--CreateReceipt/CreateReceipt/XMLFile1.xml8
6 files changed, 196 insertions, 0 deletions
diff --git a/CreateReceipt/CreateReceipt.sln b/CreateReceipt/CreateReceipt.sln
new file mode 100644
index 0000000..7be4656
--- /dev/null
+++ b/CreateReceipt/CreateReceipt.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CreateReceipt", "CreateReceipt\CreateReceipt.csproj", "{DD726672-57D1-42CC-B8F9-D5B1D91ACA59}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {DD726672-57D1-42CC-B8F9-D5B1D91ACA59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DD726672-57D1-42CC-B8F9-D5B1D91ACA59}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DD726672-57D1-42CC-B8F9-D5B1D91ACA59}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DD726672-57D1-42CC-B8F9-D5B1D91ACA59}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/CreateReceipt/CreateReceipt/CreateReceipt.csproj b/CreateReceipt/CreateReceipt/CreateReceipt.csproj
new file mode 100644
index 0000000..e9a1944
--- /dev/null
+++ b/CreateReceipt/CreateReceipt/CreateReceipt.csproj
@@ -0,0 +1,53 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{DD726672-57D1-42CC-B8F9-D5B1D91ACA59}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>CreateReceipt</RootNamespace>
+ <AssemblyName>CreateReceipt</AssemblyName>
+ <StartupObject>
+ </StartupObject>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Program.cs" />
+ <Compile Include="MonerisParameters.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="XMLFile1.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project> \ No newline at end of file
diff --git a/CreateReceipt/CreateReceipt/MonerisParameters.cs b/CreateReceipt/CreateReceipt/MonerisParameters.cs
new file mode 100644
index 0000000..587f75f
--- /dev/null
+++ b/CreateReceipt/CreateReceipt/MonerisParameters.cs
@@ -0,0 +1,22 @@
+/*
+ * Created by: Mo Khan
+ * Created: Thursday, June 07, 2007
+ */
+
+using System;
+
+namespace CreateReceipt
+{
+ public class MonerisParameters
+ {
+ public const String Amount = "charge_total";
+ public const String TransactionType = "trans_name";
+ public const String Date = "date_stamp";
+ public const String Time = "time_stamp";
+ public const String AuthorizationCode = "bank_approval_code";
+ public const String ResponseCode = "response_code";
+ public const String IsoCode = "iso_code";
+ public const String ResponseMessage = "message";
+ public const String ReferenceNumber = "bank_transaction_id";
+ }
+} \ No newline at end of file
diff --git a/CreateReceipt/CreateReceipt/Program.cs b/CreateReceipt/CreateReceipt/Program.cs
new file mode 100644
index 0000000..6a833e2
--- /dev/null
+++ b/CreateReceipt/CreateReceipt/Program.cs
@@ -0,0 +1,58 @@
+using System;
+using System.IO;
+using System.Net;
+using System.Text;
+
+namespace CreateReceipt {
+ public class Program {
+ [STAThread]
+ public static void Main( ) {
+ //"http://cams.bcforestsafe.org/Payment_Receipt.aspx"
+ WebRequest request = WebRequest.Create( ConstructUrl( "http://localhost:1916/Payment_Receipt.aspx" ) );
+ //WebRequest request = WebRequest.Create( ConstructUrl( "http://cams.bcforestsafe.org/Payment_Receipt.aspx" ) );
+
+ WebResponse response = request.GetResponse( );
+ Console.WriteLine( ( ( HttpWebResponse )response ).StatusDescription );
+ Stream dataStream = response.GetResponseStream( );
+ StreamReader reader = new StreamReader( dataStream );
+ string responseFromServer = reader.ReadToEnd( );
+ Console.WriteLine( responseFromServer );
+ reader.Close( );
+ response.Close( );
+
+ using( StreamWriter writer = File.CreateText( Path.Combine( Environment.CurrentDirectory, "MyFakeReceipt.html" ) ) ) {
+ writer.Write( responseFromServer );
+ }
+ }
+
+ private static String ConstructUrl( String pagePath ) {
+ StringBuilder builder = new StringBuilder( );
+ builder.Append( pagePath );
+ builder.Append( "?IsPrintReceiptAgain=0" );
+ builder.Append( "&" + MonerisParameters.Amount + "=100,000.00" );
+ builder.Append( "&" + MonerisParameters.TransactionType + "=N/A" );
+ builder.Append( "&" + MonerisParameters.Date + "=" + DateTime.Now.Date.ToShortDateString( ) );
+ builder.Append( "&" + MonerisParameters.Time + "=" + DateTime.Now.TimeOfDay );
+ builder.Append( "&" + MonerisParameters.ResponseMessage + "=Congratulations on your fake purchase!" );
+ builder.Append( "&" + MonerisParameters.AuthorizationCode + "=N/A" );
+ builder.Append( "&" + MonerisParameters.ResponseCode + "=N/A" );
+ builder.Append( "&" + MonerisParameters.IsoCode + "=N/A" );
+ builder.Append( "&" + MonerisParameters.ReferenceNumber + "=N/A" );
+ builder.Append( "&rvarClientID=211" );
+
+ return builder.ToString( );
+ }
+
+ public class MonerisParameters {
+ public const String Amount = "charge_total";
+ public const String TransactionType = "trans_name";
+ public const String Date = "date_stamp";
+ public const String Time = "time_stamp";
+ public const String AuthorizationCode = "bank_approval_code";
+ public const String ResponseCode = "response_code";
+ public const String IsoCode = "iso_code";
+ public const String ResponseMessage = "message";
+ public const String ReferenceNumber = "bank_transaction_id";
+ }
+ }
+} \ No newline at end of file
diff --git a/CreateReceipt/CreateReceipt/Properties/AssemblyInfo.cs b/CreateReceipt/CreateReceipt/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..aef594d
--- /dev/null
+++ b/CreateReceipt/CreateReceipt/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle( "CreateReceipt" )]
+[assembly: AssemblyDescription( "" )]
+[assembly: AssemblyConfiguration( "" )]
+[assembly: AssemblyCompany( "" )]
+[assembly: AssemblyProduct( "CreateReceipt" )]
+[assembly: AssemblyCopyright( "Copyright © 2007" )]
+[assembly: AssemblyTrademark( "" )]
+[assembly: AssemblyCulture( "" )]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible( false )]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid( "6e54b033-3d13-47ae-b900-791f5bfdb1bd" )]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion( "1.0.0.0" )]
+[assembly: AssemblyFileVersion( "1.0.0.0" )]
diff --git a/CreateReceipt/CreateReceipt/XMLFile1.xml b/CreateReceipt/CreateReceipt/XMLFile1.xml
new file mode 100644
index 0000000..9de989e
--- /dev/null
+++ b/CreateReceipt/CreateReceipt/XMLFile1.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<form method="POST" action="https://esqa.moneris.com/HPPDP/index.php">
+ <input type="HIDDEN" name="ps_store_id" VALUE="AF4Fs1024" />
+ <input type="HIDDEN" name="hpp_key" VALUE="Hsjh4GSr4g" />
+ <input type="HIDDEN" name="charge_total" VALUE="1.00" />
+ <!-- MORE OPTIONAL VARIABLES CAN BE DEFINED HERE -->
+ <input type="SUBMIT" name="SUBMIT" value="Click to proceed to Secure Page" />
+</form> \ No newline at end of file