-
Notifications
You must be signed in to change notification settings - Fork 2
Open
1 / 21 of 2 issues completedLabels
Description
High-level approach
Using pallet-balances.Transfer transactions, the user creates the extrinsic, creates an invoice in auto-drive that includes information about the transaction so Auto-Drive's Payment Processor can track the payment adding the appropriate amount of credits on finalisation, and finally submits the extrinsic.
Implementation Steps:
- Support ‘one-of’ credits granularity
- Payment processor using simple Substrate
balances.transfer - Callback on payment received to update upload credits
Updates in data model (minimal)
SubscriptionGranularity: enum [one_of,monthly]- New table
invoicesfor keeping track of payment creations.
API/services
POST /credits/invoices→ creates invoice; returns InvoiceGET /credits/invoices/{id}→ status pollingPaymentMonitorservice:- Subscribes to chain, matches transfers to the treasury address, enforces finality, triggers crediting.
Chain parameters and guardrails
- Use chain decimals correctly for UI display.
- Document supported chain and SS58 prefix.
- Handle reorgs: only act on finalised blocks.
Admin panel changes
- Product/plan form: add
granularityselector withone_offdefault.