Skip to content
This repository has been archived by the owner on Apr 27, 2021. It is now read-only.

Commit

Permalink
LevelUp Public C# SDK Version 5.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
devlaf committed Sep 6, 2017
1 parent 92ae8ff commit 0aa9471
Show file tree
Hide file tree
Showing 33 changed files with 65 additions and 125 deletions.
2 changes: 1 addition & 1 deletion LICENSE.txt
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright {yyyy} {name of copyright owner}
Copyright 2016 SCVNGR, Inc. d/b/a LevelUp

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Expand Up @@ -127,7 +127,7 @@ public void CompleteProposedOrderShouldSucceed()
"\"receipt_message_html\": \"Pick up your order at <strong>counter #4</strong>\"," +
"\"register\": \"3\"," +
"\"spend_amount\": 110," +
"\"tax_amount\": 10," +
"\"tax_amount\": 0," +
GetSampleItems().Item1 +
"}" +
"}";
Expand All @@ -139,9 +139,9 @@ public void CompleteProposedOrderShouldSucceed()
"\"order\": { " +
"\"gift_card_total_amount\": 0, " +
"\"gift_card_tip_amount\": 0, " +
"\"spend_amount\": 500, " +
"\"spend_amount\": 100, " +
"\"tip_amount\": 0, " +
"\"total_amount\": 500, " +
"\"total_amount\": 100, " +
"\"uuid\": \"5a1z9x2h31ah7g8a9i9h8g7f6e5d4c4a21o\"" +
"}" +
"}"
Expand All @@ -157,9 +157,9 @@ public void CompleteProposedOrderShouldSucceed()

Assert.AreEqual(completedOrder.GiftCardTotalAmount, 0);
Assert.AreEqual(completedOrder.GiftCardTipAmount, 0);
Assert.AreEqual(completedOrder.SpendAmount, 500);
Assert.AreEqual(completedOrder.SpendAmount, 100);
Assert.AreEqual(completedOrder.TipAmount, 0);
Assert.AreEqual(completedOrder.Total, 500);
Assert.AreEqual(completedOrder.Total, 100);
Assert.AreEqual(completedOrder.OrderIdentifier, "5a1z9x2h31ah7g8a9i9h8g7f6e5d4c4a21o");
}

Expand All @@ -173,7 +173,7 @@ public void CompleteProposedOrderShouldSucceedForSplitTender()
"\"completed_order\": {" +
"\"applied_discount_amount\": 100," +
"\"cashier\": \"Bob\"," +
"\"exemption_amount\": 40," +
"\"exemption_amount\": 0," +
"\"identifier_from_merchant\": \"001001\"," +
"\"location_id\": 19," +
"\"partial_authorization_allowed\": false," +
Expand Down
18 changes: 10 additions & 8 deletions LevelUp.Api.Client.Test/LevelUp.Api.Client.Test.csproj
Expand Up @@ -42,20 +42,20 @@
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="FluentAssertions, Version=4.19.2.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.19.2\lib\net40\FluentAssertions.dll</HintPath>
<Reference Include="FluentAssertions, Version=4.19.4.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.19.4\lib\net40\FluentAssertions.dll</HintPath>
</Reference>
<Reference Include="FluentAssertions.Core, Version=4.19.2.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.19.2\lib\net40\FluentAssertions.Core.dll</HintPath>
<Reference Include="FluentAssertions.Core, Version=4.19.4.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.19.4\lib\net40\FluentAssertions.Core.dll</HintPath>
</Reference>
<Reference Include="KellermanSoftware.Compare-NET-Objects, Version=3.8.0.0, Culture=neutral, PublicKeyToken=d970ace04cc85217, processorArchitecture=MSIL">
<HintPath>..\packages\CompareNETObjects.3.08.0.0\lib\net40\KellermanSoftware.Compare-NET-Objects.dll</HintPath>
<Reference Include="KellermanSoftware.Compare-NET-Objects, Version=3.9.0.0, Culture=neutral, PublicKeyToken=d970ace04cc85217, processorArchitecture=MSIL">
<HintPath>..\packages\CompareNETObjects.3.09.0.0\lib\net40\KellermanSoftware.Compare-NET-Objects.dll</HintPath>
</Reference>
<Reference Include="Moq, Version=4.2.1510.2205, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.2\lib\net40\Newtonsoft.Json.dll</HintPath>
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="RestSharp, Version=105.2.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RestSharp.105.2.3\lib\net4\RestSharp.dll</HintPath>
Expand Down Expand Up @@ -141,7 +141,9 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy /Y "$(ProjectDir)Config\test_config_settings.xml" "$(TargetDir)"</PostBuildEvent>
<PostBuildEvent>xcopy /Y /c "$(ProjectDir)Config\test_config_settings.xml" "$(TargetDir)"
setx LevelUpTestConfigurationFilePath "$(TargetDir)
SET ERRORLEVEL = 0</PostBuildEvent>
</PropertyGroup>
<!-- 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.
Expand Down
6 changes: 3 additions & 3 deletions LevelUp.Api.Client.Test/packages.config
Expand Up @@ -18,9 +18,9 @@
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-->
<packages>
<package id="CompareNETObjects" version="3.08.0.0" targetFramework="net40" />
<package id="FluentAssertions" version="4.19.2" targetFramework="net40" />
<package id="CompareNETObjects" version="3.09.0.0" targetFramework="net40" />
<package id="FluentAssertions" version="4.19.4" targetFramework="net40" />
<package id="Moq" version="4.2.1510.2205" targetFramework="net40" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net40" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net40" />
<package id="RestSharp" version="105.2.3" targetFramework="net40" />
</packages>
8 changes: 4 additions & 4 deletions LevelUp.Api.Client/LevelUp.Api.Client.csproj
Expand Up @@ -41,11 +41,11 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.2\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="LevelUp.Pos.ProposedOrders.ProposedOrderCalculator, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\LevelUp.Pos.ProposedOrderCalculator.1.0.0\lib\net30\LevelUp.Pos.ProposedOrders.ProposedOrderCalculator.dll\Release\LevelUp.Pos.ProposedOrders.ProposedOrderCalculator.dll</HintPath>
<HintPath>..\packages\LevelUp.Pos.ProposedOrderCalculator.1.1.0\lib\net30\LevelUp.Pos.ProposedOrders.ProposedOrderCalculator.dll\Release\LevelUp.Pos.ProposedOrders.ProposedOrderCalculator.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="RestSharp, Version=105.2.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RestSharp.105.2.3\lib\net4\RestSharp.dll</HintPath>
Expand Down
5 changes: 1 addition & 4 deletions LevelUp.Api.Client/Models/Responses/AccessToken.cs
Expand Up @@ -34,10 +34,7 @@ public class AccessToken : IResponse
/// </summary>
private AccessToken() { }

/// <summary>
/// Internal constructor for testing
/// </summary>
internal AccessToken(string token, int userId, int? merchantId)
public AccessToken(string token, int userId, int? merchantId)
{
Token = token;
UserId = userId;
Expand Down
Expand Up @@ -35,10 +35,7 @@ public class CompletedOrderResponse : IResponse
/// </summary>
private CompletedOrderResponse() { }

/// <summary>
/// Internal constructor for testing
/// </summary>
internal CompletedOrderResponse(int spendAmount, int tipAmount, int total, string orderIdentifier,
public CompletedOrderResponse(int spendAmount, int tipAmount, int total, string orderIdentifier,
int giftCardTotalAmount, int giftCardTipAmount)
{
SpendAmount = spendAmount;
Expand Down
5 changes: 1 addition & 4 deletions LevelUp.Api.Client/Models/Responses/ContributionTarget.cs
Expand Up @@ -36,10 +36,7 @@ public class ContributionTarget : IResponse
/// </summary>
private ContributionTarget() { }

/// <summary>
/// Internal constructor for testing
/// </summary>
internal ContributionTarget(string description, bool? employerRequired, string facebookUrl, string id,
public ContributionTarget(string description, bool? employerRequired, string facebookUrl, string id,
string name, string partnerSpecificTerms, string twitterUsername, string website, int? minimumAgeRequired,
bool? homeAddressRequired, bool? featured)
{
Expand Down
5 changes: 1 addition & 4 deletions LevelUp.Api.Client/Models/Responses/CreditCard.cs
Expand Up @@ -32,10 +32,7 @@ public class CreditCard : IResponse
/// </summary>
public CreditCard() { }

/// <summary>
/// Internal constructor for testing
/// </summary>
internal CreditCard(string bin, string description, int expirationMonth, int expirationYear, int id,
public CreditCard(string bin, string description, int expirationMonth, int expirationYear, int id,
string last4Numbers, bool promoted, string state, string type)
{
Bin = bin;
Expand Down
Expand Up @@ -35,10 +35,7 @@ public class DetachedRefundResponse : IResponse
/// </summary>
private DetachedRefundResponse() { }

/// <summary>
/// Internal constructor for testing
/// </summary>
internal DetachedRefundResponse(string cashier, int creditAmountCents, string customerFacingReason, string identifier,
public DetachedRefundResponse(string cashier, int creditAmountCents, string customerFacingReason, string identifier,
string internalReason, int locationId, string register, DateTime refundedAt, int userId)
{
Cashier = cashier;
Expand Down
2 changes: 1 addition & 1 deletion LevelUp.Api.Client/Models/Responses/EmptyResponse.cs
Expand Up @@ -23,7 +23,7 @@ namespace LevelUp.Api.Client.Models.Responses
/// Enables using an IResponse return value in some operations
/// that return void (ex. some delete operations return no data)
/// </summary>
class EmptyResponse : IResponse
public class EmptyResponse : IResponse
{
}
}
Expand Up @@ -32,10 +32,7 @@ public class FinalizeRemoteCheckResponse : IResponse
/// </summary>
private FinalizeRemoteCheckResponse() { }

/// <summary>
/// Internal constructor for testing
/// </summary>
internal FinalizeRemoteCheckResponse(int spendAmount, int tipAmount, int totalAmount, string orderIdentifier,
public FinalizeRemoteCheckResponse(int spendAmount, int tipAmount, int totalAmount, string orderIdentifier,
int giftCardCreditTotalAmount, int giftCardCreditTipAmount)
{
SpendAmount = spendAmount;
Expand Down
Expand Up @@ -34,10 +34,7 @@ private GetRemoteCheckDataResponse()
PendingOrderContainer = new PendingOrderResponseContainer(null, null);
}

/// <summary>
/// Internal constructor for testing
/// </summary>
internal GetRemoteCheckDataResponse(string orderIdentifier, int? discountToApply)
public GetRemoteCheckDataResponse(string orderIdentifier, int? discountToApply)
{
PendingOrderContainer = new PendingOrderResponseContainer(orderIdentifier, discountToApply);
}
Expand Down
Expand Up @@ -31,10 +31,7 @@ public class GiftCardAddValueResponse : IResponse
/// </summary>
private GiftCardAddValueResponse() { }

/// <summary>
/// Internal constructor for testing
/// </summary>
internal GiftCardAddValueResponse(int amountAddedInCents, int newGiftCardAmountInCents,
public GiftCardAddValueResponse(int amountAddedInCents, int newGiftCardAmountInCents,
int previousGiftCardAmountInCents)
{
AmountAddedInCents = amountAddedInCents;
Expand Down
5 changes: 1 addition & 4 deletions LevelUp.Api.Client/Models/Responses/GiftCardQueryResponse.cs
Expand Up @@ -31,10 +31,7 @@ public class GiftCardQueryResponse : IResponse
/// </summary>
private GiftCardQueryResponse() { }

/// <summary>
/// Internal constructor for testing
/// </summary>
internal GiftCardQueryResponse(int totalAmount)
public GiftCardQueryResponse(int totalAmount)
{
TotalAmount = totalAmount;
}
Expand Down
Expand Up @@ -31,10 +31,7 @@ public class GiftCardRemoveValueResponse : IResponse
/// </summary>
private GiftCardRemoveValueResponse() { }

/// <summary>
/// Internal constructor for testing
/// </summary>
internal GiftCardRemoveValueResponse(int amountRemovedInCents, int newGiftCardAmountInCents, int previousGiftCardAmountInCents)
public GiftCardRemoveValueResponse(int amountRemovedInCents, int newGiftCardAmountInCents, int previousGiftCardAmountInCents)
{
AmountRemovedInCents = amountRemovedInCents;
NewGiftCardAmountInCents = newGiftCardAmountInCents;
Expand Down
10 changes: 4 additions & 6 deletions LevelUp.Api.Client/Models/Responses/Location.cs
Expand Up @@ -31,14 +31,12 @@ namespace LevelUp.Api.Client.Models.Responses
public class Location : IResponse
{
/// <summary>
/// Private constructor for deserialization
/// Constructor for deserialization
/// </summary>
private Location() { }
// TODO: Make this private on next major version
public Location() { }

/// <summary>
/// Internal constructor for testing
/// </summary>
internal Location(int locationId, string name, string tipPreference)
public Location(int locationId, string name, string tipPreference)
{
LocationId = locationId;
Name = name;
Expand Down
7 changes: 2 additions & 5 deletions LevelUp.Api.Client/Models/Responses/LocationDetails.cs
Expand Up @@ -34,12 +34,9 @@ public class LocationDetails : IResponse
/// <summary>
/// Private constructor for deserialization
/// </summary>
public LocationDetails() { }
private LocationDetails() { }

/// <summary>
/// Internal constructor for testing
/// </summary>
internal LocationDetails(int locationId, string menuUrl, int merchantId, string merchantName, bool isVisible,
public LocationDetails(int locationId, string menuUrl, int merchantId, string merchantName, bool isVisible,
List<int> categories, string extendedAddress, string facebookUrl, string hours, double latitude,
double longitude, string locality, string merchantDescription, string postalCode, string region,
string streetAddress, string timeOfLastUpdate, string name, string tipPreference)
Expand Down
5 changes: 1 addition & 4 deletions LevelUp.Api.Client/Models/Responses/Loyalty.cs
Expand Up @@ -36,10 +36,7 @@ public class Loyalty : IResponse
/// </summary>
private Loyalty() { }

/// <summary>
/// Internal constructor for testing
/// </summary>
internal Loyalty(int merchantEarnAmount, int merchantId, bool merchantloyaltyEnabled, int merchantSpendAmount,
public Loyalty(int merchantEarnAmount, int merchantId, bool merchantloyaltyEnabled, int merchantSpendAmount,
int ordersCount, int potentialCreditAmount, decimal progressPercentage, int savingsAmount,
int spendRemainingAmount, int totalVolumeAmount)
{
Expand Down
5 changes: 1 addition & 4 deletions LevelUp.Api.Client/Models/Responses/ManagedLocation.cs
Expand Up @@ -36,10 +36,7 @@ public class ManagedLocation : IResponse
/// </summary>
private ManagedLocation() { }

/// <summary>
/// Internal constructor for testing
/// </summary>
internal ManagedLocation(int locationId, int merchantId, string name, string merchantName,
public ManagedLocation(int locationId, int merchantId, string name, string merchantName,
string address, string tipPreference)
{
LocationId = locationId;
Expand Down
5 changes: 1 addition & 4 deletions LevelUp.Api.Client/Models/Responses/OrderDetailsResponse.cs
Expand Up @@ -36,10 +36,7 @@ public class OrderDetailsResponse : IResponse
/// </summary>
private OrderDetailsResponse() { }

/// <summary>
/// Internal constructor for testing
/// </summary>
internal OrderDetailsResponse(string orderIdentifier, int spendAmount, int tipAmount, int total, string createdAt,
public OrderDetailsResponse(string orderIdentifier, int spendAmount, int tipAmount, int total, string createdAt,
int merchantFundedCredit, int earnAmount, int loyaltyId, string timeOfRefund, string userName,
string timeOfTransaction, int locationId)
{
Expand Down
5 changes: 1 addition & 4 deletions LevelUp.Api.Client/Models/Responses/PaymentToken.cs
Expand Up @@ -35,10 +35,7 @@ public class PaymentToken : IResponse
/// </summary>
private PaymentToken() {}

/// <summary>
/// Internal constructor for testing
/// </summary>
internal PaymentToken(int id, string data)
public PaymentToken(int id, string data)
{
Id = id;
Data = data;
Expand Down
5 changes: 1 addition & 4 deletions LevelUp.Api.Client/Models/Responses/ProposedOrderResponse.cs
Expand Up @@ -31,10 +31,7 @@ public class ProposedOrderResponse : IResponse
/// </summary>
private ProposedOrderResponse() { }

/// <summary>
/// Internal constructor for testing
/// </summary>
internal ProposedOrderResponse(string proposedOrderIdentifier, int discountAmountCents)
public ProposedOrderResponse(string proposedOrderIdentifier, int discountAmountCents)
{
ProposedOrderIdentifier = proposedOrderIdentifier;
DiscountAmountCents = discountAmountCents;
Expand Down
5 changes: 1 addition & 4 deletions LevelUp.Api.Client/Models/Responses/RefundResponse.cs
Expand Up @@ -36,10 +36,7 @@ public class RefundResponse : IResponse
/// </summary>
private RefundResponse() { }

/// <summary>
/// Internal constructor for testing
/// </summary>
internal RefundResponse(string createdAt, int merchantFundedCreditAmount, int earnAmount, string orderIdentifier,
public RefundResponse(string createdAt, int merchantFundedCreditAmount, int earnAmount, string orderIdentifier,
int loyaltyId, int spendAmount, string timeOfRefund, int tipAmount, int totalAmount, int locationId,
string userName, string timeOfTransaction)
{
Expand Down
Expand Up @@ -28,10 +28,7 @@ public class UpdateRemoteCheckDataResponse : IResponse
{
private const char LINE_SEPARATOR = ',';

/// <summary>
/// Private constructor for deserialization
/// </summary>
private UpdateRemoteCheckDataResponse() { }
public UpdateRemoteCheckDataResponse() { }

/// <summary>
/// Internal constructor for testing
Expand Down
5 changes: 1 addition & 4 deletions LevelUp.Api.Client/Models/Responses/User.cs
Expand Up @@ -42,10 +42,7 @@ private User()
CustomAttributesInternal = new Dictionary<string, string>();
}

/// <summary>
/// Internal constructor for testing
/// </summary>
internal User(int id, Dictionary<string, string> customAttributes, string email, string firstName, string gender,
public User(int id, Dictionary<string, string> customAttributes, string email, string firstName, string gender,
int globalCreditAmount, string lastName, int merchantsVisitedCount, int ordersCount,
int totalSavingsAmount, string termsAcceptedAt, string bornAt)
{
Expand Down

0 comments on commit 0aa9471

Please sign in to comment.