I see you are doing a sandbox transaction in your test. Maybe you aren't using sandbox for the eCart page? The credentials are different for both. Try using live credentials, you can always refund the purchase.
If you give me FTP access and a url to view the problem I could debug it directly. But if it works with paypal code and not eCart with a bad credentials error, then I'd guess that you are not using sandbox in eCart and are using sandbox for the other.