Skip to content

Commit

Permalink
Webhook should use updated webhook secret.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonashendrickx committed Mar 21, 2024
1 parent 9833fbd commit 162a71b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/AdminConsole/Pages/Billing/webhook.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ namespace Passwordless.AdminConsole.Pages.Billing;
public class Webhook : PageModel
{
private readonly ISharedBillingService _sharedBillingService;
private readonly BillingOptions _billingOptions;
private readonly IOptionsSnapshot<BillingOptions> _billingOptions;

public Webhook(ISharedBillingService sharedBillingService, IOptions<BillingOptions> billingOptions)
public Webhook(ISharedBillingService sharedBillingService, IOptionsSnapshot<BillingOptions> billingOptions)
{
_sharedBillingService = sharedBillingService;
_billingOptions = billingOptions.Value;
_billingOptions = billingOptions;
}

public async Task<IActionResult> OnPost()
Expand All @@ -31,7 +31,7 @@ public async Task<IActionResult> OnPost()
stripeEvent = EventUtility.ConstructEvent(
json,
Request.Headers["Stripe-Signature"],
_billingOptions.WebhookSecret
_billingOptions.Value.WebhookSecret
);
Console.WriteLine($"Webhook notification with type: {stripeEvent.Type} found for {stripeEvent.Id}");
}
Expand Down

0 comments on commit 162a71b

Please sign in to comment.