braintree / braintree_ruby

Braintree Ruby library
https://developer.paypal.com/braintree/docs/start/overview
MIT License
444 stars 195 forks source link

TimeWithZone in Rails deprecation will affect XML generation on Rails 7.1 #208

Closed Tonkpils closed 3 years ago

Tonkpils commented 3 years ago

General information

Issue description

https://github.com/rails/rails/pull/41835 introduced a deprecation warning on TimeWithZone.name. The idea is that in Rails 7.1 TimeWithZone will return "ActiveSupport::TimeWithZone" instead of "Time". However, the this gem currently uses https://github.com/braintree/braintree_ruby/blob/master/lib/braintree/xml/generator.rb#L62 the name to match against Time and triggers this warning. If the deprecation remains and Rails 7.1 removes this method, any Rails application using the Braintree gem and using objects with Time fields will likely begin failing.

I'm thinking we could add a ActiveSupport::TimeWithZone to XML_TYPE_NAMES to prevent this issue but there may be other options here?