Table of Contents

Class StripePriceApiClient

Namespace
NuvTools.Payment.Stripe.ApiClient.Services
Assembly
NuvTools.Payment.Stripe.ApiClient.dll

Reading the prices kept by the provider, found by the lookup keys the caller's catalogue names them by.

public class StripePriceApiClient : IPaymentPriceClient
Inheritance
StripePriceApiClient
Implements
Inherited Members

Remarks

Read only. Prices are created and replaced in the provider's dashboard; a caller only needs to show what a plan costs before it is bought, and the checkout or the subscription charges what the provider holds whatever the caller showed.

Its own contract, because a caller that shows a catalogue is not necessarily one that subscribes anybody, and a provider without lookup keys can simply not implement it.

Constructors

StripePriceApiClient(IStripeClient, ILogger<StripePriceApiClient>)

Reading the prices kept by the provider, found by the lookup keys the caller's catalogue names them by.

public StripePriceApiClient(IStripeClient client, ILogger<StripePriceApiClient> logger)

Parameters

client IStripeClient
logger ILogger<StripePriceApiClient>

Remarks

Read only. Prices are created and replaced in the provider's dashboard; a caller only needs to show what a plan costs before it is bought, and the checkout or the subscription charges what the provider holds whatever the caller showed.

Its own contract, because a caller that shows a catalogue is not necessarily one that subscribes anybody, and a provider without lookup keys can simply not implement it.

Methods

GetPricesAsync(IReadOnlyCollection<string>, CancellationToken)

The active prices holding the given lookup keys.

public Task<IResult<IReadOnlyList<PaymentPriceDTO>>> GetPricesAsync(IReadOnlyCollection<string> lookupKeys, CancellationToken cancellationToken = default)

Parameters

lookupKeys IReadOnlyCollection<string>

The lookup keys to resolve.

cancellationToken CancellationToken

Cancels the call.

Returns

Task<IResult<IReadOnlyList<PaymentPriceDTO>>>

Remarks

A key that names no active price is left out rather than failing the call, so one price retired in the dashboard does not hide the others.