iPaySDK 0.9.0

iPaySDK 0.9.0

Maintained by G M Tasnim Alam.



iPaySDK 0.9.0

  • By
  • Tasnim Alam Shovon

iPaySDK

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)

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.