It must be replaced by 
$captureRequest->getRegisterToMerchantCredential()->setMerchantName($GLOBALS['__PAYUM_HEARTLAND_SECOND_MERCHANT_NAME']);