RechargeSharp 12.2.0
See the version list below for details.
dotnet add package RechargeSharp --version 12.2.0
NuGet\Install-Package RechargeSharp -Version 12.2.0
<PackageReference Include="RechargeSharp" Version="12.2.0" />
<PackageVersion Include="RechargeSharp" Version="12.2.0" />
<PackageReference Include="RechargeSharp" />
paket add RechargeSharp --version 12.2.0
#r "nuget: RechargeSharp, 12.2.0"
#:package RechargeSharp@12.2.0
#addin nuget:?package=RechargeSharp&version=12.2.0
#tool nuget:?package=RechargeSharp&version=12.2.0
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
Supported API versions
- 2021-01: The namespace for this is just
RechargeSharp. - 2021-11: The namespace for this is
RechargeSharp.v2021-11.
You can use services from both namespaces simultaneously without issues.
Recharge API version 2021-11
Quickstart
Dependency injection
Use the AddRechargeSharp2021_11() to add the services to the service collection, like so:
var hostBuilder = Host.CreateDefaultBuilder()
.ConfigureServices(collection =>
{
var apiKey = "<insert-your-API-key-here>";
collection.AddRechargeSharp2021_11(options => options.ApiKey = apiKey);
});
After this, the DI container will be able to resolve services for implemented endpoints, such as the IAddressService, ICustomerService, and so on.
Here is a tiny example of a class that uses the ICustomerService.
private readonly ICustomerService _customerService;
public YourServiceThatUsesRechargeSharp(ICustomerService customerService)
{
_customerService = customerService;
}
protected async Task PrintCustomerEmail()
{
GetCustomerTypes.Response? response = await _customerService.GetCustomerAsync(1234);
Console.WriteLine($"Customer email: {response!.Customer!.Email}");
}
Recharge API version 2021-01
Quickstart
Dependency injection
If you set up your appsettings.json like this:
{
"RechargeConfiguration": {
"ApiKey": [
"1",
"2",
"3",
"4"
]
}
}
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. |
-
.NETStandard 2.1
- Polly (>= 7.2.3)
- RechargeSharp.Entities (>= 12.2.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 | 398 | 7/6/2025 |
| 12.2.5 | 206 | 7/5/2025 |
| 12.2.4 | 983 | 10/8/2024 |
| 12.2.3 | 3,166 | 10/30/2023 |
| 12.2.2 | 3,209 | 11/8/2022 |
| 12.2.1 | 803 | 9/13/2022 |
| 12.2.0 | 1,048 | 9/13/2022 |
| 12.1.1 | 627 | 9/5/2022 |
| 12.1.1-alpha.2 | 405 | 7/27/2022 |
| 12.1.1-alpha.1 | 239 | 7/27/2022 |
| 12.1.0-alpha.3 | 249 | 7/27/2022 |
| 12.0.0-alpha.3 | 783 | 6/2/2022 |
| 12.0.0-alpha.2 | 243 | 6/2/2022 |
| 12.0.0-alpha.1 | 232 | 6/2/2022 |
| 11.2.0-alpha.2 | 248 | 5/24/2022 |
| 11.2.0-alpha.1 | 276 | 4/26/2022 |
| 11.1.0-beta.5 | 2,860 | 3/23/2022 |
| 11.1.0-beta.4 | 260 | 3/2/2022 |
| 11.1.0-beta.3 | 1,090 | 2/24/2022 |
| 11.1.0-beta.1 | 257 | 2/17/2022 |
| 11.0.1 | 900 | 2/9/2022 |
| 11.0.1-alpha.1 | 272 | 2/9/2022 |
| 11.0.0 | 640 | 2/7/2022 |
| 11.0.0-alpha.7 | 523 | 2/1/2022 |
| 11.0.0-alpha.6 | 281 | 1/10/2022 |
| 11.0.0-alpha.4 | 2,007 | 12/14/2021 |
| 11.0.0-alpha.3 | 295 | 12/12/2021 |
| 11.0.0-alpha.2 | 290 | 12/10/2021 |
| 10.0.0 | 712 | 12/8/2021 |
| 10.0.0-alpha.3 | 761 | 11/30/2021 |
| 10.0.0-alpha.2 | 550 | 11/23/2021 |
| 9.0.0 | 1,374 | 11/9/2021 |
| 9.0.0-alpha.2 | 656 | 10/8/2021 |
| 9.0.0-alpha.1 | 410 | 10/7/2021 |
| 8.1.0-alpha.3 | 513 | 10/1/2021 |
| 8.1.0-alpha.2 | 355 | 9/28/2021 |
| 8.1.0-alpha.1 | 286 | 9/27/2021 |
| 8.0.1 | 591 | 9/23/2021 |
| 7.0.0 | 685 | 9/8/2021 |
| 7.0.0-alpha.4 | 609 | 8/4/2021 |
| 7.0.0-alpha.3 | 327 | 8/3/2021 |
| 7.0.0-alpha.2 | 293 | 8/2/2021 |
| 7.0.0-alpha.1 | 317 | 8/2/2021 |
| 6.0.1 | 687 | 7/13/2021 |
| 6.0.0 | 618 | 7/12/2021 |
| 5.1.0 | 624 | 7/5/2021 |
| 5.0.0 | 933 | 6/9/2021 |
| 5.0.0-alpha.1 | 305 | 6/9/2021 |
| 4.6.0 | 876 | 5/20/2021 |
| 4.6.0-beta.2 | 322 | 5/13/2021 |
| 4.6.0-beta.1 | 319 | 5/13/2021 |
| 4.5.0 | 580 | 5/11/2021 |
| 4.5.0-beta.8 | 298 | 5/11/2021 |
| 4.5.0-beta.7 | 334 | 4/27/2021 |
| 4.5.0-beta.5 | 290 | 4/27/2021 |
| 4.5.0-beta.4 | 304 | 4/27/2021 |
| 4.5.0-beta.3 | 335 | 4/23/2021 |
| 4.5.0-beta.2 | 319 | 4/22/2021 |
| 4.5.0-beta.1 | 305 | 4/21/2021 |
| 4.4.6 | 742 | 4/12/2021 |
| 4.4.6-beta.1 | 311 | 4/12/2021 |
| 4.4.4 | 590 | 4/9/2021 |
| 4.4.4-beta.1 | 304 | 4/8/2021 |
| 4.4.3 | 658 | 4/5/2021 |
| 4.4.2 | 696 | 3/26/2021 |
| 4.4.1 | 792 | 3/14/2021 |
| 4.4.0 | 985 | 2/9/2021 |
| 4.3.2 | 580 | 1/27/2021 |
| 4.3.1 | 538 | 1/27/2021 |
| 4.3.0 | 622 | 1/20/2021 |
| 4.2.0 | 577 | 1/13/2021 |
| 4.1.4 | 602 | 12/29/2020 |
| 4.1.3 | 582 | 12/29/2020 |
| 4.1.2 | 666 | 12/21/2020 |
| 4.1.1 | 1,226 | 5/29/2020 |
| 4.1.0 | 707 | 5/29/2020 |
| 4.1.0-beta.1 | 441 | 5/27/2020 |
| 4.0.3-beta.2 | 483 | 5/11/2020 |
| 4.0.3-beta.1 | 438 | 5/11/2020 |
| 4.0.2 | 784 | 4/9/2020 |
| 4.0.1 | 798 | 3/25/2020 |
| 4.0.0 | 689 | 3/25/2020 |
| 4.0.0-beta.2 | 422 | 3/24/2020 |
| 4.0.0-beta.1 | 430 | 3/24/2020 |
| 3.2.8 | 721 | 3/23/2020 |
| 3.2.7 | 723 | 3/19/2020 |
| 3.2.6 | 742 | 3/9/2020 |
| 3.2.5 | 738 | 3/5/2020 |
| 3.2.4 | 729 | 3/4/2020 |
| 3.2.3 | 763 | 3/4/2020 |
| 3.2.2 | 709 | 3/4/2020 |
| 3.2.1 | 718 | 3/4/2020 |
| 3.2.0 | 773 | 3/4/2020 |
| 3.1.0 | 729 | 3/4/2020 |
| 3.0.10 | 730 | 2/27/2020 |
| 3.0.9 | 678 | 2/24/2020 |
| 3.0.7 | 695 | 2/24/2020 |
| 3.0.6 | 786 | 2/3/2020 |
| 3.0.5 | 732 | 2/3/2020 |
| 3.0.3 | 793 | 1/31/2020 |
| 3.0.1 | 744 | 1/13/2020 |
| 3.0.0 | 835 | 12/28/2019 |
| 2.2.9 | 794 | 12/13/2019 |
| 2.2.8 | 732 | 12/13/2019 |
| 2.2.7 | 844 | 11/21/2019 |
| 2.2.6 | 750 | 11/12/2019 |
| 2.2.5 | 731 | 11/8/2019 |
| 2.2.4 | 714 | 11/6/2019 |
| 2.2.3 | 723 | 11/6/2019 |
| 2.2.2 | 727 | 11/6/2019 |
| 2.2.1 | 730 | 11/6/2019 |
| 2.2.0 | 732 | 11/6/2019 |
| 2.1.1 | 706 | 11/1/2019 |
| 2.1.0 | 719 | 10/31/2019 |
| 2.0.1 | 761 | 10/29/2019 |
| 2.0.0 | 743 | 10/29/2019 |
| 1.5.0 | 728 | 10/25/2019 |
| 1.4.0 | 706 | 10/23/2019 |
| 1.3.0 | 737 | 10/16/2019 |
| 1.2.0 | 743 | 10/16/2019 |
| 1.1.4 | 718 | 10/9/2019 |
| 1.1.0 | 744 | 10/9/2019 |
| 1.0.0 | 740 | 9/18/2019 |
| 0.2.58 | 732 | 9/17/2019 |
| 0.2.57 | 777 | 9/16/2019 |
| 0.2.56 | 768 | 9/16/2019 |
| 0.2.55 | 991 | 9/16/2019 |
| 0.2.54 | 759 | 9/16/2019 |
| 0.2.53 | 771 | 9/16/2019 |
| 0.2.52 | 768 | 9/16/2019 |
| 0.2.51 | 732 | 9/13/2019 |
| 0.2.50 | 778 | 9/12/2019 |
| 0.2.49 | 764 | 9/12/2019 |
| 0.2.48 | 781 | 9/10/2019 |
| 0.2.47 | 758 | 9/10/2019 |
| 0.2.46 | 808 | 9/9/2019 |
| 0.2.43 | 771 | 9/7/2019 |
| 0.2.42 | 783 | 9/7/2019 |
| 0.2.37 | 775 | 9/7/2019 |
| 0.2.36 | 759 | 9/7/2019 |
| 0.2.35 | 757 | 9/7/2019 |
| 0.2.34 | 787 | 9/6/2019 |
| 0.2.33 | 742 | 9/5/2019 |
| 0.2.32 | 725 | 9/5/2019 |
| 0.2.31 | 735 | 9/5/2019 |
| 0.2.30 | 756 | 9/4/2019 |
| 0.2.25 | 765 | 9/4/2019 |
| 0.2.24 | 770 | 9/4/2019 |
| 0.2.23 | 729 | 9/3/2019 |
| 0.2.14 | 732 | 9/3/2019 |
| 0.2.13 | 738 | 9/3/2019 |
| 0.2.9 | 748 | 9/3/2019 |
| 0.2.8 | 728 | 9/3/2019 |
| 0.2.7 | 720 | 9/3/2019 |
| 0.2.6 | 750 | 9/3/2019 |
| 0.1.9 | 754 | 8/30/2019 |
| 0.1.8 | 781 | 8/15/2019 |
| 0.1.4 | 766 | 8/15/2019 |
| 0.1.3 | 728 | 8/15/2019 |
| 0.1.2 | 738 | 8/15/2019 |
| 0.1.1 | 713 | 8/15/2019 |
| 0.1.0 | 763 | 7/30/2019 |
| 0.0.32 | 762 | 7/26/2019 |
| 0.0.31 | 772 | 7/26/2019 |
| 0.0.24 | 758 | 7/25/2019 |
| 0.0.23 | 779 | 7/25/2019 |
| 0.0.22 | 732 | 7/25/2019 |
| 0.0.21 | 766 | 7/25/2019 |
| 0.0.20 | 746 | 7/25/2019 |
| 0.0.19 | 738 | 7/25/2019 |
| 0.0.18 | 780 | 7/25/2019 |
| 0.0.17 | 758 | 7/25/2019 |
| 0.0.16 | 790 | 7/23/2019 |
| 0.0.15 | 769 | 7/22/2019 |
| 0.0.14 | 825 | 7/22/2019 |
| 0.0.13 | 812 | 7/22/2019 |
| 0.0.12 | 752 | 7/22/2019 |
| 0.0.11 | 825 | 7/11/2019 |
| 0.0.10 | 813 | 7/10/2019 |
| 0.0.9 | 809 | 7/10/2019 |
| 0.0.8 | 797 | 7/9/2019 |
| 0.0.7 | 759 | 7/9/2019 |
| 0.0.6 | 770 | 7/9/2019 |
| 0.0.5 | 780 | 7/8/2019 |
| 0.0.4 | 783 | 7/8/2019 |
| 0.0.3 | 779 | 7/7/2019 |
| 0.0.2 | 761 | 7/4/2019 |
| 0.0.1 | 780 | 6/25/2019 |
Simplify target frameworks