TailoredApps.Shared.Payments.Provider.Revolut
2.1.0
See the version list below for details.
dotnet add package TailoredApps.Shared.Payments.Provider.Revolut --version 2.1.0
NuGet\Install-Package TailoredApps.Shared.Payments.Provider.Revolut -Version 2.1.0
<PackageReference Include="TailoredApps.Shared.Payments.Provider.Revolut" Version="2.1.0" />
<PackageVersion Include="TailoredApps.Shared.Payments.Provider.Revolut" Version="2.1.0" />
<PackageReference Include="TailoredApps.Shared.Payments.Provider.Revolut" />
paket add TailoredApps.Shared.Payments.Provider.Revolut --version 2.1.0
#r "nuget: TailoredApps.Shared.Payments.Provider.Revolut, 2.1.0"
#:package TailoredApps.Shared.Payments.Provider.Revolut@2.1.0
#addin nuget:?package=TailoredApps.Shared.Payments.Provider.Revolut&version=2.1.0
#tool nuget:?package=TailoredApps.Shared.Payments.Provider.Revolut&version=2.1.0
TailoredApps.Shared.Payments.Provider.Revolut
Revolut is a payment operator (cards, Revolut Pay). This package plugs the Revolut Merchant API into
TailoredApps.Shared.Payments: it creates orders and returns the address of the checkout page, reads the state of an order,
and verifies and handles Revolut webhooks.
Installation
dotnet add package TailoredApps.Shared.Payments.Provider.Revolut # brings TailoredApps.Shared.Payments with it
Registration
using TailoredApps.Shared.Payments;
using TailoredApps.Shared.Payments.Provider.Revolut;
builder.Services.AddPayments().RegisterRevolutProvider();
The call registers the provider with its dependencies and adds it to IPaymentService. Several providers chain:
.AddPayments().RegisterRevolutProvider().RegisterTpayProvider().
Configuration
Options are bound from the Payments:Providers:Revolut section (RevolutServiceOptions).
{
"Payments": {
"Providers": {
"Revolut": {
"ApiKey": "<merchant-api-key>",
"WebhookSecret": "<webhook-signing-secret>",
"ApiUrl": "https://merchant.revolut.com/api",
"WebhookToleranceSeconds": 300
}
}
}
}
| Key | Required | Meaning | Default |
|---|---|---|---|
ApiKey |
yes | Merchant API key, sent as a Bearer token |
- |
WebhookSecret |
yes | Signing secret Revolut issued when the webhook was registered | - |
ApiUrl |
no | Base URL of the Merchant API; orders are at {ApiUrl}/1.0/orders |
https://merchant.revolut.com/api |
WebhookToleranceSeconds |
no | Largest accepted age of a webhook timestamp, in either direction; 0 switches the check off |
300 |
ReturnUrl |
no | Bound from configuration, but not sent to Revolut by the provider | empty |
A required key that is missing stops the host at startup with OptionsValidationException. The other keys are not validated.
Usage
// payments is an injected IPaymentService
var response = await payments.RegisterPayment(new PaymentRequest("Revolut", 49.99m, "PLN")
{
Title = "Order 7",
Email = "buyer@example.com",
AdditionalData = "order-7", // sent as merchant_order_ext_ref
}, cancellationToken);
return Redirect(response.RedirectUrl); // checkout_url of the order
response.PaymentUniqueId is the Revolut order id; pass it to GetStatus("Revolut", orderId).
Webhooks
Revolut posts a JSON body with two headers: Revolut-Request-Timestamp (milliseconds) and Revolut-Signature (v1=<hex>).
The provider computes HMAC-SHA256 over v1.{timestamp}.{raw body} keyed with WebhookSecret and compares in constant time.
The header may carry several signatures separated by commas; one match is enough. A timestamp further than
WebhookToleranceSeconds from the server clock is refused, which stops a captured webhook from being replayed.
using var reader = new StreamReader(Request.Body, Encoding.UTF8);
var result = await payments.HandleWebhookAsync("Revolut", new PaymentWebhookRequest
{
Body = await reader.ReadToEndAsync(cancellationToken), // raw body, not [FromBody]
Headers = Request.Headers.ToDictionary(h => h.Key, h => h.Value),
}, cancellationToken);
return result is PaymentWebhookRejected ? BadRequest() : Ok();
event in the body |
Result |
|---|---|
ORDER_COMPLETED |
PaymentWebhookProcessed, Payment.PaymentStatus = Finished |
ORDER_CANCELLED, ORDER_PAYMENT_DECLINED, PAYMENT_DECLINED |
PaymentWebhookProcessed, Payment.PaymentStatus = Rejected |
ORDER_AUTHORISED or any other event |
PaymentWebhookIgnored |
signature or timestamp missing, wrong or too old, or WebhookSecret not configured |
PaymentWebhookRejected (PaymentWebhookRejection.InvalidSignature) |
Payment.PaymentUniqueId is the order_id of the notification - the same identifier RegisterPayment returned.
Good to know
- A failing gateway is an exception, not a rejected payment:
RegisterPaymentthrowsPaymentGatewayException(derives fromHttpRequestException) on 5xx, 408 or 429, andGetStatusthrows it on any answer outside 2xx.RejectedfromRegisterPaymentmeans Revolut answered without an orderid. GetStatusmaps the order statecompletedtoFinished,processing,pendingandauthorisedtoProcessing,failedandcancelledtoRejected, anything else toCreated.- Keep the server clock synchronised: with the default tolerance a webhook is refused when its timestamp differs from the clock by more than 300 seconds.
- The amount is sent in the minor unit (amount x 100).
GetChannelsreturns a fixed list (card,revolut_pay);PaymentRequest.PaymentChannelis not sent to Revolut. - Requests go through the named HTTP client
RevolutfromIHttpClientFactory.
Documentation
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. net11.0 is compatible. |
-
net10.0
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.15)
- Microsoft.Extensions.Http (>= 10.0.15)
- Microsoft.Extensions.Options (>= 10.0.15)
- TailoredApps.Shared.Payments (>= 2.1.0)
-
net11.0
- Microsoft.Extensions.Configuration.Binder (>= 11.0.0)
- Microsoft.Extensions.Http (>= 11.0.0)
- TailoredApps.Shared.Payments (>= 2.1.0)
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 |
|---|---|---|
| 3.0.0-preview.3 | 35 | 12/2/2026 |
| 3.0.0-preview.2 | 58 | 11/12/2026 |
| 3.0.0-preview.1 | 67 | 11/12/2026 |
| 2.1.2 | 47 | 12/2/2026 |
| 2.1.1 | 55 | 12/2/2026 |
| 2.1.0 | 112 | 11/12/2026 |
| 2.0.1 | 92 | 11/12/2026 |
| 2.0.0 | 131 | 11/12/2026 |
| 1.6.0 | 91 | 11/12/2026 |
| 1.4.19 | 119 | 10/26/2026 |
| 1.4.18 | 105 | 10/23/2026 |
| 1.4.17 | 123 | 10/6/2026 |
| 1.4.16 | 110 | 9/28/2026 |
| 1.4.15 | 110 | 9/21/2026 |
| 1.4.14 | 115 | 8/20/2026 |
| 1.4.13 | 122 | 8/20/2026 |
| 1.4.12 | 128 | 8/20/2026 |
| 1.4.11 | 124 | 8/7/2026 |
| 1.4.10 | 138 | 7/8/2026 |
| 1.4.9 | 129 | 7/8/2026 |