Mobile SDKs

WayaQuick — iOS SDK

Pure Swift SDK with async/await. Payments, payouts and account checks.

Installhttps://github.com/WAYA-MULTI-LINK/WAYA-PAY-CHAT-2.0-IOS-SDK

The official iOS SDK for WayaQuick. Accept payments, send payouts and verify accounts — written in pure Swift with no external dependencies.

#Requirements

  • iOS 14.0+ / macOS 11.0+
  • Swift 5.9+
  • Xcode 15+

#Installation

Swift Package Manager is recommended. In Xcode:

  1. Open your project in Xcode.
  2. Go to File → Add Package Dependencies.
  3. Paste the repository URL below.
  4. Select "Up to Next Major Version" starting from 1.0.0.
  5. Click Add Package.
Text
https://github.com/WAYA-MULTI-LINK/WAYA-PAY-CHAT-2.0-IOS-SDK

Or add it to Package.swift:

Swift
dependencies: [
    .package(
        url: "https://github.com/WAYA-MULTI-LINK/WAYA-PAY-CHAT-2.0-IOS-SDK",
        from: "1.0.0"
    )
]

Then add WayaPayKit to your target dependencies:

Swift
.target(
    name: "YourApp",
    dependencies: ["WayaPayKit"]
)

#Quick start

Swift
import WayaPayKit

let client = WayaPayClient(options: WayaPayOptions(
    merchantId:  "your-merchant-id",
    publicKey:   "your-api-secret-key",
    environment: "test" // or "production"
))

Every method is async — call it with await from an async context and wrap it in do/catch.

#Initialize payment

Starts a payment and returns the transaction ID to send your customer to.

Swift
let request = InitializePaymentRequest(
    currency: "NGN",
    amount: 5000,
    callBackUrl: "https://yoursite.com/callback",
    idempotencyKey: UUID().uuidString,
    paymentRef: "ORDER-001",
    metadata: PaymentMetadata(
        firstName: "John",
        lastName: "Doe",
        phoneNumber: "08012345678",
        emailAddress: "john@example.com",
        cancelUrl: "https://yoursite.com/cancel"
    )
)

do {
    let response = try await client.initializePayment(request)
    print(response.data?.transactionId ?? "")
} catch {
    print("Payment failed: \(error)")
}

#Verify account

Returns the registered name for an account number. Always call this before a payout.

Swift
let request = VerifyAccountRequest(
    accountNumber: "0123456789",
    bankCode: "044"
)

let response = try await client.verifyAccount(request)
print(response.data?.accountName ?? "")

#Initiate payout

Sends money from your merchant balance to a bank account.

Swift
let request = InitiatePayoutRequest(
    currency: "NGN",
    amount: 10000,
    idempotencyKey: UUID().uuidString,
    bankCode: "044",
    accountNumber: "0123456789"
)

let response = try await client.initiatePayout(request)

#Verify transaction

Gets the current status of a transaction by its reference.

Swift
let response = try await client.verifyTransaction(
    ref: "your-transaction-ref"
)

print(response.data?.status ?? "")

#Fetch bank list

Returns every supported bank and its code, for payouts and account verification.

Swift
let response = try await client.fetchBankList()

response.data?.banks?.forEach { bank in
    print("\(bank.name ?? "") - \(bank.code ?? "")")
}

#Environments

ValueDescription
testTest environment for development
productionLive environment for real transactions

#SwiftUI example

Swift
import SwiftUI
import WayaPayKit

struct CheckoutView: View {
    @State private var loading = false
    @State private var transactionId: String?

    private let client = WayaPayClient(
        options: WayaPayOptions(
            merchantId: "your-merchant-id",
            publicKey: "your-api-secret-key",
            environment: "test"
        )
    )

    var body: some View {
        VStack(spacing: 20) {
            if let id = transactionId {
                Text("Transaction: \(id)")
            }

            Button("Pay ₦5,000") {
                Task { await startPayment() }
            }
            .disabled(loading)
        }
    }

    func startPayment() async {
        loading = true
        defer { loading = false }

        let request = InitializePaymentRequest(
            currency: "NGN",
            amount: 5000,
            callBackUrl: "https://yoursite.com/callback",
            idempotencyKey: UUID().uuidString,
            paymentRef: "ORDER-\(Int.random(in: 1000...9999))",
            metadata: PaymentMetadata(
                firstName: "John",
                lastName: "Doe",
                phoneNumber: "08012345678",
                emailAddress: "john@example.com"
            )
        )

        do {
            let response = try await client.initializePayment(request)
            transactionId = response.data?.transactionId
        } catch {
            print("Payment error: \(error)")
        }
    }
}

#Custom URLSession

Need custom timeouts, retries, or mocks for tests? Pass in your own URLSession.

Swift
let config = URLSessionConfiguration.default
config.timeoutIntervalForRequest = 30
config.timeoutIntervalForResource = 60

let session = URLSession(configuration: config)

let client = WayaPayClient(
    options: WayaPayOptions(
        merchantId: "your-merchant-id",
        publicKey: "your-api-secret-key",
        environment: "test"
    ),
    session: session
)