Shopify/active_merchant — pull request #1282 by duff (2014-06-27 22:49:06+00:00)
Title: Braintree: Add ability to verify a card

It looks like Braintree has some support for zero dollar authorizations:

https://support.braintreepayments.com/customer/portal/articles/1429320-card-verification

However, the feature depends on the card type and is hampered by the
fact that some underlying processors don't support it. Braintree
accommodates this by attempting a zero dollar `auth` and if that fails
they then attempt a $1 `auth`.

We're going to stick with a simpler approach. Do a $1 `auth` and then a
`void`. It'll always work, and it's only one `auth` API call.

This adds `verify` to both Braintree Blue and Braintree Orange. Added
bonus is that Transax gets it too since it shares behavior with
Braintree Orange.

Remote tests are working across the board. I didn't add unit tests for
Braintree Blue because those unit tests are somewhat off the beaten path
than our unit tests for other gateways due to the fact that we're using
the Braintree gem. The unit tests there aren't the easiest to mock out.
I suspect we're relying on the remote tests for Braintree Blue in the
cases where the unit tests are deficient. Long term, I suspect we'd
like to move away from using the gem, but I'm not sure how feasible that
is at this point.