public function authorize(
        AccessToken $accessToken,
        $payer,
        $urls,
        $transactions
    ) {
        $requestBody = $this->paymentRequestBodyBuilder->build(
            'authorize',
            $payer,
            $urls,
            $transactions
        );

        $this->assertReqeustJsonSchema($requestBody);

        $request = $this->buildRequest($accessToken, $requestBody);

        $response = $this->send($request, 201, "Payment error:");

        $data = json_decode($response->getBody(), true);

        $authorizationBuilder = new PaymentAuthorizationBuilder();
        $authorization = $authorizationBuilder->build($data);

        return $authorization;
    }
public function authorize(
        AccessToken $accessToken,
        $payer,
        $urls,
        $transactions
    ) {
        $requestBody = $this->paymentRequestBodyBuilder->build(
            'authorize',
            $payer,
            $urls,
            $transactions
        );

        $this->assertReqeustJsonSchema($requestBody);

        $request = $this->buildRequest($accessToken, $requestBody);

        $response = $this->send($request, 201, "Payment error:");

        $data = json_decode($response->getBody(), true);

        $authorizationBuilder = new PaymentAuthorizationBuilder();
        $authorization = $authorizationBuilder->build($data);

        return $authorization;
    }
public function authorize ( AccessToken $ accessToken , $ payer , $ urls , $ transactions ) { $ requestBody = $ this -> paymentRequestBodyBuilder -> build ( 'authorize' , $ payer , $ urls , $ transactions ) ; $ this -> assertReqeustJsonSchema ( $ requestBody ) ; $ request = $ this -> buildRequest ( $ accessToken , $ requestBody ) ; $ response = $ this -> send ( $ request , 201 , "Payment error:" ) ; $ data = json_decode ( $ response -> getBody ( ) , true ) ; $ authorizationBuilder = new PaymentAuthorizationBuilder ( ) ; $ authorization = $ authorizationBuilder -> build ( $ data ) ; return $ authorization ; }
Authorize a payment

@param PayPalRestApiClient\Model\AccessToken $accessToken
@param mixed $payer array or object that represents a paypal payer
@param array $urls array of the cancel and redirection url
@param array $transactions array of transaction objects

@return PayPalRestApiClient\Model\Payment|PayPalRestApiClient\Model\PaymentAuthorization
Authorize a payment