Updated payment handler to properly handle error conditions.

--HG--
branch : sandbox