Getting Started

PointCheckout Integration Support

IOS SDK


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 pc_ios_sdk

Create PointCheckoutClient

Create an object of PointCheckoutClient:

let client = PointCheckoutClient(environment: PointCheckoutClient.Environment.TEST)
ParameterDefaultDescription
EnvironmentnilSpecifies the environment of the app, use Environment.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: PointCheckoutClient.Environment.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 log in and complete the payment.

Payment listener

Use PointCheckoutPaymentDelegate to listen for payment updates.

import UIKit
import pc_ios_sdk

class ViewController: UIViewController, PointCheckoutPaymentDelegate{

    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


آخر تحديث  09 يوليو, 2019