Skip to content

Divetek-Inc/paddle-net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Paddle .Net SDK

This is 👉 Unofficial Paddle SDK for .NET

‼️ Paddle Billing API ONLY!

SDK designed to provide a developer experience similar to the Paddle Node.js SDK

Implemented APIs

  • Products
  • Prices
  • Customers
  • Customer Portal Sessions
  • Businesses
  • Addresses
  • Subscriptions
  • Transactions (no preview api yet)
  • Notifications (in progress)

Requirements

  • .NET Version: The SDK is built to support .NET 9.0.
  • Credentials: Paddle API key.

How to use

Asp.Net Core

// Add the Paddle to the services collection
builder.Services.AddPaddleClient(options => {
    options.ApiKey = "YOUR_API_KEY";
    options.Environment = PaddleEnvironment.Sandbox; // or PaddleEnvironment.Production
});


// Inject the client in your endpoint/controller
app.MapGet("/products", async (IPaddle paddle) => {
    var products = await paddle.Products.ListAsync();
    return products;
});

.Net Core CLI

// Initialize the Paddle client
var paddle = new Paddle(
   apiKey: "YOUR_API_KEY",
   environment: PaddleEnvironment.Sandbox // Or PaddleEnvironment.Production
);

// Example: Fetch and display product information
var products = await paddle.Products.ListAsync();

Console.WriteLine("Products:");
foreach (var product in products)
{
   Console.WriteLine($"ID: {product.Id}, Name: {product.Name}");
}

// Clean up the client (dispose resources)
paddle.Dispose();

Installation

To include the Paddle SDK in your project, add a reference to the SDK package or include it directly in your solution.

  1. Clone the repository or download it.
  2. Build the SDK project if not already compiled.
  3. Add a reference to the SDK DLL in your solution.

Nuget package will be available soon

Paddle API Reference

For detailed information about Paddle's API, visit Paddle API Documentation

Contributing

Contributions to the Paddle SDK are welcome! If you encounter any issues or have ideas for improvements, feel free to open an issue or submit a pull request.

Steps to contribute:

  1. Fork this repository.
  2. Create a new branch for your feature/fix.
  3. Commit your changes and push them to your branch.
  4. Open a pull request for review.

License

This SDK is licensed under the MIT License. See the See the LICENSE.md file for more details. file for more details.

Support

If you encounter any issues or require assistance, you can contact the repository maintainers or refer to Paddle API Documentation for additional guidance.