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.
Falu is available on SPM. Add the following to you package.
import PackageDescription
let package = Package(
dependencies: [
.package(url: "https://github.com/faluapp/falu-ios", from: 1.0.0)
]
)
Follow our Setup Guide to get started.
let falu = Falu("PUBLIC_KEY")
The public key is mandatory. Failing to provide it will result into an Error
when interacting with Falu.
Once you have finished the setup process, you can proceed to use the features and functionalities offered by the SDK
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
}
}
}