Getting Started

دعم تكامل Paymennt

IOS SDK


PointCheckout Merchant SDK

These are the minimum required steps to use the PointCheckout SDK in your IOS app.

Getting started

  • Add PointCheckoutSdk pod to your podfile: pod 'PointCheckoutSdk', :git => 'git@github.com:pointcheckout/merchant-ios-sdk.git', :tag=> v${version}

replace ${version} with the latest version of the SDK, you can check all available versions here, example: pod 'PointCheckoutSdk', :git => 'git@github.com:pointcheckout/merchant-ios-sdk.git', :tag=> v1.1

  • Execute pod install inside the project directory.
  • Re-build the project.

Using the SDK

Import

You can import the framework using import PointCheckoutSdk

Checkout request

Send new checkout request to PointCheckout's API using endpoint /mer/v1.2/checkouts (check the documentation for more details). The SDK needs two variables:

VariableMandatoryDescription
redirectUrlYesWill be returned in the response body of the checkout request. This is the URL to the payment page of PointCheckout. The SDK accepts only PointCheckout URLs.
resultUrlNoThis is where you normally redirect the user on payment success or failure, for instance to mark the order as paid on payment success.

Payment submit

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

PointCheckoutClient.pay(controller: viewController, redirectUrl: strRedirectUrl, resultUrl: strResultUrl, delegate: callback)
ParameterDescription
controllerA UIViewController calling the pay function
redirectUrlURL of the payment page, can be obtained from the API
resultUrlURL that PointCheckout will call upon payment success or failure
delegateDelegate that will be called on payment update or cancellation

Calling the pay function 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, 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 here. You can import the example app to xcode to see how the SDK can be used.


آخر تحديث  22 ديسمبر 2020