All Projects → Sbanken → sbankenclient-ios

Sbanken / sbankenclient-ios

Licence: MIT license
A small but enjoyable iOS framework to connect to the Sbanken API

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to sbankenclient-ios

bankster
Money Creation Made Easy
Stars: ✭ 30 (+42.86%)
Mutual labels:  financial, banking
ebics-java-client
Java open source EBICS client - Support for French, German and Swiss banks
Stars: ✭ 30 (+42.86%)
Mutual labels:  api-client, banking
psd2
API client for banks supporting PSD2 APIs with OAuth2 authentication.
Stars: ✭ 26 (+23.81%)
Mutual labels:  api-client, banking
Australian-Open-Banking-Data-Database
This is an ongoing collection of Open Banking Data APIs for Australian deposit taking institutions.
Stars: ✭ 72 (+242.86%)
Mutual labels:  financial, banking
AlphaVantage.Net
.Net client library for Alpha Vantage API
Stars: ✭ 65 (+209.52%)
Mutual labels:  api-client
bitmex-client-websocket
🛠️ C# client for Bitmex websocket API
Stars: ✭ 60 (+185.71%)
Mutual labels:  api-client
vsphere-automation-sdk-.net
[DEPRECATED] Please see README. C# samples, language bindings, and API reference documentation for vSphere, VMC, and NSX-T using the VMware REST API
Stars: ✭ 67 (+219.05%)
Mutual labels:  api-client
go-opendota
Go client library for accessing the OpenDota API
Stars: ✭ 34 (+61.9%)
Mutual labels:  api-client
servicenow
A golang client for ServiceNow
Stars: ✭ 16 (-23.81%)
Mutual labels:  api-client
adyen-python-api-library
Adyen API Library for Python
Stars: ✭ 41 (+95.24%)
Mutual labels:  api-client
clickupython
A client for working with the ClickUp API V2
Stars: ✭ 30 (+42.86%)
Mutual labels:  api-client
zoho-crm-php
An API wrapper library for Zoho CRM, written in PHP.
Stars: ✭ 15 (-28.57%)
Mutual labels:  api-client
CoordinatorSwiftUI
A simple project to test the implementation of Coordinator Pattern using SwiftUI.
Stars: ✭ 28 (+33.33%)
Mutual labels:  watchos
pyinaturalist
Python client for iNaturalist
Stars: ✭ 68 (+223.81%)
Mutual labels:  api-client
AutoMeter-API
AutoMeter-API是一款针对分布式服务,微服务API功能和性能一体的自动化测试平台,一站式解决应用,服务,API,环境管理,用例,条件,测试场景,计划,测试报告,功能/性能测试兼容支持的一体化工作平台
Stars: ✭ 105 (+400%)
Mutual labels:  api-client
yllet
Yllet is a set of packages for the WordPress API for both React and non-React projects
Stars: ✭ 46 (+119.05%)
Mutual labels:  api-client
Yandex.Music.Api
Client Yandex.Music.Api for Yandex.Music
Stars: ✭ 53 (+152.38%)
Mutual labels:  api-client
lpconnector
Python client for syncing LastPass Enterprise with a remote directory over LDAP
Stars: ✭ 14 (-33.33%)
Mutual labels:  api-client
CoinGecko
A C++20 library for CoinGecko--a cryptocurrency data service.
Stars: ✭ 69 (+228.57%)
Mutual labels:  api-client
python-sonarqube-api
Python wrapper for the SonarQube (Community Edition and Enterprise Edition) and SonarCloud API.
Stars: ✭ 107 (+409.52%)
Mutual labels:  api-client

SbankenClient.framework

An iOS framework to use the Sbanken API.

The framework is offered as an example of API usage from Swift, as well as a tool for quickly being able to create working iOS prototypes using the API.

Installation

Using Carthage

The easiest way to get up and running is to add the framework using the dependency manager Carthage.

After installing Carthage, add the following to your Cartfile:

github "Sbanken/sbankenclient-ios"

Run carthage update to build the dependencies.

Drag SbankenClient.framework from the Carthage/Build/iOS/ directory to the Linked Frameworks and Libraries section of your Xcode project’s General settings.

Add $(SRCROOT)/Carthage/Build/iOS/SbankenClient.framework to the Input Files of your Carthage copy-frameworks build step as well as $(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/SbankenClient.framework to the Output Files.

Manual installation

This describes setting up a new simple app and including SbankenClient.framework.

Clone this repository.

Create a new Workspace in Xcode (File -> New -> Workspace...).

Drag SbankenClient.xcodeproj into the left hand navigator of your new workspace:

Framework included in workspace

Add a new app project to your workspace by navigating to File -> New -> Project..., selecting for instance a Single View App. Name your project, and in the file dialog, make sure your new app is added to your workspace:

Add app project to workspace

Lastly, select your new app project inside your workspace and drag SbankenClient.framework into the Embedded Binaries area of the project info view:

Embedded framework in app

Usage

Run a build of your Xcode project or workspace before attempting to use the framework, and remember to import SbankenClient in every Swift file you want to use the client from.

Create a new client by using your Client ID and Secret:

let client = SbankenClient(clientId: "MY-CLIENT-ID", secret: "MY-SECRET")

(Sign up for API access if you don't have these)

Let this client object live for as long as possible. It will handle caching of the access token.

Getting accounts

client.accounts(userId: "[ELEVEN-DIGIT-ID]", success: { accounts in
    let acccountName = accounts.first?.name
    let availableAmount = accounts.first?.available
}) { _ in
    print "An error occurred"
}

Getting transactions from an account

let oneWeekAgo = Calendar.current.date(byAdding: .day, value: -7, to: Date())!
client.transactions(userId: "[ELEVEN-DIGIT-ID]", accountNumber: "[ACCOUNT-NUMBER]",
                    startDate: oneWeekAgo, endDate: Date(),
                    success: { response in
    let accountNumber = response.items.first?.accountNumber
    let amount = response.items.first?.amount
}, failure: { _ in
    print("An error occurred")
})

Transferring an amount between two accounts within Sbanken

client.transfer(userId: "[ELEVEN-DIGIT-ID]", fromAccount: "[ACCOUNT-NUMBER]", toAccount: "[ACCOUNT-NUMBER]",
                message: "Here, have some money", amount: 100.0,
                success: { response in
                    if (!response.isError) {
                        print("Transfer successful")
                    }
}, failure: { _ in
    print("An error occurred")
})

License

The MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].