DVBilling class

Constructors

DVBilling()
const

Properties

cancelUrl → Uri?
The declared address a buyer who abandons a payment is sent to.
no setter
config → DVBillingConfig?
The configuration in effect: dartvel.billing with DARTVEL_BILLING_PROVIDER and DARTVEL_BILLING_SITE_URL applied, or null when nothing was declared.
no setter
confirmsOnReturn → bool
Whether a buyer coming back from the configured provider may confirm a payment through its API (DVBillingProviderName.confirmsOnReturn). False when nothing is configured.
no setter
hashCode → int
The hash code for this object.
no setterinherited
isSetUp → bool
Whether a payment can be taken: a provider is configured and its keys are set.
no setter
provider → DVBillingProvider?
The provider bills go through: the one useProvider installed, else the one dartvel.billing declares, built now if its keys are set. Null when nothing is configured or its keys are not set.
no setter
providerName → DVBillingProviderName?
The configured provider's name, whether or not its keys are set; null when nothing is configured or the installed provider is not one of the official adapters.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
successUrl → Uri?
The declared address a buyer returns to after paying, on this deployment's origin; null when none is declared.
no setter

Methods

checkout({required BillingPlan plan, required Object customer}) → Future<DVBillingCheckoutSession>
checkoutOrder(DVBillingOrder order) → Future<DVBillingOrderCheckout>
Starts paying for order on the configured provider's page.
configure(DVBillingConfig config, {DVBillingFetch? fetch, Map<String, String>? environment}) → void
Bills through config, the project's dartvel.billing. The generated server calls this at start; nothing is built and no key is read yet.
grantLocalEntitlement(Object customer, Entitlement entitlement) → void
handleWebhook(String payload, Map<String, String> headers, {DVBillingProviderName? provider}) → Future<DVBillingWebhookResult>
Verifies a webhook and applies it, against the configured provider or, with provider, against that one (providerNamed).
hasEntitlement(Object customer, Entitlement entitlement) → Future<bool>
invoices(Object customer, {int limit = 20}) → Future<List<DVInvoice>>
customer's billing history, newest first.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
orderStatus({required String reference, String checkoutId = ''}) → Future<DVBillingOrderStatus>
Asks the configured provider what happened to the payment for reference.
providerNamed(DVBillingProviderName name) → DVBillingProvider?
The official provider name, built from the same dartvel.billing block with that provider's default keys, or null when they are not set.
recordUsage({required Object customer, required DVUsageMeter meter, required int quantity, required String idempotencyKey, DateTime? at}) → Future<void>
Records quantity against meter for customer.
revokeLocalEntitlement(Object customer, Entitlement entitlement) → void
toString() → String
A string representation of this object.
inherited
useProvider(DVBillingProvider provider) → void
Bills through provider, built in code. Wins over dartvel.billing.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

reset() → void
Forgets the configuration, the installed provider and every provider built from the block. For tests.
transportFor(DVBillingProviderName name) → DVBillingFetch
The transport a provider built from dartvel.billing sends with: DV.Http, over HTTPS, to name's own API hosts and nowhere else.

Constants

providerVariable → const String
The variable naming the provider to use in place of the declared one.
siteUrlVariable → const String
The variable naming the origin the return addresses are moved to.