Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

API Updates #1050

Merged
merged 3 commits into from
Apr 21, 2022
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
19 changes: 19 additions & 0 deletions lib/stripe/resources/refund.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,24 @@ def cancel(params = {}, opts = {})
opts: opts
)
end

def test_helpers
TestHelpers.new(self)
end

class TestHelpers < APIResourceTestHelpers
RESOURCE_CLASS = Refund

custom_method :expire, http_verb: :post

def expire(params = {}, opts = {})
@resource.request_stripe_object(
method: :post,
path: resource_url + "/expire",
params: params,
opts: opts
)
end
end
end
end
6 changes: 6 additions & 0 deletions test/stripe/generated_examples_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1241,6 +1241,12 @@ class CodegennedExampleTest < Test::Unit::TestCase
assert_requested :post, "#{Stripe.api_base}/v1/refunds"
end
end
context "Refund.expire" do
should "support requests with args: refund" do
Stripe::Refund::TestHelpers.expire("re_123")
assert_requested :post, "#{Stripe.api_base}/v1/test_helpers/refunds/re_123/expire?"
end
end
context "Refund.list" do
should "support requests with args: limit" do
Stripe::Refund.list(limit: 3)
Expand Down