Class: Stripe::Checkout::SessionService::CreateParams::ShippingOption::ShippingRateData

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/services/checkout/session_service.rb

Defined Under Namespace

Classes: DeliveryEstimate, FixedAmount

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(delivery_estimate: nil, display_name: nil, fixed_amount: nil, metadata: nil, tax_behavior: nil, tax_code: nil, type: nil) ⇒ ShippingRateData

Returns a new instance of ShippingRateData.



2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
# File 'lib/stripe/services/checkout/session_service.rb', line 2027

def initialize(
  delivery_estimate: nil,
  display_name: nil,
  fixed_amount: nil,
  metadata: nil,
  tax_behavior: nil,
  tax_code: nil,
  type: nil
)
  @delivery_estimate = delivery_estimate
  @display_name = display_name
  @fixed_amount = fixed_amount
  @metadata = 
  @tax_behavior = tax_behavior
  @tax_code = tax_code
  @type = type
end

Instance Attribute Details

#delivery_estimateObject

The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.



2007
2008
2009
# File 'lib/stripe/services/checkout/session_service.rb', line 2007

def delivery_estimate
  @delivery_estimate
end

#display_nameObject

The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.



2010
2011
2012
# File 'lib/stripe/services/checkout/session_service.rb', line 2010

def display_name
  @display_name
end

#fixed_amountObject

Describes a fixed amount to charge for shipping. Must be present if type is ‘fixed_amount`.



2013
2014
2015
# File 'lib/stripe/services/checkout/session_service.rb', line 2013

def fixed_amount
  @fixed_amount
end

#metadataObject

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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to ‘metadata`.



2016
2017
2018
# File 'lib/stripe/services/checkout/session_service.rb', line 2016

def 
  @metadata
end

#tax_behaviorObject

Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of ‘inclusive`, `exclusive`, or `unspecified`.



2019
2020
2021
# File 'lib/stripe/services/checkout/session_service.rb', line 2019

def tax_behavior
  @tax_behavior
end

#tax_codeObject

A [tax code](stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is ‘txcd_92010001`.



2022
2023
2024
# File 'lib/stripe/services/checkout/session_service.rb', line 2022

def tax_code
  @tax_code
end

#typeObject

The type of calculation to use on the shipping rate.



2025
2026
2027
# File 'lib/stripe/services/checkout/session_service.rb', line 2025

def type
  @type
end