Core’s current interface is KimoraPro\HotelBooking\Contracts\TaxRuleProviderInterface. Its two methods are id(): string and activeRules(TaxCalculationContext $context): array; the context class is KimoraPro\HotelBooking\Tax\TaxCalculationContext.
use KimoraPro\HotelBooking\Contracts\TaxRuleProviderInterface;
use KimoraPro\HotelBooking\Tax\TaxCalculationContext;
abstract class ExampleTaxProvider implements TaxRuleProviderInterface
{
abstract public function id(): string;
abstract public function activeRules(TaxCalculationContext $context): array;
}
This is an abstract signature example, not an installed tax rule or complete production provider. The public readiness action is kimorapro_hb_tax_engine_ready, receiving the registry and tax contract version 1.0.0. Register a stable provider at the owner lifecycle, and keep repeated initialization safe.
Preserve calculator semantics
The financial order is room subtotal, room-only discount, services, eligible taxes and grand total. Included percentage taxes are disclosed rather than added again; fixed taxes are exclusive. Rules are non-compound and round each line before aggregation.
Return validated machine values/rules, not locale-formatted prices. Core remains responsible for final calculation, availability/quote validation and immutable booking tax history. A provider must not write arbitrary booking/ledger rows or recalculate a saved booking from today’s rules.
Respect capability and failure boundaries
Free’s built-in basic rule and Pro’s advanced rules have distinct ownership/entitlement. Registering an extension does not activate a built-in premium workflow. Active required provider absence must fail closed instead of yielding a partial tax total.
Historical HB\... names and hb_tax_engine_ready references are migration history, not current examples. Do not globally rename retained Pro hooks just because Core’s tax action changed.
Verify exact namespace backslashes survive source rendering and eventual publisher round-trip. Source correctness alone does not repair an older published body. See tax concepts and template boundaries.
