id; $checkoutUrl = 'https://checkout.xendit.co/web/' . $providerRefId; return [ 'provider_ref_id' => $providerRefId, 'checkout_url' => $checkoutUrl, 'raw_payload' => [ 'stub' => true, 'intent_id' => $intent->id, 'registration_id' => $registration->id ] ]; } /** * Minimal webhook verification using a shared token (recommended baseline). * Configure `XENDIT_WEBHOOK_TOKEN` in .env and set the same token in Xendit dashboard. */ public function verifyWebhook(Request $request): bool { $expected = config('pxg.xendit.webhook_token', ''); if (!$expected) return true; // allow in dev // Xendit commonly uses X-Callback-Token for invoice callbacks. $got = $request->header('X-Callback-Token') ?? $request->header('x-callback-token'); return is_string($got) && hash_equals($expected, $got); } }