Laravel controller handling Stripe checkout and subscription webhooks.
// Source: https://github.com/thedevdojo/wave | License: MIT | Copyright DevDojo
// Provided via justclaw.it.com; keep this notice with the code.
<?php
namespace Wave\Http\Controllers\Billing\Webhooks;
use App\Http\Controllers\Controller;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
use Stripe\Checkout\Session;
use Stripe\Exception\SignatureVerificationException;
use Stripe\Stripe;
use Stripe\Webhook;
use UnexpectedValueException;
use Wave\Plan;
use Wave\Subscription;
class StripeWebhook extends Controller
{
public function handler(Request $request)
{
$payload = $request->getContent();
$sig_header = $request->server('HTTP_STRIPE_SIGNATURE');
$event = null;
try {
$event = W
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key