FlutterWave.Core 1.0.2

dotnet add package FlutterWave.Core --version 1.0.2
NuGet\Install-Package FlutterWave.Core -Version 1.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FlutterWave.Core" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FlutterWave.Core --version 1.0.2
#r "nuget: FlutterWave.Core, 1.0.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install FlutterWave.Core as a Cake Addin
#addin nuget:?package=FlutterWave.Core&version=1.0.2

// Install FlutterWave.Core as a Cake Tool
#tool nuget:?package=FlutterWave.Core&version=1.0.2

FlutterWave.Core

FlutterWave.Core

.NET Nuget Nuget The Standard - COMPLIANT

Introduction

FlutterWave.Core is a Standard-Compliant .NET library built on top of FlutterWave API RESTful endpoints to enable software engineers to develop FinTech solutions in .NET.

This library implements the following section

Please review the following documents:

Standard-Compliance

This library was built according to The Standard. The library follows engineering principles, patterns and tooling as recommended by The Standard.

This library is also a community effort which involved many nights of pair-programming, test-driven development and in-depth exploration research and design discussions.

How to use this library?

In order to use this library there are prerequisites that you must complete before you can write your first C#.NET program. These steps are as follows:

FlutterWave Account

You must create an flutterWave account with the following link: Click here

Nuget Package

Install the FlutterWave.Core library in your project. Use the method best suited for your development preference listed at the Nuget Link above or below.

Nuget

API Keys

Once you've created a FlutterWave account. Now, go ahead and get an API key from the following link: Click here

Hello, World!

Once you've completed the aforementioned steps, let's write our very first program with Standard.AI.OpenAI as follows:

Direct Charge

The following example demonstrate how you can write your first direct card charge program.

PCI Compliance is required for direct charge. Check documentation

Program.cs
using System;
using System.Threading.Tasks;
using FlutterWave.Core;
using FlutterWave.Core.Models.Services.Foundations.FlutterWave.Charge;

namespace ExampleFlutterWaveNet
{
    internal class Program
    {
        static async Task Main(string[] args)
        {

            var apiConfigurations = new ApiConfigurations
            {
                
                ApiKey = Environment.GetEnvironmentVariable("ApiKey"),

            };

            this.flutterWaveClient = new FlutterWaveClient(apiConfigurations);

            // given
            var request = new CardCharge
            {
                Request = new CardChargeRequest
                {
                    CardNumber = "5531886652142950",
                    Cvv = "564",
                    ExpiryMonth = 09,
                    ExpiryYear = 32,
                    Currency = "NGN",
                    Amount = 100,
                    FullName = "Yolande Agla� Colbert",
                    Email = "user@example.com",
                    TxRef = "MC-3243e",
                    RedirectUrl = "https://www,flutterwave.ng",
                    Authorization = new CardChargeRequest.AuthorizationData
                    {
                        Address = "3563 Huntertown Rd, Allison park, PA",
                        Pin = 3310,
                        City = "San Francisco",
                        Country = "US",
                        State = "California",
                        Mode = "pin",
                        ZipCode = "94105"

                    },
                    Preauthorize = true,
                    Meta = new CardChargeRequest.CardMeta
                    {
                        FlightId = "",
                        SideNote = ""
                    },
                    PaymentPlan = "",
                    DeviceFingerprint = "",
                    ClientIp = "127.0.0.1"

                }
            };

           

            // . when
            CardCharge responseFlutterWaveModels =
                await this.flutterWaveClient.Charge.ChargeCardAsync(
                request, Environment.GetEnvironmentVariable("EncryptionKey"));

          
        }
    }
}

ACH Charge

The following implementation shows how to accept payments directly from customers in the US and South Africa.

Program.cs
using System;
using System.Threading.Tasks;
using FlutterWave.Core;
using FlutterWave.Core.Models.Services.Foundations.FlutterWave.Charge;

namespace ExampleFlutterWaveNet
{
    internal class Program
    {
        static async Task Main(string[] args)
        {

            var apiConfigurations = new ApiConfigurations
            {
                
                ApiKey = Environment.GetEnvironmentVariable("ApiKey"),

            };

            this.flutterWaveClient = new FlutterWaveClient(apiConfigurations);

           // given
            var request = new ACHPayments
            {
                Request = new ACHPaymentsRequest
                {
                    TxRef = "MC-1585230ew9v5050e8",
                    Amount = 100,
                    Currency = "USD",
                    Country = "US",
                    Email = "user@example.com",
                    PhoneNumber = "0902620185",
                    FullName = "Yolande Agla� Colbert",
                    ClientIp = "154.123.220.1",
                    RedirectUrl = "https://www.flutterwave.com/us/",
                    DeviceFingerprint = "62wd23423rq324323qew1",

                    Meta = new ACHPaymentsRequest.ACHPaymentsMeta
                    {
                        FlightID = "123949494DC",
                    },


                }
            };

            // . when
            ACHPayments responseFlutterWaveModels =
                await this.flutterWaveClient.Charge.ChargeACHPaymentsAsync(request);
        }
    }
}

NGBank Account Charge

The following implementation shows how to initiate a direct bank charge.

Program.cs
using System;
using System.Threading.Tasks;
using FlutterWave.Core;
using FlutterWave.Core.Models.Services.Foundations.FlutterWave.Charge;

namespace ExampleFlutterWaveNet
{
    internal class Program
    {
        static async Task Main(string[] args)
        {

            var apiConfigurations = new ApiConfigurations
            {
                
                ApiKey = Environment.GetEnvironmentVariable("ApiKey"),

            };

            this.flutterWaveClient = new FlutterWaveClient(apiConfigurations);

            // given
            var request = new NGBankAccounts
            {
                Request = new NGBankAccountsRequest
                {
                    TxRef = "MC-1585230ew9v5050e8",
                    Amount = 100,
                    AccountBank = "044",
                    AccountNumber = "0690000032",
                    Currency = "NGN",
                    Email = "user@example.com",
                    PhoneNumber = "0902620185",
                    FullName = "Yolande Agla� Colbert"
                }
            };

            // . when
            NGBankAccounts responseFlutterWaveModels =
                await this.flutterWaveClient.Charge.ChargeNGBankAccountAsync(request);
        }
    }
}
Exceptions

FlutterWave.Core may throw following exceptions:

Exception Name When it will be thrown
BankClientValidationException This exception is thrown when a validation error occurs while using the bank client. For example, if required data is missing or invalid.
BankClientDependencyException This exception is thrown when a dependency error occurs while using the bank client. For example, if a required dependency is unavailable or incompatible.
BankClientServiceException This exception is thrown when a service error occurs while using the bank client. For example, if there is a problem with the server or any other service failure.
BillPaymentsClientValidationException This exception is thrown when a validation error occurs while using the bill payments client. For example, if required data is missing or invalid.
BillPaymentsClientDependencyException This exception is thrown when a dependency error occurs while using the bill payments client. For example, if a required dependency is unavailable or incompatible.
BIllPaymentsClientDependencyException This exception is thrown when a service error occurs while using the bill payments client. For example, if there is a problem with the server or any other service failure.

How to Contribute

If you want to contribute to this project please review the following documents:

If you have a question make sure you either open an issue or join our Ahmad Salim discord server.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2 152 8/15/2023