Shopify/active_merchant — pull request #923 by duff (2013-11-21 17:55:14+00:00)
Title: Paymill: Fix authorizations

In May 2013, Paymill added some response codes:
https://blog.paymill.com/new-response-codes/

And there's now a way to trigger declines and other errors using their
test gateway.

This commit now accounts for the fact that a decline may have 4XX HTPP
status code or it may have a 200 status code. Success in Paymill means
that it's a 200 status code && the response_code within the body is
20000. Except for the Void operation. In that case, just a 200
status code is sufficient since the body doesn't include a
response_code.

The Purchase operation returns a 4XX for a failure but the Authorize
returns a 200 for a failure. Now when an authorize fails on the Paymill
side, Active Merchant once again reports that transaction as having
failed.

This commit also fills the response with the appropriate response
message based on the response_code since the body doesn't include the
text. This ActiveMerchant adapter now handles the response description
mapping to give end users a better idea of what went wrong.