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 #
- PaySky should provide you by merchant id and Terminal id & Secret ID
- COCOPODS installed on your machine.
- Xcode
- Create new IOS project in xcode to use SDK or if you have created a project before with swit
Installing #
- Open your xcode project.
- in your project in Podfile in project level add :-
pod ‘PayButton’, :git => ‘https://github.com/payskyCompany/payButtonIOS.git‘ - Sync your project.(pod install)
- 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.
- Create a new instance from PayButton:-
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
Example:-
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.
Example:-
Deployment #
- Before deploy your project live, you should get a merchant id and terminal id from our company.
- you should keep your merchant id and terminal id secured in your project, encrypt them before save them in project.
Bulk with #
- Alamofire
- EVReflection
Authors #
PaySky Company – (https://www.paysky.io)