Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated PR for Release: 37.1.1 #130

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 13 additions & 13 deletions Square.Tests/ApiTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ namespace Square
/// ControllerTestBase Class.
/// </summary>
[TestFixture]
public class ApiTestBase
{
/// <summary>
/// Assert precision.
/// </summary>
protected const double AssertPrecision = 0.1;
/// <summary>
/// Gets HttpCallBackHandler.
/// </summary>
internal HttpCallBack HttpCallBack { get; private set; } = new HttpCallBack();
/// <summary>
public class ApiTestBase
{
/// <summary>
/// Assert precision.
/// </summary>
protected const double AssertPrecision = 0.1;

/// <summary>
/// Gets HttpCallBackHandler.
/// </summary>
internal HttpCallBack HttpCallBack { get; private set; } = new HttpCallBack();

/// <summary>
/// Gets SquareClient Client.
/// </summary>
protected SquareClient Client { get; private set; }
Expand Down
38 changes: 19 additions & 19 deletions Square.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Square.Tests")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Square.Tests")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
14 changes: 7 additions & 7 deletions Square.Tests/Square.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0"></PackageReference>
<PackageReference Include="NUnit" Version="3.13.3"></PackageReference>
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1"></PackageReference>
</ItemGroup>
<ItemGroup>

<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0"></PackageReference>
<PackageReference Include="NUnit" Version="3.13.3"></PackageReference>
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1"></PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Square\Square.csproj" />
</ItemGroup>

Expand Down
12 changes: 12 additions & 0 deletions Square.Tests/Utilities/WebhooksHelperTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ public void IsValidWebhookEventSignatureIsTrueForValidNotification()
Assert.True(result);
}

[Test]
public void IsValidWebhookEventSignatureIsTrueForEscapedBodyValidNotification()
{
const string escpaedRequestBody = "{\"data\":{\"type\":\"webhooks\",\"id\":\">id<\"}}";
const string newSignatureHeader = "Cxt7+aTi4rKgcA0bC4g9EHdVtLSDWdqccmL5MvihU4U=";
const string signatureKey = "signature-key";
const string url = "https://webhook.site/webhooks";

var result = WebhooksHelper.IsValidWebhookEventSignature(escpaedRequestBody, newSignatureHeader, signatureKey, url);
Assert.True(result);
}

