Aeroverra.PayPalSharp
0.0.2
See the version list below for details.
dotnet add package Aeroverra.PayPalSharp --version 0.0.2
NuGet\Install-Package Aeroverra.PayPalSharp -Version 0.0.2
<PackageReference Include="Aeroverra.PayPalSharp" Version="0.0.2" />
<PackageVersion Include="Aeroverra.PayPalSharp" Version="0.0.2" />
<PackageReference Include="Aeroverra.PayPalSharp" />
paket add Aeroverra.PayPalSharp --version 0.0.2
#r "nuget: Aeroverra.PayPalSharp, 0.0.2"
#:package Aeroverra.PayPalSharp@0.0.2
#addin nuget:?package=Aeroverra.PayPalSharp&version=0.0.2
#tool nuget:?package=Aeroverra.PayPalSharp&version=0.0.2
AeroPayPalSharp
A strict-typed PayPal REST client for modern .NET, with first-class partner / platform (multiparty) support.
Why
The existing .NET options for PayPal are dated and loosely typed, and none cleanly support the partner APIs (acting on behalf of sellers). 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, and makes partner flows (auth assertion, attribution) first-class.
- 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 - .NET 10, Newtonsoft.Json
Install
dotnet add package AeroPayPalSharp
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
Everything else lives in the wiki:
- Configuration
- Authentication
- Partner and platform (acting for sellers)
- Multi-tenant: clients from raw credentials
- The clients
- Constants and enums
- Error handling
- Models and nullability
- Regenerating the clients
- Testing
License
MIT. See LICENSE.md.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.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)
- Newtonsoft.Json (>= 13.0.3)
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 | 108 | 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 |