src/Payum/Paypal/ProHosted/Nvp/Api.php
public function doCreateButton(array $fields)
    {
        if (false == isset($fields['return'])) {
            if (false == $this->options['return']) {
                throw new RuntimeException('The return must be set either to FormRequest or to options.');
            }

            $fields['return'] = $this->options['return'];
        }

        $fields['paymentaction'] = self::PAYMENTACTION_SALE;
        $fields['cmd']           = self::FORM_CMD;

        $newFields = [];
        $i         = 0;
        foreach ($fields as $key => $val) {
            $newFields['L_BUTTONVAR'.$i] = $key.'='.$val;
            $i++;
        }

        $newFields['METHOD']     = 'BMCreateButton';
        $newFields['BUTTONTYPE'] = 'PAYMENT';
        $newFields['BUTTONCODE'] = 'TOKEN';

        $this->addVersionField($newFields);
        $this->addAuthorizeFields($newFields);

        $response = $this->doRequest($newFields);

        return $response;
    }
public function doCreateButton(array $fields)
    {
        if (false == isset($fields['return'])) {
            if (false == $this->options['return']) {
                throw new RuntimeException('The return must be set either to FormRequest or to options.');
            }

            $fields['return'] = $this->options['return'];
        }

        $fields['paymentaction'] = self::PAYMENTACTION_SALE;
        $fields['cmd']           = self::FORM_CMD;

        $newFields = [];
        $i         = 0;
        foreach ($fields as $key => $val) {
            $newFields['L_BUTTONVAR'.$i] = $key.'='.$val;
            $i++;
        }

        $newFields['METHOD']     = 'BMCreateButton';
        $newFields['BUTTONTYPE'] = 'PAYMENT';
        $newFields['BUTTONCODE'] = 'TOKEN';

        $this->addVersionField($newFields);
        $this->addAuthorizeFields($newFields);

        $response = $this->doRequest($newFields);

        return $response;
    }
Solution BMCreateButton

@param array $fields

@throws RuntimeException

@return array