PayPal.Easy
1.25.5.2
dotnet add package PayPal.Easy --version 1.25.5.2
NuGet\Install-Package PayPal.Easy -Version 1.25.5.2
<PackageReference Include="PayPal.Easy" Version="1.25.5.2" />
<PackageVersion Include="PayPal.Easy" Version="1.25.5.2" />
<PackageReference Include="PayPal.Easy" />
paket add PayPal.Easy --version 1.25.5.2
#r "nuget: PayPal.Easy, 1.25.5.2"
#addin nuget:?package=PayPal.Easy&version=1.25.5.2
#tool nuget:?package=PayPal.Easy&version=1.25.5.2
π Simple and easy library to accept credit card payments via PayPal in your application
π₯ Accept Payments in Minutes, Not Days!
PayPal.Easy is a game-changer for developers in search of a hassle-free solution to integrate credit card payments into their .NET web applications. The library is designed with simplicity in mind, eliminating the need to grapple with complex APIs or boilerplate code. Developers can now focus on their appβs core logic, knowing that PayPal.Easy takes care of the heavy lifting in payment processing.
With just one method call, PayPal.Easy allows you to generate customized PayPal or card payment links. These links can be tailored to include specific amounts, items, shipping details, and more, giving developers complete control and flexibility. Furthermore, the library supports the entire PayPal ecosystem, ensuring compatibility with credit and debit cards, PayPal balance, Venmo, and other payment methods.
The library also introduces auto-triggered events that notify developers of successful or canceled payments, enabling seamless order fulfillment and status updates. Whether you're handling digital products, automating subscription billing, or capturing buyer addresses for shipping, PayPal.Easy simplifies the process to the core. Within just ten lines of code, developers can implement e-commerce payments, reducing the time and effort involved in integration.
This library is not just a toolβitβs a gateway to offering a smooth and secure payment experience to end users. PayPal.Easy empowers developers to deliver frictionless checkout processes while maximizing efficiency and reliability in their applications. For anyone who has struggled with integrating payment APIs in the past, PayPal.Easy is the ultimate solution to say goodbye to those challenges.
π Why Developers Love PayPal.Easy
β
Single-Method Simplicity
Generate PayPal/card payment links with 1 method call β customize amounts, items, shipping, and more via parameters.
β
Zero Boilerplate Code
Focus on your appβs logic, not payment APIs. Minimal setup, maximal results.
β
Auto-Triggered Events
Instant notifications for PaymentSuccess
or PaymentCanceled
events. Perfect for order fulfillment!
β
Seamless Shipping
Automatically capture buyer addresses for physical goods.
β
Full PayPal Ecosystem
Support credit/debit cards, PayPal Balance, Venmo, and more.
π Easy Implementation
".NET PayPal Library with 1-Click Integration"
"Credit Card Processing for C# Developers"
"Automate E-commerce Payments in 10 Lines of Code"
"Shipping Address Capture for .NET Apps"
π Use Cases
Digital Products: Instant access after payment
E-commerce: Auto-capture shipping addresses
Subscriptions: Recurring billing made simple
Donations: Support causes with 3-line integration
π Introduction
PayPal.Easy is a .NET library designed to simplify PayPal integration. With just a few steps, you can accept payments, handle payment notifications, and automate processes like order management and shipping address capture.
π Tutorial
This is a minimalist, distraction-free example of a website with an online purchase of a service, and an event notification of the purchase completion. We recommend that you start by looking at this example: Tutorial on GitHub
π§ PayPalIpnMiddleware
The PayPalIpnMiddleware
allows you to handle PayPal Instant Payment Notifications (IPN). This middleware verifies incoming notifications and triggers an event when a payment is successfully completed.
How to Configure IPN Notifications
- Log in to your PayPal account.
- Navigate to Account Settings > Instant Payment Notifications (IPN).
- Set the notification URL to point to your endpoint (e.g.,
https://yourdomain.com
). - Save the changes.
For more details, refer to the official PayPal documentation.
Middleware Usage Example
Here is an example of how to use the PayPalIpnMiddleware
in your application:
var app = builder.Build();
// user for PayPal IPN validation:
// in your program.cs file you can use this code to set an event (example: OnPaymentCompleted) that will be executed at every payment.
app.UseMiddleware<PayPal.PayPalIpnMiddleware>(Events.OnPaymentCompleted);
Event Handling
You can handle the payment success event by subscribing to the OnPaymentCompleted
event. This allows you to perform actions like updating order status, sending confirmation emails, etc.
Example Event Handler
Here is an example of how to handle the payment success event:
public class Events
{
static internal void OnPaymentCompleted(Dictionary<string, string> instantPaymentNotificationData)
{
// If the payment is completed, extract transaction details
var transactionId = instantPaymentNotificationData["txn_id"]; // Transaction ID from PayPal
var id = instantPaymentNotificationData["custom"]; // Custom field set in the payment link
var amount = instantPaymentNotificationData["mc_gross"]; // Gross amount of the transaction
Debug.WriteLine($"Payment completed. Transaction ID: {transactionId}, Custom ID: {id}, Amount: {amount}");
}
}
π³ Generate Payment Links with GeneratePayPalLink
The GeneratePayPalLink
method allows you to create a PayPal payment link for single purchases or subscriptions.
Key Parameters
- businessEmail: The email address of the PayPal account receiving the payment.
- productName: The name or description of the product.
- amount: The payment amount.
- currency: The currency code (e.g., "EUR").
- purchaseId: A unique ID for tracking the transaction.
- returnUrl: The URL to redirect the user after a successful payment.
- cancelUrl: The URL to redirect the user if the payment is canceled.
Example Usage
Here is an example of how to generate a payment link:
var paypalLink = PayPal.Util.GeneratePayPalLink(Settings.PayPalBusinessEmail, description, CostInEuro, "EUR", id, true, returnUrl, cancelUrl);
Redirect = new Uri(paypalLink);
π SEO-Optimized Benefits
- ".NET PayPal Library with 1-Click Integration"
- "Credit Card Processing for C# Developers"
- "Automate E-commerce Payments in 10 Lines of Code"
- "Shipping Address Capture for .NET Apps"
π Use Cases
- Digital Products: Instant access after payment.
- E-commerce: Auto-capture shipping addresses.
- Subscriptions: Recurring billing made simple.
- Donations: Support causes with 3-line integration.
π SEO Keywords
.NET payment integration, PayPal SDK C#, credit card processing library, generate payment links, minimal code payments, automate e-commerce, capture shipping address, developer-friendly PayPal, event-driven payments.
π‘ Why Wait? "Spent 3 days on payment APIs? PayPal library does it in 3 minutes. Your users deserve frictionless checkout β give it to them."
π SEO Keywords .NET payment integration, PayPal SDK C#, credit card processing library, generate payment links, minimal code payments, automate e-commerce, capture shipping address, developer-friendly PayPal, event-driven payments
Product | Versions 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. |
-
.NETStandard 2.1
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.