public function build(array $data)
    {
        $this->validateArrayKeys(
            array('payment_method'),
            $data
        );

        if ( ! in_array($data['payment_method'], array('credit_card', 'paypal'))) {

            throw new BuilderException('Parameter payment_method not valid. Allowed values: "credit_card" and "paypal"');
        }

        $fundingInstruments = array();
        if (isset($data['funding_instruments'])) {
            $fundingInstruments = $data['funding_instruments'];
        }

        $info = array();
        if (isset($data['payer_info'])) {
            $info = $data['payer_info'];
        }

        return new Payer($data['payment_method'], $fundingInstruments, $info);
    }