customer = gateway.customer.find("the_id_of_customer")
Try to store the result of this in redis to be used later.
cache.set("braintree_customer_id", customer, 60*60*24)
This is because customer now represents a thread-local object, before it did not. Redis tries to pickle the object for storage but it can not pickle a thread-local object.