Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1968
v1968
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ci-test: (_test "--no-build" "" "Release")
# ⭐ format all files
format *args:
# This sets TargetFramework because of a race condition in dotnet format when it tries to format to multiple targets at a time, which could lead to code with compiler errors after it completes
TargetFramework=net5.0 dotnet format src/Stripe.net/Stripe.net.csproj --severity warn {{args}}
TargetFramework=net5.0 dotnet format src/Stripe.net.sln --severity warn {{args}}

# verify, but don't modify, the project's formatting
format-check: (format "--verify-no-changes")
Expand Down
2 changes: 1 addition & 1 deletion src/Examples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public Program()
/// are set before running the example.
///
/// </summary>
/// <param name="args">command line args</param>
/// <param name="args">command line args.</param>
/// <returns></returns>
public static async Task Main(string[] args)
{
Expand Down
12 changes: 6 additions & 6 deletions src/Examples/V2/ThinEventWebhookHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
[ApiController]
public class ThinEventWebhookHandler : ControllerBase
{
private readonly StripeClient _client;
private readonly string _webhookSecret;
private readonly StripeClient client;
private readonly string webhookSecret;

public ThinEventWebhookHandler()

Check warning on line 28 in src/Examples/V2/ThinEventWebhookHandler.cs

View workflow job for this annotation

GitHub Actions / Build and test

Non-nullable field 'webhookSecret' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 28 in src/Examples/V2/ThinEventWebhookHandler.cs

View workflow job for this annotation

GitHub Actions / Build and test

Non-nullable field 'webhookSecret' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.
{
var apiKey = Environment.GetEnvironmentVariable("STRIPE_API_KEY");
_client = new StripeClient(apiKey);
client = new StripeClient(apiKey);

_webhookSecret = Environment.GetEnvironmentVariable("WEBHOOK_SECRET");
webhookSecret = Environment.GetEnvironmentVariable("WEBHOOK_SECRET");

Check warning on line 33 in src/Examples/V2/ThinEventWebhookHandler.cs

View workflow job for this annotation

GitHub Actions / Build and test

Possible null reference assignment.

Check warning on line 33 in src/Examples/V2/ThinEventWebhookHandler.cs

View workflow job for this annotation

GitHub Actions / Build and test

Possible null reference assignment.
}

[HttpPost]
Expand All @@ -39,10 +39,10 @@
var json = await new StreamReader(HttpContext.Request.Body).ReadToEndAsync();
try
{
var thinEvent = _client.ParseThinEvent(json, Request.Headers["Stripe-Signature"], _webhookSecret);
var thinEvent = client.ParseThinEvent(json, Request.Headers["Stripe-Signature"], webhookSecret);

// Fetch the event data to understand the failure
var baseEvent = await _client.V2.Core.Events.GetAsync(thinEvent.Id);
var baseEvent = await client.V2.Core.Events.GetAsync(thinEvent.Id);
if (baseEvent is V1BillingMeterErrorReportTriggeredEvent fullEvent)
{
var meter = await fullEvent.FetchRelatedObjectAsync();
Expand Down
Loading
Loading