SaferPay.Netcore
1.33.2
See the version list below for details.
dotnet add package SaferPay.Netcore --version 1.33.2
NuGet\Install-Package SaferPay.Netcore -Version 1.33.2
<PackageReference Include="SaferPay.Netcore" Version="1.33.2" />
paket add SaferPay.Netcore --version 1.33.2
#r "nuget: SaferPay.Netcore, 1.33.2"
// Install SaferPay.Netcore as a Cake Addin #addin nuget:?package=SaferPay.Netcore&version=1.33.2 // Install SaferPay.Netcore as a Cake Tool #tool nuget:?package=SaferPay.Netcore&version=1.33.2
SaferPay.NetCore Json Api V1.33
This repository is an implementation of the SaferPay.Net
library (https://github.com/bmbsqd/saferpay-net
), with updates to use .NetCore 6.0 and RestSharp instead of HttpClient, and all methods extented by sync and async call.
The implementation is based on the latest version of the JSON API, v1.33, which can be found at the following URL: http://saferpay.github.io/jsonapi/#ChapterTransaction
.
You can find Test Cards and explanation of usage at https://docs.saferpay.com/home/integration-guide/testing-and-go-live#visa-and-v-pay
What's New
- Upgrade to
.NetCore 6.0
- HttpClient has been replaced by
RestSharp
- Updated to use the latest version of the JSON API,
v1.33
- Replaced
BaseUri
withSandBox
mode, and BaseUri is now generated based on SandBox mode for testing or live. - Updated and improved constructors for easier usage.
- Added descriptions to Properties based on api document.
- Converted string properties to Enum values.
Basic Usage
Initialize the ApiClient;
ISaferPayClient Client = new SaferPayClient("CustomerId", "TerminalId", "UserName", "PassWord", true);
Initialize request based on your method:
string OrderID = "123456";
InitializeRequest req = new InitializeRequest();
req.TerminalId = this.ClientId;
req.Payment = new InitializationPayment(123.45, "TRY", OrderID);
req.PaymentMeans = new InitializationPaymentMeans(new InitializationCard("9010004150000009", 12, 30, 123, "Card Holder Name"));
req.ReturnUrl = $"https://localhost/payment/";
Call Api Async
try
{
var result = await Client.InitializeAsync(req);
if (!string.IsNullOrEmpty(result.Token))
{
// Do Stuff
}
}
catch (SaferPayException ex)
{
// Catch Errors
}
or Call Api Sync
try
{
var result = Client.Initialize(req);
if (!string.IsNullOrEmpty(result.Token))
{
// Do Stuff
}
}
catch (SaferPayException ex)
{
// Catch Errors
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. 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. |
-
net6.0
- Newtonsoft.Json (>= 13.0.3)
- RestSharp (>= 110.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.