Passed
Pull Request — master (#9)
by Volodymyr
17:33 queued 09:33
created

PaypalExpressController::successAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Yves\Braintree\Controller;
9
10
use Spryker\Yves\Kernel\Controller\AbstractController;
11
use Symfony\Component\HttpFoundation\Request;
12
13
/**
14
 * @method \SprykerEco\Yves\Braintree\BraintreeFactory getFactory()
15
 */
16
class PaypalExpressController extends AbstractController
17
{
18
    /**
19
     * @param \Symfony\Component\HttpFoundation\Request $request
20
     *
21
     * @return \Symfony\Component\HttpFoundation\JsonResponse
22
     */
23
    public function successAction(Request $request)
24
    {
25
        $payload = $this->getFactory()->getUtilEncodingService()->decodeJson($request->getContent(), true);
26
27
        $this->getFactory()->createResponseProcessor()->processSuccessResponse($payload);
0 ignored issues
show
Bug introduced by
It seems like $payload can also be of type null; however, parameter $payload of SprykerEco\Yves\Braintre...rocessSuccessResponse() does only seem to accept array, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

27
        $this->getFactory()->createResponseProcessor()->processSuccessResponse(/** @scrutinizer ignore-type */ $payload);
Loading history...
28
29
        //TODO: Update route
30
        return $this->jsonResponse([
31
            'redirectUrl' => 'http://www.de.suite-nonsplit.local/checkout/summary',
32
        ]);
33
    }
34
}
35