.NET library
Accept crypto payments in your .NET app
Create crypto invoices from ASP.NET Core and check signed webhooks, async all the way. The money goes straight to your own wallet.
Install
dotnet add package ArionPayWhat it does
ArionPay for .NET developers
Read more
Every call is async and takes a CancellationToken. ArionPay never holds the money: it goes straight to your own wallet.- No dependencies: only .NET itself (HttpClient, System.Text.Json). .NET 8 or newer (8, 9, 10).
- Async all the way, with a CancellationToken on every call.
- Every invoice request carries an idempotency key, so a network error can never create two invoices.
- VerifyWebhookAsync reads the request body, checks the signature and throws ArionPaySignatureException when it does not match or is more than 5 minutes old.
- Exact amounts: prices are decimal, crypto amounts are kept as text. inv.Matches(49.90m, "USD") compares the order total to the cent.
- Thread-safe: register the client once as a singleton. You can pass your own HttpClient, for example from IHttpClientFactory.
- SimulatePaymentAsync and SendTestWebhookAsync let you test without real money.
Requirements and licence
- Works with
- .NET 8 or newer · ASP.NET Core minimal APIs and controllers, worker services, console apps
- Cost
- The library is free. ArionPay charges 0.5% per payment, with no monthly fee.
- Source
- Open source (MIT) on GitHub.
Setup
Set it up in 5 steps
Step 1
Add the package
Run dotnet add package ArionPay. It has no dependencies outside .NET.
Step 2
Copy your keys
In your ArionPay dashboard, open your store and copy the API key (pk_) and the API secret (sk_, it asks for your authenticator code). The webhook signing secret (whsec_) is on the Webhooks page. Keep them in environment variables or user secrets.
Step 3
Register the client and create an invoice
Register one ArionPayClient as a singleton. Call CreateInvoiceAsync with an InvoiceRequest (Amount, Currency, OrderId), then redirect to invoice.InvoiceUrl.
Step 4
Check the webhook
Set your webhook address on the Webhooks page, or per invoice with CallbackUrl. Pass request.Body and the ArionPay-Signature header to VerifyWebhookAsync, and deliver on invoice.paid.
Step 5
Test without real money
Create an invoice with Test = true and an Asset such as USDT_TRC20, then call SimulatePaymentAsync(inv.Id, "exact"). Your webhook gets invoice.paid, like a real payment.
After the setup
How a payment reaches your code
- invoice.pending: a payment was seen on the network and waits for confirmations. Do not deliver yet.
- invoice.paid: fully paid and confirmed, or accepted by you by hand in the dashboard. Deliver only on this event (or when GetInvoiceAsync says paid). Coming back to SuccessUrl does not prove payment.
- Before you deliver, match the invoice to your order: your OrderId or Metadata, and inv.Matches(order.Total, order.Currency).
- invoice.partial, invoice.expired and invoice.needs_review never mean deliver. A late payment can still make an expired invoice paid.
- ArionPay sends again for about 3 days when your server does not answer 2xx. Handle each ev.Id once.
16 coins and tokens on 9 networks
All coins- BTCBitcoin
- ETHEthereum
- USDTEthereum
- USDCEthereum
- BNBBNB Smart Chain
- USDTBNB Smart Chain
- USDCBNB Smart Chain
- POLPolygon
- USDTPolygon
- USDCPolygon
- TRXTRON
- USDTTRON
- LTCLitecoin
- DOGEDogecoin
- BCHBitcoin Cash
- DASHDash
Questions about the ArionPay .NET library
Short answers before you add it to your code.