Aeroverra.PayPalSharp
1.0.17
dotnet add package Aeroverra.PayPalSharp --version 1.0.17
NuGet\Install-Package Aeroverra.PayPalSharp -Version 1.0.17
<PackageReference Include="Aeroverra.PayPalSharp" Version="1.0.17" />
<PackageVersion Include="Aeroverra.PayPalSharp" Version="1.0.17" />
<PackageReference Include="Aeroverra.PayPalSharp" />
paket add Aeroverra.PayPalSharp --version 1.0.17
#r "nuget: Aeroverra.PayPalSharp, 1.0.17"
#:package Aeroverra.PayPalSharp@1.0.17
#addin nuget:?package=Aeroverra.PayPalSharp&version=1.0.17
#tool nuget:?package=Aeroverra.PayPalSharp&version=1.0.17
AeroPayPalSharp
A strict-typed PayPal REST client for modern .NET, with first-class partner / platform (multiparty) support.
Purpose
The existing .NET options for PayPal are dated and loosely typed, none cleanly support the partner APIs (acting on behalf of sellers), and none have good webhook handling. AeroPayPalSharp is generated from PayPal's official OpenAPI specs and then tightened so responses are actually typed instead of everything-nullable. It wraps all of PayPal's REST APIs behind one injectable client, handles OAuth for you, makes partner flows (auth assertion, attribution) first-class, and includes offline webhook signature verification that PayPal does not publish a spec for.
- All of PayPal's REST APIs, one injectable
IPayPalApiClient - Strongly-typed models, plus typed value constants (
PayPalIntent.Capture,PayPalCurrency.Usd, ...) with anIsKnownvalidator instead of magic strings - PayPal's enum fields stay strings under the hood, so a value PayPal adds later never crashes deserialization
- OAuth2 fetched, cached, and refreshed automatically
- Partner attribution and auth assertion built in, including a clean
ActingAsMerchantscope - Offline webhook signature verification (no extra API call) plus typed event-name constants
- .NET 10, Newtonsoft.Json
Install
dotnet add package Aeroverra.PayPalSharp
Getting started
Configure and inject (keep the client id / secret in user-secrets or env vars):
services.AddPayPalSharp(options =>
{
options.Environment = PayPalEnvironment.Sandbox; // or Live
options.ClientId = config["PayPal:ClientId"];
options.ClientSecret = config["PayPal:ClientSecret"];
// options.PartnerAttributionId = config["PayPal:PartnerAttributionId"]; // optional: partner/platform BN code
});
Create an order and read it back:
public sealed class Checkout(IPayPalApiClient paypal)
{
public async Task<string> CreateOrder()
{
var order = new Order_request
{
Intent = PayPalIntent.Capture,
Purchase_units = new List<Purchase_units>
{
new Purchase_units { Amount = new Amount3 { Currency_code = PayPalCurrency.Usd, Value = "10.00" } },
},
};
Order created = await paypal.Orders.CreateAsync(order, payPal_Request_Id: Guid.NewGuid().ToString("N"));
Order fetched = await paypal.Orders.GetAsync(created.Id);
return fetched.Status; // compare with PayPalOrderStatus.Created, etc.
}
}
Values like PayPalIntent.Capture and PayPalCurrency.Usd are typed constants (with an IsKnown
validator) so you never hand-type a magic string. See Constants and enums.
As a partner, acting for a seller
Direct the funds to the seller with payee.merchant_id, and run the call on their behalf with an
ActingAsMerchant scope (it adds the PayPal-Auth-Assertion header for that merchant):
using (paypal.ActingAsMerchant(sellerMerchantId))
{
var order = new Order_request
{
Intent = "CAPTURE",
Purchase_units = new List<Purchase_units>
{
new Purchase_units
{
Amount = new Amount3 { Currency_code = PayPalCurrency.Usd, Value = "10.00" },
Payee = new Payee3 { Merchant_id = sellerMerchantId }, // who gets the money
},
},
};
Order created = await paypal.Orders.CreateAsync(order, payPal_Request_Id: Guid.NewGuid().ToString("N"));
}
Documentation
Full documentation, including per-API usage, partner flows, configuration, and more, lives in the wiki.
License
MIT. See LICENSE.md.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. |
-
net8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Http (>= 10.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Options (>= 10.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 |
|---|---|---|
| 1.0.17 | 106 | 7/7/2026 |
| 0.0.16 | 92 | 7/7/2026 |
| 0.0.15 | 95 | 7/7/2026 |
| 0.0.14 | 94 | 7/7/2026 |
| 0.0.13 | 99 | 7/7/2026 |
| 0.0.12 | 102 | 7/7/2026 |
| 0.0.11 | 102 | 7/7/2026 |
| 0.0.10 | 94 | 7/7/2026 |
| 0.0.9 | 94 | 7/7/2026 |
| 0.0.8 | 93 | 7/6/2026 |
| 0.0.7 | 100 | 7/6/2026 |
| 0.0.6 | 87 | 7/6/2026 |
| 0.0.5 | 96 | 7/6/2026 |
| 0.0.4 | 90 | 7/5/2026 |
| 0.0.3 | 93 | 7/5/2026 |
| 0.0.2 | 93 | 7/5/2026 |
| 0.0.1 | 91 | 7/5/2026 |
| 0.0.0 | 95 | 7/5/2026 |