public function build($intent, $payer, $urls, $transactions, $returnArray = false)
    {
        $this->assertIntent($intent);
        $this->intent = $intent;

        $requestBody = array();
        $requestBody['intent'] = $this->intent;
        $requestBody['payer'] = $this->payerBuilder->buildArray($payer);
        $requestBody['transactions'] = $this->transactionsBuilder->buildArray($transactions);
        $requestBody['redirect_urls'] = $this->urlsBuilder->buildArray($urls);

        if ($returnArray) {
            return $requestBody;
        }

        return json_encode($requestBody);
    }