Class: Stripe::ShippingRateService

Inherits:
StripeService show all
Defined in:
lib/stripe/services/shipping_rate_service.rb

Defined Under Namespace

Classes: CreateParams, ListParams, RetrieveParams, UpdateParams

Instance Method Summary collapse

Methods inherited from StripeService

#initialize, #request, #request_stream

Constructor Details

This class inherits a constructor from Stripe::StripeService

Instance Method Details

#create(params = {}, opts = {}) ⇒ Object

Creates a new shipping rate object.



234
235
236
237
238
239
240
241
242
# File 'lib/stripe/services/shipping_rate_service.rb', line 234

def create(params = {}, opts = {})
  request(
    method: :post,
    path: "/v1/shipping_rates",
    params: params,
    opts: opts,
    base_address: :api
  )
end

#list(params = {}, opts = {}) ⇒ Object

Returns a list of your shipping rates.



245
246
247
248
249
250
251
252
253
# File 'lib/stripe/services/shipping_rate_service.rb', line 245

def list(params = {}, opts = {})
  request(
    method: :get,
    path: "/v1/shipping_rates",
    params: params,
    opts: opts,
    base_address: :api
  )
end

#retrieve(shipping_rate_token, params = {}, opts = {}) ⇒ Object

Returns the shipping rate object with the given ID.



256
257
258
259
260
261
262
263
264
# File 'lib/stripe/services/shipping_rate_service.rb', line 256

def retrieve(shipping_rate_token, params = {}, opts = {})
  request(
    method: :get,
    path: format("/v1/shipping_rates/%<shipping_rate_token>s", { shipping_rate_token: CGI.escape(shipping_rate_token) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

#update(shipping_rate_token, params = {}, opts = {}) ⇒ Object

Updates an existing shipping rate object.



267
268
269
270
271
272
273
274
275
# File 'lib/stripe/services/shipping_rate_service.rb', line 267

def update(shipping_rate_token, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v1/shipping_rates/%<shipping_rate_token>s", { shipping_rate_token: CGI.escape(shipping_rate_token) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end