Class: Stripe::ShippingRate
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::ShippingRate
- Extended by:
- APIOperations::Create, APIOperations::List
- Includes:
- APIOperations::Save
- Defined in:
- lib/stripe/resources/shipping_rate.rb
Overview
Shipping rates describe the price of shipping presented to your customers and applied to a purchase. For more information, see [Charge for shipping](stripe.com/docs/payments/during-payment/charge-shipping).
Defined Under Namespace
Classes: CreateParams, DeliveryEstimate, FixedAmount, ListParams, RetrieveParams, UpdateParams
Constant Summary collapse
- OBJECT_NAME =
"shipping_rate"
Constants inherited from StripeObject
Stripe::StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#active ⇒ Object
readonly
Whether the shipping rate can be used for new purchases.
-
#created ⇒ Object
readonly
Time at which the object was created.
-
#delivery_estimate ⇒ Object
readonly
The estimated range for how long shipping will take, meant to be displayable to the customer.
-
#display_name ⇒ Object
readonly
The name of the shipping rate, meant to be displayable to the customer.
-
#fixed_amount ⇒ Object
readonly
Attribute for field fixed_amount.
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#livemode ⇒ Object
readonly
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
-
#metadata ⇒ Object
readonly
Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object.
-
#object ⇒ Object
readonly
String representing the object’s type.
-
#tax_behavior ⇒ Object
readonly
Specifies whether the rate is considered inclusive of taxes or exclusive of taxes.
-
#tax_code ⇒ Object
readonly
A [tax code](stripe.com/docs/tax/tax-categories) ID.
-
#type ⇒ Object
readonly
The type of calculation to use on the shipping rate.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
-
.create(params = {}, opts = {}) ⇒ Object
Creates a new shipping rate object.
-
.list(params = {}, opts = {}) ⇒ Object
Returns a list of your shipping rates.
- .object_name ⇒ Object
-
.update(shipping_rate_token, params = {}, opts = {}) ⇒ Object
Updates an existing shipping rate object.
Methods included from APIOperations::Create
Methods included from APIOperations::List
Methods included from APIOperations::Save
Methods inherited from APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource
Methods included from APIOperations::Request
Methods inherited from StripeObject
#==, #[], #[]=, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values
Constructor Details
This class inherits a constructor from Stripe::StripeObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject
Instance Attribute Details
#active ⇒ Object (readonly)
Whether the shipping rate can be used for new purchases. Defaults to ‘true`.
252 253 254 |
# File 'lib/stripe/resources/shipping_rate.rb', line 252 def active @active end |
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
254 255 256 |
# File 'lib/stripe/resources/shipping_rate.rb', line 254 def created @created end |
#delivery_estimate ⇒ Object (readonly)
The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
256 257 258 |
# File 'lib/stripe/resources/shipping_rate.rb', line 256 def delivery_estimate @delivery_estimate end |
#display_name ⇒ Object (readonly)
The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.
258 259 260 |
# File 'lib/stripe/resources/shipping_rate.rb', line 258 def display_name @display_name end |
#fixed_amount ⇒ Object (readonly)
Attribute for field fixed_amount
260 261 262 |
# File 'lib/stripe/resources/shipping_rate.rb', line 260 def fixed_amount @fixed_amount end |
#id ⇒ Object (readonly)
Unique identifier for the object.
262 263 264 |
# File 'lib/stripe/resources/shipping_rate.rb', line 262 def id @id end |
#livemode ⇒ Object (readonly)
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
264 265 266 |
# File 'lib/stripe/resources/shipping_rate.rb', line 264 def livemode @livemode end |
#metadata ⇒ Object (readonly)
Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
266 267 268 |
# File 'lib/stripe/resources/shipping_rate.rb', line 266 def @metadata end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
268 269 270 |
# File 'lib/stripe/resources/shipping_rate.rb', line 268 def object @object end |
#tax_behavior ⇒ Object (readonly)
Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of ‘inclusive`, `exclusive`, or `unspecified`.
270 271 272 |
# File 'lib/stripe/resources/shipping_rate.rb', line 270 def tax_behavior @tax_behavior end |
#tax_code ⇒ Object (readonly)
A [tax code](stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is ‘txcd_92010001`.
272 273 274 |
# File 'lib/stripe/resources/shipping_rate.rb', line 272 def tax_code @tax_code end |
#type ⇒ Object (readonly)
The type of calculation to use on the shipping rate.
274 275 276 |
# File 'lib/stripe/resources/shipping_rate.rb', line 274 def type @type end |
Class Method Details
.create(params = {}, opts = {}) ⇒ Object
Creates a new shipping rate object.
277 278 279 |
# File 'lib/stripe/resources/shipping_rate.rb', line 277 def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/shipping_rates", params: params, opts: opts) end |
.list(params = {}, opts = {}) ⇒ Object
Returns a list of your shipping rates.
282 283 284 |
# File 'lib/stripe/resources/shipping_rate.rb', line 282 def self.list(params = {}, opts = {}) request_stripe_object(method: :get, path: "/v1/shipping_rates", params: params, opts: opts) end |
.object_name ⇒ Object
13 14 15 |
# File 'lib/stripe/resources/shipping_rate.rb', line 13 def self.object_name "shipping_rate" end |
.update(shipping_rate_token, params = {}, opts = {}) ⇒ Object
Updates an existing shipping rate object.
287 288 289 290 291 292 293 294 |
# File 'lib/stripe/resources/shipping_rate.rb', line 287 def self.update(shipping_rate_token, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/shipping_rates/%<shipping_rate_token>s", { shipping_rate_token: CGI.escape(shipping_rate_token) }), params: params, opts: opts ) end |