src/Payum/Paypal/Masspay/Nvp/PaypalMasspayGatewayFactory.php
protected function populateConfig(ArrayObject $config)
    {
        $config->defaults(array(
            'payum.factory_name' => 'paypal_masspay_nvp',
            'payum.factory_title' => 'PayPal Masspay',
            
            'payum.action.payout' => new PayoutAction(),
            'payum.action.api.masspay' => new MasspayAction(),
            'payum.action.convert_payout' => new ConvertPayoutAction(),
            'payum.action.get_payout_status' => new GetPayoutStatusAction(),
        ));

        if (false == $config['payum.api']) {
            $config['payum.default_options'] = array(
                'username' => '',
                'password' => '',
                'signature' => '',
                'sandbox' => true,
            );
            $config->defaults($config['payum.default_options']);
            $config['payum.required_options'] = array('username', 'password', 'signature');

            $config['payum.api'] = function (ArrayObject $config) {
                $config->validateNotEmpty($config['payum.required_options']);

                $paypalConfig = [
                    'username' => $config['username'],
                    'password' => $config['password'],
                    'signature' => $config['signature'],
                    'sandbox' => $config['sandbox'],
                ];

                return new Api($paypalConfig, $config['payum.http_client'], $config['httplug.message_factory']);
            };
        }
    }
protected function populateConfig(ArrayObject $config)
    {
        $config->defaults(array(
            'payum.factory_name' => 'paypal_masspay_nvp',
            'payum.factory_title' => 'PayPal Masspay',
            
            'payum.action.payout' => new PayoutAction(),
            'payum.action.api.masspay' => new MasspayAction(),
            'payum.action.convert_payout' => new ConvertPayoutAction(),
            'payum.action.get_payout_status' => new GetPayoutStatusAction(),
        ));

        if (false == $config['payum.api']) {
            $config['payum.default_options'] = array(
                'username' => '',
                'password' => '',
                'signature' => '',
                'sandbox' => true,
            );
            $config->defaults($config['payum.default_options']);
            $config['payum.required_options'] = array('username', 'password', 'signature');

            $config['payum.api'] = function (ArrayObject $config) {
                $config->validateNotEmpty($config['payum.required_options']);

                $paypalConfig = [
                    'username' => $config['username'],
                    'password' => $config['password'],
                    'signature' => $config['signature'],
                    'sandbox' => $config['sandbox'],
                ];

                return new Api($paypalConfig, $config['payum.http_client'], $config['httplug.message_factory']);
            };
        }
    }
{@inheritDoc}