Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

refactorings for readability / documentation of code

  • Loading branch information...
commit 92afaecdd052e3e5bbe64f1b9710cf66f1d5409f 1 parent ed9011f
@timiles timiles authored
View
360 GoCardlessSdk.Net2.Tests/GoCardlessSdk.Net2.Tests.csproj
@@ -1,185 +1,189 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{0B2DECE8-E280-4578-A6CD-78D98507BB0F}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>GoCardlessSdk.Net2.Tests</RootNamespace>
- <AssemblyName>GoCardlessSdk.Net2.Tests</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <TargetFrameworkProfile />
- </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="FiddlerCore">
- <HintPath>..\GoCardlessSdk.Tests\libs\FiddlerCoreAPI\FiddlerCore.dll</HintPath>
- </Reference>
- <Reference Include="Newtonsoft.Json">
- <HintPath>..\packages\Newtonsoft.Json.4.5.1\lib\net20\Newtonsoft.Json.dll</HintPath>
- </Reference>
- <Reference Include="nunit.framework">
- <HintPath>..\packages\NUnit.2.6.0.12054\lib\nunit.framework.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="..\GoCardlessSdk.Tests\Api\CancelPreAuthorizationTests.cs">
- <Link>Api\CancelPreAuthorizationTests.cs</Link>
- </Compile>
- <Compile Include="..\GoCardlessSdk.Tests\Api\CancelSubscriptionTests.cs">
- <Link>Api\CancelSubscriptionTests.cs</Link>
- </Compile>
- <Compile Include="..\GoCardlessSdk.Tests\Api\DeepAssertHelper.cs">
- <Link>Api\DeepAssertHelper.cs</Link>
- </Compile>
- <Compile Include="..\GoCardlessSdk.Tests\Api\DisposableEventHandler.cs">
- <Link>Api\DisposableEventHandler.cs</Link>
- </Compile>
- <Compile Include="..\GoCardlessSdk.Tests\Api\FiddlerSetupFixture.cs">
- <Link>Api\FiddlerSetupFixture.cs</Link>
- </Compile>
- <Compile Include="..\GoCardlessSdk.Tests\Api\GetBillTests.cs">
- <Link>Api\GetBillTests.cs</Link>
- </Compile>
- <Compile Include="..\GoCardlessSdk.Tests\Api\GetErrorTests.cs">
- <Link>Api\GetErrorTests.cs</Link>
- </Compile>
- <Compile Include="..\GoCardlessSdk.Tests\Api\GetMerchantBillTests.cs">
- <Link>Api\GetMerchantBillTests.cs</Link>
- </Compile>
- <Compile Include="..\GoCardlessSdk.Tests\Api\GetMerchantPreAuthorizationsTests.cs">
- <Link>Api\GetMerchantPreAuthorizationsTests.cs</Link>
- </Compile>
- <Compile Include="..\GoCardlessSdk.Tests\Api\GetMerchantSubscriptionsTests.cs">
- <Link>Api\GetMerchantSubscriptionsTests.cs</Link>
- </Compile>
- <Compile Include="..\GoCardlessSdk.Tests\Api\GetMerchantTests.cs">
- <Link>Api\GetMerchantTests.cs</Link>
- </Compile>
- <Compile Include="..\GoCardlessSdk.Tests\Api\GetMerchantUsersTests.cs">
- <Link>Api\GetMerchantUsersTests.cs</Link>
- </Compile>
- <Compile Include="..\GoCardlessSdk.Tests\Api\GetPreAuthorizationTests.cs">
- <Link>Api\GetPreAuthorizationTests.cs</Link>
- </Compile>
- <Compile Include="..\GoCardlessSdk.Tests\Api\GetSubscriptionTests.cs">
- <Link>Api\GetSubscriptionTests.cs</Link>
- </Compile>
- <Compile Include="..\GoCardlessSdk.Tests\Api\PostBillTests.cs">
- <Link>Api\PostBillTests.cs</Link>
- </Compile>
- <Compile Include="..\GoCardlessSdk.Tests\Connect\ConnectTests.cs">
- <Link>Connect\ConnectTests.cs</Link>
- </Compile>
- <Compile Include="..\GoCardlessSdk.Tests\Helpers\UtilsTests.cs">
- <Link>Helpers\UtilsTests.cs</Link>
- </Compile>
- <Compile Include="..\GoCardlessSdk.Tests\WebHooks\WebHooksTests.cs">
- <Link>WebHooks\WebHooksTests.cs</Link>
- </Compile>
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <None Include="packages.config" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\GoCardlessSdk.Net2\GoCardlessSdk.Net2.csproj">
- <Project>{C8AA0C78-ED08-4912-ABB5-921661A8E9C5}</Project>
- <Name>GoCardlessSdk.Net2</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup />
- <ItemGroup>
- <Content Include="..\GoCardlessSdk.Tests\Api\Data\GET gocardless.com_api_v1_bills_213.txt">
- <Link>Api\Data\GET gocardless.com_api_v1_bills_213.txt</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\GoCardlessSdk.Tests\Api\Data\GET gocardless.com_api_v1_bills_VZUG2SC3PRT5EM.txt">
- <Link>Api\Data\GET gocardless.com_api_v1_bills_VZUG2SC3PRT5EM.txt</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\GoCardlessSdk.Tests\Api\Data\GET gocardless.com_api_v1_merchants_WOQRUJU9OH2HH1.txt">
- <Link>Api\Data\GET gocardless.com_api_v1_merchants_WOQRUJU9OH2HH1.txt</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\GoCardlessSdk.Tests\Api\Data\GET gocardless.com_api_v1_merchants_WOQRUJU9OH2HH1_bills.txt">
- <Link>Api\Data\GET gocardless.com_api_v1_merchants_WOQRUJU9OH2HH1_bills.txt</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\GoCardlessSdk.Tests\Api\Data\GET gocardless.com_api_v1_merchants_WOQRUJU9OH2HH1_pre_authorizations.txt">
- <Link>Api\Data\GET gocardless.com_api_v1_merchants_WOQRUJU9OH2HH1_pre_authorizations.txt</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\GoCardlessSdk.Tests\Api\Data\GET gocardless.com_api_v1_merchants_WOQRUJU9OH2HH1_subscriptions.txt">
- <Link>Api\Data\GET gocardless.com_api_v1_merchants_WOQRUJU9OH2HH1_subscriptions.txt</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\GoCardlessSdk.Tests\Api\Data\GET gocardless.com_api_v1_merchants_WOQRUJU9OH2HH1_users.txt">
- <Link>Api\Data\GET gocardless.com_api_v1_merchants_WOQRUJU9OH2HH1_users.txt</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\GoCardlessSdk.Tests\Api\Data\GET gocardless.com_api_v1_pre_authorizations_1234JKH8KLJ.txt">
- <Link>Api\Data\GET gocardless.com_api_v1_pre_authorizations_1234JKH8KLJ.txt</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\GoCardlessSdk.Tests\Api\Data\GET gocardless.com_api_v1_subscriptions_AJKH638A99.txt">
- <Link>Api\Data\GET gocardless.com_api_v1_subscriptions_AJKH638A99.txt</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\GoCardlessSdk.Tests\Api\Data\POST gocardless.com_api_v1_bills.txt">
- <Link>Api\Data\POST gocardless.com_api_v1_bills.txt</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\GoCardlessSdk.Tests\Api\Data\PUT gocardless.com_api_v1_pre_authorizations_1580_cancel.txt">
- <Link>Api\Data\PUT gocardless.com_api_v1_pre_authorizations_1580_cancel.txt</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\GoCardlessSdk.Tests\Api\Data\PUT gocardless.com_api_v1_subscriptions_1580_cancel.txt">
- <Link>Api\Data\PUT gocardless.com_api_v1_subscriptions_1580_cancel.txt</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\GoCardlessSdk.Tests\WebHooks\Data\Bill invalid signature.txt">
- <Link>WebHooks\Data\Bill invalid signature.txt</Link>
- </Content>
- <Content Include="..\GoCardlessSdk.Tests\WebHooks\Data\Bill.txt">
- <Link>WebHooks\Data\Bill.txt</Link>
- </Content>
- <Content Include="..\GoCardlessSdk.Tests\WebHooks\Data\PreAuthorization.txt">
- <Link>WebHooks\Data\PreAuthorization.txt</Link>
- </Content>
- <Content Include="..\GoCardlessSdk.Tests\WebHooks\Data\Subscription.txt">
- <Link>WebHooks\Data\Subscription.txt</Link>
- </Content>
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{0B2DECE8-E280-4578-A6CD-78D98507BB0F}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>GoCardlessSdk.Net2.Tests</RootNamespace>
+ <AssemblyName>GoCardlessSdk.Net2.Tests</AssemblyName>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <TargetFrameworkProfile />
+ </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="FiddlerCore">
+ <HintPath>..\GoCardlessSdk.Tests\libs\FiddlerCoreAPI\FiddlerCore.dll</HintPath>
+ </Reference>
+ <Reference Include="Newtonsoft.Json">
+ <HintPath>..\packages\Newtonsoft.Json.4.5.1\lib\net20\Newtonsoft.Json.dll</HintPath>
+ </Reference>
+ <Reference Include="nunit.framework">
+ <HintPath>..\packages\NUnit.2.6.0.12054\lib\nunit.framework.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="..\GoCardlessSdk.Tests\Api\CancelPreAuthorizationTests.cs">
+ <Link>Api\CancelPreAuthorizationTests.cs</Link>
+ </Compile>
+ <Compile Include="..\GoCardlessSdk.Tests\Api\CancelSubscriptionTests.cs">
+ <Link>Api\CancelSubscriptionTests.cs</Link>
+ </Compile>
+ <Compile Include="..\GoCardlessSdk.Tests\Api\DeepAssertHelper.cs">
+ <Link>Api\DeepAssertHelper.cs</Link>
+ </Compile>
+ <Compile Include="..\GoCardlessSdk.Tests\Api\DisposableEventHandler.cs">
+ <Link>Api\DisposableEventHandler.cs</Link>
+ </Compile>
+ <Compile Include="..\GoCardlessSdk.Tests\Api\FiddlerSetupFixture.cs">
+ <Link>Api\FiddlerSetupFixture.cs</Link>
+ </Compile>
+ <Compile Include="..\GoCardlessSdk.Tests\Api\GetBillTests.cs">
+ <Link>Api\GetBillTests.cs</Link>
+ </Compile>
+ <Compile Include="..\GoCardlessSdk.Tests\Api\GetErrorTests.cs">
+ <Link>Api\GetErrorTests.cs</Link>
+ </Compile>
+ <Compile Include="..\GoCardlessSdk.Tests\Api\GetMerchantBillTests.cs">
+ <Link>Api\GetMerchantBillTests.cs</Link>
+ </Compile>
+ <Compile Include="..\GoCardlessSdk.Tests\Api\GetMerchantPreAuthorizationsTests.cs">
+ <Link>Api\GetMerchantPreAuthorizationsTests.cs</Link>
+ </Compile>
+ <Compile Include="..\GoCardlessSdk.Tests\Api\GetMerchantSubscriptionsTests.cs">
+ <Link>Api\GetMerchantSubscriptionsTests.cs</Link>
+ </Compile>
+ <Compile Include="..\GoCardlessSdk.Tests\Api\GetMerchantTests.cs">
+ <Link>Api\GetMerchantTests.cs</Link>
+ </Compile>
+ <Compile Include="..\GoCardlessSdk.Tests\Api\GetMerchantUsersTests.cs">
+ <Link>Api\GetMerchantUsersTests.cs</Link>
+ </Compile>
+ <Compile Include="..\GoCardlessSdk.Tests\Api\GetPreAuthorizationTests.cs">
+ <Link>Api\GetPreAuthorizationTests.cs</Link>
+ </Compile>
+ <Compile Include="..\GoCardlessSdk.Tests\Api\GetSubscriptionTests.cs">
+ <Link>Api\GetSubscriptionTests.cs</Link>
+ </Compile>
+ <Compile Include="..\GoCardlessSdk.Tests\Api\PostBillTests.cs">
+ <Link>Api\PostBillTests.cs</Link>
+ </Compile>
+ <Compile Include="..\GoCardlessSdk.Tests\Connect\ConnectTests.cs">
+ <Link>Connect\ConnectTests.cs</Link>
+ </Compile>
+ <Compile Include="..\GoCardlessSdk.Tests\Helpers\UtilsTests.cs">
+ <Link>Helpers\UtilsTests.cs</Link>
+ </Compile>
+ <Compile Include="..\GoCardlessSdk.Tests\WebHooks\WebHooksTests.cs">
+ <Link>WebHooks\WebHooksTests.cs</Link>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\GoCardlessSdk.Net2\GoCardlessSdk.Net2.csproj">
+ <Project>{C8AA0C78-ED08-4912-ABB5-921661A8E9C5}</Project>
+ <Name>GoCardlessSdk.Net2</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup />
+ <ItemGroup>
+ <Content Include="..\GoCardlessSdk.Tests\Api\Data\GET gocardless.com_api_v1_bills_213.txt">
+ <Link>Api\Data\GET gocardless.com_api_v1_bills_213.txt</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\GoCardlessSdk.Tests\Api\Data\GET gocardless.com_api_v1_bills_VZUG2SC3PRT5EM.txt">
+ <Link>Api\Data\GET gocardless.com_api_v1_bills_VZUG2SC3PRT5EM.txt</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\GoCardlessSdk.Tests\Api\Data\GET gocardless.com_api_v1_merchants_WOQRUJU9OH2HH1.txt">
+ <Link>Api\Data\GET gocardless.com_api_v1_merchants_WOQRUJU9OH2HH1.txt</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\GoCardlessSdk.Tests\Api\Data\GET gocardless.com_api_v1_merchants_WOQRUJU9OH2HH1_bills.txt">
+ <Link>Api\Data\GET gocardless.com_api_v1_merchants_WOQRUJU9OH2HH1_bills.txt</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\GoCardlessSdk.Tests\Api\Data\GET gocardless.com_api_v1_merchants_WOQRUJU9OH2HH1_pre_authorizations.txt">
+ <Link>Api\Data\GET gocardless.com_api_v1_merchants_WOQRUJU9OH2HH1_pre_authorizations.txt</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\GoCardlessSdk.Tests\Api\Data\GET gocardless.com_api_v1_merchants_WOQRUJU9OH2HH1_subscriptions.txt">
+ <Link>Api\Data\GET gocardless.com_api_v1_merchants_WOQRUJU9OH2HH1_subscriptions.txt</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\GoCardlessSdk.Tests\Api\Data\GET gocardless.com_api_v1_merchants_WOQRUJU9OH2HH1_users.txt">
+ <Link>Api\Data\GET gocardless.com_api_v1_merchants_WOQRUJU9OH2HH1_users.txt</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\GoCardlessSdk.Tests\Api\Data\GET gocardless.com_api_v1_pre_authorizations_1234JKH8KLJ.txt">
+ <Link>Api\Data\GET gocardless.com_api_v1_pre_authorizations_1234JKH8KLJ.txt</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\GoCardlessSdk.Tests\Api\Data\GET gocardless.com_api_v1_subscriptions_AJKH638A99.txt">
+ <Link>Api\Data\GET gocardless.com_api_v1_subscriptions_AJKH638A99.txt</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\GoCardlessSdk.Tests\Api\Data\POST gocardless.com_api_v1_bills.txt">
+ <Link>Api\Data\POST gocardless.com_api_v1_bills.txt</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\GoCardlessSdk.Tests\Api\Data\PUT gocardless.com_api_v1_pre_authorizations_1580_cancel.txt">
+ <Link>Api\Data\PUT gocardless.com_api_v1_pre_authorizations_1580_cancel.txt</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\GoCardlessSdk.Tests\Api\Data\PUT gocardless.com_api_v1_subscriptions_1580_cancel.txt">
+ <Link>Api\Data\PUT gocardless.com_api_v1_subscriptions_1580_cancel.txt</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\GoCardlessSdk.Tests\WebHooks\Data\Bill invalid signature.txt">
+ <Link>WebHooks\Data\Bill invalid signature.txt</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\GoCardlessSdk.Tests\WebHooks\Data\Bill.txt">
+ <Link>WebHooks\Data\Bill.txt</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\GoCardlessSdk.Tests\WebHooks\Data\PreAuthorization.txt">
+ <Link>WebHooks\Data\PreAuthorization.txt</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\GoCardlessSdk.Tests\WebHooks\Data\Subscription.txt">
+ <Link>WebHooks\Data\Subscription.txt</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\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>
View
207 GoCardlessSdk.Tests/Connect/ConnectTests.cs
@@ -9,179 +9,150 @@ public class ConnectTests
[Test]
public void NewBillUrl_ExcOptionalParams_GeneratesCorrectUrl()
{
- var @params = new BillRequest
- {
- Amount = 15m,
- MerchantId = "0190G74E3J",
- };
+ var request = new BillRequest("0190G74E3J", 15m);
GoCardless.Environment = GoCardless.Environments.Sandbox;
GoCardless.AccountDetails.AppId = "test_id";
GoCardless.AccountDetails.AppSecret = "test_secret";
GoCardless.GenerateNonce = () => "Q9gMPVBZixfRiQ9VnRdDyrrMiskqT0ox8IT+HO3ReWMxavlco0Fw8rva+ZcI";
GoCardless.GetUtcNow = () => new DateTimeOffset(new DateTime(2012, 03, 21, 08, 55, 56));
- var url = ConnectClient.NewBillUrl(@params);
+ var url = GoCardless.Connect.NewBillUrl(request);
var expected =
"https://sandbox.gocardless.com/connect/bills/new?bill%5Bamount%5D=15.00&bill%5Bmerchant_id%5D=0190G74E3J&client_id=test_id&nonce=Q9gMPVBZixfRiQ9VnRdDyrrMiskqT0ox8IT%2BHO3ReWMxavlco0Fw8rva%2BZcI&signature=bab27ff9111e292286d207e68722a00a3d8a36d1cf69fb4d094b4443998283b1&timestamp=2012-03-21T08%3A55%3A56Z";
Assert.AreEqual(expected, url);
}
[Test]
- public void NewBillUrl_IncOptionalParams_GeneratesCorrectUrl()
- {
- var @params = new BillRequest
- {
- Amount = 15m,
- MerchantId = "0190G74E3J",
-
- Name = "Premium Account",
- Description = "Test payment",
- User = new UserRequest
- {
- Name = "John Smith",
- FirstName = "John",
- LastName = "Smith",
- Email = "john.smith@example.com",
- BillingAddress1 = "Flat 1",
- BillingAddress2 = "100 Main Street",
- BillingTown = "Townville",
- BillingCounty = "Countyshire",
- BillingPostcode = "N1 1AB",
- }
- };
+ public void NewBillUrl_IncOptionalParams_GeneratesCorrectUrl()
+ {
+ var request = new BillRequest("0190G74E3J", 15m)
+ {
+ Name = "Premium Account",
+ Description = "Test payment",
+ User = new UserRequest
+ {
+ Name = "John Smith",
+ FirstName = "John",
+ LastName = "Smith",
+ Email = "john.smith@example.com",
+ BillingAddress1 = "Flat 1",
+ BillingAddress2 = "100 Main Street",
+ BillingTown = "Townville",
+ BillingCounty = "Countyshire",
+ BillingPostcode = "N1 1AB",
+ }
+ };
GoCardless.Environment = GoCardless.Environments.Sandbox;
GoCardless.AccountDetails.AppId = "test_id";
GoCardless.AccountDetails.AppSecret = "test_secret";
GoCardless.GenerateNonce = () => "Q9gMPVBZixfRiQ9VnRdDyrrMiskqT0ox8IT+HO3ReWMxavlco0Fw8rva+ZcI";
- GoCardless.GetUtcNow = () => new DateTimeOffset(new DateTime(2012, 03, 21, 08, 55, 56));
-
- var url = ConnectClient.NewBillUrl(@params);
+ GoCardless.GetUtcNow = () => new DateTimeOffset(new DateTime(2012, 03, 21, 08, 55, 56));
+
+ var url = GoCardless.Connect.NewBillUrl(request);
var expected =
- "https://sandbox.gocardless.com/connect/bills/new?bill%5Bamount%5D=15.00&bill%5Bdescription%5D=Test%20payment&bill%5Bmerchant_id%5D=0190G74E3J&bill%5Bname%5D=Premium%20Account&bill%5Buser%5D%5Bbilling_address1%5D=Flat%201&bill%5Buser%5D%5Bbilling_address2%5D=100%20Main%20Street&bill%5Buser%5D%5Bbilling_county%5D=Countyshire&bill%5Buser%5D%5Bbilling_postcode%5D=AB12%203CD&bill%5Buser%5D%5Bbilling_town%5D=Townville&bill%5Buser%5D%5Bemail%5D=john.smith%40example.com&bill%5Buser%5D%5Bfirst_name%5D=John&bill%5Buser%5D%5Blast_name%5D=Smith&bill%5Buser%5D%5Bname%5D=John%20Smith&client_id=test_id&nonce=Q9gMPVBZixfRiQ9VnRdDyrrMiskqT0ox8IT%2BHO3ReWMxavlco0Fw8rva%2BZcI&signature=8bff4a2989828bed0e1d2e085326d1f3a65ceed85ee8bbb7e3f512a87bba3e6b&timestamp=2012-03-21T08%3A55%3A56Z";
+ "https://sandbox.gocardless.com/connect/bills/new?bill%5Bamount%5D=15.00&bill%5Bdescription%5D=Test%20payment&bill%5Bmerchant_id%5D=0190G74E3J&bill%5Bname%5D=Premium%20Account&bill%5Buser%5D%5Bbilling_address1%5D=Flat%201&bill%5Buser%5D%5Bbilling_address2%5D=100%20Main%20Street&bill%5Buser%5D%5Bbilling_county%5D=Countyshire&bill%5Buser%5D%5Bbilling_postcode%5D=N1%201AB&bill%5Buser%5D%5Bbilling_town%5D=Townville&bill%5Buser%5D%5Bemail%5D=john.smith%40example.com&bill%5Buser%5D%5Bfirst_name%5D=John&bill%5Buser%5D%5Blast_name%5D=Smith&bill%5Buser%5D%5Bname%5D=John%20Smith&client_id=test_id&nonce=Q9gMPVBZixfRiQ9VnRdDyrrMiskqT0ox8IT%2BHO3ReWMxavlco0Fw8rva%2BZcI&signature=7534d0255bb20d8ca38255c9861431f65ffb1625be9c6d0f338624f3b2c7b9b5&timestamp=2012-03-21T08%3A55%3A56Z";
Assert.AreEqual(expected, url);
}
[Test]
- public void NewPreAuthorizationUrl_ExcOptionalParams_GeneratesCorrectUrl()
- {
- var @params = new PreAuthorizationRequest
- {
- MaxAmount = 15m,
- MerchantId = "0190G74E3J",
- IntervalLength = 1,
- IntervalUnit = "month",
- };
+ public void NewPreAuthorizationUrl_ExcOptionalParams_GeneratesCorrectUrl()
+ {
+ var request = new PreAuthorizationRequest("0190G74E3J", 15m, 1, "month");
GoCardless.Environment = GoCardless.Environments.Sandbox;
GoCardless.AccountDetails.AppId = "test_id";
GoCardless.AccountDetails.AppSecret = "test_secret";
GoCardless.GenerateNonce = () => "Q9gMPVBZixfRiQ9VnRdDyrrMiskqT0ox8IT+HO3ReWMxavlco0Fw8rva+ZcI";
- GoCardless.GetUtcNow = () => new DateTimeOffset(new DateTime(2012, 03, 21, 08, 55, 56));
-
- var url = ConnectClient.NewPreAuthorizationUrl(@params);
+ GoCardless.GetUtcNow = () => new DateTimeOffset(new DateTime(2012, 03, 21, 08, 55, 56));
+
+ var url = GoCardless.Connect.NewPreAuthorizationUrl(request);
var expected =
"https://sandbox.gocardless.com/connect/pre_authorizations/new?client_id=test_id&nonce=Q9gMPVBZixfRiQ9VnRdDyrrMiskqT0ox8IT%2BHO3ReWMxavlco0Fw8rva%2BZcI&pre_authorization%5Binterval_length%5D=1&pre_authorization%5Binterval_unit%5D=month&pre_authorization%5Bmax_amount%5D=15.00&pre_authorization%5Bmerchant_id%5D=0190G74E3J&signature=40792b67ff99a474c2db08b870842bd5b3b82003206e4ab003a69860bbb0a30e&timestamp=2012-03-21T08%3A55%3A56Z";
Assert.AreEqual(expected, url);
}
[Test]
- public void NewPreAuthorizationUrl_IncOptionalParams_GeneratesCorrectUrl()
- {
- var @params = new PreAuthorizationRequest
- {
- MaxAmount = 15m,
- MerchantId = "0190G74E3J",
- IntervalLength = 1,
- IntervalUnit = "month",
-
- ExpiresAt = new DateTimeOffset(new DateTime(2013, 03, 24, 19, 32, 22)),
- Name = "Premium Account",
- Description = "Test preauthorization",
- IntervalCount = 12,
- CalendarIntervals = true,
- User = new UserRequest
- {
- Name = "John Smith",
- FirstName = "John",
- LastName = "Smith",
- Email = "john.smith@example.com",
- BillingAddress1 = "Flat 1",
- BillingAddress2 = "100 Main Street",
- BillingTown = "Townville",
- BillingCounty = "Countyshire",
- BillingPostcode = "N1 1AB",
- }
- };
+ public void NewPreAuthorizationUrl_IncOptionalParams_GeneratesCorrectUrl()
+ {
+ var request = new PreAuthorizationRequest("0190G74E3J", 15m, 1, "month")
+ {
+ ExpiresAt = new DateTimeOffset(new DateTime(2013, 03, 24, 19, 32, 22)),
+ Name = "Premium Account",
+ Description = "Test preauthorization",
+ IntervalCount = 12,
+ CalendarIntervals = true,
+ User = new UserRequest
+ {
+ Name = "John Smith",
+ FirstName = "John",
+ LastName = "Smith",
+ Email = "john.smith@example.com",
+ BillingAddress1 = "Flat 1",
+ BillingAddress2 = "100 Main Street",
+ BillingTown = "Townville",
+ BillingCounty = "Countyshire",
+ BillingPostcode = "N1 1AB",
+ }
+ };
GoCardless.Environment = GoCardless.Environments.Sandbox;
GoCardless.AccountDetails.AppId = "test_id";
GoCardless.AccountDetails.AppSecret = "test_secret";
GoCardless.GenerateNonce = () => "Q9gMPVBZixfRiQ9VnRdDyrrMiskqT0ox8IT+HO3ReWMxavlco0Fw8rva+ZcI";
- GoCardless.GetUtcNow = () => new DateTimeOffset(new DateTime(2012, 03, 21, 08, 55, 56));
-
- var url = ConnectClient.NewPreAuthorizationUrl(@params);
- var expected =
- "https://sandbox.gocardless.com/connect/pre_authorizations/new?client_id=test_id&nonce=Q9gMPVBZixfRiQ9VnRdDyrrMiskqT0ox8IT%2BHO3ReWMxavlco0Fw8rva%2BZcI&pre_authorization%5Bcalendar_intervals%5D=True&pre_authorization%5Bdescription%5D=Test%20preauthorization&pre_authorization%5Bexpires_at%5D=2013-03-24T19%3A32%3A22Z&pre_authorization%5Binterval_count%5D=12&pre_authorization%5Binterval_length%5D=1&pre_authorization%5Binterval_unit%5D=month&pre_authorization%5Bmax_amount%5D=15.00&pre_authorization%5Bmerchant_id%5D=0190G74E3J&pre_authorization%5Bname%5D=Premium%20Account&pre_authorization%5Buser%5D%5Bbilling_address1%5D=Flat%201&pre_authorization%5Buser%5D%5Bbilling_address2%5D=100%20Main%20Street&pre_authorization%5Buser%5D%5Bbilling_county%5D=Countyshire&pre_authorization%5Buser%5D%5Bbilling_postcode%5D=AB12%203CD&pre_authorization%5Buser%5D%5Bbilling_town%5D=Townville&pre_authorization%5Buser%5D%5Bemail%5D=john.smith%40example.com&pre_authorization%5Buser%5D%5Bfirst_name%5D=John&pre_authorization%5Buser%5D%5Blast_name%5D=Smith&pre_authorization%5Buser%5D%5Bname%5D=John%20Smith&signature=ce364a27e77455e32c1c1246bd4306055f8afee41fe28e1bf7b90e9e8f9f88a8&timestamp=2012-03-21T08%3A55%3A56Z";
+ GoCardless.GetUtcNow = () => new DateTimeOffset(new DateTime(2012, 03, 21, 08, 55, 56));
+
+ var url = GoCardless.Connect.NewPreAuthorizationUrl(request);
+ var expected =
+ "https://sandbox.gocardless.com/connect/pre_authorizations/new?client_id=test_id&nonce=Q9gMPVBZixfRiQ9VnRdDyrrMiskqT0ox8IT%2BHO3ReWMxavlco0Fw8rva%2BZcI&pre_authorization%5Bcalendar_intervals%5D=True&pre_authorization%5Bdescription%5D=Test%20preauthorization&pre_authorization%5Bexpires_at%5D=2013-03-24T19%3A32%3A22Z&pre_authorization%5Binterval_count%5D=12&pre_authorization%5Binterval_length%5D=1&pre_authorization%5Binterval_unit%5D=month&pre_authorization%5Bmax_amount%5D=15.00&pre_authorization%5Bmerchant_id%5D=0190G74E3J&pre_authorization%5Bname%5D=Premium%20Account&pre_authorization%5Buser%5D%5Bbilling_address1%5D=Flat%201&pre_authorization%5Buser%5D%5Bbilling_address2%5D=100%20Main%20Street&pre_authorization%5Buser%5D%5Bbilling_county%5D=Countyshire&pre_authorization%5Buser%5D%5Bbilling_postcode%5D=N1%201AB&pre_authorization%5Buser%5D%5Bbilling_town%5D=Townville&pre_authorization%5Buser%5D%5Bemail%5D=john.smith%40example.com&pre_authorization%5Buser%5D%5Bfirst_name%5D=John&pre_authorization%5Buser%5D%5Blast_name%5D=Smith&pre_authorization%5Buser%5D%5Bname%5D=John%20Smith&signature=d28979ca9f0a515b06636777edfaec8c3b80bca6c783517a35ac4ed499a456ff&timestamp=2012-03-21T08%3A55%3A56Z";
Assert.AreEqual(expected, url);
}
[Test]
public void NewSubscriptionUrl_ExcOptionalParams_GeneratesCorrectUrl()
{
- var @params = new SubscriptionRequest
- {
- Amount = 15m,
- MerchantId = "0190G74E3J",
- IntervalLength = 1,
- IntervalUnit = "month",
- };
+ var request = new SubscriptionRequest("0190G74E3J", 15m, 1, "month");
GoCardless.Environment = GoCardless.Environments.Sandbox;
GoCardless.AccountDetails.AppId = "test_id";
GoCardless.AccountDetails.AppSecret = "test_secret";
GoCardless.GenerateNonce = () => "Q9gMPVBZixfRiQ9VnRdDyrrMiskqT0ox8IT+HO3ReWMxavlco0Fw8rva+ZcI";
- GoCardless.GetUtcNow = () => new DateTimeOffset(new DateTime(2012, 03, 21, 08, 55, 56));
-
- var url = ConnectClient.NewSubscriptionUrl(@params);
+ GoCardless.GetUtcNow = () => new DateTimeOffset(new DateTime(2012, 03, 21, 08, 55, 56));
+
+ var url = GoCardless.Connect.NewSubscriptionUrl(request);
var expected =
"https://sandbox.gocardless.com/connect/subscriptions/new?client_id=test_id&nonce=Q9gMPVBZixfRiQ9VnRdDyrrMiskqT0ox8IT%2BHO3ReWMxavlco0Fw8rva%2BZcI&signature=5e17c04a0f7f211f55bba6ba633cb06121eb79c3284a5a1d9ac0ba5d0bce0c80&subscription%5Bamount%5D=15.00&subscription%5Binterval_length%5D=1&subscription%5Binterval_unit%5D=month&subscription%5Bmerchant_id%5D=0190G74E3J&timestamp=2012-03-21T08%3A55%3A56Z";
Assert.AreEqual(expected, url);
}
[Test]
- public void NewSubscriptionUrl_IncOptionalParams_GeneratesCorrectUrl()
- {
- var @params = new SubscriptionRequest
- {
- Amount = 15m,
- MerchantId = "0190G74E3J",
- IntervalLength = 1,
- IntervalUnit = "month",
-
- StartAt = new DateTimeOffset(new DateTime(2012, 03, 24, 19, 32, 22)),
- ExpiresAt = new DateTimeOffset(new DateTime(2013, 03, 24, 19, 32, 22)),
- Name = "Premium Account",
- Description = "test subscription",
- IntervalCount = 12,
- User = new UserRequest
- {
- Name = "John Smith",
- FirstName = "John",
- LastName = "Smith",
- Email = "john.smith@example.com",
- BillingAddress1 = "Flat 1",
- BillingAddress2 = "100 Main Street",
- BillingTown = "Townville",
- BillingCounty = "Countyshire",
- BillingPostcode = "N1 1AB",
- }
- };
+ public void NewSubscriptionUrl_IncOptionalParams_GeneratesCorrectUrl()
+ {
+ var request = new SubscriptionRequest("0190G74E3J", 15m, 1, "month")
+ {
+ StartAt = new DateTimeOffset(new DateTime(2012, 03, 24, 19, 32, 22)),
+ ExpiresAt = new DateTimeOffset(new DateTime(2013, 03, 24, 19, 32, 22)),
+ Name = "Premium Account",
+ Description = "test subscription",
+ IntervalCount = 12,
+ User = new UserRequest
+ {
+ Name = "John Smith",
+ FirstName = "John",
+ LastName = "Smith",
+ Email = "john.smith@example.com",
+ BillingAddress1 = "Flat 1",
+ BillingAddress2 = "100 Main Street",
+ BillingTown = "Townville",
+ BillingCounty = "Countyshire",
+ BillingPostcode = "N1 1AB",
+ }
+ };
GoCardless.Environment = GoCardless.Environments.Sandbox;
GoCardless.AccountDetails.AppId = "test_id";
GoCardless.AccountDetails.AppSecret = "test_secret";
GoCardless.GenerateNonce = () => "Q9gMPVBZixfRiQ9VnRdDyrrMiskqT0ox8IT+HO3ReWMxavlco0Fw8rva+ZcI";
- GoCardless.GetUtcNow = () => new DateTimeOffset(new DateTime(2012, 03, 21, 08, 55, 56));
-
- var url = ConnectClient.NewSubscriptionUrl(@params);
- var expected =
- "https://sandbox.gocardless.com/connect/subscriptions/new?client_id=test_id&nonce=Q9gMPVBZixfRiQ9VnRdDyrrMiskqT0ox8IT%2BHO3ReWMxavlco0Fw8rva%2BZcI&signature=ee2e43caabcec4f3369460a889ff010cc411eda60f9ea9974b5d195175cc14c0&subscription%5Bamount%5D=15.00&subscription%5Bdescription%5D=test%20subscription&subscription%5Bexpires_at%5D=2013-03-24T19%3A32%3A22Z&subscription%5Binterval_count%5D=12&subscription%5Binterval_length%5D=1&subscription%5Binterval_unit%5D=month&subscription%5Bmerchant_id%5D=0190G74E3J&subscription%5Bname%5D=Premium%20Account&subscription%5Bstart_at%5D=2012-03-24T19%3A32%3A22Z&subscription%5Buser%5D%5Bbilling_address1%5D=Flat%201&subscription%5Buser%5D%5Bbilling_address2%5D=100%20Main%20Street&subscription%5Buser%5D%5Bbilling_county%5D=Countyshire&subscription%5Buser%5D%5Bbilling_postcode%5D=AB12%203CD&subscription%5Buser%5D%5Bbilling_town%5D=Townville&subscription%5Buser%5D%5Bemail%5D=john.smith%40example.com&subscription%5Buser%5D%5Bfirst_name%5D=John&subscription%5Buser%5D%5Blast_name%5D=Smith&subscription%5Buser%5D%5Bname%5D=John%20Smith&timestamp=2012-03-21T08%3A55%3A56Z";
+ GoCardless.GetUtcNow = () => new DateTimeOffset(new DateTime(2012, 03, 21, 08, 55, 56));
+
+ var url = GoCardless.Connect.NewSubscriptionUrl(request);
+ var expected =
+ "https://sandbox.gocardless.com/connect/subscriptions/new?client_id=test_id&nonce=Q9gMPVBZixfRiQ9VnRdDyrrMiskqT0ox8IT%2BHO3ReWMxavlco0Fw8rva%2BZcI&signature=7b5a1fe9abc37a21c9cd8b22cd09dfbca9ec3d8d9cd1083796c6a4cbef666984&subscription%5Bamount%5D=15.00&subscription%5Bdescription%5D=test%20subscription&subscription%5Bexpires_at%5D=2013-03-24T19%3A32%3A22Z&subscription%5Binterval_count%5D=12&subscription%5Binterval_length%5D=1&subscription%5Binterval_unit%5D=month&subscription%5Bmerchant_id%5D=0190G74E3J&subscription%5Bname%5D=Premium%20Account&subscription%5Bstart_at%5D=2012-03-24T19%3A32%3A22Z&subscription%5Buser%5D%5Bbilling_address1%5D=Flat%201&subscription%5Buser%5D%5Bbilling_address2%5D=100%20Main%20Street&subscription%5Buser%5D%5Bbilling_county%5D=Countyshire&subscription%5Buser%5D%5Bbilling_postcode%5D=N1%201AB&subscription%5Buser%5D%5Bbilling_town%5D=Townville&subscription%5Buser%5D%5Bemail%5D=john.smith%40example.com&subscription%5Buser%5D%5Bfirst_name%5D=John&subscription%5Buser%5D%5Blast_name%5D=Smith&subscription%5Buser%5D%5Bname%5D=John%20Smith&timestamp=2012-03-21T08%3A55%3A56Z";
Assert.AreEqual(expected, url);
}
}
View
261 GoCardlessSdk.Tests/Helpers/UtilsTests.cs
@@ -1,120 +1,115 @@
-using System;
-using System.Linq;
-using GoCardlessSdk.Connect;
-using GoCardlessSdk.Helpers;
-using GoCardlessSdk.Partners;
-using NUnit.Framework;
-
-namespace GoCardlessSdk.Tests.Helpers
-{
- public class UtilsTests
- {
- [Test]
- public void NonceTest()
- {
- Assert.AreNotEqual(Utils.GenerateNonce(), Utils.GenerateNonce());
- }
-
- [Test]
- public void ToUnderscoreCaseTests()
- {
- Assert.AreEqual("name", "name".ToUnderscoreCase());
- Assert.AreEqual("name", "Name".ToUnderscoreCase());
- Assert.AreEqual("name", "NAME".ToUnderscoreCase());
- Assert.AreEqual("first_name", "FirstName".ToUnderscoreCase());
- Assert.AreEqual("date_of_birth", "DateOfBirth".ToUnderscoreCase());
- }
-
- [Test]
- public void ToHashtableTests()
- {
- var subscription = new SubscriptionRequest
- {
- Amount = 2m,
- MerchantId = "merchant123",
- User = new UserRequest
- {
- FirstName = "Tim",
- Email = "blah@timiles.com"
- }
- };
- var subscriptionHash = subscription.ToHashParams();
- Assert.AreEqual(2m, subscriptionHash["amount"].Single());
- Assert.AreEqual("merchant123", subscriptionHash["merchant_id"].Single());
- Assert.AreEqual("Tim", subscriptionHash["user[first_name]"].Single());
- Assert.AreEqual("blah@timiles.com", subscriptionHash["user[email]"].Single());
-
- var manageMerchant = new ManageMerchantRequest
- {
- Merchant = new Merchant
- {
- Name = "Mike the Merchant",
- BillingAddress1 = "Flat 1",
- BillingAddress2 = "200 High St",
- BillingTown = "Townville",
- BillingCounty = "Countyshire",
- BillingPostcode = "N1 1AB",
- User = new User
- {
- FirstName = "Mike",
- LastName = "Merchant",
- Email = "mike@merchants.com",
- }
- }
- };
- var manageMerchantHash = manageMerchant.ToHashParams();
- Assert.AreEqual("Mike the Merchant", manageMerchantHash["merchant[name]"].Single());
- Assert.AreEqual("Flat 1", manageMerchantHash["merchant[billing_address1]"].Single());
- Assert.AreEqual("200 High St", manageMerchantHash["merchant[billing_address2]"].Single());
- Assert.AreEqual("Townville", manageMerchantHash["merchant[billing_town]"].Single());
- Assert.AreEqual("Countyshire", manageMerchantHash["merchant[billing_county]"].Single());
- Assert.AreEqual("N1 1AB", manageMerchantHash["merchant[billing_postcode]"].Single());
- Assert.AreEqual("Mike", manageMerchantHash["merchant[user][first_name]"].Single());
- Assert.AreEqual("Merchant", manageMerchantHash["merchant[user][last_name]"].Single());
- Assert.AreEqual("mike@merchants.com", manageMerchantHash["merchant[user][email]"].Single());
- }
-
- [Test]
- public void PercentEncodeTests()
- {
- Assert.AreEqual("Tim", "Tim".PercentEncode());
- Assert.AreEqual("Tim%20Iles", "Tim Iles".PercentEncode());
- Assert.AreEqual("%21%40%A3%24%25%5E%26%2A%28%29%2B%3D%5B%5D%7B%7D%3A%27%40%22%23%3F%3C%3E%2C%60%20",
- "!@£$%^&*()+=[]{}:'@\"#?<>,` ".PercentEncode());
- const string allValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~";
- Assert.AreEqual(allValidChars, allValidChars.PercentEncode());
- }
-
- [Test]
- public void ToQueryStringTests()
- {
- Assert.AreEqual("name=Tim", new UserRequest { Name = "Tim" }.ToQueryString());
-
- var subscription = new SubscriptionRequest
- {
- Amount = 2m,
- StartAt =
- new DateTimeOffset(new DateTime(2011, 01, 01, 12, 00, 00)),
- User =
- new UserRequest
- {
- Name = "Tim Iles",
- FirstName = "Tim",
- }
- };
- Assert.AreEqual(
- "amount=2.00&interval_length=0&start_at=2011-01-01T12%3A00%3A00Z&user%5Bfirst_name%5D=Tim&user%5Bname%5D=Tim%20Iles",
- subscription.ToQueryString());
- }
-
- class SignatureTestModel
- {
- public string Foo { get; set; }
- public object[] Example { get; set; }
- }
- [Test]
- public void SignatureTest()
- {
+using System;
+using System.Linq;
+using GoCardlessSdk.Connect;
+using GoCardlessSdk.Helpers;
+using GoCardlessSdk.Partners;
+using NUnit.Framework;
+
+namespace GoCardlessSdk.Tests.Helpers
+{
+ public class UtilsTests
+ {
+ [Test]
+ public void NonceTest()
+ {
+ Assert.AreNotEqual(Utils.GenerateNonce(), Utils.GenerateNonce());
+ }
+
+ [Test]
+ public void ToUnderscoreCaseTests()
+ {
+ Assert.AreEqual("name", "name".ToUnderscoreCase());
+ Assert.AreEqual("name", "Name".ToUnderscoreCase());
+ Assert.AreEqual("name", "NAME".ToUnderscoreCase());
+ Assert.AreEqual("first_name", "FirstName".ToUnderscoreCase());
+ Assert.AreEqual("date_of_birth", "DateOfBirth".ToUnderscoreCase());
+ }
+
+ [Test]
+ public void ToHashtableTests()
+ {
+ var subscription = new SubscriptionRequest("merchant123", 2m, 1, "month")
+ {
+ User = new UserRequest
+ {
+ FirstName = "Tim",
+ Email = "blah@timiles.com"
+ }
+ };
+ var subscriptionHash = subscription.ToHashParams();
+ Assert.AreEqual(2m, subscriptionHash["amount"].Single());
+ Assert.AreEqual("merchant123", subscriptionHash["merchant_id"].Single());
+ Assert.AreEqual("Tim", subscriptionHash["user[first_name]"].Single());
+ Assert.AreEqual("blah@timiles.com", subscriptionHash["user[email]"].Single());
+
+ var manageMerchant = new ManageMerchantRequest
+ {
+ Merchant = new Merchant
+ {
+ Name = "Mike the Merchant",
+ BillingAddress1 = "Flat 1",
+ BillingAddress2 = "200 High St",
+ BillingTown = "Townville",
+ BillingCounty = "Countyshire",
+ BillingPostcode = "N1 1AB",
+ User = new User
+ {
+ FirstName = "Mike",
+ LastName = "Merchant",
+ Email = "mike@merchants.com",
+ }
+ }
+ };
+ var manageMerchantHash = manageMerchant.ToHashParams();
+ Assert.AreEqual("Mike the Merchant", manageMerchantHash["merchant[name]"].Single());
+ Assert.AreEqual("Flat 1", manageMerchantHash["merchant[billing_address1]"].Single());
+ Assert.AreEqual("200 High St", manageMerchantHash["merchant[billing_address2]"].Single());
+ Assert.AreEqual("Townville", manageMerchantHash["merchant[billing_town]"].Single());
+ Assert.AreEqual("Countyshire", manageMerchantHash["merchant[billing_county]"].Single());
+ Assert.AreEqual("N1 1AB", manageMerchantHash["merchant[billing_postcode]"].Single());
+ Assert.AreEqual("Mike", manageMerchantHash["merchant[user][first_name]"].Single());
+ Assert.AreEqual("Merchant", manageMerchantHash["merchant[user][last_name]"].Single());
+ Assert.AreEqual("mike@merchants.com", manageMerchantHash["merchant[user][email]"].Single());
+ }
+
+ [Test]
+ public void PercentEncodeTests()
+ {
+ Assert.AreEqual("Tim", "Tim".PercentEncode());
+ Assert.AreEqual("Tim%20Iles", "Tim Iles".PercentEncode());
+ Assert.AreEqual("%21%40%A3%24%25%5E%26%2A%28%29%2B%3D%5B%5D%7B%7D%3A%27%40%22%23%3F%3C%3E%2C%60%20",
+ "!@£$%^&*()+=[]{}:'@\"#?<>,` ".PercentEncode());
+ const string allValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~";
+ Assert.AreEqual(allValidChars, allValidChars.PercentEncode());
+ }
+
+ [Test]
+ public void ToQueryStringTests()
+ {
+ Assert.AreEqual("name=Bob", new UserRequest {Name = "Bob"}.ToQueryString());
+
+ var subscription = new SubscriptionRequest("merchant123", 2m, 1, "month")
+ {
+ StartAt = new DateTimeOffset(new DateTime(2011, 01, 01, 12, 00, 00)),
+ User = new UserRequest
+ {
+ Name = "John Smith",
+ FirstName = "John",
+ }
+ };
+ Assert.AreEqual(
+ "amount=2.00&interval_length=1&interval_unit=month&merchant_id=merchant123&start_at=2011-01-01T12%3A00%3A00Z&user%5Bfirst_name%5D=John&user%5Bname%5D=John%20Smith",
+ subscription.ToQueryString());
+ }
+
+ class SignatureTestModel
+ {
+ public string Foo { get; set; }
+ public object[] Example { get; set; }
+ }
+ [Test]
+ public void SignatureTest()
+ {
/* from API docs: (https://gocardless.com/docs/signature_guide#constructing-the-parameter-array)
* irb(main):002:0> to_query(data)
* => "example%5B%5D=1&example%5B%5D=a&foo=bar"
@@ -122,19 +117,19 @@ public void SignatureTest()
* => "5PUZmVMmukNwiHc7V/TJvFHRQZWZumIpCnfZKrVYGpuAdkCcEfv3LIDSrsJ+xOVH"
* irb(main):004:0> signature(data, secret)
* => "5a9447aef2ebd0e12d80d80c836858c6f9c13219f615ef5d135da408bcad453d"
- */
-
- var model = new SignatureTestModel
- {
- Foo = "bar",
- Example = new object[] {1, 'a'}
- };
- var hash = model.ToHashParams();
- Assert.AreEqual("example%5B%5D=1&example%5B%5D=a&foo=bar", hash.ToQueryString());
-
- const string secret = "5PUZmVMmukNwiHc7V/TJvFHRQZWZumIpCnfZKrVYGpuAdkCcEfv3LIDSrsJ+xOVH";
- Assert.AreEqual("5a9447aef2ebd0e12d80d80c836858c6f9c13219f615ef5d135da408bcad453d",
- Utils.GetSignatureForParams(hash, secret));
- }
- }
-}
+ */
+
+ var model = new SignatureTestModel
+ {
+ Foo = "bar",
+ Example = new object[] { 1, 'a' }
+ };
+ var hash = model.ToHashParams();
+ Assert.AreEqual("example%5B%5D=1&example%5B%5D=a&foo=bar", hash.ToQueryString());
+
+ const string secret = "5PUZmVMmukNwiHc7V/TJvFHRQZWZumIpCnfZKrVYGpuAdkCcEfv3LIDSrsJ+xOVH";
+ Assert.AreEqual("5a9447aef2ebd0e12d80d80c836858c6f9c13219f615ef5d135da408bcad453d",
+ Utils.GetSignatureForParams(hash, secret));
+ }
+ }
+}
View
9 GoCardlessSdk/Connect/BillRequest.cs
@@ -1,9 +1,16 @@
namespace GoCardlessSdk.Connect
{
public class BillRequest
- {
+ {
+ public BillRequest(string merchantId, decimal amount)
+ {
+ Amount = amount;
+ MerchantId = merchantId;
+ }
+
public decimal Amount { get; set; }
public string MerchantId { get; set; }
+
public string Name { get; set; }
public string Description { get; set; }
public UserRequest User { get; set; }
View
361 GoCardlessSdk/Connect/ConnectClient.cs
@@ -1,184 +1,189 @@
-using System;
-using System.Collections.Specialized;
-using System.Net;
-using GoCardlessSdk.Api;
-using GoCardlessSdk.Helpers;
-using Newtonsoft.Json;
-using RestSharp;
-
-namespace GoCardlessSdk.Connect
-{
- public class ConnectClient
- {
- /// <summary>
- /// Add a signature to a Hash of parameters. The signature will be generated
- /// from the app secret and the provided parameters, and should be used
- /// whenever signed data needs to be sent to GoCardless (e.g. when creating
- /// a new subscription). The signature will be added to the hash under the
- /// key +:signature+.
- /// </summary>
- /// <param name="params">params the parameters to sign</param>
- /// <returns>the parameters with the new +:signature+ key</returns>
- private static Utils.HashParams SignParams(Utils.HashParams @params)
- {
- var signature = Utils.GetSignatureForParams(@params, GoCardless.AccountDetails.AppSecret);
- @params.Add("signature", signature);
- return @params;
- }
-
-
- /// <summary>
- /// Generate the URL for creating a limit of type +type+, including the
- /// provided params, nonce, timestamp and signature
- /// </summary>
- /// <param name="type">type the limit type (+:subscription+, etc)</param>
- /// <param name="params">params the parameters</param>
- /// <returns>the generated URL</returns>
- private static string NewLimitUrl(string type, object @params,
- string redirectUri = null, string cancelUri = null, string state = null)
- {
+using System;
+using System.Collections.Specialized;
+using System.Net;
+using GoCardlessSdk.Api;
+using GoCardlessSdk.Helpers;
+using Newtonsoft.Json;
+using RestSharp;
+
+namespace GoCardlessSdk.Connect
+{
+ public class ConnectClient
+ {
+ /// <summary>
+ /// Add a signature to a Hash of parameters. The signature will be generated
+ /// from the app secret and the provided parameters, and should be used
+ /// whenever signed data needs to be sent to GoCardless (e.g. when creating
+ /// a new subscription). The signature will be added to the hash under the
+ /// key signature.
+ /// </summary>
+ /// <param name="params">the parameters to sign</param>
+ /// <returns>the parameters with the new signature key</returns>
+ private static Utils.HashParams SignParams(Utils.HashParams @params)
+ {
+ var signature = Utils.GetSignatureForParams(@params, GoCardless.AccountDetails.AppSecret);
+ @params.Add("signature", signature);
+ return @params;
+ }
+
+
+ /// <summary>
+ /// Generate the URL for creating a limit, including the
+ /// provided params, nonce, timestamp and signature
+ /// </summary>
+ /// <param name="type">the limit type (subscription, etc)</param>
+ /// <param name="requestResource">the request values</param>
+ /// <param name="redirectUri">optional override URI on success</param>
+ /// <param name="cancelUri">optional override URI on cancel</param>
+ /// <param name="state">optional state, gets passed back with the successful payload</param>
+ /// <returns>the generated URL</returns>
+ private static string GenerateNewLimitUrl(string type, object requestResource,
+ string redirectUri = null, string cancelUri = null, string state = null)
+ {
var hash = new Utils.HashParams
{
{"client_id", GoCardless.AccountDetails.AppId},
{"nonce", GoCardless.GenerateNonce()},
{"timestamp", GoCardless.GetUtcNow().IsoFormatTime()},
- };
-
- hash = @params.ToHashParams(hash, type);
-
-
- if (redirectUri != null)
- {
- hash.Add("redirect_uri", redirectUri);
- }
- if (cancelUri != null)
- {
- hash.Add("cancel_uri", cancelUri);
- }
- if (state != null)
- {
- hash.Add("state", state);
- }
-
- hash = SignParams(hash);
-
- var url = GoCardless.BaseUrl + "/connect/" + type + "s/new?" + hash.ToQueryString();
- return url;
- }
-
-
- /// <summary>
- /// Generate the URL for creating a new subscription. The parameters passed
- /// in define various attributes of the subscription. Redirecting a user to
- /// the resulting URL will show them a page where they can approve or reject
- /// the subscription described by the parameters. Note that this method
- /// automatically includes the nonce, timestamp and signature.
- /// </summary>
- /// <param name="params">params the subscription parameters</param>
- /// <returns>the generated URL</returns>
- public static string NewSubscriptionUrl(SubscriptionRequest @params,
- string redirectUri = null, string cancelUri = null, string state = null)
- {
- return NewLimitUrl("subscription", @params, redirectUri, cancelUri, state);
- }
-
- /// <summary>
- /// Generate the URL for creating a new pre authorization. The parameters
- /// passed in define various attributes of the pre authorization. Redirecting
- /// a user to the resulting URL will show them a page where they can approve
- /// or reject the pre authorization described by the parameters. Note that
- /// this method automatically includes the nonce, timestamp and signature.
- /// </summary>
- /// <param name="params">params the pre authorization parameters</param>
- /// <returns>the generated URL</returns>
- public static string NewPreAuthorizationUrl(PreAuthorizationRequest @params,
- string redirectUri = null, string cancelUri = null, string state = null)
- {
- return NewLimitUrl("pre_authorization", @params, redirectUri, cancelUri, state);
- }
-
- /// <summary>
- /// Generate the URL for creating a new bill. The parameters passed in define
- /// various attributes of the bill. Redirecting a user to the resulting URL
- /// will show them a page where they can approve or reject the bill described
- /// by the parameters. Note that this method automatically includes the
- /// nonce, timestamp and signature.
- /// </summary>
- /// <param name="params">params the bill parameters</param>
- /// <returns>the generated URL</returns>
- public static string NewBillUrl(BillRequest @params,
- string redirectUri = null, string cancelUri = null, string state = null)
- {
- return NewLimitUrl("bill", @params, redirectUri, cancelUri, state);
- }
-
- private static void ThrowIfNull(string s)
- {
- if (s == null)
- {
- // TODO: name of parameter
- throw new ArgumentException("Parameter missing ");
- }
- }
-
- /// <summary>
- /// Confirm a newly-created subscription, pre-authorzation or one-off
- /// payment. This method also checks that the resource response data includes
- /// a valid signature and will throw a {SignatureException} if the signature is
- /// invalid.
- /// </summary>
- /// <param name="requestContent">the response parameters returned by the API server</param>
- /// <returns>the confirmed resource object</returns>
- public static ConfirmResource ConfirmResource(NameValueCollection requestContent)
- {
- var resource = new ConfirmResource
- {
- ResourceId = requestContent["resource_id"],
- ResourceType = requestContent["resource_type"],
- ResourceUri = requestContent["resource_uri"],
- Signature = requestContent["signature"],
- State = requestContent["state"],
- };
-
- ThrowIfNull(resource.ResourceId);
- ThrowIfNull(resource.ResourceType);
- ThrowIfNull(resource.ResourceUri);
- ThrowIfNull(resource.Signature);
-
- var signature = resource.Signature;
- resource.Signature = null;
-
- if (signature != Utils.GetSignatureForParams(resource.ToHashParams(), GoCardlessSdk.GoCardless.AccountDetails.AppSecret))
- {
- throw new SignatureException("An invalid signature was detected");
- }
-
- var request = new RestRequest("confirm", Method.POST);
- request.RequestFormat = DataFormat.Json;
- request.AddBody(
- new
- {
- resource_id = resource.ResourceId,
- resource_type = resource.ResourceType
- });
-
- var client = new RestClient
- {
- BaseUrl = ApiClient.ApiUrl,
- };
- var serializer = new JsonSerializer
- {
- ContractResolver = new UnderscoreToCamelCasePropertyResolver(),
- };
- client.AddHandler("application/json", new NewtonsoftJsonDeserializer(serializer));
- client.Authenticator = new HttpBasicAuthenticator(GoCardlessSdk.GoCardless.AccountDetails.AppId, GoCardlessSdk.GoCardless.AccountDetails.AppSecret);
- var response = client.Execute(request);
- if (response.StatusCode != HttpStatusCode.OK)
- {
- throw new ApiException("Unexpected response : " + (int) response.StatusCode + " " + response.StatusCode);
- }
-
- return resource;
- }
- }
+ };
+
+ hash = requestResource.ToHashParams(hash, type);
+
+
+ if (redirectUri != null)
+ {
+ hash.Add("redirect_uri", redirectUri);
+ }
+ if (cancelUri != null)
+ {
+ hash.Add("cancel_uri", cancelUri);
+ }
+ if (state != null)
+ {
+ hash.Add("state", state);
+ }
+
+ hash = SignParams(hash);
+
+ var url = GoCardless.BaseUrl + "/connect/" + type + "s/new?" + hash.ToQueryString();
+ return url;
+ }
+
+
+ /// <summary>
+ /// Generate the URL for creating a new subscription.
+ /// </summary>
+ /// <remarks>
+ /// The parameters passed in define various attributes of the subscription.
+ /// Redirecting a user to the resulting URL will show them a page where they
+ /// can approve or reject the subscription described by the parameters.
+ /// Note that this method automatically includes the nonce, timestamp and signature.
+ /// </remarks>
+ /// <param name="requestResource">the request values</param>
+ /// <param name="redirectUri">optional override URI on success</param>
+ /// <param name="cancelUri">optional override URI on cancel</param>
+ /// <param name="state">optional state, gets passed back with the successful payload</param>
+ /// <returns>the generated URL</returns>
+ public string NewSubscriptionUrl(SubscriptionRequest requestResource,
+ string redirectUri = null, string cancelUri = null, string state = null)
+ {
+ return GenerateNewLimitUrl("subscription", requestResource, redirectUri, cancelUri, state);
+ }
+
+ /// <summary>
+ /// Generate the URL for creating a new pre authorization. The parameters
+ /// passed in define various attributes of the pre authorization. Redirecting
+ /// a user to the resulting URL will show them a page where they can approve
+ /// or reject the pre authorization described by the parameters. Note that
+ /// this method automatically includes the nonce, timestamp and signature.
+ /// </summary>
+ /// <param name="requestResource">the request values</param>
+ /// <param name="redirectUri">optional override URI on success</param>
+ /// <param name="cancelUri">optional override URI on cancel</param>
+ /// <param name="state">optional state, gets passed back with the successful payload</param>
+ /// <returns>the generated URL</returns>
+ public string NewPreAuthorizationUrl(PreAuthorizationRequest requestResource,
+ string redirectUri = null, string cancelUri = null, string state = null)
+ {
+ return GenerateNewLimitUrl("pre_authorization", requestResource, redirectUri, cancelUri, state);
+ }
+
+ /// <summary>
+ /// Generate the URL for creating a new bill. The parameters passed in define
+ /// various attributes of the bill. Redirecting a user to the resulting URL
+ /// will show them a page where they can approve or reject the bill described
+ /// by the parameters. Note that this method automatically includes the
+ /// nonce, timestamp and signature.
+ /// </summary>
+ /// <param name="requestResource">the request values</param>
+ /// <param name="redirectUri">optional override URI on success</param>
+ /// <param name="cancelUri">optional override URI on cancel</param>
+ /// <param name="state">optional state, gets passed back with the successful payload</param>
+ /// <returns>the generated URL</returns>
+ public string NewBillUrl(BillRequest requestResource,
+ string redirectUri = null, string cancelUri = null, string state = null)
+ {
+ return GenerateNewLimitUrl("bill", requestResource, redirectUri, cancelUri, state);
+ }
+
+ /// <summary>
+ /// Confirm a newly-created subscription, pre-authorzation or one-off
+ /// payment. This method also checks that the resource response data includes
+ /// a valid signature and will throw a {SignatureException} if the signature is
+ /// invalid.
+ /// </summary>
+ /// <param name="requestContent">the response parameters returned by the API server</param>
+ /// <returns>the confirmed resource object</returns>
+ public ConfirmResource ConfirmResource(NameValueCollection requestContent)
+ {
+ var resource = new ConfirmResource
+ {
+ ResourceId = requestContent["resource_id"],
+ ResourceType = requestContent["resource_type"],
+ ResourceUri = requestContent["resource_uri"],
+ Signature = requestContent["signature"],
+ State = requestContent["state"],
+ };
+
+ if (resource.ResourceId == null) throw new ArgumentNullException("ResourceId");
+ if (resource.ResourceType == null) throw new ArgumentNullException("ResourceType");
+ if (resource.ResourceUri == null) throw new ArgumentNullException("ResourceUri");
+ if (resource.Signature == null) throw new ArgumentNullException("Signature");
+
+ var signature = resource.Signature;
+ resource.Signature = null;
+
+ if (signature != Utils.GetSignatureForParams(resource.ToHashParams(), GoCardless.AccountDetails.AppSecret))
+ {
+ throw new SignatureException("An invalid signature was detected");
+ }
+
+ var request = new RestRequest("confirm", Method.POST);
+ request.RequestFormat = DataFormat.Json;
+ request.AddBody(
+ new
+ {
+ resource_id = resource.ResourceId,
+ resource_type = resource.ResourceType
+ });
+
+ var client = new RestClient
+ {
+ BaseUrl = ApiClient.ApiUrl,
+ };
+ var serializer = new JsonSerializer
+ {
+ ContractResolver = new UnderscoreToCamelCasePropertyResolver(),
+ };
+ client.AddHandler("application/json", new NewtonsoftJsonDeserializer(serializer));
+ client.Authenticator = new HttpBasicAuthenticator(GoCardless.AccountDetails.AppId, GoCardless.AccountDetails.AppSecret);
+ var response = client.Execute(request);
+ if (response.StatusCode != HttpStatusCode.OK)
+ {
+ throw new ApiException("Unexpected response : " + (int)response.StatusCode + " " + response.StatusCode);
+ }
+
+ return resource;
+ }
+ }
}
View
10 GoCardlessSdk/Connect/PreAuthorizationRequest.cs
@@ -3,7 +3,15 @@
namespace GoCardlessSdk.Connect
{
public class PreAuthorizationRequest
- {
+ {
+ public PreAuthorizationRequest(string merchantId, decimal maxAmount, int intervalLength, string intervalUnit)
+ {
+ MaxAmount = maxAmount;
+ MerchantId = merchantId;
+ IntervalLength = intervalLength;
+ IntervalUnit = intervalUnit;
+ }
+
public decimal MaxAmount { get; set; }
public string MerchantId { get; set; }
public int IntervalLength { get; set; }
View
10 GoCardlessSdk/Connect/SubscriptionRequest.cs
@@ -3,7 +3,15 @@
namespace GoCardlessSdk.Connect
{
public class SubscriptionRequest
- {
+ {
+ public SubscriptionRequest(string merchantId, decimal amount, int intervalLength, string intervalUnit)
+ {
+ Amount = amount;
+ MerchantId = merchantId;
+ IntervalLength = intervalLength;
+ IntervalUnit = intervalUnit;
+ }
+
public decimal Amount { get; set; }
public string MerchantId { get; set; }
public int IntervalLength { get; set; }
View
8 GoCardlessSdk/GoCardless.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
-using GoCardlessSdk.Api;
+using GoCardlessSdk.Api;
+using GoCardlessSdk.Connect;
using GoCardlessSdk.Helpers;
using GoCardlessSdk.Partners;
@@ -43,6 +44,11 @@ public static string BaseUrl
public static ApiClient Api
{
get { return new ApiClient(AccountDetails.Token); }
+ }
+
+ public static ConnectClient Connect
+ {
+ get { return new ConnectClient(); }
}
public static PartnerClient Partner
View
6 GoCardlessSdk/Partners/PartnerClient.cs
@@ -8,9 +8,9 @@ namespace GoCardlessSdk.Partners
{
public class PartnerClient
{
- public static string GetManageMerchantUrl(string redirectUri, Merchant merchant = null)
+ public string NewMerchantUrl(string redirectUri, Merchant merchant = null)
{
- var @params = new ManageMerchantRequest
+ var request = new ManageMerchantRequest
{
ClientId = GoCardless.AccountDetails.AppId,
RedirectUri = redirectUri,
@@ -19,7 +19,7 @@ public static string GetManageMerchantUrl(string redirectUri, Merchant merchant
Merchant = merchant
};
- return GoCardless.BaseUrl + "/oauth/authorize?" + @params.ToQueryString();
+ return GoCardless.BaseUrl + "/oauth/authorize?" + request.ToQueryString();
}
public MerchantAccessTokenResponse ParseCreateMerchantResponse(string redirectUri, string code)
View
4 Sample.Mvc3/Controllers/GoCardlessController.cs
@@ -28,8 +28,8 @@ public ContentResult Index()
[HttpGet]
public ActionResult ConfirmResource()
{
- var requestContent = Request.QueryString;
- var resource = ConnectClient.ConfirmResource(requestContent);
+ var requestContent = Request.QueryString;
+ var resource = GoCardless.Connect.ConfirmResource(requestContent);
// TODO: store request payload.
TempData["payload"] = resource;
View
308 Sample.Mvc3/Controllers/HomeController.cs
@@ -1,159 +1,149 @@
-using System;
-using System.Web.Mvc;
-using GoCardlessSdk;
-using GoCardlessSdk.Connect;
-using GoCardlessSdk.Partners;
-using Sample.Mvc3.Models;
-
-namespace Sample.Mvc3.Controllers
-{
- public class HomeController : Controller
- {
- public ActionResult Index()
- {
- GoCardless.Environment = GoCardless.Environments.Sandbox;
-
- var model = new LinksModel();
- try
- {
- model.NewSubscriptionUrl = ConnectClient.NewSubscriptionUrl(
- new SubscriptionRequest
- {
- Amount = 10m,
- Description = "Testing a new monthly subscription",
- IntervalLength = 1,
- IntervalUnit = "month",
- MerchantId = Settings.MyMerchantId,
- User = new UserRequest
- {
- BillingAddress1 = "Flat 1",
- BillingAddress2 = "100 Main St",
- BillingTown = "Townville",
- BillingCounty = "Countyshire",
- BillingPostcode = "N1 1AB",
- Email = "john.smith@example.com",
- FirstName = "John",
- LastName = "Smith",
- }
- });
-
- model.NewBillUrl = ConnectClient.NewBillUrl(
- new BillRequest
- {
- Amount = 10m,
- Description = "Testing a new bill",
- MerchantId = Settings.MyMerchantId,
- Name = "Test bill",
- User = new UserRequest
- {
- BillingAddress1 = "Flat 1",
- BillingAddress2 = "100 Main St",
- BillingTown = "Townville",
- BillingCounty = "Countyshire",
- BillingPostcode = "N1 1AB",
- Email = "john.smith@example.com",
- FirstName = "John",
- LastName = "Smith",
- }
- });
-
- model.NewPreAuthorizationUrl = ConnectClient.NewPreAuthorizationUrl(
- new PreAuthorizationRequest
- {
- MaxAmount = 15m,
- MerchantId = Settings.MyMerchantId,
- IntervalLength = 1,
- IntervalUnit = "month",
-
- ExpiresAt = DateTimeOffset.UtcNow.AddYears(1),
- Name = "Test preauth",
- Description = "Testing a new preauthorization",
- IntervalCount = 12,
- CalendarIntervals = true,
- User = new UserRequest
- {
- BillingAddress1 = "Flat 1",
- BillingAddress2 = "100 Main St",
- BillingTown = "Townville",
- BillingCounty = "Countyshire",
- BillingPostcode = "N1 1AB",
- Email = "john.smith@example.com",
- FirstName = "John",
- LastName = "Smith",
- }
- });
-
- model.CreateMerchantUrl = PartnerClient.GetManageMerchantUrl(
- Settings.CreateMerchantRedirectUri,
- new Merchant
- {
- Name = "Mike the Merchant",
- BillingAddress1 = "Flat 1",
- BillingAddress2 = "200 High St",
- BillingTown = "Townville",
- BillingCounty = "Countyshire",
- BillingPostcode = "N1 1AB",
- User = new User
- {
- FirstName = "Mike",
- LastName = "Merchant",
- Email = "mike.merchant@example.com",
- }
- }
- );
- }
- catch (Exception ex)
- {
- model.Error = ex.Message;
- }
- ViewData.Model = model;
- return View();
- }
-
- public ActionResult Merchant()
- {
- GoCardless.Environment = GoCardless.Environments.Sandbox;
- ViewData.Model = GoCardless.Api.GetMerchant(Settings.MyMerchantId);
- return View();
- }
-
- public ActionResult Bills()
- {
- GoCardless.Environment = GoCardless.Environments.Sandbox;
- ViewData.Model = GoCardless.Api.GetMerchantBills(Settings.MyMerchantId);
- return View();
- }
-
- public ActionResult Subscriptions()
- {
- GoCardless.Environment = GoCardless.Environments.Sandbox;
- ViewData.Model = GoCardless.Api.GetMerchantSubscriptions(Settings.MyMerchantId);
- return View();
- }
-
- public ActionResult PreAuthorizations()
- {
- GoCardless.Environment = GoCardless.Environments.Sandbox;
- ViewData.Model = GoCardless.Api.GetMerchantPreAuthorizations(Settings.MyMerchantId);
- return View();
- }
-
- public ActionResult Users()
- {
- GoCardless.Environment = GoCardless.Environments.Sandbox;
- ViewData.Model = GoCardless.Api.GetMerchantUsers(Settings.MyMerchantId);
- return View();
- }
-
- public ActionResult Cancel()
- {
- return View();
- }
-
- public ActionResult Success()
- {
- ViewData.Model = TempData["payload"];
- return View();
- }
- }
-}
+using System;
+using System.Web.Mvc;
+using GoCardlessSdk;
+using GoCardlessSdk.Connect;
+using GoCardlessSdk.Partners;
+using Sample.Mvc3.Models;
+
+namespace Sample.Mvc3.Controllers
+{
+ public class HomeController : Controller
+ {
+ public ActionResult Index()
+ {
+ GoCardless.Environment = GoCardless.Environments.Sandbox;
+
+ var model = new LinksModel();
+ try
+ {
+ model.NewSubscriptionUrl = GoCardless.Connect.NewSubscriptionUrl(
+ new SubscriptionRequest(Settings.MyMerchantId, 10m, 1, "month")
+ {
+ Name = "Test subscription",
+ Description = "Testing a new monthly subscription",
+ User = new UserRequest
+ {
+ BillingAddress1 = "Flat 1",
+ BillingAddress2 = "100 Main St",
+ BillingTown = "Townville",
+ BillingCounty = "Countyshire",
+ BillingPostcode = "N1 1AB",
+ Email = "john.smith14444@example.com",
+ FirstName = "John",
+ LastName = "Smith",
+ }
+ });
+
+ model.NewBillUrl = GoCardless.Connect.NewBillUrl(
+ new BillRequest(Settings.MyMerchantId, 10m)
+ {
+ Name = "Test bill",
+ Description = "Testing a new bill",
+ User = new UserRequest
+ {
+ BillingAddress1 = "Flat 1",
+ BillingAddress2 = "100 Main St",
+ BillingTown = "Townville",
+ BillingCounty = "Countyshire",
+ BillingPostcode = "N1 1AB",
+ Email = "john.smith345345345@example.com",
+ FirstName = "John",
+ LastName = "Smith",
+ }
+ });
+
+ model.NewPreAuthorizationUrl = GoCardless.Connect.NewPreAuthorizationUrl(
+ new PreAuthorizationRequest(Settings.MyMerchantId, 15m, 1, "month")
+ {
+ ExpiresAt = DateTimeOffset.UtcNow.AddYears(1),
+ Name = "Test preauth",
+ Description = "Testing a new preauthorization",
+ IntervalCount = 12,
+ CalendarIntervals = true,
+ User = new UserRequest
+ {
+ BillingAddress1 = "Flat 1",
+ BillingAddress2 = "100 Main St",
+ BillingTown = "Townville",
+ BillingCounty = "Countyshire",
+ BillingPostcode = "N1 1AB",
+ Email = "john.smith34534545@example.com",
+ FirstName = "John",
+ LastName = "Smith",
+ }
+ });
+
+ model.CreateMerchantUrl = GoCardless.Partner.NewMerchantUrl(
+ Settings.CreateMerchantRedirectUri,
+ new Merchant
+ {
+ Name = "Mike the Merchant",
+ BillingAddress1 = "Flat 1",
+ BillingAddress2 = "200 High St",
+ BillingTown = "Townville",
+ BillingCounty = "Countyshire",
+ BillingPostcode = "N1 1AB",
+ User = new User
+ {
+ FirstName = "Mike",
+ LastName = "Merchant",
+ Email = "mike.merchant@example.com",
+ }
+ }
+ );
+ }
+ catch (Exception ex)
+ {
+ model.Error = ex.Message;
+ }
+ ViewData.Model = model;
+ return View();
+ }
+
+ public ActionResult Merchant()
+ {
+ GoCardless.Environment = GoCardless.Environments.Sandbox;
+ ViewData.Model = GoCardless.Api.GetMerchant(Settings.MyMerchantId);
+ return View();
+ }
+
+ public ActionResult Bills()
+ {
+ GoCardless.Environment = GoCardless.Environments.Sandbox;
+ ViewData.Model = GoCardless.Api.GetMerchantBills(Settings.MyMerchantId);
+ return View();
+ }
+
+ public ActionResult Subscriptions()
+ {
+ GoCardless.Environment = GoCardless.Environments.Sandbox;
+ ViewData.Model = GoCardless.Api.GetMerchantSubscriptions(Settings.MyMerchantId);
+ return View();
+ }
+
+ public ActionResult PreAuthorizations()
+ {
+ GoCardless.Environment = GoCardless.Environments.Sandbox;
+ ViewData.Model = GoCardless.Api.GetMerchantPreAuthorizations(Settings.MyMerchantId);
+ return View();
+ }
+
+ public ActionResult Users()
+ {
+ GoCardless.Environment = GoCardless.Environments.Sandbox;
+ ViewData.Model = GoCardless.Api.GetMerchantUsers(Settings.MyMerchantId);
+ return View();
+ }
+
+ public ActionResult Cancel()
+ {
+ return View();
+ }
+
+ public ActionResult Success()
+ {
+ ViewData.Model = TempData["payload"];
+ return View();
+ }
+ }
+}
View
303 Sample.Mvc3/Sample.Mvc3.csproj
@@ -1,156 +1,159 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>
- </ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{63BA941A-94D4-41A2-8AE2-D9B2814F2A9C}</ProjectGuid>
- <ProjectTypeGuids>{E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Sample.Mvc3</RootNamespace>
- <AssemblyName>Sample.Mvc3</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <MvcBuildViews>false</MvcBuildViews>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\</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\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System.Data.Entity" />
- <Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
- <Reference Include="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
- <Reference Include="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
- <Reference Include="Microsoft.CSharp" />
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Drawing" />
- <Reference Include="System.Web.DynamicData" />
- <Reference Include="System.Web.Entity" />
- <Reference Include="System.Web.ApplicationServices" />
- <Reference Include="System.ComponentModel.DataAnnotations" />
- <Reference Include="System.Core" />
- <Reference Include="System.Data.DataSetExtensions" />
- <Reference Include="System.Xml.Linq" />
- <Reference Include="System.Web" />
- <Reference Include="System.Web.Extensions" />
- <Reference Include="System.Web.Abstractions" />
- <Reference Include="System.Web.Routing" />
- <Reference Include="System.Xml" />
- <Reference Include="System.Configuration" />
- <Reference Include="System.Web.Services" />
- <Reference Include="System.EnterpriseServices" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Controllers\GoCardlessController.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Controllers\HomeController.cs" />
- <Compile Include="Controllers\Settings.cs" />
- <Compile Include="Global.asax.cs">
- <DependentUpon>Global.asax</DependentUpon>
- </Compile>
- <Compile Include="Models\LinksModel.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="favicon.ico" />
- <Content Include="Global.asax" />
- <Content Include="Content\Site.css" />
- <Content Include="Web.config" />
- <Content Include="Web.Debug.config">
- <DependentUpon>Web.config</DependentUpon>
- </Content>
- <Content Include="Web.Release.config">
- <DependentUpon>Web.config</DependentUpon>
- </Content>
- <Content Include="Views\Web.config" />
- <Content Include="Views\_ViewStart.cshtml" />
- <Content Include="Views\Shared\Error.cshtml" />
- <Content Include="Views\Shared\_Layout.cshtml" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="GoCardlessAppSettings.config">
- <SubType>Designer</SubType>
- </Content>
- </ItemGroup>
- <ItemGroup>
- <Content Include="Views\Home\Index.cshtml" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\GoCardlessSdk\GoCardlessSdk.csproj">
- <Project>{36CDA1FB-4093-41ED-9879-CD18EFCCE80B}</Project>
- <Name>GoCardlessSdk</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <Content Include="Views\Home\Merchant.cshtml" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Views\Home\Bills.cshtml" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Views\Home\Subscriptions.cshtml" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Views\Home\PreAuthorizations.cshtml" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="App_Code\Helpers.cshtml" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Views\Home\Users.cshtml" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Views\Home\Success.cshtml" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Views\Home\Cancel.cshtml" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>
+ </ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{63BA941A-94D4-41A2-8AE2-D9B2814F2A9C}</ProjectGuid>
+ <ProjectTypeGuids>{E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Sample.Mvc3</RootNamespace>
+ <AssemblyName>Sample.Mvc3</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <MvcBuildViews>false</MvcBuildViews>
+ <UseIISExpress>false</UseIISExpress>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\</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\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System.Data.Entity" />
+ <Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+ <Reference Include="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+ <Reference Include="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Web.DynamicData" />
+ <Reference Include="System.Web.Entity" />
+ <Reference Include="System.Web.ApplicationServices" />
+ <Reference Include="System.ComponentModel.DataAnnotations" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Web" />
+ <Reference Include="System.Web.Extensions" />
+ <Reference Include="System.Web.Abstractions" />
+ <Reference Include="System.Web.Routing" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Configuration" />
+ <Reference Include="System.Web.Services" />
+ <Reference Include="System.EnterpriseServices" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Controllers\GoCardlessController.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Controllers\HomeController.cs" />
+ <Compile Include="Controllers\Settings.cs" />
+ <Compile Include="Global.asax.cs">
+ <DependentUpon>Global.asax</DependentUpon>
+ </Compile>
+ <Compile Include="Models\LinksModel.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="favicon.ico" />
+ <Content Include="Global.asax" />
+ <Content Include="Content\Site.css" />
+ <Content Include="Web.config">
+ <SubType>Designer</SubType>
+ </Content>
+ <Content Include="Web.Debug.config">
+ <DependentUpon>Web.config</DependentUpon>
+ </Content>
+ <Content Include="Web.Release.config">
+ <DependentUpon>Web.config</DependentUpon>
+ </Content>
+ <Content Include="Views\Web.config" />
+ <Content Include="Views\_ViewStart.cshtml" />
+ <Content Include="Views\Shared\Error.cshtml" />
+ <Content Include="Views\Shared\_Layout.cshtml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="GoCardlessAppSettings.config">
+ <SubType>Designer</SubType>
+ </Content>
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Views\Home\Index.cshtml" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\GoCardlessSdk\GoCardlessSdk.csproj">
+ <Project>{36CDA1FB-4093-41ED-9879-CD18EFCCE80B}</Project>
+ <Name>GoCardlessSdk</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Views\Home\Merchant.cshtml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Views\Home\Bills.cshtml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Views\Home\Subscriptions.cshtml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Views\Home\PreAuthorizations.cshtml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="App_Code\Helpers.cshtml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Views\Home\Users.cshtml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Views\Home\Success.cshtml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Views\Home\Cancel.cshtml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.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> -->
- <Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
- <AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
- </Target>
- <ProjectExtensions>
- <VisualStudio>
- <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
- <WebProjectProperties>
- <UseIIS>False</UseIIS>
- <AutoAssignPort>False</AutoAssignPort>
- <DevelopmentServerPort>12345</DevelopmentServerPort>
- <DevelopmentServerVPath>/</DevelopmentServerVPath>
- <IISUrl>
- </IISUrl>
- <NTLMAuthentication>False</NTLMAuthentication>
- <UseCustomServer>False</UseCustomServer>
- <CustomServerUrl>
- </CustomServerUrl>
- <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
- </WebProjectProperties>
- </FlavorProperties>
- </VisualStudio>
- </ProjectExtensions>
+ </Target> -->
+ <Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
+ <AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
+ </Target>
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
+ <WebProjectProperties>
+ <UseIIS>False</UseIIS>
+ <AutoAssignPort>False</AutoAssignPort>
+ <DevelopmentServerPort>12345</DevelopmentServerPort>
+ <DevelopmentServerVPath>/</DevelopmentServerVPath>
+ <IISUrl>
+ </IISUrl>
+ <NTLMAuthentication>False</NTLMAuthentication>
+ <UseCustomServer>False</UseCustomServer>
+ <CustomServerUrl>
+ </CustomServerUrl>
+ <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
+ </WebProjectProperties>
+ </FlavorProperties>
+ </VisualStudio>
+ </ProjectExtensions>
</Project>
Please sign in to comment.
Something went wrong with that request. Please try again.