Latest 0.9.0
Homepage https://github.com/ipay-systems/iPaySDK
License Apache-2.0
Platforms ios 9.0
Dependencies SVProgressHUD
Frameworks UIKit
Authors

iPay iOS SDK

Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • iOS 9.3 and Above

Installation

iPaySDK is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'iPaySDK'

Prerequisite

iPaySDK requires merchant to obtain the client_id from iPay. If your client_id is xyz then you need to add the following URL Type in your info.plist

    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>None</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>ipayxyz</string>
            </array>
        </dict>
    </array>

How to use

Setup Configuration and Initialization

iPaySDK.shared.environment = .Development //Use this for Development environment
iPaySDK.shared.configure(withClientId: "xyz")
iPaySDK.shared.delegate = self

Initiate Session

iPaySDK.shared.userInitiateSession()

Add URL Handler

Place this code in AppDelegate

func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
    return iPaySDK.shared.handleUrl(url: url)
}

Get Balance

iPaySDK.shared.getBalance { (balance) in
   DispatchQueue.main.async {
       print(balance)
   }
}

Make Payment

iPaySDK.shared.makePayment(amount: 10)

Fetch User’s Basic Info

iPaySDK.shared.getUserInfo { (model) in
    DispatchQueue.main.async {
        print("(model.name ?? "") n (model.primaryEmailAddress ?? "")")
    }
}

Check Whether SDK is already connected

if iPaySDK.shared.isAuthenticated {
    //Write your code here     
}

SDK Delegate: Use these delegate to handle callbacks and show appropriate results to improve user experience.

func oauthDidSuccess()
func oauthDidFail() 
func paymentDidSuccess()
func paymentDidFail()

Author

Tasnim Alam Shovon, [email protected]

License

iPaySDK is available under the Apache-2.0. See the LICENSE file for more info.

Latest podspec

{
    "name": "iPaySDK",
    "version": "0.9.0",
    "summary": "A framework for connecting with iPay and smooth payment experience.",
    "description": "This library is for easy iPay integration in third party application. With this library third party app can connect with iPay and make payments easily.",
    "homepage": "https://github.com/ipay-systems/iPaySDK",
    "license": {
        "type": "Apache-2.0",
        "file": "LICENSE"
    },
    "authors": {
        "Tasnim Alam Shovon": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/ipay-systems/iPaySDK.git",
        "tag": "0.9.0"
    },
    "source_files": "iPaySDK/Classes/**/*",
    "swift_version": "4.2",
    "frameworks": "UIKit",
    "dependencies": {
        "SVProgressHUD": []
    }
}

Pin It on Pinterest

Share This