Swiftpack.co - tinglesoftware/falu-ios as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
tinglesoftware/falu-ios
The official client for Falu (https:falu.io) on iOS
.package(url: "https://github.com/tinglesoftware/falu-ios.git", from: "1.1.1")
Falu Logo

Falu iOS SDK

Falu Language GitHub tag (latest by date)

Falu's iOS SDK simplifies the process of building excellent financial services into iOS applications. The SDK exposes APIs that will enable you to make payments and evaluate your client's credit worth.

Installation

Swift Package Manager

Falu is available on SPM. Add the following to you package.

import PackageDescription

let package = Package(
    dependencies: [
        .package(url: "https://github.com/tinglesoftware/falu-ios", from: 1.0.0)
    ]
)

Getting Started

Setup Guide

Follow our Setup Guide to get started.

Create an instance of Falu

let falu =  Falu("PUBLIC_KEY")

The public key is mandatory. Failing to provide it will result into an Error when interacting with Falu.

Features

Once you have finished the setup process, you can proceed to use the features and functionalities offered by the SDK

Evaluations

Use this feature when you want to know the credit score/worth of a user. This will allow you to know your user's spending habits from their financial statements. Vist Credit scoring customers using the Evaluations API for more information relating to this.


let request = EvaluationRequest(
    currency: "kes",
    scope: .personal,
    provider: .mpesa,
    name: "JOHN DOE",
    phone: "+254712345678",
    password: "pass",
    fileId: "file_602a8dd0a54847479a874de5"
)

falu.createEvaluation(request: request) { result in
    if case .failure(let error) = result{
        DispatchQueue.main.async {
            // show errors on the UI thread
        }
    } else {
        DispatchQueue.main.async {
            // show on UI thread
        }
    }
}

Payments

Create a Payment object when initiating payments from a customer. Falu supports several payment methods including MPESA. See How to Authorize Payments and How to Accept Payments for information.

let mpesa = MpesaPaymentRequest(
    phone: "+254722000000",
    reference: "254722000000",
    paybill: true
)

let request = PaymentRequest(amount: 100, currency: "kes", mpesa: mpesa)

falu.createPayment(request: request) { result in
    if case .failure(let error) = result{
        DispatchQueue.main.async {
            // show errors on the UI thread
        }
    } else {
        DispatchQueue.main.async {
            // show on UI thread
        }
    }
}

GitHub

link
Stars: 0
Last commit: 2 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics