stripe-ruby/lib/stripe/subscription.rb
Brandur c1ff8bdc4c Integer-index encode all arrays
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.
2018-08-14 14:44:43 -07:00

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