Class: Stripe::Tax::CalculationCreateParams::ShippingCost

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/params/tax/calculation_create_params.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

attr_accessor, coerce_params, coerce_value, field_encodings, new, #to_h

Constructor Details

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

Returns a new instance of ShippingCost.



207
208
209
210
211
212
# File 'lib/stripe/params/tax/calculation_create_params.rb', line 207

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 representing the shipping charge. If tax_behavior=inclusive, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount.



199
200
201
# File 'lib/stripe/params/tax/calculation_create_params.rb', line 199

def amount
  @amount
end

#shipping_rateObject

If provided, the shipping rate'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.



201
202
203
# File 'lib/stripe/params/tax/calculation_create_params.rb', line 201

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.



203
204
205
# File 'lib/stripe/params/tax/calculation_create_params.rb', line 203

def tax_behavior
  @tax_behavior
end

#tax_codeObject

The tax code used to calculate tax on shipping. If not provided, the default shipping tax code from your Tax Settings is used.



205
206
207
# File 'lib/stripe/params/tax/calculation_create_params.rb', line 205

def tax_code
  @tax_code
end