Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helper method for returns #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions lib/sailthru/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,31 @@ def purchase(email, items, incomplete = nil, message_id = nil, options = {})
end
api_post(:purchase, data)
end

# params:
# email, String
# items, Array of Hashes
# incomplete, Integer
# message_id, String
# options, Hash
# returns:
# hash, response from server
#
# Record that a user has made a return or refund.
def return(email, items, incomplete = nil, message_id = nil, options = {})
data = options
data[:email] = email
data[:items] = items

if incomplete != nil
data[:incomplete] = incomplete.to_i
end

if message_id != nil
data[:message_id] = message_id
end
api_post(:return, data)
end

# <b>DEPRECATED:</b> Please use either stats_list or stats_blast
# params:
Expand Down