Skip to content

Commit

Permalink
Release 0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Tasnim Alam Shovon committed Apr 4, 2019
2 parents 72b9a48 + fc56841 commit 4198e5b
Showing 1 changed file with 75 additions and 1 deletion.
76 changes: 75 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Requirements
* iOS 9.3 and Above

## Installation

Expand All @@ -18,10 +19,83 @@ 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, shovon54@gmail.com

## License

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

0 comments on commit 4198e5b

Please sign in to comment.