Shared constants and validation rules for prepaid ad top-ups and billing calculations. Reuse when implementing ad platform billing systems without direct Stripe calls.
// Source: https://github.com/innotelinc/freebuff | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works // Provided via justclaw.it.com; keep this notice with the code. /** * The prepaid balance behind the placements rail. * * The engagement marketplace bills a fixed daily Stripe SUBSCRIPTION, where * the daily budget is simultaneously the price and the delivery cap. That * identity breaks the moment the unit is an activation: a $50/day cap can * deliver $50 or $3 depending on how many developers actually save the env * var, and billing $50 either way is charging for activations we did not * deliver. So placements is prepaid — the advertiser tops up, delivery draws * the balance down, campaigns stop serving at zero. * * Nothing here talks ... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key