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.
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" />
                    
Directory.Packages.props
<PackageReference Include="RechargeSharp" />
                    
Project file
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
                    
#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
                    
Install as a Cake Addin
#tool nuget:?package=RechargeSharp&version=9.0.0-alpha.1&prerelease
                    
Install as a Cake Tool

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 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.

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 160 7/6/2025
12.2.5 181 7/5/2025
12.2.4 962 10/8/2024
12.2.3 3,108 10/30/2023
12.2.2 2,945 11/8/2022
12.2.1 771 9/13/2022
12.2.0 1,011 9/13/2022
12.1.1 595 9/5/2022
12.1.1-alpha.2 374 7/27/2022
12.1.1-alpha.1 205 7/27/2022
12.1.0-alpha.3 205 7/27/2022
12.0.0-alpha.3 746 6/2/2022
12.0.0-alpha.2 210 6/2/2022
12.0.0-alpha.1 204 6/2/2022
11.2.0-alpha.2 208 5/24/2022
11.2.0-alpha.1 231 4/26/2022
11.1.0-beta.5 2,827 3/23/2022
11.1.0-beta.4 222 3/2/2022
11.1.0-beta.3 1,043 2/24/2022
11.1.0-beta.1 215 2/17/2022
11.0.1 856 2/9/2022
11.0.1-alpha.1 224 2/9/2022
11.0.0 601 2/7/2022
11.0.0-alpha.7 491 2/1/2022
11.0.0-alpha.6 235 1/10/2022
11.0.0-alpha.4 1,958 12/14/2021
11.0.0-alpha.3 254 12/12/2021
11.0.0-alpha.2 247 12/10/2021
10.0.0 666 12/8/2021
10.0.0-alpha.3 717 11/30/2021
10.0.0-alpha.2 509 11/23/2021
9.0.0 1,333 11/9/2021
9.0.0-alpha.2 613 10/8/2021
9.0.0-alpha.1 369 10/7/2021
8.1.0-alpha.3 468 10/1/2021
8.1.0-alpha.2 311 9/28/2021
8.1.0-alpha.1 245 9/27/2021
8.0.1 555 9/23/2021
7.0.0 639 9/8/2021
7.0.0-alpha.4 567 8/4/2021
7.0.0-alpha.3 290 8/3/2021
7.0.0-alpha.2 252 8/2/2021
7.0.0-alpha.1 277 8/2/2021
6.0.1 646 7/13/2021
6.0.0 577 7/12/2021
5.1.0 582 7/5/2021
5.0.0 894 6/9/2021
5.0.0-alpha.1 266 6/9/2021
4.6.0 833 5/20/2021
4.6.0-beta.2 288 5/13/2021
4.6.0-beta.1 275 5/13/2021
4.5.0 541 5/11/2021
4.5.0-beta.8 259 5/11/2021
4.5.0-beta.7 291 4/27/2021
4.5.0-beta.5 248 4/27/2021
4.5.0-beta.4 268 4/27/2021
4.5.0-beta.3 296 4/23/2021
4.5.0-beta.2 278 4/22/2021
4.5.0-beta.1 270 4/21/2021
4.4.6 704 4/12/2021
4.4.6-beta.1 268 4/12/2021
4.4.4 551 4/9/2021
4.4.4-beta.1 267 4/8/2021
4.4.3 619 4/5/2021
4.4.2 653 3/26/2021
4.4.1 746 3/14/2021
4.4.0 940 2/9/2021
4.3.2 537 1/27/2021
4.3.1 500 1/27/2021
4.3.0 585 1/20/2021
4.2.0 530 1/13/2021
4.1.4 555 12/29/2020
4.1.3 538 12/29/2020
4.1.2 620 12/21/2020
4.1.1 1,177 5/29/2020
4.1.0 662 5/29/2020
4.1.0-beta.1 390 5/27/2020
4.0.3-beta.2 439 5/11/2020
4.0.3-beta.1 392 5/11/2020
4.0.2 736 4/9/2020
4.0.1 747 3/25/2020
4.0.0 641 3/25/2020
4.0.0-beta.2 372 3/24/2020
4.0.0-beta.1 377 3/24/2020
3.2.8 673 3/23/2020
3.2.7 677 3/19/2020
3.2.6 688 3/9/2020
3.2.5 691 3/5/2020
3.2.4 677 3/4/2020
3.2.3 710 3/4/2020
3.2.2 658 3/4/2020
3.2.1 665 3/4/2020
3.2.0 724 3/4/2020
3.1.0 679 3/4/2020
3.0.10 685 2/27/2020
3.0.9 628 2/24/2020
3.0.7 645 2/24/2020
3.0.6 739 2/3/2020
3.0.5 679 2/3/2020
3.0.3 747 1/31/2020
3.0.1 691 1/13/2020
3.0.0 786 12/28/2019
2.2.9 745 12/13/2019
2.2.8 683 12/13/2019
2.2.7 796 11/21/2019
2.2.6 701 11/12/2019
2.2.5 682 11/8/2019
2.2.4 669 11/6/2019
2.2.3 668 11/6/2019
2.2.2 679 11/6/2019
2.2.1 683 11/6/2019
2.2.0 681 11/6/2019
2.1.1 660 11/1/2019
2.1.0 667 10/31/2019
2.0.1 711 10/29/2019
2.0.0 696 10/29/2019
1.5.0 680 10/25/2019
1.4.0 659 10/23/2019
1.3.0 688 10/16/2019
1.2.0 689 10/16/2019
1.1.4 668 10/9/2019
1.1.0 697 10/9/2019
1.0.0 691 9/18/2019
0.2.58 682 9/17/2019
0.2.57 723 9/16/2019
0.2.56 720 9/16/2019
0.2.55 946 9/16/2019
0.2.54 702 9/16/2019
0.2.53 720 9/16/2019
0.2.52 715 9/16/2019
0.2.51 683 9/13/2019
0.2.50 734 9/12/2019
0.2.49 713 9/12/2019
0.2.48 733 9/10/2019
0.2.47 706 9/10/2019
0.2.46 757 9/9/2019
0.2.43 727 9/7/2019
0.2.42 729 9/7/2019
0.2.37 723 9/7/2019
0.2.36 701 9/7/2019
0.2.35 708 9/7/2019
0.2.34 736 9/6/2019
0.2.33 691 9/5/2019
0.2.32 670 9/5/2019
0.2.31 684 9/5/2019
0.2.30 703 9/4/2019
0.2.25 716 9/4/2019
0.2.24 719 9/4/2019
0.2.23 679 9/3/2019
0.2.14 680 9/3/2019
0.2.13 691 9/3/2019
0.2.9 701 9/3/2019
0.2.8 679 9/3/2019
0.2.7 670 9/3/2019
0.2.6 701 9/3/2019
0.1.9 705 8/30/2019
0.1.8 730 8/15/2019
0.1.4 718 8/15/2019
0.1.3 677 8/15/2019
0.1.2 693 8/15/2019
0.1.1 669 8/15/2019
0.1.0 713 7/30/2019
0.0.32 714 7/26/2019
0.0.31 717 7/26/2019
0.0.24 710 7/25/2019
0.0.23 733 7/25/2019
0.0.22 686 7/25/2019
0.0.21 711 7/25/2019
0.0.20 697 7/25/2019
0.0.19 688 7/25/2019
0.0.18 726 7/25/2019
0.0.17 707 7/25/2019
0.0.16 743 7/23/2019
0.0.15 717 7/22/2019
0.0.14 775 7/22/2019
0.0.13 763 7/22/2019
0.0.12 708 7/22/2019
0.0.11 774 7/11/2019
0.0.10 766 7/10/2019
0.0.9 766 7/10/2019
0.0.8 746 7/9/2019
0.0.7 712 7/9/2019
0.0.6 720 7/9/2019
0.0.5 733 7/8/2019
0.0.4 735 7/8/2019
0.0.3 729 7/7/2019
0.0.2 709 7/4/2019
0.0.1 731 6/25/2019

Replaced all DateTimes with DateTimeOffsets