Univapay API Swift SDK
Requirements
The Univapay API Swift SDK is compatible with iOS apps supporting iOS 10.1 and above. It requires Xcode 8.0+ to build the source.
Installation
-
If you haven't already, install the latest version of CocoaPods.
-
Add the following line to your Podfile:
pod "Univapay"
-
Run the following command:
pod install
-
Don't forget to use the .xcworkspace file to open your project in Xcode, instead of the .xcodeproj file, from here on out.
-
In the future, to update to the latest version of the SDK, just run:
pod update Univapay
Getting Started
Configuring your app to use our SDK
-
Add the following to your list of imports:
import UnivapayAPI
-
Create an instance of the API client. You must specify the API endpoint to connect to and the origin header to use when making requests, and can optionally specify an App ID and secret to use when making requests.
let sdk: UnivapayAPIClient = UnivapayAPIClient(options: UnivapayAPIOptions(endpoint: "http://localhost:9000", origin: "http://localhost:9000", apiId: "APPTOKEN", secret: "APPTOKENSECRET"))
-
Start using the API client to manage your transactions. Every request made through the SDK will return a
Promise
from PromiseKit.Example: Get a list of stores
let data: StoreListRequestData = StoreListRequestData(search: "test") sdk.storeResource.list(data: data).done { stores in print(stores.items) })
For more information please check out our full reference guide.
Author
UNIVA Paycast
License
Univapay is available under the MIT license. See the LICENSE file for more info.