payload-api 0.1.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package payload-api --version 0.1.3
NuGet\Install-Package payload-api -Version 0.1.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="payload-api" Version="0.1.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add payload-api --version 0.1.3
#r "nuget: payload-api, 0.1.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install payload-api as a Cake Addin
#addin nuget:?package=payload-api&version=0.1.3

// Install payload-api as a Cake Tool
#tool nuget:?package=payload-api&version=0.1.3

Payload C# Library

A C# library for integrating Payload.

Installation

1) Download

Download the latest version from GitHub.

2) Include in Project

Include the Payload folder in your Visual Studio project.

NuGet

Coming Soon

Get Started

Once you've included the Payload C# library in your project, include the Payload namespace to get started.

All Payload objects and methods are accessible using the pl static class.

API Authentication

To authenticate with the Payload API, you'll need a live or test API key. API keys are accessible from within the Payload dashboard.

using Payload;
pl.api_key = "secret_key_3bW9JMZtPVDOfFNzwRdfE";

Creating an Object

Interfacing with the Payload API is done primarily through Payload Objects. Below is an example of creating a customer using the pl.Customer object.

// Create a Customer
var customer = pl.Customer.create(new {
    email="matt.perez@example.com",
    full_name="Matt Perez"
});
// Create a Payment
var payment = pl.Payment.create(new {
    amount=100.0,
    payment_method=new pl.Card(new{
        card_number="4242 4242 4242 4242"
    })
});

Accessing Object Attributes

Object attributes are accessible through both dot and bracket notation.

Console.WriteLine(customer.name);
Console.WriteLine(customer["email"]);

Updating an Object

Updating an object is a simple call to the update object method.

// Updating a customer's email
customer.update(new { email="matt.perez@newwork.com" });

Selecting Objects

Objects can be selected using any of their attributes.

// Select a customer by email
var customers = pl.Customer.filter_by(new {
    email="matt.perez@example.com"
});

Use the pl.attr attribute helper interface to write powerful queries with a little extra syntax sugar.

var payments = pl.Payments.filter_by(
    pl.attr.amount.gt(100),
    pl.attr.amount.lt(200),
    pl.attr.description.contains("Test"),
    pl.attr.created_at.gt(new DateTime(2019,2,1))
).all();

Documentation

To get further information on Payload's C# library and API capabilities, visit the unabridged Payload Documentation.

Product Compatible and additional computed target framework versions.
.NET Framework net35 is compatible.  net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
2.0.1 87 4/11/2024
2.0.0 108 1/19/2024
1.0.4 318 10/12/2023
1.0.3 126 8/22/2023
1.0.2 125 8/12/2023
1.0.1 139 7/25/2023
1.0.0 137 7/5/2023
0.3.0 219 4/27/2023
0.2.5 690 6/3/2021
0.2.4 355 3/18/2021
0.2.3 307 3/17/2021
0.2.2 485 12/3/2020
0.2.1 414 9/7/2020
0.2.0 410 8/26/2020
0.1.12 651 2/27/2020
0.1.10 521 1/13/2020
0.1.9 844 12/17/2019
0.1.8 500 12/4/2019
0.1.7 462 12/4/2019
0.1.6 536 6/19/2019
0.1.5 508 6/19/2019
0.1.4 508 6/16/2019
0.1.3 503 6/16/2019

Added nuget files