PaySky Button SDK – iOS #

Purpose of Document #

The purpose of this SDK to help programmers to use PaySky payment SDK for IOS.

Getting Started #

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes

Prerequisites #

  1. PaySky should provide you by merchant id and Terminal id & Secret ID
  2. COCOPODS installed on your machine.
  3. Xcode
  4. Create new IOS project in xcode to use SDK or if you have created a project before with swit

Installing #

  1. Open your xcode project.
  2. in your project in Podfile in project level add :-
    pod ‘PayButton’, :git => ‘
  3. Sync your project.(pod install)
  4. import PayButton
    • Create a new instance from PayButton:-
      • Let paymentViewController = PaymentViewController ()
    • You need to just pass some parameters to PayButton class instance :-
      • isProduction
      • Merchat id
      • Terminal id.
      • Payment amount
      • Currency code [Optional]
      • merchant secure hash
      • transaction Reference Number.

Note That:-

  • you should keep your secret key and merchant id and terminal id with encryption before save them in storage if you want.
  • You need to set “isProduction” = true if you want to go live


paymentViewController.amount = “amount” // Amount
paymentViewController.delegate = self // PaymentDelegate
paymentViewController.mId = “merchantId” // Merchant id
paymentViewController.tId = “terminalId” // Terminal id
paymentViewController.isProduction = false // set it true if you want to go live
paymentViewController.Currency = “currencyCode” // Currency Code [Optional]
paymentViewController.refnumber = “reference number”” // unique transaction
reference number.
paymentViewController.Key = “Merchant secure hash”

in order to create transaction call back in deleget PaymentDelegate:-

implete deleget on your ViewController
class ViewController: UIViewController, PaymentDelegate {
func finishSdkPayment(_ receipt: TransactionStatusResponse) {

Creating transaction using sdk #

To create transaction in our sdk you just need to call create Transaction method and pass to it Payment Transaction Callback listener to call it after transaction.

This listener has 2 methods:-

Finish Sdk Payment Method – Card #

This method called in case transaction success by card payment with Successful Card Transaction object.

Successful Card Transaction object from create transaction listener contains:-

  • Network Reference variable that is reference number of transaction.
  • AuthCode variable Action Code variable.
  • Receipt Number variable.
  • Amount variable.
Finish Sdk Payment Method – Wallet #

This method is called if customer make a wallet transaction with Successful Wallet Transaction object.

Successful Wallet Transaction object from create transaction listener contains:-

  • Network Reference variable that is reference number of transaction.
  • Amount variable.


func finishSdkPayment(_ receipt: TransactionStatusResponse) {
if receipt.Success // will be true if transaction success
print(receipt.Message) // resonse of error

Deployment #

  1. Before deploy your project live, you should get a merchant id and terminal id from our company.
  2. you should keep your merchant id and terminal id secured in your project, encrypt them before save them in project.

Bulk with #

  1. Alamofire
  2. EVReflection

Authors #

PaySky Company – (

Powered by BetterDocs