Skip to content

Stripe Shipping Rate Database Service

The Stripe Shipping Rate database service is what handles the insertion, retrieval, updating, and deletion of the Shipping Rates within the database.

You can access the database service by injecting IStripeShippingRateDatabaseService which can be found within the namespace UmbCheckout.Stripe.Interfaces

Every method takes an optional CancellationToken as its last parameter. Reads publish OnShippingRatesLoadedNotification, and saves and deletes publish the cancellable OnShippingRateSavingNotification and OnShippingRateDeletingNotification (see Extending UmbCheckout).

Gets the Shipping Rates

Task<IEnumerable<ShippingRate>> GetShippingRatesAsync(CancellationToken cancellationToken = default);

Gets a specified Shipping Rate by its key, or by its Stripe ID

Name Detail
key Key of the Stripe Shipping Rate
value StripeId of the Stripe Shipping Rate
Task<ShippingRate?> GetShippingRateAsync(Guid key, CancellationToken cancellationToken = default);
Task<ShippingRate?> GetShippingRateAsync(string value, CancellationToken cancellationToken = default);

Creates a Shipping Rate. Returns null when a rate with the same Stripe ID already exists.

Task<ShippingRate?> CreateShippingRateAsync(ShippingRate shippingRate, CancellationToken cancellationToken = default);

Updates a specified Shipping Rate

Task<ShippingRate?> UpdateShippingRateAsync(ShippingRate shippingRate, CancellationToken cancellationToken = default);

Deletes a specified Shipping Rate

Name Detail
key Key of the Stripe Shipping Rate
Task<bool> DeleteShippingRateAsync(Guid key, CancellationToken cancellationToken = default);