mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-04 00:00:47 -04:00
Changes all arrays from classic Rack encoding: ``` sh arr[]=...&arr[]=...&arr[]=... ``` To integer-indexed encoding: ``` sh arr[0]=...&arr[1]=...&arr[2]=... ``` We think that this should be tractable now that we've fully converted all endpoints over to the new AbstractAPIMethod infrastructure on the backend (although we should do a little more testing to make sure that all endpoints still work). As part of the conversion, we also remove any places that we were "spot encoding" to get required integer-indexed syntax. This should now all be built in.
26 lines
536 B
Ruby
26 lines
536 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Stripe
|
|
class Subscription < APIResource
|
|
extend Stripe::APIOperations::List
|
|
extend Stripe::APIOperations::Create
|
|
include Stripe::APIOperations::Save
|
|
include Stripe::APIOperations::Delete
|
|
|
|
OBJECT_NAME = "subscription".freeze
|
|
|
|
save_nested_resource :source
|
|
|
|
def delete_discount
|
|
_, opts = request(:delete, discount_url)
|
|
initialize_from({ discount: nil }, opts, true)
|
|
end
|
|
|
|
private
|
|
|
|
def discount_url
|
|
resource_url + "/discount"
|
|
end
|
|
end
|
|
end
|