PaperTiger.AutomaticTax (PaperTiger v1.1.1)

Copy Markdown View Source

Deterministic Stripe Tax helpers for PaperTiger's local test surface.

This intentionally models only the automatic-tax totals that tests need. It is not a standalone Tax Calculations/Transactions API implementation.

Summary

Functions

Applies deterministic automatic-tax fields to line items and returns totals.

Returns a Stripe-shaped automatic_tax map from request params or a resource.

True when automatic_tax[enabled]=true was requested.

Functions

apply_to_line_items(line_items, source, resource \\ :invoice)

@spec apply_to_line_items([map()], map(), atom()) :: {[map()], map()}

Applies deterministic automatic-tax fields to line items and returns totals.

automatic_tax(source, resource \\ :checkout_session)

@spec automatic_tax(map(), atom()) :: map()

Returns a Stripe-shaped automatic_tax map from request params or a resource.

enabled?(source)

@spec enabled?(map()) :: boolean()

True when automatic_tax[enabled]=true was requested.