mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-11-29 00:01:18 -05:00
Remove deprecations
This commit is contained in:
parent
437c2dfa02
commit
13cba9f29a
@ -1,6 +1,5 @@
|
|||||||
module Stripe
|
module Stripe
|
||||||
class ApplicationFee < APIResource
|
class ApplicationFee < APIResource
|
||||||
extend Gem::Deprecate
|
|
||||||
extend Stripe::APIOperations::List
|
extend Stripe::APIOperations::List
|
||||||
|
|
||||||
def self.url
|
def self.url
|
||||||
@ -17,6 +16,5 @@ module Stripe
|
|||||||
# from the server
|
# from the server
|
||||||
self.refresh
|
self.refresh
|
||||||
end
|
end
|
||||||
deprecate :refund, "application_fee.refunds.create", 2016, 07
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
module Stripe
|
module Stripe
|
||||||
class Charge < APIResource
|
class Charge < APIResource
|
||||||
extend Gem::Deprecate
|
|
||||||
extend Stripe::APIOperations::List
|
extend Stripe::APIOperations::List
|
||||||
extend Stripe::APIOperations::Create
|
extend Stripe::APIOperations::Create
|
||||||
include Stripe::APIOperations::Update
|
include Stripe::APIOperations::Update
|
||||||
@ -13,7 +12,6 @@ module Stripe
|
|||||||
# from the server
|
# from the server
|
||||||
self.refresh
|
self.refresh
|
||||||
end
|
end
|
||||||
deprecate :refund, "charge.refunds.create", 2016, 07
|
|
||||||
|
|
||||||
def capture(params={}, opts={})
|
def capture(params={}, opts={})
|
||||||
response, opts = request(:post, capture_url, params, opts)
|
response, opts = request(:post, capture_url, params, opts)
|
||||||
|
|||||||
@ -21,31 +21,5 @@ module Stripe
|
|||||||
refund = fee.refunds.create
|
refund = fee.refunds.create
|
||||||
assert refund.is_a?(Stripe::ApplicationFeeRefund)
|
assert refund.is_a?(Stripe::ApplicationFeeRefund)
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
|||||||
@ -114,31 +114,5 @@ module Stripe
|
|||||||
})
|
})
|
||||||
assert c.paid
|
assert c.paid
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user