RechargeSharp 9.0.0-alpha.1
This is a prerelease version of RechargeSharp.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package RechargeSharp --version 9.0.0-alpha.1
NuGet\Install-Package RechargeSharp -Version 9.0.0-alpha.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="RechargeSharp" Version="9.0.0-alpha.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RechargeSharp" Version="9.0.0-alpha.1" />
<PackageReference Include="RechargeSharp" />
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 RechargeSharp --version 9.0.0-alpha.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: RechargeSharp, 9.0.0-alpha.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 RechargeSharp@9.0.0-alpha.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=RechargeSharp&version=9.0.0-alpha.1&prerelease
#tool nuget:?package=RechargeSharp&version=9.0.0-alpha.1&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
RechargeSharp, a C# library for RechargePayments
Get it here https://www.nuget.org/packages/RechargeSharp/
Built to work with the api documented at https://developer.rechargepayments.com/
Please feel free to submit issues and pull requests on github
Quickstart
Dependency injection
If you set up your appsettings.json like this:
{
"RechargeConfiguration": {
"ApiKey": [
"1",
"2",
"3",
"4"
],
"Url": "https://api.rechargeapps.com/"
}
}
Add RechargeSharp to dependency injection. After that the services will be constructor injected.
// this example shows how you can get a list of api keys from configuration that the services will swap between automatically when encountering throttling.
services.AddRechargeSharp(opts =>
{
opts.ApiKeyArray = _configuration.GetSection("RechargeConfiguration:ApiKey").GetChildren().Select(x => x.Value).ToArray();
opts.WebhookApiKey = _configuration["RechargeConfiguration:ApiKey:0"];
})
// if you only have 1 api key you wish to work with you can do the following.
services.AddRechargeSharp(opts =>
{
opts.ApiKeyArray = new[] { "apikey" });
opts.WebhookApiKey = "apikey";
}
Subscriptions
public class SubscriptionTestClass {
private readonly SubscriptionService _subscriptionService;
// constructor inject the subscription service to start working with subscriptions.
public SubscriptionTestClass(SubscriptionService subscriptionService){
_subscriptionService = subscriptionService;
}
public async Task DoStuff(){
// get all subscriptions with status ACTIVE and created after two months ago.
var subscriptions = await subscriptionService.GetAllSubscriptionsWithParamsAsync(status: "ACTIVE", createdAtMin: DateTime.Today.AddMonths(-2));
// iterate results and print subscription Id.
foreach (var subscription in subscriptions)
{
Console.WriteLine(subscription.Id);
}
}
}
Customers
public class CustomerTestClass {
private readonly CustomerService _customerService;
// constructor inject the customer service to start working with customers.
public CustomerTestClass(CustomerService customerService){
_customerService = customerService;
}
public async Task DoStuff(){
// get all customers created in the last two days.
var customers = await _customerService.GetAllCustomersWithParamsAsync(createdAtMin: DateTime.Now.AddDays(-2));
// iterate results and print whether the customer has a valid payment method.
foreach (var customer in customers)
{
Console.WriteLine(customer.HasValidPaymentMethod);
}
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.1
- Microsoft.Extensions.Http (>= 5.0.0)
- Newtonsoft.Json (>= 13.0.1)
- NuGet.Versioning (>= 5.11.0)
- Polly (>= 7.2.2)
- System.ComponentModel.Annotations (>= 5.0.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 |
|---|---|---|
| 12.2.6 | 213 | 7/6/2025 |
| 12.2.5 | 189 | 7/5/2025 |
| 12.2.4 | 970 | 10/8/2024 |
| 12.2.3 | 3,146 | 10/30/2023 |
| 12.2.2 | 3,057 | 11/8/2022 |
| 12.2.1 | 779 | 9/13/2022 |
| 12.2.0 | 1,020 | 9/13/2022 |
| 12.1.1 | 605 | 9/5/2022 |
| 12.1.1-alpha.2 | 383 | 7/27/2022 |
| 12.1.1-alpha.1 | 212 | 7/27/2022 |
| 12.1.0-alpha.3 | 213 | 7/27/2022 |
| 12.0.0-alpha.3 | 755 | 6/2/2022 |
| 12.0.0-alpha.2 | 222 | 6/2/2022 |
| 12.0.0-alpha.1 | 213 | 6/2/2022 |
| 11.2.0-alpha.2 | 220 | 5/24/2022 |
| 11.2.0-alpha.1 | 244 | 4/26/2022 |
| 11.1.0-beta.5 | 2,838 | 3/23/2022 |
| 11.1.0-beta.4 | 234 | 3/2/2022 |
| 11.1.0-beta.3 | 1,057 | 2/24/2022 |
| 11.1.0-beta.1 | 232 | 2/17/2022 |
| 11.0.1 | 872 | 2/9/2022 |
| 11.0.1-alpha.1 | 241 | 2/9/2022 |
| 11.0.0 | 612 | 2/7/2022 |
| 11.0.0-alpha.7 | 504 | 2/1/2022 |
| 11.0.0-alpha.6 | 249 | 1/10/2022 |
| 11.0.0-alpha.4 | 1,975 | 12/14/2021 |
| 11.0.0-alpha.3 | 268 | 12/12/2021 |
| 11.0.0-alpha.2 | 261 | 12/10/2021 |
| 10.0.0 | 683 | 12/8/2021 |
| 10.0.0-alpha.3 | 731 | 11/30/2021 |
| 10.0.0-alpha.2 | 523 | 11/23/2021 |
| 9.0.0 | 1,348 | 11/9/2021 |
| 9.0.0-alpha.2 | 627 | 10/8/2021 |
| 9.0.0-alpha.1 | 383 | 10/7/2021 |
| 8.1.0-alpha.3 | 482 | 10/1/2021 |
| 8.1.0-alpha.2 | 325 | 9/28/2021 |
| 8.1.0-alpha.1 | 259 | 9/27/2021 |
| 8.0.1 | 568 | 9/23/2021 |
| 7.0.0 | 655 | 9/8/2021 |
| 7.0.0-alpha.4 | 583 | 8/4/2021 |
| 7.0.0-alpha.3 | 301 | 8/3/2021 |
| 7.0.0-alpha.2 | 265 | 8/2/2021 |
| 7.0.0-alpha.1 | 289 | 8/2/2021 |
| 6.0.1 | 662 | 7/13/2021 |
| 6.0.0 | 590 | 7/12/2021 |
| 5.1.0 | 596 | 7/5/2021 |
| 5.0.0 | 907 | 6/9/2021 |
| 5.0.0-alpha.1 | 277 | 6/9/2021 |
| 4.6.0 | 850 | 5/20/2021 |
| 4.6.0-beta.2 | 301 | 5/13/2021 |
| 4.6.0-beta.1 | 289 | 5/13/2021 |
| 4.5.0 | 554 | 5/11/2021 |
| 4.5.0-beta.8 | 273 | 5/11/2021 |
| 4.5.0-beta.7 | 309 | 4/27/2021 |
| 4.5.0-beta.5 | 263 | 4/27/2021 |
| 4.5.0-beta.4 | 280 | 4/27/2021 |
| 4.5.0-beta.3 | 311 | 4/23/2021 |
| 4.5.0-beta.2 | 292 | 4/22/2021 |
| 4.5.0-beta.1 | 281 | 4/21/2021 |
| 4.4.6 | 718 | 4/12/2021 |
| 4.4.6-beta.1 | 284 | 4/12/2021 |
| 4.4.4 | 564 | 4/9/2021 |
| 4.4.4-beta.1 | 279 | 4/8/2021 |
| 4.4.3 | 637 | 4/5/2021 |
| 4.4.2 | 668 | 3/26/2021 |
| 4.4.1 | 759 | 3/14/2021 |
| 4.4.0 | 953 | 2/9/2021 |
| 4.3.2 | 552 | 1/27/2021 |
| 4.3.1 | 514 | 1/27/2021 |
| 4.3.0 | 597 | 1/20/2021 |
| 4.2.0 | 545 | 1/13/2021 |
| 4.1.4 | 570 | 12/29/2020 |
| 4.1.3 | 554 | 12/29/2020 |
| 4.1.2 | 635 | 12/21/2020 |
| 4.1.1 | 1,194 | 5/29/2020 |
| 4.1.0 | 678 | 5/29/2020 |
| 4.1.0-beta.1 | 405 | 5/27/2020 |
| 4.0.3-beta.2 | 453 | 5/11/2020 |
| 4.0.3-beta.1 | 407 | 5/11/2020 |
| 4.0.2 | 752 | 4/9/2020 |
| 4.0.1 | 761 | 3/25/2020 |
| 4.0.0 | 657 | 3/25/2020 |
| 4.0.0-beta.2 | 384 | 3/24/2020 |
| 4.0.0-beta.1 | 392 | 3/24/2020 |
| 3.2.8 | 689 | 3/23/2020 |
| 3.2.7 | 692 | 3/19/2020 |
| 3.2.6 | 701 | 3/9/2020 |
| 3.2.5 | 707 | 3/5/2020 |
| 3.2.4 | 695 | 3/4/2020 |
| 3.2.3 | 724 | 3/4/2020 |
| 3.2.2 | 674 | 3/4/2020 |
| 3.2.1 | 682 | 3/4/2020 |
| 3.2.0 | 741 | 3/4/2020 |
| 3.1.0 | 697 | 3/4/2020 |
| 3.0.10 | 700 | 2/27/2020 |
| 3.0.9 | 645 | 2/24/2020 |
| 3.0.7 | 660 | 2/24/2020 |
| 3.0.6 | 752 | 2/3/2020 |
| 3.0.5 | 695 | 2/3/2020 |
| 3.0.3 | 762 | 1/31/2020 |
| 3.0.1 | 708 | 1/13/2020 |
| 3.0.0 | 803 | 12/28/2019 |
| 2.2.9 | 761 | 12/13/2019 |
| 2.2.8 | 698 | 12/13/2019 |
| 2.2.7 | 810 | 11/21/2019 |
| 2.2.6 | 716 | 11/12/2019 |
| 2.2.5 | 698 | 11/8/2019 |
| 2.2.4 | 683 | 11/6/2019 |
| 2.2.3 | 682 | 11/6/2019 |
| 2.2.2 | 692 | 11/6/2019 |
| 2.2.1 | 698 | 11/6/2019 |
| 2.2.0 | 698 | 11/6/2019 |
| 2.1.1 | 674 | 11/1/2019 |
| 2.1.0 | 681 | 10/31/2019 |
| 2.0.1 | 727 | 10/29/2019 |
| 2.0.0 | 710 | 10/29/2019 |
| 1.5.0 | 696 | 10/25/2019 |
| 1.4.0 | 672 | 10/23/2019 |
| 1.3.0 | 703 | 10/16/2019 |
| 1.2.0 | 706 | 10/16/2019 |
| 1.1.4 | 683 | 10/9/2019 |
| 1.1.0 | 711 | 10/9/2019 |
| 1.0.0 | 708 | 9/18/2019 |
| 0.2.58 | 697 | 9/17/2019 |
| 0.2.57 | 740 | 9/16/2019 |
| 0.2.56 | 735 | 9/16/2019 |
| 0.2.55 | 961 | 9/16/2019 |
| 0.2.54 | 722 | 9/16/2019 |
| 0.2.53 | 737 | 9/16/2019 |
| 0.2.52 | 732 | 9/16/2019 |
| 0.2.51 | 698 | 9/13/2019 |
| 0.2.50 | 749 | 9/12/2019 |
| 0.2.49 | 728 | 9/12/2019 |
| 0.2.48 | 750 | 9/10/2019 |
| 0.2.47 | 723 | 9/10/2019 |
| 0.2.46 | 773 | 9/9/2019 |
| 0.2.43 | 743 | 9/7/2019 |
| 0.2.42 | 747 | 9/7/2019 |
| 0.2.37 | 739 | 9/7/2019 |
| 0.2.36 | 719 | 9/7/2019 |
| 0.2.35 | 724 | 9/7/2019 |
| 0.2.34 | 751 | 9/6/2019 |
| 0.2.33 | 707 | 9/5/2019 |
| 0.2.32 | 685 | 9/5/2019 |
| 0.2.31 | 701 | 9/5/2019 |
| 0.2.30 | 721 | 9/4/2019 |
| 0.2.25 | 731 | 9/4/2019 |
| 0.2.24 | 734 | 9/4/2019 |
| 0.2.23 | 692 | 9/3/2019 |
| 0.2.14 | 696 | 9/3/2019 |
| 0.2.13 | 706 | 9/3/2019 |
| 0.2.9 | 713 | 9/3/2019 |
| 0.2.8 | 695 | 9/3/2019 |
| 0.2.7 | 684 | 9/3/2019 |
| 0.2.6 | 714 | 9/3/2019 |
| 0.1.9 | 724 | 8/30/2019 |
| 0.1.8 | 747 | 8/15/2019 |
| 0.1.4 | 734 | 8/15/2019 |
| 0.1.3 | 692 | 8/15/2019 |
| 0.1.2 | 709 | 8/15/2019 |
| 0.1.1 | 682 | 8/15/2019 |
| 0.1.0 | 729 | 7/30/2019 |
| 0.0.32 | 729 | 7/26/2019 |
| 0.0.31 | 734 | 7/26/2019 |
| 0.0.24 | 725 | 7/25/2019 |
| 0.0.23 | 750 | 7/25/2019 |
| 0.0.22 | 700 | 7/25/2019 |
| 0.0.21 | 728 | 7/25/2019 |
| 0.0.20 | 712 | 7/25/2019 |
| 0.0.19 | 703 | 7/25/2019 |
| 0.0.18 | 741 | 7/25/2019 |
| 0.0.17 | 722 | 7/25/2019 |
| 0.0.16 | 758 | 7/23/2019 |
| 0.0.15 | 733 | 7/22/2019 |
| 0.0.14 | 790 | 7/22/2019 |
| 0.0.13 | 779 | 7/22/2019 |
| 0.0.12 | 723 | 7/22/2019 |
| 0.0.11 | 789 | 7/11/2019 |
| 0.0.10 | 780 | 7/10/2019 |
| 0.0.9 | 780 | 7/10/2019 |
| 0.0.8 | 762 | 7/9/2019 |
| 0.0.7 | 728 | 7/9/2019 |
| 0.0.6 | 735 | 7/9/2019 |
| 0.0.5 | 749 | 7/8/2019 |
| 0.0.4 | 748 | 7/8/2019 |
| 0.0.3 | 741 | 7/7/2019 |
| 0.0.2 | 727 | 7/4/2019 |
| 0.0.1 | 745 | 6/25/2019 |
Replaced all DateTimes with DateTimeOffsets