paymill / paymill-java

Java wrapper for Paymill API
http://paymill.github.io
MIT License
26 stars 22 forks source link

Change Offer setInterval method parameter type from String to Interval.Period type #50

Closed basoko closed 10 years ago

basoko commented 10 years ago

There is an error getting an offer's interval property because the interval is not copied using the RestfulUtils.refreshInstance method. The error is due to the inconsistency between the types of interval's getter and setter methods.

nikoloff commented 10 years ago

Hi @basoko, thx for helping us to build a better software. Is it going to work if we have 2 setters (one with String and one with Interval)? I think leaving the String setter will simplify the usage of the wrapper.

basoko commented 10 years ago

Hi @nikoloff,

This was what I tried at first, but I got an error because there was two method with the same name and one parameter. I decided to change the parameter type because the getter method returns that type and in other model's setters you use the specific type instead of a String, like for example in the Subscription model with interval property of type .

I think that another solution, if you don't want to change the setter parameter type, would be to implement a converter from Apache Commons Beanutils, but I think that this is better.

stoilkov commented 10 years ago

thanks @basoko this was merged manually with #60