From 16d5c773ac93f93b43b74c9f48b9565ab854b81e Mon Sep 17 00:00:00 2001 From: Sean Date: Thu, 8 Oct 2020 09:28:37 -0500 Subject: [PATCH] Fix value conversion method In Solidus, this method has changed from having two parameters to having three. This updates the method here to match, so we avoid any too_many_parameter errors. Most noticably, this was affecting our test suite. See: https://github.com/solidusio/solidus/commit/e05da68179b45a68d762dfcc7c1ba6618d00d234 --- app/models/solidus_paypal_braintree/gateway.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/models/solidus_paypal_braintree/gateway.rb b/app/models/solidus_paypal_braintree/gateway.rb index a2133639..e9f13657 100644 --- a/app/models/solidus_paypal_braintree/gateway.rb +++ b/app/models/solidus_paypal_braintree/gateway.rb @@ -292,11 +292,15 @@ def to_hash(preference_string) JSON.parse(preference_string.gsub("=>", ":")) end - def convert_preference_value(value, type) + def convert_preference_value(value, type, preference_encryptor = nil) if type == :hash && value.is_a?(String) value = to_hash(value) end - super + if method(__method__).super_method.arity == 3 + super + else + super(value, type) + end end def transaction_options(source, options, submit_for_settlement = false)