![]() |
VOOZH | about |
dotnet add package FahdCloud.ThirdParty.PaymentIntegrations --version 10.0.12
NuGet\Install-Package FahdCloud.ThirdParty.PaymentIntegrations -Version 10.0.12
<PackageReference Include="FahdCloud.ThirdParty.PaymentIntegrations" Version="10.0.12" />
<PackageVersion Include="FahdCloud.ThirdParty.PaymentIntegrations" Version="10.0.12" />Directory.Packages.props
<PackageReference Include="FahdCloud.ThirdParty.PaymentIntegrations" />Project file
paket add FahdCloud.ThirdParty.PaymentIntegrations --version 10.0.12
#r "nuget: FahdCloud.ThirdParty.PaymentIntegrations, 10.0.12"
#:package FahdCloud.ThirdParty.PaymentIntegrations@10.0.12
#addin nuget:?package=FahdCloud.ThirdParty.PaymentIntegrations&version=10.0.12Install as a Cake Addin
#tool nuget:?package=FahdCloud.ThirdParty.PaymentIntegrations&version=10.0.12Install as a Cake Tool
A premium .NET 10.0 C# library for integrating multiple third-party payment gateways into your application with a unified, clean API. This library simplifies the complexity of interacting with various payment providers, enabling seamless payment processing, BNPL (Buy Now Pay Later) solutions, and health checks.
IHttpClientFactory and System.Text.Json.IServiceCollection.| Gateway | Region | Key Features |
|---|---|---|
| ClickPay | Saudi Arabia (KSA) | Invoice creation, Status tracking, Health checks |
| Tabby | GCC (UAE, KSA, etc.) | BNPL (Installments, Pay Later), Cardless |
| Tamara | GCC (KSA, UAE, etc.) | BNPL (Installments, Pay Now), Webhooks |
| PayPal | Global | Worldwide reach, Easy checkout |
| Stripe | Global | Card processing, Apple Pay, Google Pay |
| Paymob | MENA (Egypt, etc.) | Intentions, Caching support, Multiple methods |
| MyFatoorah | Middle East | Multi-region endpoints (KW, UAE, EG, QA, SA) |
| Taps (Tap) | GCC | Simple integration, Invoice status |
| Moyasar | KSA | Direct card integration, Simple API |
| Fawaterak | MENA | Invoice initialization, Health checks |
| Kashier | MENA | Simple & Card-based flows |
Install-Package FahdCloud.ThirdParty.PaymentIntegrations
Add the following to your Program.cs:
using FahdCloud.ThirdParty.PaymentIntegrations.Extensions;
// Registers all gateway services and the Factory
builder.Services.AddPaymentIntegration();
Configure your gateways in appsettings.json. Below is a comprehensive example of all settings classes:
{
"PaymentGateways": {
"ClickPay": {
"ApiKey": "your_api_key_here",
"ApiSecret": "your_api_secret_here",
"IsLiveMode": false
},
"Tabby": {
"ApiKey": "pk_test_...",
"MerchantCode": "your_code",
"IsLiveMode": false
},
"Tamara": {
"ApiKey": "your_token",
"ApiUrl": "https://api-sandbox.tamara.co",
"IsLiveMode": false
},
"Paypal": {
"ClientId": "your_id",
"ClientSecret": "your_secret",
"IsLiveMode": false
},
"Stripe": { "ApiKey": "sk_test_..." },
"Paymob": {
"ApiKey": "...",
"SecretKey": "...",
"PublicKey": "..."
},
"MyFatoorah": {
"ApiKey": "...",
"IsLiveMode": false,
"MyFatoorahApiRegion": "SaudiArabia"
},
"Taps": { "ApiKey": "sk_test_..." },
"Moyasar": { "ApiKey": "sk_test_..." },
"Fawaterak": { "ApiKey": "...", "IsLiveMode": false },
"Kashier": {
"MerchantId": "...",
"PublicKey": "...",
"SecretKey": "...",
"IsLiveMode": false
}
}
}
ClickPay is a Saudi Arabian payment gateway providing simple invoice-based payment flows with sandbox and production environments.
IClickPayServiceClickPaySettingClickPayCheckoutRequest, ClickPayPaymentDetailsRequestvar request = new PaymentCheckoutRequest
{
ReferenceId = "INV-2024-001",
Currency = "SAR",
Description = "Invoice payment",
PaymentMethod = ClickPayPaymentMethodTypeConst.Mada, // Optional: specify payment method
Customer = new PaymentCustomer
{
FirstName = "Ahmed",
Email = "customer@example.com",
PhoneNumber = "+966501234567"
},
Urls = new PaymentRedirectUrls
{
SuccessUrl = "https://yoursite.com/success",
CallbackUrl = "https://yoursite.com/webhook"
},
Items = new List<PaymentLineItem>
{
new()
{
Name = "Product 1",
Description = "Premium widget",
Sku = "SKU-001",
Quantity = 2,
UnitPrice = 75m,
Currency = "SAR",
ProductUrl = "https://yoursite.com/product1"
}
},
TaxAmount = 15m,
ShippingAmount = 10m,
DiscountAmount = 5m
};
var response = await _clickPayService.CreateCheckoutUrlAsync(request, settings);
// Redirect user to: response.CheckoutUrl
// Check payment status
var statusRequest = new ClickPayPaymentDetailsRequest { TransactionId = response.GatewayTransactionId };
var status = await _clickPayService.GetPaymentDetails(statusRequest, settings);
Key Features:
https://sandbox.clickpay.sahttps://secure.clickpay.saCheckConnection()Supported Payment Methods:
| Payment Method | Description | Region |
|---|---|---|
card |
Credit Card payment method | Global |
creditcard |
Credit Card payment method (alternative) | Global |
mada |
MADA payment method in KSA | Saudi Arabia |
stcpay |
STC Pay payment method in KSA | Saudi Arabia |
applepay |
Apple Pay payment method | Global |
Request Structure:
The ClickPay integration automatically maps the unified PaymentCheckoutRequest to ClickPay's invoice format, including:
profile_id - Your merchant profile ID (from settings)tran_type - Transaction type ("sale")tran_class - Transaction class ("ecom")cart_id - Your reference IDcart_amount - Total amount (calculated from items + tax + shipping - discount)invoice.line_items - Array of items with detailed breakdowninvoice.shipping_charges - Shipping amountinvoice.extra_charges - Tax amountinvoice.extra_discount - Discount amounthide_shipping - Always true for digital payments// Example: Using MADA payment method
var request = new PaymentCheckoutRequest
{
ReferenceId = "INV-2024-001",
Currency = "SAR",
PaymentMethod = ClickPayPaymentMethodTypeConst.Mada, // Use "mada" for KSA
Items = [ new PaymentLineItem { Name = "Item", Quantity = 1, UnitPrice = 100m } ]
};
// Example: Using STC Pay
var stcPayRequest = new PaymentCheckoutRequest
{
ReferenceId = "INV-2024-002",
Currency = "SAR",
PaymentMethod = ClickPayPaymentMethodTypeConst.StcPay,
Items = [ new PaymentLineItem { Name = "Item", Quantity = 1, UnitPrice = 100m } ]
};
// Example: Multiple payment methods allowed
var multiMethodRequest = new PaymentCheckoutRequest
{
ReferenceId = "INV-2024-003",
Currency = "SAR",
PaymentMethod = ClickPayPaymentMethodTypeConst.Card, // Can specify primary method
Items = [ new PaymentLineItem { Name = "Item", Quantity = 1, UnitPrice = 100m } ]
};
Tabby is the leading BNPL provider in the GCC. It requires mandatory buyer data and specific currency codes (AED, SAR, etc.).
ITabbyServiceTabbySettingTabbyCheckoutRequestvar request = new TabbyCheckoutRequest {
Payment = new() { Amount = 150.00m, Currency = "SAR" },
Buyer = new() {
Email = "customer@example.com",
Phone = "+966501112223", // Mandatory: Include Country Code
FirstName = "Fahd",
LastName = "Cloud"
},
RedirectUrls = new() {
Success = "https://yoursite.com/success",
Cancel = "https://yoursite.com/cancel"
}
};
var response = await _tabbyService.CreateCheckoutUrlAsync(request, settings);
// Redirect user to: response.CheckoutUrl
Tamara provides installments and "Pay Now" options. It uses a region-specific base URL.
ITamaraServiceTamaraSettingTamaraCheckoutRequestvar request = new TamaraCheckoutRequest {
OrderReferenceId = "INV-2024-001",
PaymentType = TamaraPaymentTypeConst.PayByInstallments,
OrderAmount = new() { Amount = 500.00m, Currency = "SAR" },
Consumer = new() {
FirstName = "Ahmed",
LastName = "Test",
PhoneNumber = "+966501234567"
}
};
var response = await _tamaraService.CreateCheckoutUrlAsync(request, settings);
Uses the official PayPal Server SDK for order creation and capture.
IPayPalServicePayPalSettingvar request = new OrderRequest {
Intent = CheckoutPaymentIntent.Capture,
PurchaseUnits = new List<PurchaseUnitRequest> {
new() {
Amount = new() { CurrencyCode = "USD", MValue = "100.00" }
}
}
};
var response = await _payPalService.CreateCheckoutUrlAsync(request, settings);
Stripe integration uses the official Stripe.net SDK and the Checkout Session flow.
IStripeServiceStripeSettingSessionCreateOptions (from Stripe.net)var options = new SessionCreateOptions {
PaymentMethodTypes = new List<string> { "card" },
LineItems = new List<SessionLineItemOptions> {
new() {
PriceData = new SessionLineItemPriceDataOptions {
UnitAmount = 2000, // 20.00 USD
Currency = "usd",
ProductData = new SessionLineItemPriceDataProductDataOptions { Name = "Test Product" },
},
Quantity = 1,
},
},
Mode = "payment",
SuccessUrl = "https://example.com/success",
CancelUrl = "https://example.com/cancel",
};
var response = await _stripeService.CreateCheckoutUrlAsync(options, settings);
Paymob uses the unified "Intention" flow for modern checkouts.
IPaymobServicePaymobSettingPaymobTransactionRequestvar request = new PaymobTransactionRequest {
amount = 1000, // 10.00 EGP (in cents)
currency = "EGP",
billing_data = new() {
first_name = "Fahd",
last_name = "Cloud",
email = "test@example.com",
phone_number = "+201012345678"
},
items = new() { new() { name = "Item 1", amount = 1000, quantity = 1 } }
};
var response = await _paymobService.CreateCheckoutUrlAsync(request, settings);
Supports multiple regions in the Middle East with a single API.
IMyFatooraServiceMyFatooraSettingMyFatooraInvoiceRequestvar request = new MyFatooraInvoiceRequest {
InvoiceValue = 100,
CustomerName = "Ahmed test",
DisplayCurrencyIso = "SAR",
CallBackUrl = "https://example.com/callback",
ErrorUrl = "https://example.com/error"
};
var response = await _myFatooraService.CreateCheckoutUrlAsync(request, settings);
A GCC-based provider supporting various local payment methods.
ITapsServiceTapsSettingTapsInvoiceRequestvar request = new TapsInvoiceRequest {
amount = 50,
currency = "KWD",
customer = new() { first_name = "Test", email = "test@tap.company" },
redirect = new() { url = "https://example.com/redirect" }
};
var response = await _tapsService.CreateCheckoutUrlAsync(request, settings);
A clean, card-focused gateway for the Saudi Arabian market.
IMoyasarServiceMoyasarSettingMoyasarInvoiceRequestvar request = new MoyasarInvoiceRequest {
amount = 10000, // 100.00 SAR (in halalas)
currency = "SAR",
description = "Order #123",
callback_url = "https://example.com/callback"
};
var response = await _moyasarService.CreateCheckoutUrlAsync(request, settings);
Focuses on the Egyptian market with simplified invoice flows.
IFawaterakServiceFawaterakSettingFawaterakInvoiceRequestvar request = new FawaterakInvoiceRequest {
cartTotal = 250,
customer = new() { first_name = "User", last_name = "Test", email = "user@test.com" },
cartItems = new() { new() { name = "Example", price = 250, quantity = 1 } }
};
var response = await _fawaterakService.CreateCheckoutUrlAsync(request, settings);
Provides a secure hosted checkout for Egyptian merchants.
IKashierServiceKashierSettingKashierInvoiceRequestvar request = new KashierInvoiceRequest {
amount = 150,
currency = "EGP",
customerName = "Test User",
merchantOrderId = "ORD-456",
redirectUrl = "https://example.com/kashier-callback"
};
var response = await _kashierService.CreateCheckoutUrlAsync(request, settings);
The project includes a comprehensive Console Test Application located in the Test directory. This tool allows you to manually verify integrations without setting up a web server.
How to run:
Test directory.PaymentSettingsFactory.cs with your test credentials.dotnet run.For real-world examples of how to implement each gateway, refer to the files in:
d:\Career\Work\Libraries\FahdCloud.ThirdParty\Test\Gateways\
| File | Purpose |
|---|---|
ClickPayPaymentServiceImplementation.cs |
Invoice creation and status tracking |
TabbyPaymentServiceImplementation.cs |
End-to-end Tabby flow |
TamaraPaymentServiceImplementation.cs |
Installments & address handling |
PayPalPaymentProcessingService.cs |
Order creation & status check |
StripePaymentServiceImplementation.cs |
Session-based card checkout |
4242... cards. View Specs+971500000001. View Docs+966550000000 for sandbox. View DocsFahdCloud.ThirdParty.PaymentIntegrations\Interfaces\FahdCloud.ThirdParty.PaymentIntegrations\Services\Models\Shared\.Every CreateCheckoutUrlAsync returns a CheckoutResponse<T> which includes:
CheckoutUrl: The URL to redirect the user.GatewayTransactionId: The provider's internal ID.PaymentDetailsJson: The raw response for logging.AddPaymentIntegration() in IServiceCollection.Setting class (e.g., PaymobSetting).IPaymobService) and call CreateCheckoutUrlAsync(request, settings).GetPaymentDetails to confirm the transaction.Test project before moving to production.This project is licensed under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.12 | 198 | 4/20/2026 |
| 10.0.11 | 102 | 4/20/2026 |
| 10.0.10 | 107 | 4/19/2026 |
| 10.0.9 | 105 | 4/19/2026 |
| 10.0.8 | 154 | 4/13/2026 |
| 10.0.7 | 115 | 4/12/2026 |
| 10.0.6 | 116 | 4/12/2026 |
| 10.0.5 | 106 | 4/12/2026 |
| 10.0.4 | 127 | 4/11/2026 |
| 10.0.3 | 117 | 4/9/2026 |
| 10.0.2 | 118 | 4/8/2026 |
| 10.0.1 | 114 | 3/1/2026 |
| 10.0.0 | 225 | 2/28/2026 |
| 6.0.0 | 242 | 9/2/2025 |
| 1.0.8 | 230 | 1/20/2026 |
| 1.0.7 | 840 | 7/21/2025 |
| 1.0.6 | 215 | 7/13/2025 |
| 1.0.5 | 209 | 6/21/2025 |
| 1.0.4 | 232 | 6/19/2025 |
| 1.0.3 | 227 | 5/29/2025 |