Coflnet.Payments.Client 0.24.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Coflnet.Payments.Client --version 0.24.1
                    
NuGet\Install-Package Coflnet.Payments.Client -Version 0.24.1
                    
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="Coflnet.Payments.Client" Version="0.24.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Coflnet.Payments.Client" Version="0.24.1" />
                    
Directory.Packages.props
<PackageReference Include="Coflnet.Payments.Client" />
                    
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 Coflnet.Payments.Client --version 0.24.1
                    
#r "nuget: Coflnet.Payments.Client, 0.24.1"
                    
#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 Coflnet.Payments.Client@0.24.1
                    
#: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=Coflnet.Payments.Client&version=0.24.1
                    
Install as a Cake Addin
#tool nuget:?package=Coflnet.Payments.Client&version=0.24.1
                    
Install as a Cake Tool

Payments

Handles payments, and access to digital goods and services

Configuration

Configuration is handled via asp.net configuration providers Keys with defaults are set in appsettings.json

Credit-terms rollout

At startup Payments downloads LEGAL_MANIFEST_URL and verifies the manifest, every referenced legal document, the bilingual Terms acceptance hash and the Premium declaration hashes. Startup fails if the production source is not https://coflnet.com, a file is unavailable, or a hash does not match. Terms/withdrawal version and acceptance-hash evidence for top-ups is stamped onto the § 312f payment confirmation from the verified manifest. Terms versions and hashes are not duplicated in Payments. Acceptance enforcement is canaried for internal user account 7, then applies to all accounts from 2026-08-08T00:00:00Z; earlier would-be blocks for other accounts are logged.

Google Play completion idempotency

Raw Google Play purchase tokens are not stored. Their SHA-256 hashes and Google order IDs are recorded with the completed response to make retries durable and prevent duplicate crediting. Production does not apply migrations automatically. Apply these migrations in order before deploying this code:

  1. 20260728120000_PaymentConfirmationOutbox
  2. 20260728122000_GooglePlayCompletions
  3. 20260728180315_CoflCoinServiceDeclarations

How purchases work

  1. Start top up
  2. wait till payment is verified
  3. (optional) plan purchase (locks some amount of balance)
  4. purchase product/service

Setup

Becuase it is the esiest by default stripe is used. To configure stripe get your stripe KEY and SIGNING_SECRET from stripe.com and set them as configuration. (either modify appsettings.json or set the enviromentvariables STRIPE__KEY and STRIPE__SIGNING_SECRET)
Next create a webhook callback to /Callback/stripe that triggers on confirmed purchase.

Stripe — Minimal API Key Permissions

The Stripe API key (STRIPE__KEY) is used for Checkout Sessions and pre-capture country validation:

Operation API Call Permission
Create checkout session with dynamic payment methods SessionService.CreateAsync() Write
List sessions by PaymentIntent SessionService.ListAsync() Read
Expire stale sessions SessionService.ExpireAsync() Write
Read provider country and capture/cancel supported authorizations PaymentIntentService Read & Write
Read the expanded payment method country PaymentIntent payment_method expansion Read

Webhook verification uses the signing secret. Card and Link use per-method manual capture without disabling other methods. When Stripe supplies a payment-method country it is authoritative; otherwise the country or locale supplied at session creation must match the independently looked-up IP country. Disallowed automatically captured payments are marked for manual refund and are not credited.

Restricted key: Enable only Checkout Sessions → Read & Write, Payment Intents → Read & Write, and Payment Methods → Read.

CoinGate country verification

CoinGate requests must set TopUpOptions.Country from an explicit user selection and TopUpOptions.UserIp from the trusted ingress. The service looks up the IP country using IP_COUNTRY__BASE_URL (default: https://ipapi.co/) and falls back to IP_COUNTRY__FALLBACK_BASE_URL (default: https://api.country.is/). It creates the order only when both ISO country codes match and the country is eligible.

Paypal

Paypal can be configured with PAYPAL__SECRET, PAYPAL__ID and PAYPAL__IS_SANDBOX Create a webhook callback to /Callback/paypal to allow for payments to be verified.

PayPal — Minimal API Permissions

PayPal uses the Orders API v2 (PayPalCheckoutSdk). The REST API app credentials (PAYPAL__ID / PAYPAL__SECRET) are used for three operations:

Operation API Call Permission
Create order OrdersCreateRequest Accept payments
Capture order (complete payment) OrdersCaptureRequest Accept payments
Get order details OrdersGetRequest Accept payments

The code handles these webhook events (no API key needed — events carry their own data):

  • CHECKOUT.ORDER.APPROVED → triggers capture
  • PAYMENT.CAPTURE.COMPLETED → updates transaction reference
  • PAYMENT.CAPTURE.REFUNDED → reverts purchase locally

No PayPal Payouts, Disputes, Subscriptions, Invoicing, Vault, or Transaction Search APIs are used.

Live app features: In the PayPal Developer Dashboard, enable only the "Accept payments" feature for the live REST API app. Disable Payouts, Customer disputes, Transaction search, Invoicing, Subscriptions, Partner referrals, Vault, and Webhooks management.

Events

This microservice can produce transaction events into a Kafka Topic. To configure it set the configuration variables KAFKA_HOST and KAFKA__TRANSACTION_TOPIC__NAME. The format and fields of the events can be seen in the TransactionEvent class

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 was computed.  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 was computed.  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.26.0 40 8/8/2026
0.25.0 45 8/7/2026
0.24.1 98 8/2/2026
0.24.0 86 8/2/2026
0.23.0 121 7/25/2026
0.22.0 844 4/8/2026
0.21.0 1,030 2/8/2026
0.20.0 616 1/4/2026
0.19.0 747 11/30/2025
0.18.1 525 10/31/2025
0.18.0 309 10/30/2025
0.17.3 280 10/29/2025
0.17.2 279 10/29/2025
0.17.1 282 10/28/2025
0.17.0 275 10/28/2025
0.16.1 4,153 10/31/2024
0.16.0 766 10/9/2024
0.15.0 494 10/5/2024
0.14.0 840 8/27/2024
0.13.0 1,605 6/15/2024
Loading failed

Minor update