src/PayPalRestApiClient/Service/PaymentService.php
public function create(
        AccessToken $accessToken,
        $payer,
        $urls,
        $transactions
    ) {
        $requestBody = $this->paymentRequestBodyBuilder->build(
            'sale',
            $payer,
            $urls,
            $transactions
        );

        $this->assertReqeustJsonSchema($requestBody);

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

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

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

        $paymentBuilder = new PaymentBuilder();
        $payment = $paymentBuilder->build($data);

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

        $this->assertReqeustJsonSchema($requestBody);

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

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

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

        $paymentBuilder = new PaymentBuilder();
        $payment = $paymentBuilder->build($data);

        return $payment;
    }
Create 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