gemspec, lib: fix build for old versions of JRuby

Tested with jruby-1.6.5.1.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
resource: fix serialization of nested attributes

This fixes refund with item adjustments.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>