Class: Stripe::Tax::CalculationService::CreateParams::ShippingCost

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/services/tax/calculation_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(amount: nil, shipping_rate: nil, tax_behavior: nil, tax_code: nil) ⇒ ShippingCost

Returns a new instance of ShippingCost.



174
175
176
177
178
179
# File 'lib/stripe/services/tax/calculation_service.rb', line 174

def initialize(amount: nil, shipping_rate: nil, tax_behavior: nil, tax_code: nil)
  @amount = amount
  @shipping_rate = shipping_rate
  @tax_behavior = tax_behavior
  @tax_code = tax_code
end

Instance Attribute Details

#amountObject

A positive integer in the [smallest currency unit](stripe.com/docs/currencies#zero-decimal) representing the shipping charge. If ‘tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount.



166
167
168
# File 'lib/stripe/services/tax/calculation_service.rb', line 166

def amount
  @amount
end

#shipping_rateObject

If provided, the [shipping rate](stripe.com/docs/api/shipping_rates/object)‘s `amount`, `tax_code` and `tax_behavior` are used. If you provide a shipping rate, then you cannot pass the `amount`, `tax_code`, or `tax_behavior` parameters.



168
169
170
# File 'lib/stripe/services/tax/calculation_service.rb', line 168

def shipping_rate
  @shipping_rate
end

#tax_behaviorObject

Specifies whether the ‘amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes. Defaults to `exclusive`.



170
171
172
# File 'lib/stripe/services/tax/calculation_service.rb', line 170

def tax_behavior
  @tax_behavior
end

#tax_codeObject

The [tax code](stripe.com/docs/tax/tax-categories) used to calculate tax on shipping. If not provided, the default shipping tax code from your [Tax Settings](dashboard.stripe.com/settings/tax) is used.



172
173
174
# File 'lib/stripe/services/tax/calculation_service.rb', line 172

def tax_code
  @tax_code
end