PaymentGatewayClient 0.0.8
dotnet add package PaymentGatewayClient --version 0.0.8
NuGet\Install-Package PaymentGatewayClient -Version 0.0.8
<PackageReference Include="PaymentGatewayClient" Version="0.0.8" />
paket add PaymentGatewayClient --version 0.0.8
#r "nuget: PaymentGatewayClient, 0.0.8"
// Install PaymentGatewayClient as a Cake Addin #addin nuget:?package=PaymentGatewayClient&version=0.0.8 // Install PaymentGatewayClient as a Cake Tool #tool nuget:?package=PaymentGatewayClient&version=0.0.8
Payment Gateway Client
There are several "smaller" merchant payment gateways that all use the same API system. This client is meant to work with all of them. Below is a list of known providers that use this system.
Original documentation: https://integratepayments.transactiongateway.com/merchants/resources/integration/integration_portal.php
https://www.integratepayments.com/payment-gateway/integrate-payments-query-api
http://status.transactiongateway.com/
Known Providers
- 0 Merchant
- Advanced Merchant Group
- Aliant Payments
- Align Pay
- Bottom Line Payments
- CanyonPay
- Charge1
- CMS
- CryptoBucks (not for their crypto currency API)
- CyoGate
- Durango Merchant Services
- Easy Pay Direct
- Electronic Processing of North America (EPNA)
- Empyrean Merchant Services
- Inspire Commerce (.pay / dot pay)
- Merchant Guy
- Merchant One
- MSG Payment Systems
- National Processing
- Network Merchants (NMI)
- Payabli (Centavo)
- PayKings
- PayDough.Me
- Payscape
- Pay Engines
- PlanetAuthorize
- RedFynn Technologies
- SecureGlobalPay
- Sibacpay
- SkyBank Financial
- TranzCrypt
- UMS Banking Gateway
- Valued Merchant Services
- Vericheck
- VizyPay
Note: This is not an indication of endorsement and there is no guarantee of compatibility. With the exception of NMI, these providers have not been tested. Based on current experience, it may be possible to use any of these (and new) providers using the NMI
API endpoint though this use case has not been tested.
If you find another gateway that uses this system, please file an issue to get this list updated.
Usage
Credit/Debit Cards
var securityKey = "6457Thfj624V5r7WUwc5v6a68Zsd6YEm"; // test account
var client = new GatewayClient(securityKey, GatewayProvider.NMI);
Sale sale = new Sale
{
CardNumber = "4111111111111111",
CardExpiration = "0323",
CVV = "999",
Amount = "5.00",
FirstName = "John",
LastName = "Smith",
Address1 = "1234 Main St.",
City = "Chicago",
State = "IL",
Zip = "60193",
Payment = "creditcard"
};
var result = client.Sale(sale);
ACH/eCheck
var securityKey = "6457Thfj624V5r7WUwc5v6a68Zsd6YEm"; // test account
var client = new GatewayClient(securityKey, GatewayProvider.NMI);
Sale sale = new Sale
{
CheckABA = "123123123",
CheckAccount = "123123123",
CheckName = "John Smith",
StandardEntryClass = "WEB",
Amount = "5.00",
FirstName = "John",
LastName = "Smith",
Address1 = "1234 Main St.",
City = "Chicago",
State = "IL",
Zip = "60193",
Payment = "check",
AccountHolderType = "business",
AccountType = "checking"
};
var result = client.Sale(sale);
Response
public class GatewayResponse {
public readonly GatewayResponseCode Response; // Approved, Declined, Error
public readonly string ResponseText;
public readonly ReadOnlyDictionary<string, string> Data;
}
Web hook Validation
.NET Framework
ctx = HttpContext.Current;
// generate/retrieve signing key from gateway portal
string key = "WEBHOOK SIGNING KEY";
string signature = ctx.Request.Headers["webhook-Signature"];
string reqBody = "";
try
{
using (StreamReader sr = new StreamReader(ctx.Request.InputStream))
reqBody = await sr.ReadToEndAsync();
}
catch { }
WriteLog($"------{DateTime.UtcNow:R}---------------");
WriteLog(signature);
WriteLog(reqBody);
var status = WebhookParser.ParseWebhookData(reqBody, key, signature);
if (!status.IsValid)
{
WriteLog($"------{DateTime.UtcNow:R}---------------");
WriteLog("Webhook validation failed!");
return;
}
// process status.Data
.NET Core / .NET 5+
// generate/retrieve signing key from gateway portal
string key = "WEBHOOK SIGNING KEY";
string signature = Request.Headers["webhook-Signature"];
string reqBody = "";
try
{
using (StreamReader sr = new StreamReader(Request.Body))
reqBody = await sr.ReadToEndAsync();
}
catch { }
WriteLog($"------{DateTime.UtcNow:R}---------------");
WriteLog(signature);
WriteLog(reqBody);
var status = WebhookParser.ParseWebhookData(reqBody, key, signature);
if (!status.IsValid)
{
WriteLog($"------{DateTime.UtcNow:R}---------------");
WriteLog("Webhook validation failed!");
return;
}
// process status.Data
Product | Versions 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 is compatible. 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 | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- System.Text.Json (>= 8.0.0)
-
.NETStandard 2.0
- System.Text.Json (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
releasing update with missing fields added