Getting Started

PointCheckout Integration Support

POS IOS SDK


Getting started

  • Download the .framework file, Download this for Swift 5.1 SDK and And this for Swift 5.0 SDK
  • Add the downloaded file to the embedded binaries and Linked Frameworks and Binaries of your project.
  • Add Firebase dependency to your project either by downloading the framework or using pods by following this tutorial
    • Due to recent major update in firebase, please use the below pod versions
      pod 'Firebase/Core', '~> 6.8.1'
      pod
      'Firebase/Auth', '~> 6.8.1'
      pod
      'Firebase/Firestore', '~> 6.8.1'
      pod
      'Protobuf', '~> 3.9.2'
  • Create a Firebase IOS app

Using the SDK

Import

You can import the framework using  import PointCheckoutSdk

Create PointCheckoutClient

Create an object of PointCheckoutClient:

let client: PointCheckoutClient = PointCheckoutClient(environment: PointCheckoutEnvironment.TEST,  apiKey: apiKey,  apiSecret: apiSecret,  googleAppID: googleAppID )



ParameterDescription
EnvironmentSpecifies the environment of the app, use Environment.TEST for testing purposes.
apiKeyThe key of the API user, can be obtained from PointCheckout.
apiSecretThe secret of the API user, can be obtained from PointCheckout.
googleAppIDThe google app id, can be obtained from Firebase console.

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


Checkout submit

To submit a checkout call the pay function of the  PointCheckoutClient, there are two pay functions inside  PointCheckoutClient.

Function 1:  Shows a modal that contains a QR code.

client.pay(checkout: CheckoutRequest,  paymentDelegate: PaymentDelegate,  controller: UIViewController) 

ParameterDescription
checkoutHolds the checkout details.
paymentDelegateDelegate that will be called on payment success, cancellation or error.
controllerA UIViewController calling the pay function


Function 2:
  Use to implement your own view.

client.pay(checkout: CheckoutRequest,  paymentDelegate: PaymentDelegate,  viewDelegate: ViewDelegate) 


ParameterDescription
checkoutHolds the checkout details.
paymentDelegateDelegate that will be called on payment success, cancellation or error.
viewDelegateDelegate that will be called when QR code is generated.

When the user completes the payment, the delegate will be called by Firebase. If for some reason Firebase was unable to deliver the message, you will have to check the status of the checkout manually

Check payment status

To check the status manually, call  paymentStatus.

client.paymentStatus(referenceId: String,  paymentDelegate: PaymentDelegate) 


ParameterDescription
referenceIdHolds the checkout details.
paymentDelegateThe reference id used while submitting the checkout.

Using the SDK

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


Last Updated  November 6, 2019