![]() |
VOOZH | about |
dotnet add package FonsecaFramework.PayPal --version 2026.6.18.1
NuGet\Install-Package FonsecaFramework.PayPal -Version 2026.6.18.1
<PackageReference Include="FonsecaFramework.PayPal" Version="2026.6.18.1" />
<PackageVersion Include="FonsecaFramework.PayPal" Version="2026.6.18.1" />Directory.Packages.props
<PackageReference Include="FonsecaFramework.PayPal" />Project file
paket add FonsecaFramework.PayPal --version 2026.6.18.1
#r "nuget: FonsecaFramework.PayPal, 2026.6.18.1"
#:package FonsecaFramework.PayPal@2026.6.18.1
#addin nuget:?package=FonsecaFramework.PayPal&version=2026.6.18.1Install as a Cake Addin
#tool nuget:?package=FonsecaFramework.PayPal&version=2026.6.18.1Install as a Cake Tool
A simplified PayPal REST API client for .NET with invoicing and PDF generation.
FonsecaFramework.PayPal is a .NET 9 library that wraps the PayPal REST API to provide a streamlined experience for common payment operations. It supports purchasing products, creating and managing invoices, handling subscriptions, and generating professional invoice PDFs using iText.
dotnet add package FonsecaFramework.PayPal
| Area | Key Classes |
|---|---|
| PayPal Client | PayPalClient — authenticate, purchase products, capture payments, create/send invoices, manage subscriptions |
| Configuration | PayPalSettings — holds PayPalClientId, PayPalClientSecret, and PayPalUrl |
| Products | Product — name, price, currency code, and quantity |
| Receipts | Reciept — tracks order ID, checkout URL, status, subtotal, tax, and total |
| Invoicing | Invoice, BillingParty, BillableParty — full invoice model with line items and party details |
| PDF Generation | InvoicePdfGenerator — generates formatted invoice PDFs with line-item tables and watermarks |
using FonsecaFramework.PayPal;
var settings = new PayPalSettings
{
PayPalClientId = "<your-client-id>",
PayPalClientSecret = "<your-client-secret>",
PayPalUrl = "https://api-m.sandbox.paypal.com"
};
var client = new PayPalClient(new HttpClient(), settings, logger);
var products = new List<Product>
{
new Product { Name = "Widget", Price = 25.00m, CurrencyCode = "USD", Quantity = 2 },
new Product { Name = "Gadget", Price = 15.50m, CurrencyCode = "USD", Quantity = 1 }
};
Reciept? receipt = await client.StartPurchaseProducts(
products,
SuccessUrl: "https://mysite.com/success",
FailureUrl: "https://mysite.com/cancel",
InvoiceNumber: "INV-001",
TaxRate: 0.08m);
if (receipt != null)
{
Console.WriteLine($"Order: {receipt.OrderID}");
Console.WriteLine($"Checkout: {receipt.CheckoutUrl}");
Console.WriteLine($"Total: {receipt.Total:C}");
}
using FonsecaFramework.PayPal;
var invoice = new Invoice
{
InvoiceNumber = "INV-2025-001",
InvoiceDate = DateTime.Today,
DueDate = DateTime.Today.AddDays(30),
TaxRate = 0.07m,
BillingParty = new BillingParty
{
FirstName = "Acme Corp",
StreetAddress = "123 Main St",
City = "Springfield",
State = "IL",
PostalCode = "62704",
CountryCode = "US"
},
BillableParties = new List<BillableParty>
{
new BillableParty
{
FirstName = "Jane",
LastName = "Doe",
Email = "jane@example.com",
StreetAddress = "456 Oak Ave",
City = "Chicago",
State = "IL",
PostalCode = "60601",
CountryCode = "US"
}
},
Products = new List<Product>
{
new Product { Name = "Consulting", Price = 150.00m, CurrencyCode = "USD", Quantity = 4 }
}
};
InvoicePdfGenerator.GenerateInvoice("invoice.pdf", invoice);
Console.WriteLine("Invoice PDF generated.");
Copyright 2025 Steven Fonseca / VLR Creations
Licensed under the . You may use this library free of charge, provided you include the required attribution notices. See the file for full terms.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on FonsecaFramework.PayPal:
| Package | Downloads |
|---|---|
|
FonsecaFramework.Stripe
A simple client for the payment processor Stripe.net |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2026.6.18.1 | 0 | 6/18/2026 |
| 2026.6.13.1 | 58 | 6/13/2026 |
| 2026.6.4.2 | 104 | 6/4/2026 |
| 2026.6.4.1 | 122 | 6/4/2026 |
| 2026.6.3.3 | 110 | 6/4/2026 |
| 2026.6.3.2 | 111 | 6/4/2026 |
| 2026.6.3.1 | 112 | 6/3/2026 |
| 2026.5.21.1 | 119 | 5/22/2026 |
| 2026.5.20.1 | 117 | 5/20/2026 |
| 2026.5.12.1 | 117 | 5/13/2026 |
| 2026.5.11.1 | 126 | 5/11/2026 |
| 2026.5.7.2 | 119 | 5/7/2026 |
| 2026.5.7.1 | 117 | 5/7/2026 |
| 2026.5.6.1 | 118 | 5/6/2026 |
| 2026.5.5.1 | 120 | 5/5/2026 |
| 2026.5.2.1 | 112 | 5/2/2026 |
| 2026.4.30.1 | 113 | 4/30/2026 |
| 2026.4.29.1 | 134 | 4/29/2026 |
| 2026.4.27.1 | 121 | 4/28/2026 |
| 2026.4.22.1 | 117 | 4/22/2026 |