Http::response([ 'data' => [ 'id' => 'ord_123', 'attributes' => [ 'status' => 'paid', 'custom_data' => [ 'success_url' => 'https://fotospiel-app.test/event-admin/mobile/events/slug/photos?addon_success=1', 'return_url' => 'https://fotospiel-app.test/event-admin/mobile/events/slug/photos', ], ], ], ], 200), ]); $response = $this->get('/lemonsqueezy/return?order_id=ord_123'); $response->assertRedirect('https://fotospiel-app.test/event-admin/mobile/events/slug/photos?addon_success=1'); } public function test_return_redirects_to_return_url_when_not_completed(): void { Config::set('lemonsqueezy.api_key', 'test_key'); Config::set('lemonsqueezy.base_url', 'https://lemonsqueezy.test'); Config::set('app.url', 'https://fotospiel-app.test'); Http::fake([ 'https://lemonsqueezy.test/orders/ord_456' => Http::response([ 'data' => [ 'id' => 'ord_456', 'attributes' => [ 'status' => 'failed', 'custom_data' => [ 'success_url' => 'https://fotospiel-app.test/event-admin/mobile/events/slug/photos?addon_success=1', 'return_url' => 'https://fotospiel-app.test/event-admin/mobile/events/slug/photos', ], ], ], ], 200), ]); $response = $this->get('/lemonsqueezy/return?order_id=ord_456'); $response->assertRedirect('https://fotospiel-app.test/event-admin/mobile/events/slug/photos'); } }