Subscrio.Payments 0.5.0

dotnet add package Subscrio.Payments --version 0.5.0
                    
NuGet\Install-Package Subscrio.Payments -Version 0.5.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Subscrio.Payments" Version="0.5.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Subscrio.Payments" Version="0.5.0" />
                    
Directory.Packages.props
<PackageReference Include="Subscrio.Payments" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Subscrio.Payments --version 0.5.0
                    
#r "nuget: Subscrio.Payments, 0.5.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Subscrio.Payments@0.5.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Subscrio.Payments&version=0.5.0
                    
Install as a Cake Addin
#tool nuget:?package=Subscrio.Payments&version=0.5.0
                    
Install as a Cake Tool

Subscrio.Payments

First-party payments extension for Subscrio.Core. Records Stripe invoice.payment_succeeded amounts in Postgres via stripe.received.after.

Install

dotnet add package Subscrio.Payments

Depends on Subscrio.Core and PostgreSQL (Npgsql).

Usage

using Subscrio.Core;
using Subscrio.Core.Config;
using Subscrio.Payments;
using Subscrio.Payments.DTOs;

var connectionString = Environment.GetEnvironmentVariable("DATABASE_URL")!;
var subscrio = new Subscrio(new SubscrioConfig
{
    Database = new DatabaseConfig { ConnectionString = connectionString }
});
await subscrio.InstallSchemaAsync();

await using var payments = subscrio.UsePayments(new PaymentTrackerOptions
{
    ConnectionString = connectionString
});
await payments.InstallSchemaAsync();

var page = await payments.ListAsync(new PaymentFilters
{
    CustomerId = 1,
    Limit = 50
});
var row = page.Data.Count > 0 ? await payments.GetAsync(page.Data[0].Id) : null;

// Dispose unsubscribes the hook and closes the Npgsql data source

Schema

Owned by this extension (not core). Created only when you call InstallSchemaAsync().

  • Table: subscrio.payments
  • Version key in subscrio.system_config: payments_schema_version (current: 1.0.0)
  • VerifySchemaAsync() → version string or null
  • MigrateAsync() applies future extension-only migrations

Nullable FKs (customer_id, subscription_id, billing_cycle_id) use ON DELETE SET NULL. Billing cycle interval is stored as duration_value + duration_unit. Amounts are Stripe integer cents plus currency. Duplicate webhooks are ignored (UNIQUE on stripe_invoice_id).

Hooks

Registers OnStripeReceivedAfter only. Other Stripe event types are ignored. Invoices without a Stripe subscription id, or whose Subscrio subscription cannot be resolved, are skipped.

After-hook failure semantics

Payment writes run on the after hook, so Subscrio’s invoice handling is already committed when the insert runs.

  • If the payment insert throws, the error propagates and ProcessStripeEventAsync fails.
  • The underlying subscription period update remains in the database.
  • Call DisposeAsync() to unsubscribe; further Stripe events will not write payment rows.

Query

await payments.ListAsync(new PaymentFilters
{
    CustomerId = 1,
    SubscriptionId = 2,
    StartDate = DateTime.Parse("2026-01-01T00:00:00.000Z").ToUniversalTime(),
    EndDate = DateTime.Parse("2026-12-31T23:59:59.999Z").ToUniversalTime(),
    SortOrder = "desc",
    Limit = 50,
    Offset = 0,
});
// → PaymentPage { Data, Total }

Development

From this directory (dotnet/):

dotnet build
dotnet test

Builds and tests use published Subscrio.Core 0.5.1 by default. In the hub workspace, pass -p:UseLocalSubscrioCore=true to build against the local core checkout instead. Core tests in subscrio-dotnet do not run this suite.

Tests create a fresh Postgres database. Set TEST_DATABASE_URL, copy tests/appsettings.example.json to tests/appsettings.json, or use default localhost credentials (postgres / postgres).

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.5.0 93 9/23/2026
0.4.0 100 9/20/2026
0.3.1 108 9/5/2026