PaydockSdk.Core 1.3.21

dotnet add package PaydockSdk.Core --version 1.3.21
                    
NuGet\Install-Package PaydockSdk.Core -Version 1.3.21
                    
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="PaydockSdk.Core" Version="1.3.21" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PaydockSdk.Core" Version="1.3.21" />
                    
Directory.Packages.props
<PackageReference Include="PaydockSdk.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PaydockSdk.Core --version 1.3.21
                    
#r "nuget: PaydockSdk.Core, 1.3.21"
                    
#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.
#:package PaydockSdk.Core@1.3.21
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PaydockSdk.Core&version=1.3.21
                    
Install as a Cake Addin
#tool nuget:?package=PaydockSdk.Core&version=1.3.21
                    
Install as a Cake Tool

Welcome to Paydock dot net SDK

This SDK provides a wrapper around the PayDock REST API.

For more info on the Paydock API, see our full documentation.

.Net Core SDK Usage

The best way to get this is on nuget

Simple example to create a single charge.

var charge = new ChargeRequest
{
    amount = amount,
    currency = "AUD",
    customer = new Paydock_dotnet_sdk.Models.Customer
    {
        email = customerEmail,
        payment_source = new PaymentSource
        {
            gateway_id = "<your gateway id here>",
            card_name = "Test Name",
            card_number = "4111111111111111",
            card_ccv = "123",
            expire_month = "10",
            expire_year = "2020"
        }
    }
};

try
{
    Config.Initialise(Environment.Sandbox, "<your access token here>");
    var result = await new Charges().Add(charge);

    if (!result.IsSuccess) {
        // handle failed payment
    }
}
catch (ResponseException ex)
{
    // handle possible error
}

Simple example to create a customer

var customer = new CustomerRequest
{
    first_name = "john",
    last_name = "smith",
    email = "email@email.com",
    payment_source = new PaymentSource
    {
        gateway_id = TestConfig.GatewayId,
        card_name = "John Smith",
        card_number = "4111111111111111",
        card_ccv = "123",
        expire_month = "10",
        expire_year = "2020"
    }
};

try
{
    Config.Initialise(Environment.Sandbox, "<your access token here>");
    var result = await Customers().Add(request);

    if (!result.IsSuccess) {
        // handle failure to create customer
    }
}
catch (ResponseException ex)
{
    // handle possible error
}

Use a different config token per request

In most cases, you'll be looking to use just one PayDock Account. However we support using multiple PayDock account, choosing which one you use when create the service classes.

var charge = new ChargeRequest
{
    amount = amount,
    currency = "AUD",
    customer = new Paydock_dotnet_sdk.Models.Customer
    {
        email = customerEmail,
        payment_source = new PaymentSource
        {
            gateway_id = "<your gateway id here>",
            card_name = "Test Name",
            card_number = "4111111111111111",
            card_ccv = "123",
            expire_month = "10",
            expire_year = "2020"
        }
    }
};

try
{
    Config.Initialise(Environment.Sandbox, "<this is the default access token>");
    var result = await new Charges("<this is a different access token>").Add(charge);

    if (!result.IsSuccess) {
        // handle failed payment
    }
}
catch (ResponseException ex)
{
    // handle possible error
}

Parsing a webhook

Webhooks are POSTed to the URL, once you've captured the payload, you can parse this:

// transaction webhook
var tran = (new Webhook()).Parse<TransactionWebhook>(tranJson);

// subscription webhook
var subscription = (new Webhook()).Parse<SubscriptionWebhook>(subscriptionJson);

The different webhook types map to different data objects:

  • Transaction Success → Webhook.Parse<TransactionWebhook>()
  • Transaction by Subscription Success → Webhook.Parse<TransactionWebhook>()
  • Transaction by Subscription Failed → Webhook.Parse<TransactionWebhook>()
  • Subscription Creation Success → Webhook.Parse<SubscriptionWebhook>()
  • Subscription Finished → Webhook.Parse<SubscriptionWebhook>()
  • Subscription Updated → Webhook.Parse<SubscriptionWebhook>()
  • Subscription Failed → Webhook.Parse<SubscriptionWebhook>()
  • Refund Requested → Webhook.Parse<TransactionWebhook>()
  • Refund Success → Webhook.Parse<TransactionWebhook>()
  • Refund Failure → Webhook.Parse<TransactionWebhook>()
  • Card Expiration Warning → Webhook.Parse<CardExpirationWebhook>()
Product 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 netcoreapp1.0 was computed.  netcoreapp1.1 was computed.  netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard1.2 is compatible.  netstandard1.3 was computed.  netstandard1.4 was computed.  netstandard1.5 was computed.  netstandard1.6 was computed.  netstandard2.0 was computed.  netstandard2.1 was computed. 
.NET Framework 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. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen30 was computed.  tizen40 was computed.  tizen60 was computed. 
Universal Windows Platform uap was computed.  uap10.0 was computed. 
Windows Phone wpa81 was computed. 
Windows Store netcore451 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
1.3.21 96 4/8/2026
1.3.21-rc2 86 3/27/2026
1.3.21-rc1 82 3/27/2026
1.3.20 2,515 4/29/2025
1.3.20-rc5 132 12/10/2024
1.3.20-rc4 115 12/6/2024
1.3.20-rc3 152 12/6/2024
1.3.20-rc2 674 10/23/2024
1.3.20-rc1 129 10/23/2024
1.3.20-rc 139 10/23/2024
1.3.19-rc 154 7/5/2024
1.3.18-rc9 131 6/21/2024
1.3.18-rc8 128 6/10/2024
1.3.18-rc7 169 4/11/2024
1.3.18-rc6 180 4/3/2024
1.3.18-rc5 186 4/1/2024
1.3.18-rc4 207 7/27/2023
1.3.18-rc3 266 9/7/2022
1.3.18-rc2 1,277 8/17/2022
1.3.18-rc10 159 6/27/2024
Loading failed