Skip to content

Commit

Permalink
Merge pull request #748 from stripe/remi-add-terminal-delete
Browse files Browse the repository at this point in the history
Add support for Terminal Location and Reader deletion
  • Loading branch information
remi-stripe authored Mar 18, 2019
2 parents 26ac126 + 031075c commit 7b9b7b6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/stripe/terminal/location.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Stripe
module Terminal
class Location < Stripe::APIResource
extend Stripe::APIOperations::Create
include Stripe::APIOperations::Delete
extend Stripe::APIOperations::List
include Stripe::APIOperations::Save

Expand Down
1 change: 1 addition & 0 deletions lib/stripe/terminal/reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Stripe
module Terminal
class Reader < Stripe::APIResource
extend Stripe::APIOperations::Create
include Stripe::APIOperations::Delete
extend Stripe::APIOperations::List
include Stripe::APIOperations::Save

Expand Down
7 changes: 7 additions & 0 deletions test/stripe/terminal/location_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ class LocationTest < Test::Unit::TestCase
assert_requested :post, "#{Stripe.api_base}/v1/terminal/locations/loc_123"
assert location.is_a?(Stripe::Terminal::Location)
end

should "be deletable" do
location = Stripe::Terminal::Location.retrieve("loc_123")
location = location.delete
assert_requested :delete, "#{Stripe.api_base}/v1/terminal/locations/#{location.id}"
assert location.is_a?(Stripe::Terminal::Location)
end
end
end
end
7 changes: 7 additions & 0 deletions test/stripe/terminal/reader_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ class ReaderTest < Test::Unit::TestCase
assert_requested :post, "#{Stripe.api_base}/v1/terminal/readers/rdr_123"
assert reader.is_a?(Stripe::Terminal::Reader)
end

should "be deletable" do
reader = Stripe::Terminal::Reader.retrieve("rdr_123")
reader = reader.delete
assert_requested :delete, "#{Stripe.api_base}/v1/terminal/readers/#{reader.id}"
assert reader.is_a?(Stripe::Terminal::Reader)
end
end
end
end

0 comments on commit 7b9b7b6

Please sign in to comment.