zfoltin / DotNetSDK

JudoPay API client for Microsoft.Net

Home Page:https://www.judopay.com/docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Judo .NET SDK

Coverity Scan Build Status

The .NET SDK is a client for our Judopay API, which provides card payment processing for mobile apps and websites.

***Due to industry-wide security updates, versions below 1.1.113 of this SDK will no longer be supported after 1st Oct 2016. For more information regarding these updates, please read our blog here.***

Requirements

Getting started

The Judopay SDK is distributed as a NuGet package using the package name of JudoPay.Net.

####1. Integration You can install the SDK directly from within Visual Studio either using the NuGet package manager UI, or in the Package Manager Console:

Install-Package JudoPay.Net

####2. Setup

You configure you Judopay API client when invoking the JudoPaymentsFactory.Create method. This has three parameters; environment (Sandbox for development and testing, and Live for production), and api token and secret. You set you API token and secret up through our management dashboard after creating an account. You can create a testing account by clicking "Getting Started" in our documentation

var client = JudoPaymentsFactory.Create(JudoPayDotNet.Enums.JudoEnvironment.Sandbox, "<TOKEN>", "<SECRET>");

####3. Make a payment Once you have your API client, you can easily process a payment:

var cardPaymentModel = new CardPaymentModel
{
	JudoId = "<JUDO_ID>",

	// value of the payment
	Amount = 1.01m,
	Currency = "GBP",

	// card details
	CardNumber = "4976000000000036",
	ExpiryDate = "1215",
	CV2 = "452",

	// an identifier for your customer
	YourConsumerReference = "MyCustomer004",
};

Note: Please make sure that you are using a unique Consumer Reference for each different consumer.

####4. Check the payment result

client.Payments.Create(cardPaymentModel).ContinueWith(result =>
{
	var paymentResult = result.Result;

	if (!paymentResult.HasError && paymentResult.Response.Result == "Success")
	{
		Console.WriteLine("Payment successful. Transaction Reference {0}", paymentResult.Response.ReceiptId);
	}

});

Next steps

The Judo .NET library supports additional features and a range of customization options. For more information about this SDK see our wiki documentation as well as our public documentation.

About

JudoPay API client for Microsoft.Net

https://www.judopay.com/docs

License:MIT License


Languages

Language:C# 100.0%