Skip to content

Commit

Permalink
Next major release changes (#1144)
Browse files Browse the repository at this point in the history
  • Loading branch information
pakrym-stripe authored Nov 16, 2022
1 parent 6dc0095 commit a0935c2
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 240 deletions.
5 changes: 5 additions & 0 deletions lib/stripe/api_operations/save.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ def update(id, params = {}, opts = {})
end
end

# The `save` method is DEPRECATED and will be removed in a future major
# version of the library. Use the `update` method on the resource instead.
#
# Creates or updates an API resource.
#
# If the resource doesn't yet have an assigned ID and the resource is one
Expand Down Expand Up @@ -68,6 +71,8 @@ def save(params = {}, opts = {})
resp, opts = execute_resource_request(:post, save_url, values, opts)
initialize_from(resp.data, opts)
end
extend Gem::Deprecate
deprecate :save, :update, 2022, 11

def self.included(base)
# Set `metadata` as additive so that when it's set directly we remember
Expand Down
2 changes: 1 addition & 1 deletion lib/stripe/api_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

module Stripe
module ApiVersion
CURRENT = "2022-08-01"
CURRENT = "2022-11-15"
end
end
2 changes: 0 additions & 2 deletions lib/stripe/object_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def self.object_names_to_classes
LineItem::OBJECT_NAME => LineItem,
LoginLink::OBJECT_NAME => LoginLink,
Mandate::OBJECT_NAME => Mandate,
Order::OBJECT_NAME => Order,
PaymentIntent::OBJECT_NAME => PaymentIntent,
PaymentLink::OBJECT_NAME => PaymentLink,
PaymentMethod::OBJECT_NAME => PaymentMethod,
Expand All @@ -85,7 +84,6 @@ def self.object_names_to_classes
SetupIntent::OBJECT_NAME => SetupIntent,
ShippingRate::OBJECT_NAME => ShippingRate,
Sigma::ScheduledQueryRun::OBJECT_NAME => Sigma::ScheduledQueryRun,
SKU::OBJECT_NAME => SKU,
Source::OBJECT_NAME => Source,
SourceTransaction::OBJECT_NAME => SourceTransaction,
Subscription::OBJECT_NAME => Subscription,
Expand Down
2 changes: 0 additions & 2 deletions lib/stripe/resources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
require "stripe/resources/line_item"
require "stripe/resources/login_link"
require "stripe/resources/mandate"
require "stripe/resources/order"
require "stripe/resources/payment_intent"
require "stripe/resources/payment_link"
require "stripe/resources/payment_method"
Expand All @@ -72,7 +71,6 @@
require "stripe/resources/setup_intent"
require "stripe/resources/shipping_rate"
require "stripe/resources/sigma/scheduled_query_run"
require "stripe/resources/sku"
require "stripe/resources/source"
require "stripe/resources/source_transaction"
require "stripe/resources/subscription"
Expand Down
89 changes: 0 additions & 89 deletions lib/stripe/resources/order.rb

This file was deleted.

4 changes: 0 additions & 4 deletions lib/stripe/resources/refund.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ module Stripe
# but not yet refunded. Funds will be refunded to the credit or debit card that
# was originally charged.
#
# Stripe Tax users with recurring payments and invoices can create [Credit Notes](https://stripe.com/docs/api/credit_notes),
# which reduce overall tax liability because tax is correctly recalculated and
# apportioned to the related invoice.
#
# Related guide: [Refunds](https://stripe.com/docs/refunds).
class Refund < APIResource
extend Stripe::APIOperations::Create
Expand Down
19 changes: 0 additions & 19 deletions lib/stripe/resources/sku.rb

This file was deleted.

25 changes: 0 additions & 25 deletions lib/stripe/resources/subscription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,31 +50,6 @@ def self.delete_discount(subscription_exposed_id, params = {}, opts = {})
end

save_nested_resource :source
def delete(params = {}, opts = {})
request_stripe_object(
method: :delete,
path: format("/v1/subscriptions/%<subscription_exposed_id>s", { subscription_exposed_id: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end

def self.delete(subscription_exposed_id, params = {}, opts = {})
request_stripe_object(
method: :delete,
path: format("/v1/subscriptions/%<subscription_exposed_id>s", { subscription_exposed_id: CGI.escape(subscription_exposed_id) }),
params: params,
opts: opts
)
end

extend Gem::Deprecate
deprecate :delete, "Stripe::Subscription.cancel", 2022, 7

class << self
extend Gem::Deprecate
deprecate :delete, "Stripe::Subscription#cancel", 2022, 7
end

def self.search(params = {}, opts = {})
_search("/v1/subscriptions/search", params, opts)
Expand Down
38 changes: 0 additions & 38 deletions test/stripe/generated_examples_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1815,44 +1815,6 @@ class CodegennedExampleTest < Test::Unit::TestCase
assert_requested :get, "#{Stripe.api_base}/v1/sigma/scheduled_query_runs/sqr_xxxxxxxxxxxxx?"
end
end
context "SKU.create" do
should "support requests with args: attributes, price, currency, inventory, product" do
Stripe::SKU.create(
{
attributes: { size: "Medium", gender: "Unisex" },
price: 1500,
currency: "usd",
inventory: { type: "finite", quantity: 500 },
product: "prod_xxxxxxxxxxxxx",
}
)
assert_requested :post, "#{Stripe.api_base}/v1/skus"
end
end
context "SKU.delete" do
should "support requests with args: id" do
Stripe::SKU.delete("sku_xxxxxxxxxxxxx")
assert_requested :delete, "#{Stripe.api_base}/v1/skus/sku_xxxxxxxxxxxxx?"
end
end
context "SKU.list" do
should "support requests with args: limit" do
Stripe::SKU.list({ limit: 3 })
assert_requested :get, "#{Stripe.api_base}/v1/skus?limit=3"
end
end
context "SKU.retrieve" do
should "support requests with args: id" do
Stripe::SKU.retrieve("sku_xxxxxxxxxxxxx")
assert_requested :get, "#{Stripe.api_base}/v1/skus/sku_xxxxxxxxxxxxx?"
end
end
context "SKU.update" do
should "support requests with args: metadata, id" do
Stripe::SKU.update("sku_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/skus/sku_xxxxxxxxxxxxx"
end
end
context "Source.retrieve" do
should "support requests with args: id" do
Stripe::Source.retrieve("src_xxxxxxxxxxxxx")
Expand Down
60 changes: 0 additions & 60 deletions test/stripe/sku_test.rb

This file was deleted.

0 comments on commit a0935c2

Please sign in to comment.