Skip to content

Commit

Permalink
Extracted IWebhookTestingGateway
Browse files Browse the repository at this point in the history
  • Loading branch information
ronin1 committed Oct 6, 2015
1 parent 26d683a commit d006db2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
1 change: 1 addition & 0 deletions Braintree/Braintree.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
<Compile Include="ITransactionGateway.cs" />
<Compile Include="ITransparentRedirectGateway.cs" />
<Compile Include="IWebhookNotificationGateway.cs" />
<Compile Include="IWebhookTestingGateway.cs" />
<Compile Include="KeyValueNode.cs" />
<Compile Include="Merchant.cs" />
<Compile Include="MerchantGateway.cs" />
Expand Down
2 changes: 1 addition & 1 deletion Braintree/BraintreeGateway.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public virtual IWebhookNotificationGateway WebhookNotification
get { return new WebhookNotificationGateway(this); }
}

public virtual WebhookTestingGateway WebhookTesting
public virtual IWebhookTestingGateway WebhookTesting
{
get { return new WebhookTestingGateway(this); }
}
Expand Down
12 changes: 12 additions & 0 deletions Braintree/IWebhookTestingGateway.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#pragma warning disable 1591

using System;
using System.Collections.Generic;

namespace Braintree
{
public interface IWebhookTestingGateway
{
Dictionary<string, string> SampleNotification(WebhookKind kind, string id);
}
}
15 changes: 8 additions & 7 deletions Braintree/WebhookTestingGateway.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#pragma warning disable 1591

using System;
using System.Collections.Generic;
using System.Text;

namespace Braintree
{
public class WebhookTestingGateway
public class WebhookTestingGateway : IWebhookTestingGateway
{
private BraintreeService service;
private readonly BraintreeService service;

protected internal WebhookTestingGateway(BraintreeGateway gateway)
{
Expand Down Expand Up @@ -67,11 +68,11 @@ private string SubjectSampleXml(WebhookKind kind, string id)
}
}

private static readonly string TYPE_DATE = "type=\"date\"";
private static readonly string TYPE_ARRAY = "type=\"array\"";
private static readonly string TYPE_SYMBOL = "type=\"symbol\"";
private static readonly string NIL_TRUE = "nil=\"true\"";
private static readonly string TYPE_BOOLEAN = "type=\"boolean\"";
private const string TYPE_DATE = "type=\"date\"";
private const string TYPE_ARRAY = "type=\"array\"";
private const string TYPE_SYMBOL = "type=\"symbol\"";
private const string NIL_TRUE = "nil=\"true\"";
private const string TYPE_BOOLEAN = "type=\"boolean\"";

private string MerchantAccountDeclinedSampleXml(string id)
{
Expand Down

0 comments on commit d006db2

Please sign in to comment.