Skip to content

Commit

Permalink
Codegen for openapi v161
Browse files Browse the repository at this point in the history
  • Loading branch information
dcr-stripe committed Jun 29, 2022
1 parent a447425 commit e68ed26
Show file tree
Hide file tree
Showing 4 changed files with 513 additions and 368 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v157
v161
8 changes: 8 additions & 0 deletions lib/stripe/api_version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true

module Stripe
module ApiVersion
CURRENT = "2020-08-27"
end
end
80 changes: 80 additions & 0 deletions lib/stripe/resources/issuing/card.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,86 @@ def self.details(card, params = {}, opts = {})
opts: opts
)
end

def test_helpers
TestHelpers.new(self)
end

class TestHelpers < APIResourceTestHelpers
RESOURCE_CLASS = Card

def self.deliver_card(card, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/cards/%<card>s/shipping/deliver", { card: CGI.escape(card) }),
params: params,
opts: opts
)
end

def self.fail_card(card, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/cards/%<card>s/shipping/fail", { card: CGI.escape(card) }),
params: params,
opts: opts
)
end

def self.return_card(card, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/cards/%<card>s/shipping/return", { card: CGI.escape(card) }),
params: params,
opts: opts
)
end

def self.ship_card(card, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/cards/%<card>s/shipping/ship", { card: CGI.escape(card) }),
params: params,
opts: opts
)
end

def deliver_card(params = {}, opts = {})
@resource.request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/cards/%<card>s/shipping/deliver", { card: CGI.escape(@resource["id"]) }),
params: params,
opts: opts
)
end

def fail_card(params = {}, opts = {})
@resource.request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/cards/%<card>s/shipping/fail", { card: CGI.escape(@resource["id"]) }),
params: params,
opts: opts
)
end

def return_card(params = {}, opts = {})
@resource.request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/cards/%<card>s/shipping/return", { card: CGI.escape(@resource["id"]) }),
params: params,
opts: opts
)
end

def ship_card(params = {}, opts = {})
@resource.request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/cards/%<card>s/shipping/ship", { card: CGI.escape(@resource["id"]) }),
params: params,
opts: opts
)
end
end
end
end
end
Loading

0 comments on commit e68ed26

Please sign in to comment.