mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-04 00:00:47 -04:00
Codegen for openapi v157 (#1073)
This commit is contained in:
parent
020328bf27
commit
8ec93fb0b7
@ -1 +1 @@
|
|||||||
v154
|
v157
|
@ -146,5 +146,31 @@ module Stripe
|
|||||||
opts: opts
|
opts: opts
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_helpers
|
||||||
|
TestHelpers.new(self)
|
||||||
|
end
|
||||||
|
|
||||||
|
class TestHelpers < APIResourceTestHelpers
|
||||||
|
RESOURCE_CLASS = Customer
|
||||||
|
|
||||||
|
def self.fund_cash_balance(customer, params = {}, opts = {})
|
||||||
|
request_stripe_object(
|
||||||
|
method: :post,
|
||||||
|
path: format("/v1/test_helpers/customers/%<customer>s/fund_cash_balance", { customer: CGI.escape(customer) }),
|
||||||
|
params: params,
|
||||||
|
opts: opts
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
def fund_cash_balance(params = {}, opts = {})
|
||||||
|
@resource.request_stripe_object(
|
||||||
|
method: :post,
|
||||||
|
path: format("/v1/test_helpers/customers/%<customer>s/fund_cash_balance", { customer: CGI.escape(@resource["id"]) }),
|
||||||
|
params: params,
|
||||||
|
opts: opts
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -409,6 +409,15 @@ module Stripe
|
|||||||
assert_requested :delete, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx?"
|
assert_requested :delete, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx?"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
context "Customer.fund_cash_balance" do
|
||||||
|
should "support requests with args: customer, amount, currency" do
|
||||||
|
Stripe::Customer::TestHelpers.fund_cash_balance(
|
||||||
|
"cus_123",
|
||||||
|
{ amount: 30, currency: "eur" }
|
||||||
|
)
|
||||||
|
assert_requested :post, "#{Stripe.api_base}/v1/test_helpers/customers/cus_123/fund_cash_balance"
|
||||||
|
end
|
||||||
|
end
|
||||||
context "Customer.list" do
|
context "Customer.list" do
|
||||||
should "support requests with args: limit" do
|
should "support requests with args: limit" do
|
||||||
Stripe::Customer.list(limit: 3)
|
Stripe::Customer.list(limit: 3)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user