[Test]
public void IsValidWebhookEventSignatureIsFalseIfNotificationUrlMismatch()
{
Expand Down
20 changes: 10 additions & 10 deletions Square.sln
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26430.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square", "Square/Square.csproj", "{d597539f-1cd3-4697-bf09-71333f46e441}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square", "Square/Square.csproj", "{90bb2cf4-19be-4e65-b4c9-6c820facdc83}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square.Tests", "Square.Tests/Square.Tests.csproj", "{473eb2cb-aa17-41a3-8663-831dc114e4f8}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square.Tests", "Square.Tests/Square.Tests.csproj", "{0594486c-0de1-4568-83dd-2ddb85e6804f}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{d597539f-1cd3-4697-bf09-71333f46e441}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{d597539f-1cd3-4697-bf09-71333f46e441}.Debug|Any CPU.Build.0 = Debug|Any CPU
{d597539f-1cd3-4697-bf09-71333f46e441}.Release|Any CPU.ActiveCfg = Release|Any CPU
{d597539f-1cd3-4697-bf09-71333f46e441}.Release|Any CPU.Build.0 = Release|Any CPU
{473eb2cb-aa17-41a3-8663-831dc114e4f8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{473eb2cb-aa17-41a3-8663-831dc114e4f8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{473eb2cb-aa17-41a3-8663-831dc114e4f8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{473eb2cb-aa17-41a3-8663-831dc114e4f8}.Release|Any CPU.Build.0 = Release|Any CPU
{90bb2cf4-19be-4e65-b4c9-6c820facdc83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{90bb2cf4-19be-4e65-b4c9-6c820facdc83}.Debug|Any CPU.Build.0 = Debug|Any CPU
{90bb2cf4-19be-4e65-b4c9-6c820facdc83}.Release|Any CPU.ActiveCfg = Release|Any CPU
{90bb2cf4-19be-4e65-b4c9-6c820facdc83}.Release|Any CPU.Build.0 = Release|Any CPU
{0594486c-0de1-4568-83dd-2ddb85e6804f}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0594486c-0de1-4568-83dd-2ddb85e6804f}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0594486c-0de1-4568-83dd-2ddb85e6804f}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0594486c-0de1-4568-83dd-2ddb85e6804f}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
36 changes: 21 additions & 15 deletions Square/Apis/ApplePayApi.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
namespace Square.Apis
{
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Square.Apis
{
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using APIMatic.Core;
using APIMatic.Core.Types;
using APIMatic.Core.Utilities;
Expand All @@ -35,8 +35,11 @@ internal ApplePayApi(GlobalConfiguration globalConfiguration) : base(globalConfi
/// an Apple Pay enabled domain.
/// This endpoint provides an easy way for platform developers to bulk activate.
/// Apple Pay on the Web with Square for merchants using their platform.
/// Note: The SqPaymentForm library is deprecated as of May 13, 2021, and will only receive critical security updates until it is retired on October 31, 2022.
/// You must migrate your payment form code to the Web Payments SDK to continue using your domain for Apple Pay. For more information on migrating to the Web Payments SDK, see [Migrate to the Web Payments SDK](https://developer.squareup.com/docs/web-payments/migrate).
/// Note: You will need to host a valid domain verification file on your domain to support Apple Pay. The.
/// current version of this file is always available at https://app.squareup.com/digital-wallets/apple-pay/apple-developer-merchantid-domain-association,.
/// and should be hosted at `.well_known/apple-developer-merchantid-domain-association` on your.
/// domain. This file is subject to change; we strongly recommend checking for updates regularly and avoiding.
/// long-lived caches that might not keep in sync with the correct file version.
/// To learn more about the Web Payments SDK and how to add Apple Pay, see [Take an Apple Pay Payment](https://developer.squareup.com/docs/web-payments/apple-pay).
/// </summary>
/// <param name="body">Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details..</param>
Expand All @@ -51,8 +54,11 @@ public Models.RegisterDomainResponse RegisterDomain(
/// an Apple Pay enabled domain.
/// This endpoint provides an easy way for platform developers to bulk activate.
/// Apple Pay on the Web with Square for merchants using their platform.
/// Note: The SqPaymentForm library is deprecated as of May 13, 2021, and will only receive critical security updates until it is retired on October 31, 2022.
/// You must migrate your payment form code to the Web Payments SDK to continue using your domain for Apple Pay. For more information on migrating to the Web Payments SDK, see [Migrate to the Web Payments SDK](https://developer.squareup.com/docs/web-payments/migrate).
/// Note: You will need to host a valid domain verification file on your domain to support Apple Pay. The.
/// current version of this file is always available at https://app.squareup.com/digital-wallets/apple-pay/apple-developer-merchantid-domain-association,.
/// and should be hosted at `.well_known/apple-developer-merchantid-domain-association` on your.
/// domain. This file is subject to change; we strongly recommend checking for updates regularly and avoiding.
/// long-lived caches that might not keep in sync with the correct file version.
/// To learn more about the Web Payments SDK and how to add Apple Pay, see [Take an Apple Pay Payment](https://developer.squareup.com/docs/web-payments/apple-pay).
/// </summary>
/// <param name="body">Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details..</param>
Expand Down
22 changes: 11 additions & 11 deletions Square/Apis/BankAccountsApi.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
namespace Square.Apis
{
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Square.Apis
{
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using APIMatic.Core;
using APIMatic.Core.Types;
using APIMatic.Core.Utilities;
Expand Down
10 changes: 5 additions & 5 deletions Square/Apis/BaseApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ internal class BaseApi
/// <summary>
/// Initializes a new instance of the <see cref="BaseApi"/> class.
/// </summary>
internal BaseApi(GlobalConfiguration config) => globalConfiguration = config;
protected static ErrorCase<HttpRequest, HttpResponse, HttpContext, ApiException> CreateErrorCase(string reason, Func<string, HttpContext, ApiException> error, bool isErrorTemplate = false)
=> new ErrorCase<HttpRequest, HttpResponse, HttpContext, ApiException>(reason, error, isErrorTemplate);
internal BaseApi(GlobalConfiguration config) => globalConfiguration = config;

protected static ErrorCase<HttpRequest, HttpResponse, HttpContext, ApiException> CreateErrorCase(string reason, Func<string, HttpContext, ApiException> error, bool isErrorTemplate = false)
=> new ErrorCase<HttpRequest, HttpResponse, HttpContext, ApiException>(reason, error, isErrorTemplate);

protected ApiCall<HttpRequest, HttpResponse, HttpContext, ApiException, T, T> CreateApiCall<T>(ArraySerialization arraySerialization = ArraySerialization.Indexed)
=> new ApiCall<HttpRequest, HttpResponse, HttpContext, ApiException, T, T>(
globalConfiguration,
Expand Down
22 changes: 11 additions & 11 deletions Square/Apis/BookingCustomAttributesApi.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
namespace Square.Apis
{
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Square.Apis
{
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using APIMatic.Core;
using APIMatic.Core.Types;
using APIMatic.Core.Utilities;
Expand Down
22 changes: 11 additions & 11 deletions Square/Apis/BookingsApi.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
namespace Square.Apis
{
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Square.Apis
{
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using APIMatic.Core;
using APIMatic.Core.Types;
using APIMatic.Core.Utilities;
Expand Down
22 changes: 11 additions & 11 deletions Square/Apis/CardsApi.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
namespace Square.Apis
{
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Square.Apis
{
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using APIMatic.Core;
using APIMatic.Core.Types;
using APIMatic.Core.Utilities;
Expand Down
22 changes: 11 additions & 11 deletions Square/Apis/CashDrawersApi.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
namespace Square.Apis
{
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Square.Apis
{
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using APIMatic.Core;
using APIMatic.Core.Types;
using APIMatic.Core.Utilities;
Expand Down
22 changes: 11 additions & 11 deletions Square/Apis/CatalogApi.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
namespace Square.Apis
{
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Square.Apis
{
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using APIMatic.Core;
using APIMatic.Core.Types;
using APIMatic.Core.Utilities;
Expand Down
Loading
Loading