|
@@ -1,41 +0,0 @@
|
|
|
-<?php
|
|
|
-
|
|
|
-namespace Bolt\Extension\Ginger\Squarepay\Controller;
|
|
|
-
|
|
|
-use Bolt\Controller\Base;
|
|
|
-use Silex\Application;
|
|
|
-use Silex\ControllerCollection;
|
|
|
-use Silex\ControllerProviderInterface;
|
|
|
-use Symfony\Component\HttpFoundation\Request;
|
|
|
-use Symfony\Component\HttpFoundation\Response;
|
|
|
-
|
|
|
-/**
|
|
|
- * The controller for Square backend routes.
|
|
|
- *
|
|
|
- * @author Richard Knight <rich@apewave.com>
|
|
|
- */
|
|
|
-class SquareController extends Base
|
|
|
-{
|
|
|
- /**
|
|
|
- * {@inheritdoc}
|
|
|
- */
|
|
|
- public function addRoutes(ControllerCollection $c)
|
|
|
- {
|
|
|
- $c->match('/oauth/{type}', [$this, 'oauthHandler']);
|
|
|
- return $c;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * @param Request $request
|
|
|
- * @param string $type
|
|
|
- *
|
|
|
- * @return Response
|
|
|
- */
|
|
|
- public function oauthHandler(Request $request, $type)
|
|
|
- {
|
|
|
- if ($type === 'dropbear') {
|
|
|
- return new Response('Drop bear sighted!', Response::HTTP_OK);
|
|
|
- }
|
|
|
- return new Response('Koala in a tree!', Response::HTTP_OK);
|
|
|
- }
|
|
|
-}
|