RevenueFlow.AutoTopUp 0.1.0-alpha.7.2

This is a prerelease version of RevenueFlow.AutoTopUp.
dotnet add package RevenueFlow.AutoTopUp --version 0.1.0-alpha.7.2
                    
NuGet\Install-Package RevenueFlow.AutoTopUp -Version 0.1.0-alpha.7.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RevenueFlow.AutoTopUp" Version="0.1.0-alpha.7.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RevenueFlow.AutoTopUp" Version="0.1.0-alpha.7.2" />
                    
Directory.Packages.props
<PackageReference Include="RevenueFlow.AutoTopUp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RevenueFlow.AutoTopUp --version 0.1.0-alpha.7.2
                    
#r "nuget: RevenueFlow.AutoTopUp, 0.1.0-alpha.7.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RevenueFlow.AutoTopUp@0.1.0-alpha.7.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RevenueFlow.AutoTopUp&version=0.1.0-alpha.7.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=RevenueFlow.AutoTopUp&version=0.1.0-alpha.7.2&prerelease
                    
Install as a Cake Tool

RevenueFlow.AutoTopUp

Optional automatic prepaid replenishment for user or billing-account resource wallets. Configure an application-authorized AutoTopUpPolicy, then invoke AutoTopUpService.RunAsync from a host-owned worker or after consumption. RunPoliciesAsync evaluates one bounded page with an explicit stable run ID. There is no background charge merely from constructing services.

Policies explicitly choose enabled status, owner/resource, threshold, fixed purchased units/amount/currency, provider binding, opaque secure-profile key, consent version/time, cooldown and anchored UTC count/spend budgets. An IAutoTopUpPaymentResolver returns transient exact payer/saved-method references; retain historical profile/consent versions for outstanding operations. Journals keep only the fingerprint and opaque key. Policy edits preserve existing budgets; currency/window schedules cannot be reset by editing a policy.

PersonalAutoTopUpCreditPreparer composes the real Commerce resource engine through IRevenueResourcePreparationService. TeamsAutoTopUpCreditPreparer from the optional Teams package supplies billing-account funding. Supply the same operational store to the engines/coordinator: no cross-store guarantee exists. Availability and credit preparations are reads only and supply actual CAS/balance/lot/ledger/history writes. Billing-account funding never raises per-member default/override limits or resets consumption.

The coordinator atomically holds budget and admits one pending operation per scoped owner/resource. It rechecks enabled/version/threshold/wallet eligibility before a definite committed claim submits once outside the transaction. Unknown, processing and action-required payments retain that hold even after rollover. Reconciliation only reads. Paid evidence must match the exact binding, operation, payer, method and money. Real credit, canonical source/mode claims, budget completion, journal, receipt, history and outbox commit together. Disabled policy and payment response loss do not erase an already submitted payment. Frozen/debted wallets never trigger a new charge.

Clock rollback cannot make a verified paid operation unreadable: its local confirmation time is UTC and at least its retained creation time. This timestamp records local observation, not a provider settlement timestamp. Fresh admission while the local clock precedes the policy's consent fails before retaining an operation or budget hold; committed admission receipts still replay exactly. Applications can retry fresh admission when the clock recovers.

CancelPreparedAsync cancels only work never claimed. After a claim, resolve or cancel the native payment explicitly and reconcile; there is no unsafe local “forget unknown payment” switch. Operational views/page cursors and IRevenueHealthContributor expose pending, unknown/action-required/paid-uncredited, invalid and incomplete state. Schedulers and cursor/run persistence remain application-owned.

SetSharedBudgetAsync adds a fixed UTC owner/currency count/spend ceiling across resource policies and payment providers. It joins each policy's own budget atomically. Editing limits never resets consumed/held money; changing anchor/window/currency requires a separate future migration design. First configuration affects subsequent admissions; existing operations keep their original budget contract. A scoped configuration fence makes configuration/admission races safe and introduces owner/currency admission contention even before a ceiling exists. Shared windows remain explicit serialization points.

IProviderPrepaidRecoveryGateway supplies existing-payment customer action and nonconfirming method replacement. GetCustomerActionAsync returns a transient secret only after exact scoped operation/provider checks. Applications authorize the customer and complete native confirmation in their web/client flow; client callbacks never prove payment. RepairPaymentMethodAsync records explicit new consent/profile versions and one durable update claim, with at most eight versions. Stripe updates the existing PaymentIntent's attached saved card without confirming or creating another intent. Unknown updates reconcile by reads. Keep historical vault versions available: prior-method settlement racing repair can still credit the same original payment exactly once. Secrets/tokens must never enter logs, URL query parameters or durable journals.

ReconcileFinancialAdjustmentsAsync reads authoritative provider refunds/disputes and applies a proportional cumulative target only to that funding. Personal funding includes unused same-owner rollover descendants with the exact original source identity. Free units are removed first; consumed/reserved/transferred-out units become debt on the original owner. Proven naturally expired units create no new liability. Dispute wins reverse this funding's debt/removed units using append-only ledger entries; removed units return to their exact original lots and retain their expiry. Unrelated credits are retained. Permanent refunds cannot decrease or reset budgets. Multiple/linked native dispute chains stay incomplete; unknown inventory never restores money or units. Integer rounding can produce a financial observation with no resource entry (EntryId=null).

Personal funding uses direct reads when the original lot covers the new removal, and exact retained-lot reads for restoration. Descendant/expiry discovery supports at most 120 same-owner source lots and 1,000 candidate rows per lot/expiry-ledger scan. Native filtered stores restrict candidates to the owner/resource; a query-only custom store counts every scoped row of that kind toward the scan limit. It fails before returning prepared writes if discovery, provenance or transaction limits are exceeded. Keep original funding lots, removal journals and expiry ledger evidence with economic history. All required lot/account/balance, coordinator, receipt and event writes must commit in the same operational store.

Natural-expiry evidence avoids newly classified liability. Units already classified as consumed/reserved funding debt retain that classification until a provider reversal; releasing or expiring the reservation later does not automatically settle that retained debt.

Nonpayment observations are fenced to the payment-method revision they read. A delayed pre-repair action, processing or rejection result cannot overwrite the repaired payment state or release its budget hold. Exact prior-method paid settlement remains recoverable for the same operation and credits once.

Each changed target also carries the coordinator's expected previous cumulative reversed units. Resource preparations must match that total against their retained journal before changing credits or debt; a missing journal is accepted only for an expected zero total. The built-in personal and team engines enforce this check. Custom personal engines must implement the predecessor-fenced IRevenueResourceFundingAdjustmentService overload; its default fails explicitly rather than silently falling back. The legacy direct overload remains callable without an independent previous-total assertion, so it cannot distinguish a missing journal from a first adjustment. The official coordinator always uses the guarded path. Keep resource adjustment journals and financial heads with their economic history.

RunFinancialAdjustmentsAsync separately scans bounded pages of all retained funding operations, including credited funding with a disabled policy or closed account. Schedule it explicitly, persist its returned cursor, and restart from the beginning after each complete sweep to catch late refunds/disputes. Incomplete native inventory and pending repair state appear in health observations. Use the same operational store for resource engines, journals and events.

Stripe supports fixed attached saved-card funding, customer action, same-intent repair and authoritative financial reads. Braintree supports fixed vaulted-card unscheduled sales, settlement-only fulfillment, read-only exact-order recovery and bounded financial reads; no generic same-transaction SCA repair is advertised there. Other providers must explicitly implement the corresponding Core optional capability. No automatic bank mandates or uncertain payment retry is included. See E28 plan for protocol sources, verification and limitations.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-alpha.7.2 50 11/10/2026