RechargeSharp 11.0.0-alpha.7

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 11.0.0-alpha.7
NuGet\Install-Package RechargeSharp -Version 11.0.0-alpha.7
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="11.0.0-alpha.7" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RechargeSharp --version 11.0.0-alpha.7
#r "nuget: RechargeSharp, 11.0.0-alpha.7"
#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.
// Install RechargeSharp as a Cake Addin
#addin nuget:?package=RechargeSharp&version=11.0.0-alpha.7&prerelease

// Install RechargeSharp as a Cake Tool
#tool nuget:?package=RechargeSharp&version=11.0.0-alpha.7&prerelease

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 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.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.3 1,217 10/30/2023
12.2.2 1,307 11/8/2022
12.2.1 635 9/13/2022
12.2.0 810 9/13/2022
12.1.1 460 9/5/2022
12.1.1-alpha.2 287 7/27/2022
12.1.1-alpha.1 119 7/27/2022
12.1.0-alpha.3 112 7/27/2022
12.0.0-alpha.3 649 6/2/2022
12.0.0-alpha.2 111 6/2/2022
12.0.0-alpha.1 111 6/2/2022
11.2.0-alpha.2 109 5/24/2022
11.2.0-alpha.1 123 4/26/2022
11.1.0-beta.5 2,723 3/23/2022
11.1.0-beta.4 117 3/2/2022
11.1.0-beta.3 941 2/24/2022
11.1.0-beta.1 112 2/17/2022
11.0.1 714 2/9/2022
11.0.1-alpha.1 120 2/9/2022
11.0.0 451 2/7/2022
11.0.0-alpha.7 384 2/1/2022
11.0.0-alpha.6 134 1/10/2022
11.0.0-alpha.4 1,857 12/14/2021
11.0.0-alpha.3 145 12/12/2021
11.0.0-alpha.2 148 12/10/2021
10.0.0 514 12/8/2021
10.0.0-alpha.3 619 11/30/2021
10.0.0-alpha.2 400 11/23/2021
9.0.0 1,190 11/9/2021
9.0.0-alpha.2 512 10/8/2021
9.0.0-alpha.1 266 10/7/2021
8.1.0-alpha.3 370 10/1/2021
8.1.0-alpha.2 212 9/28/2021
8.1.0-alpha.1 147 9/27/2021
8.0.1 408 9/23/2021
7.0.0 488 9/8/2021
7.0.0-alpha.4 465 8/4/2021
7.0.0-alpha.3 184 8/3/2021
7.0.0-alpha.2 147 8/2/2021
7.0.0-alpha.1 169 8/2/2021
6.0.1 502 7/13/2021
6.0.0 429 7/12/2021
5.1.0 432 7/5/2021
5.0.0 747 6/9/2021
5.0.0-alpha.1 159 6/9/2021
4.6.0 692 5/20/2021
4.6.0-beta.2 188 5/13/2021
4.6.0-beta.1 172 5/13/2021
4.5.0 396 5/11/2021
4.5.0-beta.8 155 5/11/2021
4.5.0-beta.7 178 4/27/2021
4.5.0-beta.5 139 4/27/2021
4.5.0-beta.4 154 4/27/2021
4.5.0-beta.3 188 4/23/2021
4.5.0-beta.2 165 4/22/2021
4.5.0-beta.1 165 4/21/2021
4.4.6 550 4/12/2021
4.4.6-beta.1 161 4/12/2021
4.4.4 398 4/9/2021
4.4.4-beta.1 159 4/8/2021
4.4.3 429 4/5/2021
4.4.2 495 3/26/2021
4.4.1 586 3/14/2021
4.4.0 774 2/9/2021
4.3.2 380 1/27/2021
4.3.1 344 1/27/2021
4.3.0 430 1/20/2021
4.2.0 383 1/13/2021
4.1.4 393 12/29/2020
4.1.3 380 12/29/2020
4.1.2 453 12/21/2020
4.1.1 1,014 5/29/2020
4.1.0 515 5/29/2020
4.1.0-beta.1 264 5/27/2020
4.0.3-beta.2 315 5/11/2020
4.0.3-beta.1 270 5/11/2020
4.0.2 574 4/9/2020
4.0.1 581 3/25/2020
4.0.0 475 3/25/2020
4.0.0-beta.2 253 3/24/2020
4.0.0-beta.1 258 3/24/2020
3.2.8 507 3/23/2020
3.2.7 512 3/19/2020
3.2.6 519 3/9/2020
3.2.5 521 3/5/2020
3.2.4 510 3/4/2020
3.2.3 546 3/4/2020
3.2.2 492 3/4/2020
3.2.1 501 3/4/2020
3.2.0 553 3/4/2020
3.1.0 512 3/4/2020
3.0.10 521 2/27/2020
3.0.9 462 2/24/2020
3.0.7 481 2/24/2020
3.0.6 576 2/3/2020
3.0.5 515 2/3/2020
3.0.3 588 1/31/2020
3.0.1 524 1/13/2020
3.0.0 621 12/28/2019
2.2.9 578 12/13/2019
2.2.8 516 12/13/2019
2.2.7 628 11/21/2019
2.2.6 537 11/12/2019
2.2.5 508 11/8/2019
2.2.4 505 11/6/2019
2.2.3 515 11/6/2019
2.2.2 513 11/6/2019
2.2.1 515 11/6/2019
2.2.0 512 11/6/2019
2.1.1 491 11/1/2019
2.1.0 497 10/31/2019
2.0.1 536 10/29/2019
2.0.0 525 10/29/2019
1.5.0 515 10/25/2019
1.4.0 496 10/23/2019
1.3.0 516 10/16/2019
1.2.0 516 10/16/2019
1.1.4 501 10/9/2019
1.1.0 538 10/9/2019
1.0.0 526 9/18/2019
0.2.58 508 9/17/2019
0.2.57 554 9/16/2019
0.2.56 550 9/16/2019
0.2.55 731 9/16/2019
0.2.54 551 9/16/2019
0.2.53 551 9/16/2019
0.2.52 545 9/16/2019
0.2.51 543 9/13/2019
0.2.50 566 9/12/2019
0.2.49 542 9/12/2019
0.2.48 564 9/10/2019
0.2.47 543 9/10/2019
0.2.46 583 9/9/2019
0.2.43 552 9/7/2019
0.2.42 561 9/7/2019
0.2.37 547 9/7/2019
0.2.36 548 9/7/2019
0.2.35 549 9/7/2019
0.2.34 557 9/6/2019
0.2.33 539 9/5/2019
0.2.32 514 9/5/2019
0.2.31 530 9/5/2019
0.2.30 531 9/4/2019
0.2.25 542 9/4/2019
0.2.24 548 9/4/2019
0.2.23 509 9/3/2019
0.2.14 514 9/3/2019
0.2.13 536 9/3/2019
0.2.9 533 9/3/2019
0.2.8 511 9/3/2019
0.2.7 516 9/3/2019
0.2.6 524 9/3/2019
0.1.9 553 8/30/2019
0.1.8 564 8/15/2019
0.1.4 543 8/15/2019
0.1.3 509 8/15/2019
0.1.2 526 8/15/2019
0.1.1 509 8/15/2019
0.1.0 557 7/30/2019
0.0.32 562 7/26/2019
0.0.31 550 7/26/2019
0.0.24 556 7/25/2019
0.0.23 565 7/25/2019
0.0.22 533 7/25/2019
0.0.21 539 7/25/2019
0.0.20 526 7/25/2019
0.0.19 531 7/25/2019
0.0.18 557 7/25/2019
0.0.17 541 7/25/2019
0.0.16 570 7/23/2019
0.0.15 548 7/22/2019
0.0.14 595 7/22/2019
0.0.13 592 7/22/2019
0.0.12 557 7/22/2019
0.0.11 604 7/11/2019
0.0.10 592 7/10/2019
0.0.9 598 7/10/2019
0.0.8 561 7/9/2019
0.0.7 543 7/9/2019
0.0.6 546 7/9/2019
0.0.5 566 7/8/2019
0.0.4 568 7/8/2019
0.0.3 564 7/7/2019
0.0.2 545 7/4/2019
0.0.1 559 6/25/2019

Fixed typos