Latest 0.1.3
Homepage https://github.com/payskyCompany/payButtonIOS
License MIT
Platforms ios 11.0, requires ARC
Dependencies Alamofire, IQKeyboardManagerSwift, EVReflection, Toast-Swift, EVReflection/Alamofire, PayCardsRecognizer, PopupDialog, QRCode, InputMask, CreditCardValidator
Frameworks UIKit
Authors

PaySky Button SDK

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

What things you need to install the software and how to install them

1-COCOPODS installed on your machine   .
2-Xcode
3-Create new IOS project in xcode to use SDK or if you have created a project before with swit

Installing

A step by step that tell you how to get our SDK in your project.

1- open your xcode project.
2- in your project in Podfile in project level  add :-
pod 'PayButton'

4- Sync your project.(pod install)

### Using SDK

in order to use our SDK you should get merchant id and Terminal id from our company.

1-import PayButton
2 – create a new instance from PayButton:-

let paymentViewController = PaymentViewController ()

you need to just pass some parameters to PayButton class instance :-
1-Merchat id.
2-Terminal id.
3-Payment amount.
4-Currency code [Optional].
5-merchant secure hash.
6-transaction Reference Number.

Note That:-
you shoud keep your secure hash and merchant id and terminal id with encryption before save them in storage if you want.

Example:-

    paymentViewController.amount =  "amount"  // Amount
    paymentViewController.delegate = self // PaymentDelegate
    paymentViewController.mId = "merchantId" // Merchant id
    paymentViewController.tId = "terminalId" // Terminal  id
    paymentViewController.Currency = "currencyCode" // Currency Code [Optional]
    paymentViewController.refnumber = "reference number""  // unique transaction reference number.
    paymentViewController.Key = "Merchant secure hash"
    paymentViewController.pushViewController()

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

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

    }

}

to create transaction in our sdk you just call createTransaction method and pass to it
PaymentTransactionCallback listener to call it after transaction.
this listener has 2 methods:-

1 – finishSdkPayment method
this method called in case transaction success by card payment with SuccessfulCardTransaction object.
SuccessfulCardTransaction object from create transaction listener contains:-
NetworkReference variable that is reference number of transaction.
AuthCode variable
ActionCode variable.
ReceiptNumber variable.
amount variable.

2 – finishSdkPayment method
this method is called if customer make a wallet transaction with SuccessfulWalletTransaction object.
SuccessfulWalletTransaction object from create transaction listener contains:-
NetworkReference variable that is reference number of transaction.
amount variable.

Example:-

       func finishSdkPayment(_ receipt: TransactionStatusResponse) {
     if receipt.Success   // will be true if transaction success 
     {
      print(receipt.NetworkReference)
     }else{
      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.

## Built With

* [Alamofire](https://github.com/Alamofire/Alamofire)  
* [EVReflection](https://github.com/evermeer/EVReflection)  

## Authors

**PaySky Company** - (https://www.paysky.io)

## Sample Project
**https://github.com/payskyCompany/payButtonIOS.git**

Latest podspec

{
    "name": "PayButton",
    "version": "0.1.3",
    "summary": "PayButton",
    "description": "PayButton PayButton PayButton",
    "homepage": "https://github.com/payskyCompany/payButtonIOS",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "payskyCompany": "[email protected]"
    },
    "source": {
        "git": "https://github.com/payskyCompany/payButtonIOS.git",
        "tag": "0.1.3"
    },
    "xcconfig": {
        "APPLY_RULES_IN_COPY_FILES": "YES",
        "STRINGS_FILE_OUTPUT_ENCODING": "binary",
        "OTHER_LDFLAGS": "-lz"
    },
    "public_header_files": "PayButton/PayButton-Bridging-Header.h",
    "exclude_files": [
        "PayButton/TestApi/Base.lproj/LaunchScreen.storyboard",
        "PayButton/TestApi/Base.lproj/Main.storyboard",
        "PayButton/TestApi/ViewController.swift"
    ],
    "platforms": {
        "ios": "11.0"
    },
    "frameworks": "UIKit",
    "dependencies": {
        "Alamofire": [
            "~> 4.7.3"
        ],
        "IQKeyboardManagerSwift": [
            "~> 6.1.0"
        ],
        "EVReflection": [
            "~> 5.6.2"
        ],
        "Toast-Swift": [
            "~> 3.0.1"
        ],
        "EVReflection/Alamofire": [
            "~> 5.6.2"
        ],
        "PayCardsRecognizer": [
            "~> 1.1.4"
        ],
        "PopupDialog": [
            "~> 0.7.1"
        ],
        "QRCode": [
            "~> 2.0"
        ],
        "InputMask": [
            "~> 3.4.1"
        ],
        "CreditCardValidator": [
            "~> 0.4"
        ]
    },
    "static_framework": true,
    "requires_arc": true,
    "source_files": "PayButton/**/*.{swift,h,m}",
    "resources": "PayButton/**/*.{png,jpeg,jpg,storyboard,xib,xcassets,lproj,json,plist,strings}",
    "resource_bundles": {
        "PayButton": [
            "PayButton/Strings/*.lproj/*.strings"
        ]
    }
}

Pin It on Pinterest

Share This