Add support for Terminal Location and Reader deletion

This commit is contained in:
Remi Jannel 2019-03-15 22:11:41 -07:00
parent df8c141bb8
commit 031075c954
6 changed files with 18 additions and 2 deletions

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -46,6 +46,13 @@ module Stripe
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

View File

@ -40,6 +40,13 @@ module Stripe
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

View File

@ -17,7 +17,7 @@ require ::File.expand_path("../test_data", __FILE__)
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