Skip to content

kudi-inc/nomba-ios-sdk

Repository files navigation

Octane: Nomba iOS SDK

The Nomba iOS SDK allows you bring the same great Nomba Checkout experience natively to your iOS apps using UIKit or SwiftUI Accept payments in your app by bank transfer or card

Platform


🚀 Getting Started

Use Xcode's built-in Swift Package Manager:


📖 Documentation

All of your interactions with the Nomba iOS SDK is done through a singleton, Octane.shared. Initialise it as early as you can passing in your Nomba accountID, your Nomba ClientID and your Nomba ClientKey (you can get this values from your Nomba Dashboard).

UIKit

import UIKit
import Octane

@main
class AppDelegate: UIResponder, UIApplicationDelegate {

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        Octane.shared.configure(clientId: "clientId", accountId: "accountId", clientKey: "clientKey")
        return true
    }
    ...
}

SwiftUI

import SwiftUI
import Octane

struct ContentView: View {
    init() {
        Octane.shared.configure(clientId: "clientId", accountId: "accountId", clientKey: "clientKey")
    }
  
    ...
}

Before presenting the PaymentView, pass in details for the current payment session

Octane.shared.setPaymentDetails(email: "[email protected]", amount: 1000, customerName: "Emeka Bond")

Present the PaymentView when you are ready for payment to occur

UIKit

import UIKit
import Octane

class CartViewController: UIViewController {
    ...
  
    @objc func paymentButtonTapped() {
        present(Octane.shared.viewController, animated: true)  
    }
}

SwiftUI

import SwiftUI
import Octane

struct ContentView: View {
    @State var isShowingPayment : Bool = false
    
    var body: some View {
        VStack{
            Button(action: {
                isShowingPayment = true
            }) {
                Text("Make Payment")
            }
        }.sheet(isPresented: $isShowingPayment){
            Octane.shared.view
        }
    }
}


📱 Projects

If you use the Nomba iOS SDK in your project and would like it listed here, simply create a new issue with the title of your app, link to it on the AppStore and tag it with the label 'project'. It would be added here afterwards.


👨‍💻 Contributing

Pull requests with bugfixes and new features are much appreciated. We'll be happy to review them and merge them once they're ready, as long as they contain change that fit within the vision of Nomba's iOS SDK and provide generally useful functionality.

Clone the repository to get started working on the project.

git clone https://github.com/kudi-inc/nomba-ios-sdk

❤️ Acknowledgments

  • Drops is used for showing the top alerts

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages