Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

Commit

Permalink
Successful Test with API Key Implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
adamreed90 committed Feb 18, 2016
1 parent 238c6d4 commit ac81e86
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 0 additions & 2 deletions Data/NimbusFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
{
public class NimbusFunction
{
[Property("Cmn", true)]
public string MerchantNumber { get; set; }
/// <summary>
/// This places the system into Test Mode, 0 = Live, 1 = Test.
/// </summary>
Expand Down
10 changes: 6 additions & 4 deletions NimbusSharp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ namespace NimbusSharp
public class NimbusSharp
{
private readonly string _merchantId;
private readonly string _apiKey;

public NimbusSharp(string merchantId)
public NimbusSharp(string merchantId, string apiKey)
{
_merchantId = merchantId;
_apiKey = apiKey;
}


public async Task<string> Execute(NimbusFunction function)
{
function.MerchantNumber = _merchantId;

CheckRequiredProperties(function);

var functionString =
Expand All @@ -33,7 +33,9 @@ public async Task<string> Execute(NimbusFunction function)

var data = new List<KeyValuePair<string, string>>
{
new KeyValuePair<string, string>("func", functionString)
new KeyValuePair<string, string>("func", functionString),
new KeyValuePair<string, string>("Cmn", _merchantId),
new KeyValuePair<string, string>("key", _apiKey)
};
foreach (var propertyName in propertyNames)
{
Expand Down

0 comments on commit ac81e86

Please sign in to comment.