Table of Contents

Class DependencyInjection

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

Registers Stripe as the payment provider.

public static class DependencyInjection
Inheritance
DependencyInjection
Inherited Members

Methods

AddStripeApiClient(IServiceCollection, IConfiguration)

Binds the Stripe configuration section and registers Stripe behind the NuvTools.Payment contracts — the customer, payee account, charge, refund and webhook clients.

public static IServiceCollection AddStripeApiClient(this IServiceCollection services, IConfiguration configuration)

Parameters

services IServiceCollection

The container.

configuration IConfiguration

Where the Stripe section is read from.

Returns

IServiceCollection

Remarks

This is the only place a caller names Stripe: everything above it depends on IPaymentCustomerClient and its siblings, so changing provider is changing this call.

The SDK's client is built over an HttpClient from the factory, so the host's own handlers and logging apply, and its retries are the SDK's: it knows which calls are safe to repeat and sends the idempotency key again when it repeats one.