lib/recurly/invoice.rb in recurly-2.18.17 vs lib/recurly/invoice.rb in recurly-2.18.18
- old
+ new
@@ -201,9 +201,12 @@
def refund(line_items = nil, refund_method = 'credit_first', options = {})
return false unless link? :refund
self.class.from_response(
follow_link :refund, :body => refund_line_items_to_xml(line_items, refund_method, options)
)
+ rescue Recurly::API::UnprocessableEntity => e
+ Transaction::Error.validate! e, (self if is_a?(Transaction))
+ raise
end
# Refunds the invoice for a specific amount.
#
# @return [Invoice, false] Invoice if successful, false if the invoice isn't