mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-03 00:01:21 -04:00
Add support for the SetupAttempt
resource and List API (#949)
* Codegen for openapi 3854362 * Fix and add tests
This commit is contained in:
parent
eb84249205
commit
29f321b224
@ -15,7 +15,7 @@ notifications:
|
||||
env:
|
||||
global:
|
||||
# If changing this number, please also change it in `test/test_helper.rb`.
|
||||
- STRIPE_MOCK_VERSION=0.98.0
|
||||
- STRIPE_MOCK_VERSION=0.99.0
|
||||
|
||||
cache:
|
||||
directories:
|
||||
|
@ -73,6 +73,7 @@ module Stripe
|
||||
Reversal::OBJECT_NAME => Reversal,
|
||||
Review::OBJECT_NAME => Review,
|
||||
SKU::OBJECT_NAME => SKU,
|
||||
SetupAttempt::OBJECT_NAME => SetupAttempt,
|
||||
SetupIntent::OBJECT_NAME => SetupIntent,
|
||||
Sigma::ScheduledQueryRun::OBJECT_NAME => Sigma::ScheduledQueryRun,
|
||||
Source::OBJECT_NAME => Source,
|
||||
|
@ -61,6 +61,7 @@ require "stripe/resources/reporting/report_run"
|
||||
require "stripe/resources/reporting/report_type"
|
||||
require "stripe/resources/reversal"
|
||||
require "stripe/resources/review"
|
||||
require "stripe/resources/setup_attempt"
|
||||
require "stripe/resources/setup_intent"
|
||||
require "stripe/resources/sigma/scheduled_query_run"
|
||||
require "stripe/resources/sku"
|
||||
|
10
lib/stripe/resources/setup_attempt.rb
Normal file
10
lib/stripe/resources/setup_attempt.rb
Normal file
@ -0,0 +1,10 @@
|
||||
# File generated from our OpenAPI spec
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Stripe
|
||||
class SetupAttempt < APIResource
|
||||
extend Stripe::APIOperations::List
|
||||
|
||||
OBJECT_NAME = "setup_attempt"
|
||||
end
|
||||
end
|
@ -19,8 +19,7 @@ module Stripe
|
||||
|
||||
should "be creatable" do
|
||||
product = Stripe::Product.create(
|
||||
name: "My Product",
|
||||
type: "good"
|
||||
name: "My Product"
|
||||
)
|
||||
assert_requested :post, "#{Stripe.api_base}/v1/products"
|
||||
assert product.is_a?(Stripe::Product)
|
||||
|
16
test/stripe/setup_attempt_test.rb
Normal file
16
test/stripe/setup_attempt_test.rb
Normal file
@ -0,0 +1,16 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require ::File.expand_path("../test_helper", __dir__)
|
||||
|
||||
module Stripe
|
||||
class SetupAttemptTest < Test::Unit::TestCase
|
||||
should "be listable" do
|
||||
setup_attempts = Stripe::SetupAttempt.list({
|
||||
setup_intent: "seti_123",
|
||||
})
|
||||
assert_requested :get, "#{Stripe.api_base}/v1/setup_attempts?setup_intent=seti_123"
|
||||
assert setup_attempts.data.is_a?(Array)
|
||||
assert setup_attempts.data[0].is_a?(Stripe::SetupAttempt)
|
||||
end
|
||||
end
|
||||
end
|
@ -16,7 +16,7 @@ require ::File.expand_path("test_data", __dir__)
|
||||
require ::File.expand_path("stripe_mock", __dir__)
|
||||
|
||||
# If changing this number, please also change it in `.travis.yml`.
|
||||
MOCK_MINIMUM_VERSION = "0.98.0"
|
||||
MOCK_MINIMUM_VERSION = "0.99.0"
|
||||
MOCK_PORT = Stripe::StripeMock.start
|
||||
|
||||
# Disable all real network connections except those that are outgoing to
|
||||
|
Loading…
x
Reference in New Issue
Block a user