mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-12-09 00:01:53 -05:00
Merge upstream and update generated code for v1013
This commit is contained in:
commit
78e3166e20
@ -1 +1 @@
|
|||||||
v1011
|
v1013
|
||||||
@ -187,6 +187,18 @@ module Stripe
|
|||||||
ch = Stripe::Charge.retrieve("ch_123", "sk_test_local")
|
ch = Stripe::Charge.retrieve("ch_123", "sk_test_local")
|
||||||
ch.refunds.create
|
ch.refunds.create
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -109,6 +109,28 @@ module Stripe
|
|||||||
assert_equal expected, list.auto_paging_each.to_a
|
assert_equal expected, list.auto_paging_each.to_a
|
||||||
end
|
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
|
should "provide #auto_paging_each that responds to a block" do
|
||||||
arr = [
|
arr = [
|
||||||
{ id: 1 },
|
{ id: 1 },
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user