Skip to main content

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Payaza SDK is compatible with iOS apps running on iOS 11.0 and above. It requires Xcode 10.0+ to build the source..

Example

PayAzaSDK is available through Cocoapods. To install it, simply add the following line to your Podfile:
FOR PODFILE
  source 'https://github.com/78-Financials/Specs.git'
  source 'https://github.com/CocoaPods/Specs.git'
  pod 'PayAzaSDK'

In your terminal, run

pod update && pod install

Usage

There are three steps you would have to complete to set up the SDK and perform transactionStatus
  1. Install the SDK as a dependency.
  2. Configure the SDK with Merchant Information.
  3. Initiate Payment with customer details.
Request Sample
import PayazaPod

class ViewController: UIViewController, PayazaCallbackMethods {

private var transactionAmount: Int64?



@objc func showExample(){
  let baseUrl = "https://your-base-url"
  let manager = PayazaManager()
  transactionAmount = 100
  manager.initialize(delegateController: self, viewControler: self)
  manager.PayAzaConfig(merchantKey: "Your Merchant Key Here", merchantName: "Test Merchant", currency: "NGN", firstname: "Firstname",
  lastname: "Lastname", email: "emailAdreess", phone: "Phone", transactionRef: "transactionReference",
  amount: transactionAmount!, isLive: true, baseUrl: baseUrl)  // Set isLive to false during testing and set to true during production
  manager.payNow()
}
 func onPaymentComplete(response: TransactionResponse) {
       print("Successful with (response.reference ?? "Failed to return data")")
 }

func onPaymentCancelled(errorMessage: String) {
   print( errorMessage)
}
}

Arguments

ParameterDescriptionFormat
baseUrlThe URL of the payment servicestring
emailThe email address of the customer.string
firstNameThe first name of the customer.string
lastNameThe last name of the customer.string
phoneThe phone number of the customer. It must be international standard i.e. +2348012345678string
transactionrefThis is the transaction reference that you generated for the transaction. This unique and no 2 transactions can have the same reference..string
merchantKeyThis is your public API Key.string
isLiveMode of session (If False, it is in test mode, if True, It is in live mode).boolean
transactionAmountThe amount that the customer would pay.amount
currencyIt refers to the code of the currency.(NGN, USD etc.).string