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 support for Terminal Location and Reader deletion #748

Merged
merged 1 commit into from
Mar 18, 2019
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ sudo: false
env:
global:
# If changing this number, please also change it in `test/test_helper.rb`.
- STRIPE_MOCK_VERSION=0.47.0
- STRIPE_MOCK_VERSION=0.49.0

cache:
directories:
Expand Down
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
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
require ::File.expand_path("../stripe_mock", __FILE__)

# If changing this number, please also change it in `.travis.yml`.
MOCK_MINIMUM_VERSION = "0.47.0".freeze
MOCK_MINIMUM_VERSION = "0.49.0".freeze
MOCK_PORT = Stripe::StripeMock.start

# Disable all real network connections except those that are outgoing to
Expand Down