Class: WhopSDK::Models::PlanCalculateTaxResponse

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/whop_sdk/models/plan_calculate_tax_response.rb,
sig/whop_sdk/models/plan_calculate_tax_response.rbs

Overview

See Also:

  • WhopSDK::Resources::Plans#calculate_tax

Defined Under Namespace

Modules: Status, TaxBehavior

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(currency:, status:, subtotal:, tax_amount:, tax_behavior:, total:) ⇒ Object

Some parameter documentations has been truncated, see WhopSDK::Models::PlanCalculateTaxResponse for more details.

Parameters:

  • currency (String)

    Three-letter ISO 4217 currency code for the returned amounts.

  • status (Symbol, WhopSDK::Models::PlanCalculateTaxResponse::Status)

    Whether Whop calculated tax for this preview. not_calculated means no tax coul

  • subtotal (Integer)

    Plan price in the currency's smallest unit, for example cents. For exclusive tax

  • tax_amount (Integer)

    Calculated tax amount in the currency's smallest unit. For exclusive tax, this i

  • tax_behavior (Symbol, WhopSDK::Models::PlanCalculateTaxResponse::TaxBehavior)

    Whether tax is added on top of the plan price or already included in it for this

  • total (Integer)

    Amount the buyer would pay in the currency's smallest unit.



# File 'lib/whop_sdk/models/plan_calculate_tax_response.rb', line 49

Instance Attribute Details

#currencyString

Three-letter ISO 4217 currency code for the returned amounts.

Parameters:

  • value (String)

Returns:

  • (String)


11
# File 'lib/whop_sdk/models/plan_calculate_tax_response.rb', line 11

required :currency, String

#statusSymbol, WhopSDK::Models::PlanCalculateTaxResponse::Status

Whether Whop calculated tax for this preview. not_calculated means no tax could be determined, so tax_amount is 0 and total equals subtotal.

Parameters:

  • value (WhopSDK::Models::PlanCalculateTaxResponse::status)

Returns:



18
# File 'lib/whop_sdk/models/plan_calculate_tax_response.rb', line 18

required :status, enum: -> { WhopSDK::Models::PlanCalculateTaxResponse::Status }

#subtotalInteger

Plan price in the currency's smallest unit, for example cents. For exclusive tax, this is the pre-tax amount; for inclusive tax, it already includes tax and equals the total.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


26
# File 'lib/whop_sdk/models/plan_calculate_tax_response.rb', line 26

required :subtotal, Integer

#tax_amountInteger

Calculated tax amount in the currency's smallest unit. For exclusive tax, this is added on top of the subtotal; for inclusive tax, it is the portion of the subtotal that is tax.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


34
# File 'lib/whop_sdk/models/plan_calculate_tax_response.rb', line 34

required :tax_amount, Integer

#tax_behaviorSymbol, WhopSDK::Models::PlanCalculateTaxResponse::TaxBehavior

Whether tax is added on top of the plan price or already included in it for this buyer's location.

Parameters:

  • value (WhopSDK::Models::PlanCalculateTaxResponse::tax_behavior)

Returns:



41
# File 'lib/whop_sdk/models/plan_calculate_tax_response.rb', line 41

required :tax_behavior, enum: -> { WhopSDK::Models::PlanCalculateTaxResponse::TaxBehavior }

#totalInteger

Amount the buyer would pay in the currency's smallest unit.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


47
# File 'lib/whop_sdk/models/plan_calculate_tax_response.rb', line 47

required :total, Integer

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/whop_sdk/models/plan_calculate_tax_response.rb', line 75

Instance Method Details

#to_hash{

Returns:

  • ({)


35
# File 'sig/whop_sdk/models/plan_calculate_tax_response.rbs', line 35

def to_hash: -> {