Table of Contents

Interface IOrderProcessor

Namespace
VpnHood.AppLib.Abstractions.Billing
Assembly
VpnHood.AppLib.Abstractions.dll

Backend-specific purchase reconciliation. The billing provider talks to the platform store; the order processor talks to the account backend before and after the store purchase.

public interface IOrderProcessor

Methods

CompleteOrder(PurchaseProof, CancellationToken)

Hand the store's proof of purchase to the backend and wait until it is turned into access.

Task CompleteOrder(PurchaseProof purchaseProof, CancellationToken cancellationToken)

Parameters

purchaseProof PurchaseProof

The store's proof of purchase.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task

A task that completes once the purchase is turned into access.

Exceptions

InvalidOperationException

The store had not settled the payment by the processor's last try; a later call may succeed.

ApiException

The account backend refused the request.

OperationCanceledException

cancellationToken was canceled.

PreparePurchase(CancellationToken)

Called before the store's payment flow opens: answers what the purchase must be attributed to, and is the point where a backend could also reserve an order of its own.

Task<PurchaseAttribution> PreparePurchase(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task<PurchaseAttribution>

A task whose result is what the purchase must be attributed to.

Exceptions

AuthenticationException

Nobody is signed in.