.NET Software Development Kit for Paytrail payment service
Paytrail is a payment gateway that offer 20+ payment methods for finish customers.
The payment gateway provides all the popular payment methods with one simple integration. The provided payment methods include, but are not limited to, credit cards, online banking and mobile payments.
To use the payment service, you need to sign up for a Paytrai account. Transactio fees will be charged for every transaction. Transaction cost may vary from merchant to merchant, based on what is agreed upon with Paytrail when negotiating your contract. For more informationm and registration, please visit our website or contact (asiakaspalvelu@paytrail.com) directly.
- .NET and .NET Core 2.0 or later
- .NET Framework 4.6.1 or later
- XUnit - community-focused unit testing tool for the .NET
Install with Nuget Package Management Install with .NET Core CLI
Nuget\Install-Package Paytrail-dotnet-sdk -Version 1.0.2
Install with Package Manager Console`
dotnet add package Paytrail-dotnet-sdk --version 1.0.2
using Newtonsoft.Json;
using Paytrail_dotnet_sdk;
using Paytrail_dotnet_sdk.Model.Request;
using Paytrail_dotnet_sdk.Model.Request.RequestModels;
using Paytrail_dotnet_sdk.Model.Response;
class Program
{
static void Main()
{
PaytrailClient payTrail = new PaytrailClient("375917", "SAIPPUAKAUPPIAS", "xxx");
GetPaymentProvidersRequest payload = new GetPaymentProvidersRequest
{
amount = 1000,
groups = new List<PaymentMethodGroup>()
{
PaymentMethodGroup.creditcard,
}
};
GetPaymentProvidersResponse res = payTrail.GetPaymentProviders(payload);
Console.WriteLine(JsonConvert.SerializeObject(res));
}
}
Folder/File | Content/Description |
---|---|
Paytrail-dotnet-sdk/Interface | Interface for all the related classes to implement |
Paytrail-dotnet-sdk/Model | Model classes and functions |
Paytrail-dotnet-sdk/Model/Request | Request model and functions |
Paytrail-dotnet-sdk/Model/Response | Response model and functions |
Paytrail-dotnet-sdk/Util | Utility/Enum classes and functions |
Paytrail-dotnet-sdk/Paytrail.cs | Init paytrail service |
Paytrail-dotnet-sdk/PaytrailClient.cs | Paytrail client class and functions |
Paytrail-dotnet-sdk.UnitTest | .NET unit test |
The Paytrail-dotnet-sdk supports some functionalities of the Paytrail Payment API.
Some of the key features are:
- Creating Shop-in-shop payment request
Method | Description |
---|---|
CreatePayment() | Create payment |
CreateShopInShopPayment() | Create SiS payment |
GetPaymentInfo() | Request payment status |
RefundPayment() | Create refund request |
PayAndAddCardRequest() | Combine a payment and adding a new card with a single request |
GetPaymentProviders() | Get a list of payment providers |
GetGroupedPaymentProviders() | Returns an array of grouped payment providers fields |
EmailRefund() | Create email refund |
CreateGetTokenRequest() | Request card token |
GetSettlements() | Request settlements |
RequestPaymentReport() | Request payment report |
CreateMitPaymentCharge() | Create MiT payment |
CreateMitPaymentAuthorizationHold() | Create MiT authorization hold |
CreateCitPaymentCharge() | Create CiT payment |
CreateCitPaymentAuthorizationHold() | Create CiT authorization hold |
CreateMitPaymentCommit() | Commit MiT authorization hold |
CreateCitPaymentCommit() | Commit CiT authorization hold |
RevertPaymentAuthorizationHold() | Revert existing Mit or CiT authorization hold |
RequestPaymentReportBySettlement() | Request payment report by settlement ID |
CreateAddCardFormRequest() | Save card details |