Merge upstream and update generated code for v1013

This commit is contained in:
Stripe OpenAPI 2024-05-07 17:28:36 +00:00
commit 78e3166e20
3 changed files with 35 additions and 1 deletions

View File

@ -1 +1 @@
v1011
v1013

View File

@ -187,6 +187,18 @@ module Stripe
ch = Stripe::Charge.retrieve("ch_123", "sk_test_local")
ch.refunds.create
end
should "use the per-object credential when making subsequent requests on the object" do
stub_request(:get, "#{Stripe.api_base}/v1/customers/cus_123")
.with(headers: { "Authorization" => "Bearer sk_test_local", "Stripe-Account" => "acct_12345" })
.to_return(body: JSON.generate(charge_fixture))
stub_request(:delete, "#{Stripe.api_base}/v1/customers/cus_123")
.with(headers: { "Authorization" => "Bearer sk_test_local", "Stripe-Account" => "acct_12345" })
.to_return(body: "{}")
cus = Stripe::Customer.retrieve("cus_123", { api_key: "sk_test_local", stripe_account: "acct_12345" })
cus.delete
end
end
end

View File

@ -109,6 +109,28 @@ module Stripe
assert_equal expected, list.auto_paging_each.to_a
end
should "forward api key through #auto_paging_iter" do
arr = [
{ id: "ch_001" },
{ id: "ch_002" },
]
expected = Util.convert_to_stripe_object(arr, {})
stub_request(:get, "#{Stripe.api_base}/v1/charges")
.with(headers: { "Authorization" => "Bearer sk_test_iter_forwards_options" })
.to_return(body: JSON.generate(data: [{ id: "ch_001" }], has_more: true, url: "/v1/charges",
object: "list"))
stub_request(:get, "#{Stripe.api_base}/v1/charges")
.with(headers: { "Authorization" => "Bearer sk_test_iter_forwards_options" })
.with(query: { starting_after: "ch_001" })
.to_return(body: JSON.generate(data: [{ id: "ch_002" }], has_more: false, url: "/v1/charges",
object: "list"))
list = Stripe::Charge.list({}, { api_key: "sk_test_iter_forwards_options" })
assert_equal expected, list.auto_paging_each.to_a
end
should "provide #auto_paging_each that responds to a block" do
arr = [
{ id: 1 },