Skip to content

Commit

Permalink
IN-292 Adds builder for returns from notes
Browse files Browse the repository at this point in the history
  • Loading branch information
reinaldob committed Dec 16, 2014
1 parent 024faaa commit a8a03b8
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions lib/integrations/builders/return.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module Integration
module Builder
class Return

attr_reader :object

def initialize(object)
@object = object.with_indifferent_access
end

def build
params = {
'Title' => "Return:#{object['id']}",
'Body' => build_body(object),
'IsPrivate' => false
}
end

def build_body(object)
<<-body
Status: #{object['status']}
Amount: #{object['refund_amount']}
Extra: #{object['extra']}
body
end
end
end
end

0 comments on commit a8a03b8

Please sign in to comment.