lib/recurly/invoice.rb in recurly-2.4.5 vs lib/recurly/invoice.rb in recurly-2.4.6

- old
+ new

@@ -19,12 +19,16 @@ belongs_to :subscription # @return [Invoice] belongs_to :original_invoice, class_name: 'Invoice' # @return [Redemption] - has_one :redemption + has_many :redemptions + def redemption + redemptions.first + end + def invoice_number_with_prefix "#{invoice_number_prefix}#{invoice_number}" end define_attribute_methods %w( @@ -76,10 +80,10 @@ def mark_failed return false unless link? :mark_failed reload follow_link :mark_failed true end - + def enter_offline_payment(attrs={}) Transaction.from_response API.post("#{uri}/transactions", attrs.empty? ? nil : Transaction.to_xml(attrs)) rescue Recurly::API::UnprocessableEntity => e raise Invalid, e.message end