RechargeSharp 12.2.4
See the version list below for details.
dotnet add package RechargeSharp --version 12.2.4
NuGet\Install-Package RechargeSharp -Version 12.2.4
<PackageReference Include="RechargeSharp" Version="12.2.4" />
<PackageVersion Include="RechargeSharp" Version="12.2.4" />
<PackageReference Include="RechargeSharp" />
paket add RechargeSharp --version 12.2.4
#r "nuget: RechargeSharp, 12.2.4"
#:package RechargeSharp@12.2.4
#addin nuget:?package=RechargeSharp&version=12.2.4
#tool nuget:?package=RechargeSharp&version=12.2.4
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.4)
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 | 303 | 7/6/2025 |
| 12.2.5 | 191 | 7/5/2025 |
| 12.2.4 | 974 | 10/8/2024 |
| 12.2.3 | 3,150 | 10/30/2023 |
| 12.2.2 | 3,153 | 11/8/2022 |
| 12.2.1 | 790 | 9/13/2022 |
| 12.2.0 | 1,029 | 9/13/2022 |
| 12.1.1 | 611 | 9/5/2022 |
| 12.1.1-alpha.2 | 391 | 7/27/2022 |
| 12.1.1-alpha.1 | 220 | 7/27/2022 |
| 12.1.0-alpha.3 | 227 | 7/27/2022 |
| 12.0.0-alpha.3 | 762 | 6/2/2022 |
| 12.0.0-alpha.2 | 228 | 6/2/2022 |
| 12.0.0-alpha.1 | 220 | 6/2/2022 |
| 11.2.0-alpha.2 | 228 | 5/24/2022 |
| 11.2.0-alpha.1 | 251 | 4/26/2022 |
| 11.1.0-beta.5 | 2,842 | 3/23/2022 |
| 11.1.0-beta.4 | 242 | 3/2/2022 |
| 11.1.0-beta.3 | 1,069 | 2/24/2022 |
| 11.1.0-beta.1 | 239 | 2/17/2022 |
| 11.0.1 | 879 | 2/9/2022 |
| 11.0.1-alpha.1 | 249 | 2/9/2022 |
| 11.0.0 | 624 | 2/7/2022 |
| 11.0.0-alpha.7 | 511 | 2/1/2022 |
| 11.0.0-alpha.6 | 258 | 1/10/2022 |
| 11.0.0-alpha.4 | 1,985 | 12/14/2021 |
| 11.0.0-alpha.3 | 278 | 12/12/2021 |
| 11.0.0-alpha.2 | 271 | 12/10/2021 |
| 10.0.0 | 692 | 12/8/2021 |
| 10.0.0-alpha.3 | 741 | 11/30/2021 |
| 10.0.0-alpha.2 | 531 | 11/23/2021 |
| 9.0.0 | 1,358 | 11/9/2021 |
| 9.0.0-alpha.2 | 635 | 10/8/2021 |
| 9.0.0-alpha.1 | 392 | 10/7/2021 |
| 8.1.0-alpha.3 | 490 | 10/1/2021 |
| 8.1.0-alpha.2 | 333 | 9/28/2021 |
| 8.1.0-alpha.1 | 266 | 9/27/2021 |
| 8.0.1 | 578 | 9/23/2021 |
| 7.0.0 | 669 | 9/8/2021 |
| 7.0.0-alpha.4 | 592 | 8/4/2021 |
| 7.0.0-alpha.3 | 311 | 8/3/2021 |
| 7.0.0-alpha.2 | 275 | 8/2/2021 |
| 7.0.0-alpha.1 | 300 | 8/2/2021 |
| 6.0.1 | 671 | 7/13/2021 |
| 6.0.0 | 602 | 7/12/2021 |
| 5.1.0 | 606 | 7/5/2021 |
| 5.0.0 | 914 | 6/9/2021 |
| 5.0.0-alpha.1 | 285 | 6/9/2021 |
| 4.6.0 | 858 | 5/20/2021 |
| 4.6.0-beta.2 | 308 | 5/13/2021 |
| 4.6.0-beta.1 | 300 | 5/13/2021 |
| 4.5.0 | 562 | 5/11/2021 |
| 4.5.0-beta.8 | 281 | 5/11/2021 |
| 4.5.0-beta.7 | 319 | 4/27/2021 |
| 4.5.0-beta.5 | 271 | 4/27/2021 |
| 4.5.0-beta.4 | 288 | 4/27/2021 |
| 4.5.0-beta.3 | 320 | 4/23/2021 |
| 4.5.0-beta.2 | 303 | 4/22/2021 |
| 4.5.0-beta.1 | 290 | 4/21/2021 |
| 4.4.6 | 726 | 4/12/2021 |
| 4.4.6-beta.1 | 294 | 4/12/2021 |
| 4.4.4 | 574 | 4/9/2021 |
| 4.4.4-beta.1 | 288 | 4/8/2021 |
| 4.4.3 | 646 | 4/5/2021 |
| 4.4.2 | 678 | 3/26/2021 |
| 4.4.1 | 773 | 3/14/2021 |
| 4.4.0 | 967 | 2/9/2021 |
| 4.3.2 | 563 | 1/27/2021 |
| 4.3.1 | 527 | 1/27/2021 |
| 4.3.0 | 611 | 1/20/2021 |
| 4.2.0 | 556 | 1/13/2021 |
| 4.1.4 | 582 | 12/29/2020 |
| 4.1.3 | 565 | 12/29/2020 |
| 4.1.2 | 648 | 12/21/2020 |
| 4.1.1 | 1,208 | 5/29/2020 |
| 4.1.0 | 690 | 5/29/2020 |
| 4.1.0-beta.1 | 419 | 5/27/2020 |
| 4.0.3-beta.2 | 464 | 5/11/2020 |
| 4.0.3-beta.1 | 419 | 5/11/2020 |
| 4.0.2 | 768 | 4/9/2020 |
| 4.0.1 | 776 | 3/25/2020 |
| 4.0.0 | 670 | 3/25/2020 |
| 4.0.0-beta.2 | 396 | 3/24/2020 |
| 4.0.0-beta.1 | 406 | 3/24/2020 |
| 3.2.8 | 701 | 3/23/2020 |
| 3.2.7 | 706 | 3/19/2020 |
| 3.2.6 | 718 | 3/9/2020 |
| 3.2.5 | 723 | 3/5/2020 |
| 3.2.4 | 708 | 3/4/2020 |
| 3.2.3 | 741 | 3/4/2020 |
| 3.2.2 | 690 | 3/4/2020 |
| 3.2.1 | 696 | 3/4/2020 |
| 3.2.0 | 756 | 3/4/2020 |
| 3.1.0 | 711 | 3/4/2020 |
| 3.0.10 | 712 | 2/27/2020 |
| 3.0.9 | 658 | 2/24/2020 |
| 3.0.7 | 673 | 2/24/2020 |
| 3.0.6 | 767 | 2/3/2020 |
| 3.0.5 | 710 | 2/3/2020 |
| 3.0.3 | 775 | 1/31/2020 |
| 3.0.1 | 723 | 1/13/2020 |
| 3.0.0 | 818 | 12/28/2019 |
| 2.2.9 | 779 | 12/13/2019 |
| 2.2.8 | 712 | 12/13/2019 |
| 2.2.7 | 828 | 11/21/2019 |
| 2.2.6 | 732 | 11/12/2019 |
| 2.2.5 | 714 | 11/8/2019 |
| 2.2.4 | 699 | 11/6/2019 |
| 2.2.3 | 702 | 11/6/2019 |
| 2.2.2 | 708 | 11/6/2019 |
| 2.2.1 | 712 | 11/6/2019 |
| 2.2.0 | 714 | 11/6/2019 |
| 2.1.1 | 689 | 11/1/2019 |
| 2.1.0 | 695 | 10/31/2019 |
| 2.0.1 | 744 | 10/29/2019 |
| 2.0.0 | 727 | 10/29/2019 |
| 1.5.0 | 711 | 10/25/2019 |
| 1.4.0 | 689 | 10/23/2019 |
| 1.3.0 | 717 | 10/16/2019 |
| 1.2.0 | 722 | 10/16/2019 |
| 1.1.4 | 699 | 10/9/2019 |
| 1.1.0 | 728 | 10/9/2019 |
| 1.0.0 | 725 | 9/18/2019 |
| 0.2.58 | 712 | 9/17/2019 |
| 0.2.57 | 759 | 9/16/2019 |
| 0.2.56 | 750 | 9/16/2019 |
| 0.2.55 | 978 | 9/16/2019 |
| 0.2.54 | 737 | 9/16/2019 |
| 0.2.53 | 755 | 9/16/2019 |
| 0.2.52 | 752 | 9/16/2019 |
| 0.2.51 | 715 | 9/13/2019 |
| 0.2.50 | 764 | 9/12/2019 |
| 0.2.49 | 745 | 9/12/2019 |
| 0.2.48 | 766 | 9/10/2019 |
| 0.2.47 | 739 | 9/10/2019 |
| 0.2.46 | 789 | 9/9/2019 |
| 0.2.43 | 758 | 9/7/2019 |
| 0.2.42 | 764 | 9/7/2019 |
| 0.2.37 | 756 | 9/7/2019 |
| 0.2.36 | 738 | 9/7/2019 |
| 0.2.35 | 742 | 9/7/2019 |
| 0.2.34 | 767 | 9/6/2019 |
| 0.2.33 | 724 | 9/5/2019 |
| 0.2.32 | 702 | 9/5/2019 |
| 0.2.31 | 721 | 9/5/2019 |
| 0.2.30 | 741 | 9/4/2019 |
| 0.2.25 | 748 | 9/4/2019 |
| 0.2.24 | 751 | 9/4/2019 |
| 0.2.23 | 709 | 9/3/2019 |
| 0.2.14 | 712 | 9/3/2019 |
| 0.2.13 | 723 | 9/3/2019 |
| 0.2.9 | 730 | 9/3/2019 |
| 0.2.8 | 710 | 9/3/2019 |
| 0.2.7 | 701 | 9/3/2019 |
| 0.2.6 | 732 | 9/3/2019 |
| 0.1.9 | 740 | 8/30/2019 |
| 0.1.8 | 766 | 8/15/2019 |
| 0.1.4 | 751 | 8/15/2019 |
| 0.1.3 | 709 | 8/15/2019 |
| 0.1.2 | 725 | 8/15/2019 |
| 0.1.1 | 698 | 8/15/2019 |
| 0.1.0 | 745 | 7/30/2019 |
| 0.0.32 | 745 | 7/26/2019 |
| 0.0.31 | 752 | 7/26/2019 |
| 0.0.24 | 741 | 7/25/2019 |
| 0.0.23 | 765 | 7/25/2019 |
| 0.0.22 | 716 | 7/25/2019 |
| 0.0.21 | 744 | 7/25/2019 |
| 0.0.20 | 728 | 7/25/2019 |
| 0.0.19 | 718 | 7/25/2019 |
| 0.0.18 | 761 | 7/25/2019 |
| 0.0.17 | 739 | 7/25/2019 |
| 0.0.16 | 774 | 7/23/2019 |
| 0.0.15 | 752 | 7/22/2019 |
| 0.0.14 | 808 | 7/22/2019 |
| 0.0.13 | 796 | 7/22/2019 |
| 0.0.12 | 738 | 7/22/2019 |
| 0.0.11 | 805 | 7/11/2019 |
| 0.0.10 | 796 | 7/10/2019 |
| 0.0.9 | 795 | 7/10/2019 |
| 0.0.8 | 780 | 7/9/2019 |
| 0.0.7 | 745 | 7/9/2019 |
| 0.0.6 | 754 | 7/9/2019 |
| 0.0.5 | 763 | 7/8/2019 |
| 0.0.4 | 763 | 7/8/2019 |
| 0.0.3 | 760 | 7/7/2019 |
| 0.0.2 | 744 | 7/4/2019 |
| 0.0.1 | 763 | 6/25/2019 |
Added missing storefront purchase option