Class: Stripe::Tax::Calculation::CreateParams::ShippingCost

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/resources/tax/calculation.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.



320
321
322
323
324
325
# File 'lib/stripe/resources/tax/calculation.rb', line 320

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.



312
313
314
# File 'lib/stripe/resources/tax/calculation.rb', line 312

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.



314
315
316
# File 'lib/stripe/resources/tax/calculation.rb', line 314

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`.



316
317
318
# File 'lib/stripe/resources/tax/calculation.rb', line 316

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.



318
319
320
# File 'lib/stripe/resources/tax/calculation.rb', line 318

def tax_code
  @tax_code
end