A zero-dependency .NET (C#) client for U.CASH Pay: create crypto + card checkouts and verify settlement webhooks. Non-custodial. Targets .NET 6+.
dotnet add package UdotCASH.UcashPayOr reference the source directly. To publish to NuGet yourself: dotnet pack then dotnet nuget push.
using UdotCASH.UcashPay;
var client = new UcashPayClient(Environment.GetEnvironmentVariable("UCASH_CLOUD_TOKEN")!);
var r = await client.CreateCheckoutAsync(
amount: "10.00",
currency: "USD",
externalReference: order.Id, // idempotent; returned in the webhook
title: $"Order #{order.Id}",
redirectUrl: "https://yoursite.com/thanks");
if (r.Ok) return Redirect(r.PaymentUrl); // send buyer to hosted checkoutapp.MapPost("/ucashpay/webhook", async (HttpContext ctx) =>
{
var raw = await new StreamReader(ctx.Request.Body).ReadToEndAsync();
var sig = ctx.Request.Headers["X-Webhook-Signature"].ToString();
var secret = Environment.GetEnvironmentVariable("UCASH_WEBHOOK_SECRET")!;
var client = new UcashPayClient("");
var v = client.VerifyWebhook(raw, sig, secret);
if (!v.Verified) return Results.Unauthorized();
// parse `raw`, mark the order paid
return Results.Ok();
});Set the webhook URL in pay.u.cash to your endpoint, save, then Test Webhook.
- Sign up at pay.u.cash with email + password, then click the verification link in the email.
- Set your receive addresses under Settings → Addresses (a wallet per coin, or ENS/Unstoppable/FIO names). Crypto settles here.
- Create a store at Account → Stores → + Add Store.
- Copy the Store Cloud Token + Store Webhook Secret into your env. Use the store-level token, not the account-wide one.
- Set the webhook URL as above, then Test Webhook.
MIT.