getContent(); $signature = (string) $request->header('Stripe-Signature'); try { $payment = $gateway->readWebhook($payload, $signature); // The same address also receives news about merchants' own plans. $subscription = $subscriptions->readWebhook($payload, $signature); } catch (PaymentException) { return response('Invalid webhook.', 400); } if ($subscription !== null) { $billing->applyFromWebhook($subscription); } if ($payment !== null) { $order = Order::query()->where('payment_checkout_id', $payment->checkoutId)->first(); if ($order !== null) { $checkout->markPaid($order, $payment); } } return response('OK'); } }