# StripePayment::constructEvent()

> Verifies a Stripe webhook request and turns it into an event

- See also: `https://docs.stripe.com/webhooks#verify-official-libraries`
- Source: `src/StripePayment.php#L32` <https://github.com/wagnerwagner/merx/blob/2.0.0-alpha.11/src/StripePayment.php#L32>

```php
StripePayment::constructEvent(string $payload): Stripe\Event
```

## Parameters

| Name | Type | Default |
| --- | --- | --- |
| `$payload` | `string` | `–` |

## Return type

`Stripe\Event`

## Exceptions

| Type | Description |
| --- | --- |
| `Exception` | merx.stripeWebhook when the signing secret is missing, the signature is invalid or the payload cannot be parsed |

## Description

The reason a webhook is rejected is only written to the log. It must not
reach the caller, who is unauthenticated on this endpoint.

## Parent class

`Wagnerwagner\Merx\StripePayment`
