Getting Started

PointCheckout Integration Support

IOS SDK


By  Abdullah Al-Shishani

Getting started

  • Download the .framework file from here 
  • Add the downloaded file to the embedded binaries of your project.
  • Rebuild your project.

Using the SDK

First you will need a checkoutKey which can be obtained via PointCheckout's API.

Import

You can import the framework using import PointCheckoutSdk

Create PointCheckoutClient

Create an object of PointCheckoutClient:

let client = PointCheckoutClient(environment: PointCheckoutClientEnvironment.TEST)
ParameterDefaultDescription
EnvironmentnilSpecifies the environment of the app, use PointCheckoutClientEnvironment.TEST for testing purposes.

Create a single instance of PointCheckoutClient and re-use that instance each time you want to checkout.

Payment submit

To submit a payment call the pay function of the PointCheckoutClient:

let client = PointCheckoutClient(environment: PointCheckoutEnvironment.TEST)
client.pay(controller: viewController, checkoutKey: strCheckoutKey, delegate: callback)
ParameterDescription
controllerA UIViewController calling the pay function
checkoutKeyThe checkoutKey String value
delegateDelegate that will be called on payment update or cancellation

Calling the pay method will open a modal and the user will be able to login and complete the payment.

Payment listener

Use PointCheckoutPaymentDelegate to listen for payment updates.

import UIKit
import PointCheckoutSdk

class ViewController: UIViewController, PaymentDelegate{

    override func viewDidLoad() {
        super.viewDidLoad()
        
    }
    
    func onPaymentUpdate(){
        print("UPDATE CALLBACK")
    }
    
    func onPaymentCancel(){
        print("CANCEL CALLBACK")
    }
}

Demo app

You can use our Demo app as an example of how to integrate our SDK on your application. you can access it from hereYou can import the example app to XCode to see how the SDK can be used


Last Updated  September 26, 2019