Skip to content

Commit

Permalink
Release version 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Team Mobile Schorsch committed Feb 11, 2022
1 parent d5f48fb commit cd9eb89
Show file tree
Hide file tree
Showing 28 changed files with 59 additions and 371 deletions.
2 changes: 1 addition & 1 deletion .jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ xcodebuild_arguments:
author: Gini GmbH
author_url: https://gini.net
module: GiniBankAPILibrary
readme: README.md
readme: Documentation/Sections/Documentation.md
theme: Documentation/jazzy-theme/
output: Documentation/Api
github_url: https://github.com/gini/gini-mobile-ios.git
Expand Down
Binary file modified Documentation/jazzy-theme/assets/img/GiniBank_Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Documentation/jazzy-theme/assets/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Documentation/jazzy-theme/assets/img/repo-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 21 additions & 2 deletions Documentation/sections/Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,25 @@
[![Swift package manager](https://img.shields.io/badge/Swift_Package_Manager-compatible-orange?style=flat-square)]()


The Gini Bank API Library provides components for uploading, reviewing and analyzing photos of invoices and remittance slips.
The Gini Bank API Library for iOS encapsulates the Gini Bank API to allow you to easily integrate it into your app.

By integrating this library into your application you can allow your users to easily upload a picture of a document, review it and get analysis results from the Gini backend, create a payment and send it to the prefferable payment provider.
The Gini Bank API provides an information extraction service for analyzing Bank invoices. Specifically, it extracts information such as the document sender or the payment relevant information (amount to pay, IBAN, etc.). In addition it also provides a secure channel for sharing payment related information between clients.

## Documentation

Further documentation with information about how install and integrate it can be found in our [website](https://developer.gini.net/gini-mobile-ios/GiniBankAPILibrary/index.html).

## Requirements

- iOS 11+
- Xcode 12+

## Author

Gini GmbH, hello@gini.net

## License

The Gini Bank API Library for iOS is licensed under a Private License. See [the license](https://developer.gini.net/gini-mobile-ios/GiniBankAPILibrary/license.html) for more info.

**Important:** Always make sure to ship all license notices and permissions with your application.
17 changes: 15 additions & 2 deletions Documentation/source/Getting started.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The token your provide will be added as a bearer token to all api.custom.net req

## Public Key Pinning

If you want to use _Certificate pinning_, provide metadata for the upload process, you can pass both your public key pinning configuration (see [TrustKit repo](https://github.com/datatheorem/TrustKit) for more information), the metadata information (the [Gini Bank API](http://developer.gini.net/gini-api/html/index.html) is used by default) as follows:
If you want to use _Certificate pinning_, provide metadata for the upload process, you can pass both your public key pinning configuration (see [TrustKit repo](https://github.com/datatheorem/TrustKit) for more information), the metadata information (the [Gini Bank API](https://developer.gini.net/gini-api/html/index.html) is used by default) as follows:

```swift
let yourPublicPinningConfig = [
Expand Down Expand Up @@ -58,6 +58,19 @@ If you want to use _Certificate pinning_, provide metadata for the upload proces
pinningConfig: yourPublicPinningConfig)
.build()
```

For customizing an API domain please, use the following snippet:

```swift
let giniBankAPI = GiniBankAPI
.Builder(client: Client(id: "your-id",
secret: "your-secret",
domain: "your-domain"),
api: .custom(domain: "custom-api.net"),
pinningConfig: yourPublicPinningConfig)
.build()
```

> ⚠️ **Important**
> - The document metadata for the upload process is intended to be used for reporting.
Expand Down Expand Up @@ -205,4 +218,4 @@ All errors that occur during request execution are handed over transparently. Yo
let paymentService: PaymentService = giniBankAPI.paymentService()
```

You can start using the Gini Pay Connect through the `paymentService`.
You can start using the Gini Pay Connect through the `paymentService`.
6 changes: 3 additions & 3 deletions Documentation/source/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ Once you have your Swift package set up, adding `GiniBankAPILibrary` as a depend

```swift
dependencies: [
.package(url: "https://github.com/gini/bank-api-library-ios.git", .exact("1.0.0"))
.package(url: "https://github.com/gini/bank-api-library-ios.git", .exact("1.1.0"))
]
```

In case that you want to use the certificate pinning in the library, add `GiniBankAPILibraryPinning`:
```swift
dependencies: [
.package(url: "https://github.com/gini/bank-api-library-pinning-ios.git", .exact("1.0.0"))
.package(url: "https://github.com/gini/bank-api-library-pinning-ios.git", .exact("1.1.0"))
]
```

## Manually

If you prefer not to use a dependency management tool, you can integrate the Gini Bank API Library into your project manually.
To do so drop the GiniBankAPILibrary (classes and assets) folder into your project and add the files to your target.
To do so drop the [GiniBankAPILibrary](https://github.com/gini/gini-mobile-ios/tree/main/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary) (classes and assets) folder into your project and add the files to your target.

Xcode will automatically check your project for swift files and will create an autogenerated import header for you.
Use this header in an Objective-C project by adding
Expand Down
4 changes: 2 additions & 2 deletions Documentation/source/License.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Always make sure to ship all license notices and permissions with your applicati

## The Gini Bank API Library for iOS is licensed under a Private License.

Copyright (c) 2014-2021, Gini GmbH
Copyright (c) 2014-2022, Gini GmbH
All rights reserved.

The Gini Bank API Library is licensed through Gini GmbH ("Gini") and may not be
Expand All @@ -20,7 +20,7 @@ Always make sure to ship all license notices and permissions with your applicati

## The Gini Bank API Library Pinning for iOS is licensed under a Private License.

Copyright (c) 2014-2021, Gini GmbH
Copyright (c) 2014-2022, Gini GmbH
All rights reserved.

The Gini Bank API Library Pinning is licensed through Gini GmbH ("Gini") and may not be
Expand Down
Binary file modified GiniBank_Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img src="./Documentation/jazzy-theme/assets/img/logo.png" width="250">
<img src="./GiniBank_Logo.png" width="250">
</p>

# Gini Bank API Library for iOS
Expand Down
3 changes: 0 additions & 3 deletions Sources/GiniBankAPILibrary/Documents/APIMethod.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ enum APIMethod: ResourceMethod {
case page(forDocumentId: String, number: Int, size: Document.Page.Size?)
case pagePreview(forDocumentId: String, number: Int)
case processedDocument(withId: String)
case paymentProvider(id: String)
case paymentProviders
case createPaymentRequest
case paymentRequest(id: String)
case paymentRequests(limit: Int?, offset: Int?)
case resolvePaymentRequest(id: String)
Expand Down
10 changes: 2 additions & 8 deletions Sources/GiniBankAPILibrary/Documents/APIResource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,6 @@ struct APIResource<T: Decodable>: Resource {
return "/documents/partial"
case .processedDocument(let id):
return "/documents/\(id)/processed"
case .paymentProviders:
return "/paymentProviders"
case .paymentProvider(let id):
return "/paymentProviders/\(id)"
case .createPaymentRequest:
return "/paymentRequests"
case .paymentRequest(let id):
return "/paymentRequests/\(id)"
case .paymentRequests(_, _):
Expand All @@ -136,7 +130,7 @@ struct APIResource<T: Decodable>: Resource {
]
case .page, .pagePreview(_, _):
return [:]
case .paymentProviders, .paymentProvider(_), .paymentRequests(_, _) :
case .paymentRequests(_, _) :
return ["Accept": ContentType.content(version: apiVersion,
subtype: nil,
mimeSubtype: "json").value]
Expand Down Expand Up @@ -167,7 +161,7 @@ struct APIResource<T: Decodable>: Resource {
guard ResponseType.self != String.self else {
let string: String?
switch method {
case .createDocument, .createPaymentRequest:
case .createDocument:
string = response.allHeaderFields["Location"] as? String
default:
string = String(data: data, encoding: .utf8)
Expand Down
12 changes: 6 additions & 6 deletions Sources/GiniBankAPILibrary/Documents/Extraction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation
/**
* Data model for a document extraction.
*/
@objcMembers final public class Extraction: NSObject {
@objcMembers final public class Extraction: NSObject, Decodable {

/// The extraction's box. Only available for some extractions.
public let box: Box?
Expand All @@ -24,7 +24,7 @@ import Foundation
public var name: String?

/// The extraction's box attributes.
@objcMembers final public class Box: NSObject {
@objcMembers final public class Box: NSObject, Decodable {
public let height: Double
public let left: Double
public let page: Int
Expand All @@ -41,7 +41,7 @@ import Foundation
}

/// A extraction candidate, containing a box, an entity and a its value.
@objcMembers final public class Candidate: NSObject {
@objcMembers final public class Candidate: NSObject, Decodable {
public let box: Box?
public let entity: String
public let value: String
Expand All @@ -65,9 +65,9 @@ import Foundation

// MARK: - Decodable

extension Extraction: Decodable {}
extension Extraction.Box: Decodable {}
extension Extraction.Candidate: Decodable {}
//extension Extraction: Decodable {}
//extension Extraction.Box: Decodable {}
//extension Extraction.Candidate: Decodable {}

// MARK: - isEqual

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import Foundation
Struct for payment request response
*/
public struct PaymentRequest: Codable {
public var paymentProvider: String
public var requesterURI: String?
public var iban: String
public var bic: String?
Expand All @@ -19,7 +18,6 @@ public struct PaymentRequest: Codable {
var links: Links?

enum CodingKeys: String, CodingKey {
case paymentProvider
case requesterURI = "requesterUri"
case iban, bic, amount, purpose, recipient, createdAt, status
case links = "_links"
Expand All @@ -30,12 +28,12 @@ public struct PaymentRequest: Codable {
Struct for links in payment request response
*/
public struct Links: Codable {
var linksSelf, paymentProvider: String
var linksSelf: String?
var payment: String?

enum CodingKeys: String, CodingKey {
case linksSelf = "self"
case paymentProvider, payment
case payment
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Foundation
*/
struct PaymentRequestBody: Codable {
var sourceDocumentLocation: String?
var paymentProvider,recipient, iban: String
var recipient, iban: String
var bic: String?
var amount, purpose: String

Expand All @@ -20,7 +20,6 @@ struct PaymentRequestBody: Codable {
if let sourceDocumentLocationString = sourceDocumentLocation {
try container.encode(sourceDocumentLocationString, forKey: .sourceDocumentLocation)
}
try container.encode(paymentProvider, forKey: .paymentProvider)
try container.encode(recipient, forKey: .recipient)
try container.encode(iban, forKey: .iban)
if let bicString = bic {
Expand Down
Loading

0 comments on commit cd9eb89

Please sign in to comment.