Remove deprecations

This commit is contained in:
Brandur 2016-01-19 15:31:44 -08:00
parent 437c2dfa02
commit 13cba9f29a
4 changed files with 0 additions and 56 deletions

View File

@ -1,6 +1,5 @@
module Stripe
class ApplicationFee < APIResource
extend Gem::Deprecate
extend Stripe::APIOperations::List
def self.url
@ -17,6 +16,5 @@ module Stripe
# from the server
self.refresh
end
deprecate :refund, "application_fee.refunds.create", 2016, 07
end
end

View File

@ -1,6 +1,5 @@
module Stripe
class Charge < APIResource
extend Gem::Deprecate
extend Stripe::APIOperations::List
extend Stripe::APIOperations::Create
include Stripe::APIOperations::Update
@ -13,7 +12,6 @@ module Stripe
# from the server
self.refresh
end
deprecate :refund, "charge.refunds.create", 2016, 07
def capture(params={}, opts={})
response, opts = request(:post, capture_url, params, opts)

View File

@ -21,31 +21,5 @@ module Stripe
refund = fee.refunds.create
assert refund.is_a?(Stripe::ApplicationFeeRefund)
end
should "warn that #refund is deprecated" do
old_stderr = $stderr
$stderr = StringIO.new
begin
fee = Stripe::ApplicationFee.construct_from(make_application_fee)
# creates the refund (this is not how the endpoint would actually
# respond, but we discard the result anyway)
@mock.expects(:post).once.
with("#{Stripe.api_base}/v1/application_fees/#{fee.id}/refunds", nil, '').
returns(make_response({}))
# reloads the application fee to get the field updates
@mock.expects(:get).once.
with("#{Stripe.api_base}/v1/application_fees/#{fee.id}", nil, nil).
returns(make_response({:id => fee.id, :refunded => true}))
fee.refund
message = "NOTE: Stripe::ApplicationFee#refund is deprecated; use " +
"application_fee.refunds.create instead"
assert_match Regexp.new(message), $stderr.string
ensure
$stderr = old_stderr
end
end
end
end

View File

@ -114,31 +114,5 @@ module Stripe
})
assert c.paid
end
should "warn that #refund is deprecated" do
old_stderr = $stderr
$stderr = StringIO.new
begin
charge = Stripe::Charge.construct_from(make_charge)
# creates the refund (this is not how the endpoint would actually
# respond, but we discard the result anyway)
@mock.expects(:post).once.
with("#{Stripe.api_base}/v1/charges/#{charge.id}/refunds", nil, '').
returns(make_response({}))
# reloads the charge to get the field updates
@mock.expects(:get).once.
with("#{Stripe.api_base}/v1/charges/#{charge.id}", nil, nil).
returns(make_response({:id => charge.id, :refunded => true}))
charge.refund
message = "NOTE: Stripe::Charge#refund is deprecated; use " +
"charge.refunds.create instead"
assert_match Regexp.new(message), $stderr.string
ensure
$stderr = old_stderr
end
end
end
end