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

32 lines
663 B
Ruby

# frozen_string_literal: true
module Stripe
class Order < APIResource
extend Stripe::APIOperations::List
extend Stripe::APIOperations::Create
include Stripe::APIOperations::Save
OBJECT_NAME = "order".freeze
def pay(params, opts = {})
resp, opts = request(:post, pay_url, params, opts)
initialize_from(resp.data, opts)
end
def return_order(params, opts = {})
resp, opts = request(:post, returns_url, params, opts)
Util.convert_to_stripe_object(resp.data, opts)
end
private
def pay_url
resource_url + "/pay"
end
def returns_url
resource_url + "/returns"
end
end
end