Logo Lanfrica

paynow/Paynow-DotNet-SDK

Domaine:

digital infrastructure

Type de record:

software
Créateur:
pay
Hôte:
.NET SDK for Zimbabwe's leading payments gateway, Paynow # Paynow Zimbabwe .NET SDK .NET SDK for Paynow Zimbabwe's API ## Sign in to Paynow and get integration details > Before you can start making requests to Paynow's API, you need to get an integration ID and integration Key from Paynow. Details about how you can retrieve the ID and key are explained in detail on this page ## Prerequisites This library has a set of prerequisites that must be met for it to work 1. .NET Framework 4.5.2 or later (although the project targets .NET Framework 4.5.2, the code is directly compatible with .NET Core 2.0 or later) ## Installation There are two ways to install the Paynow .NET SDK. The first method uses the NuGet Package Manager, which comes preconfigured with Visual Studio 2013 and later. If you prefer to not use NuGet, you can also download the SDK directly from this repository. ### Installing using Nuget From the Nuget package manager console, enter the follwing command ```sh PM> Install-Package Paynow ``` ### Downloading the SDK directly 1. Navigate to the Paynow .NET SDK Releases page 2. Click the appropriate link to download a ZIP file containing the SDK files ## Usage example ### Importing library ```csharp using Webdev.Payments.Paynow; ``` Create an instance of the Paynow class optionally setting the result and return url(s) ```cs var paynow = new Paynow("INTEGRATION_ID", "INTEGRATION_KEY"); paynow.ResultUrl = "example.com"; paynow.ReturnUrl = "example.com"; // The return url can be set at later stages. You might want to do this if you want to pass data to the return url (like the reference of the transaction) ``` Create a new payment passing in the reference for that payment (e.g invoice id, or anything that you can use to identify the transaction. ```cs var payment = paynow.CreatePayment("Invoice 35"); ``` You can then start adding items to the payment ```cs // Passing in the name of the item and the price of the item payment.add("Bananas" …