Error when integrating new API

I get that error so the page crashes and I never get the call back for good or failed transaction due to that invalid JSON error.