spree/spree_gateway — pull request #122 by HoyaBoya (2013-12-04 00:01:45+00:00)
Title: Fix for Feature/braintree merchant account

This is a fix for a bug introduced in this commit:

https://github.com/spree/spree_gateway/commit/d58d419050942ec7f9232bf8d8b1d69691eb06a0

The super.provider creates the BraintreeBlueGateway object with all preference hashes so merchant_account_id is always sent, even if blank. This will create a regression where all Braintree transactions receive a 91513 error code.

The fix is to not bother with the adjustment methods and instead extend def options to remove the merchant_account_id if it is blank? then return the hash for super.provider.

I also tried doing this in def preferences, but this logic determines what fields are shown in the admin tool for payment methods.