TailoredApps.Shared.Payments.Provider.CashBill
2.1.2
See the version list below for details.
dotnet add package TailoredApps.Shared.Payments.Provider.CashBill --version 2.1.2
NuGet\Install-Package TailoredApps.Shared.Payments.Provider.CashBill -Version 2.1.2
<PackageReference Include="TailoredApps.Shared.Payments.Provider.CashBill" Version="2.1.2" />
<PackageVersion Include="TailoredApps.Shared.Payments.Provider.CashBill" Version="2.1.2" />
<PackageReference Include="TailoredApps.Shared.Payments.Provider.CashBill" />
paket add TailoredApps.Shared.Payments.Provider.CashBill --version 2.1.2
#r "nuget: TailoredApps.Shared.Payments.Provider.CashBill, 2.1.2"
#:package TailoredApps.Shared.Payments.Provider.CashBill@2.1.2
#addin nuget:?package=TailoredApps.Shared.Payments.Provider.CashBill&version=2.1.2
#tool nuget:?package=TailoredApps.Shared.Payments.Provider.CashBill&version=2.1.2
TailoredApps.Shared.Payments.Provider.CashBill
CashBill is a Polish operator of one-time payments. This package plugs the CashBill REST API into
TailoredApps.Shared.Payments: it lists the payment channels of a shop, starts payments, reads their status, and verifies
and handles CashBill status notifications.
Installation
dotnet add package TailoredApps.Shared.Payments.Provider.CashBill # brings TailoredApps.Shared.Payments with it
Registration
using TailoredApps.Shared.Payments;
using TailoredApps.Shared.Payments.Provider.CashBill;
builder.Services.AddPayments().RegisterCashbillProvider();
The call registers the provider with its dependencies and adds it to IPaymentService. Several providers chain:
.AddPayments().RegisterCashbillProvider().RegisterTpayProvider(). Mind the spelling: the extension method, the options
class (CashbillServiceOptions) and the provider key use Cashbill; the provider class is CashBillProvider.
Configuration
Options are bound from the Payments:Providers:Cashbill section (CashbillServiceOptions).
{
"Payments": {
"Providers": {
"Cashbill": {
"ServiceUrl": "https://<cashbill-rest-api-address>/",
"ShopId": "<shop-id>",
"ShopSecretPhrase": "<shop-secret-phrase>",
"ReturnUrl": "https://shop.example/payment/return",
"NegativeReturnUrl": "https://shop.example/payment/failed"
}
}
}
}
| Key | Required | Meaning | Default |
|---|---|---|---|
ServiceUrl |
yes | Base URL of the CashBill REST API; end it with /, request addresses are resolved relative to it |
- |
ShopId |
yes | Shop identifier | - |
ShopSecretPhrase |
yes | Secret that signs the requests and verifies notifications | - |
ReturnUrl |
no | Return address after a payment. Not validated at startup, but RegisterPayment fails unless it is an absolute URL |
empty |
NegativeReturnUrl |
no | Return address after a failed or cancelled payment | 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 channels = await payments.GetChannels("Cashbill", "PLN", cancellationToken); // read from the CashBill API
var response = await payments.RegisterPayment(new PaymentRequest("Cashbill", 49.99m, "PLN")
{
Title = "Order 7",
Description = "Order 7 at shop.example",
Email = "buyer@example.com",
PaymentChannel = channels.First().Id,
AdditionalData = "order-7",
}, cancellationToken);
return Redirect(response.RedirectUrl);
response.PaymentUniqueId is the CashBill payment id; pass it to GetStatus("Cashbill", paymentId).
Webhooks
CashBill calls the notification address (GET or POST) with three query-string parameters: cmd, args (the payment id) and
sign. The provider reads them from PaymentWebhookRequest.Query; it does not read the body or the headers. sign must equal
the hex MD5 of cmd + args + ShopSecretPhrase (compared in constant time). For an authentic notification the provider then
reads the current status of the payment from the CashBill API.
var result = await payments.HandleWebhookAsync("Cashbill", new PaymentWebhookRequest
{
HttpMethod = Request.Method,
Query = Request.Query.ToDictionary(q => q.Key, q => q.Value),
}, cancellationToken);
return result is PaymentWebhookRejected ? BadRequest() : Ok();
| Outcome | Result |
|---|---|
| signature valid | PaymentWebhookProcessed with the current status of the payment (Created, Processing, Finished or Rejected) |
args missing |
PaymentWebhookRejected (MalformedPayload) |
sign missing or wrong |
PaymentWebhookRejected (InvalidSignature) |
ShopSecretPhrase not configured |
PaymentWebhookRejected (NotConfigured) |
This provider never returns PaymentWebhookIgnored: check Payment.PaymentStatus before acting on a processed result.
Good to know
- Every CashBill answer outside 2xx throws
PaymentGatewayException(derives fromHttpRequestException) - fromGetChannels,RegisterPayment,GetStatusand also fromHandleWebhookAsync, which queries the status. The state of the payment is then not known. Failures are logged without the query string, which carries the request signature. - Requests go through the named HTTP client
CashBill(CashbillHttpClient.HttpClientName) fromIHttpClientFactory, so the handlers and timeouts the host configures for it apply. - After creating a payment the provider sets its return address to
{ReturnUrl}/{paymentId}: the payer comes back toReturnUrlwith the payment id appended as a path segment. - Status mapping:
PreStartandStartareCreated;PositiveAuthorizationandNegativeAuthorizationareProcessing;PositiveFinishisFinished;NegativeFinish,CriticalError,Abort,FraudandTimeExceededareRejected. - The provider key is
"Cashbill"and it is compared case-sensitively:"CashBill"does not find the provider.
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.Logging.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Options (>= 10.0.15)
- TailoredApps.Shared.Payments (>= 2.1.2)
-
net11.0
- Microsoft.Extensions.Configuration.Binder (>= 11.0.0)
- Microsoft.Extensions.Http (>= 11.0.0)
- TailoredApps.Shared.Payments (>= 2.1.2)
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 | 40 | 12/2/2026 |
| 3.0.0-preview.2 | 60 | 11/12/2026 |
| 3.0.0-preview.1 | 64 | 11/12/2026 |
| 2.1.2 | 46 | 12/2/2026 |
| 2.1.1 | 68 | 12/2/2026 |
| 2.1.0 | 115 | 11/12/2026 |
| 2.0.1 | 98 | 11/12/2026 |
| 2.0.0 | 136 | 11/12/2026 |
| 1.6.0 | 218 | 11/12/2026 |
| 1.4.19 | 247 | 10/26/2026 |
| 1.4.18 | 348 | 10/23/2026 |
| 1.4.17 | 439 | 10/6/2026 |
| 1.4.16 | 114 | 9/28/2026 |
| 1.4.15 | 120 | 9/21/2026 |
| 1.4.14 | 124 | 8/20/2026 |
| 1.4.13 | 130 | 8/20/2026 |
| 1.4.12 | 138 | 8/20/2026 |
| 1.4.11 | 137 | 8/7/2026 |
| 1.4.10 | 160 | 7/8/2026 |
| 1.4.9 | 145 | 7/8/2026 |