This transaction cannot be processed due to an invalid merchant configuration.

Paypal Sandbox Problem: I was getting an error "This transaction cannot be processed due to an invalid merchant configuration."  while trying to use the DoDirectPayment example on the sandbox using the provided API user/pass.  

Solution:

The API credentials in the Sandbox environment uses the default buyer account you have. You need to make sure to use the "payments pro" option when you create a buyer account in the sandbox environment. You'll then see a new set of API credentials under API credentials... Steps below:

1. Go to the link https://developer.paypal.com/us/cgi-bin/devscr?cmd=_sandbox-acct-session and login with your sandbox credentials

2. And click on the link Preconfigured which will take you to https://developer.paypal.com/us/cgi-bin/devscr?cmd=_create-account-session

3. From the options select Website Payments Pro (Use to represent yourself as a merchant using Pro) and create a Test Account and use these details for sandbox. And it works !! :)