Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(GiniHealthSDK): Pay invoice to new payment review screen IPC-133 #461

Merged
merged 36 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
f092665
wip(GiniHealthSDK): Adds paymentScreenBackgroundColor and inputFields…
zladzeyka Feb 23, 2024
a58f91c
feat(GiniHealthSDK): Removes granular colour customisation option fro…
zladzeyka Feb 26, 2024
58fdc5c
feat(GiniHealthSDK): Introduces `TextFieldConfiguration`
zladzeyka Feb 26, 2024
8eeff9f
feat(GiniHealthSDK): Adds configuration styles for the input fields
zladzeyka Feb 28, 2024
1627885
refactor(GiniHealthSDK): Removes old Bank Selection Screen and its co…
zladzeyka Mar 1, 2024
4a4d5a3
Merge branch 'IPC-156-pay-invoice-button' into IPC-153_payment_review…
zladzeyka Mar 4, 2024
43628f0
refactor(GiniHealthSDK): Removes bankProviderView, updates default f…
zladzeyka Mar 5, 2024
3a6f272
feat(GiniHealtSDK: Payment review screen pay button update
razvancapra Mar 6, 2024
89d8789
feat(GiniHealthSDK): Payment Review Screen textfields replaced with t…
razvancapra Mar 6, 2024
ba09b76
feat(GiniHealthSDK): Add powered by Gini on Payment Review Screen
razvancapra Mar 6, 2024
83c5b8e
feat(GiniHealthSDK): Fix Payment review pay invoice button disabled s…
razvancapra Mar 6, 2024
8eb9ce6
Merge branch 'IPC-162-more-information-screen' into IPC-153_payment_r…
razvancapra Mar 6, 2024
61c7ba6
fix(GiniHealthSDK): Fix default font after cleanup
razvancapra Mar 6, 2024
999fd72
refactor(GiniHealthSDK): Set documentIds on the Payment Component Vie…
a-szotyori Mar 6, 2024
32432ef
fix(GiniHealthSDKExample): Show close button on the Payment Review Sc…
a-szotyori Mar 6, 2024
7a4b200
Merge branch 'IPC-162-more-information-screen' into IPC-153_payment_r…
razvancapra Mar 7, 2024
eb8794f
Merge branch 'IPC-162-more-information-screen' into IPC-153_payment_r…
razvancapra Mar 8, 2024
ac5f212
fix(GiniHealthSDK): Fix payment review input container background color
razvancapra Mar 8, 2024
f78e4c7
Merge branch 'IPC-162-more-information-screen' into IPC-153_payment_r…
razvancapra Mar 11, 2024
6563914
fix(GiniHealthSDK): PaymentReviewScreen move constants to Constants enum
razvancapra Mar 11, 2024
96d3913
fix(GiniHealthSDK): Move extension files to Extensions folder
razvancapra Mar 11, 2024
bdb412b
fix(GiniHealthSDK): Remove GiniDocument protocol
razvancapra Mar 11, 2024
e5aff55
fix(GiniHealthSDKExample): Handle Start with Gini Capture flow withou…
razvancapra Mar 12, 2024
6a68da7
fix(GiniHealthSDK): Fix Gini Capture and Fix GIni with test document …
razvancapra Mar 18, 2024
2df0a32
Merge branch 'IPC-162-more-information-screen' into IPC-153_payment_r…
razvancapra Mar 18, 2024
4d98b15
fix(GiniHealtSDK): Fix info bar appearance multiple times
razvancapra Mar 18, 2024
7f7bf42
Merge branch 'IPC-162-more-information-screen' into IPC-153_payment_r…
razvancapra Mar 19, 2024
8ed475b
fix(GiniHealthSDK): Remove check of any banks installed
razvancapra Mar 19, 2024
4c05c26
fix(GiniHealthSDK): Fix Health SDK in English Language
razvancapra Mar 19, 2024
d522d4d
Merge branch 'IPC-162-more-information-screen' into IPC-153_payment_r…
razvancapra Mar 19, 2024
86ec1c3
Merge branch 'IPC-167_remove_requirements_check_health_sdk' into IPC-…
razvancapra Mar 19, 2024
46df54f
fix(GiniHealthSDK): Fix colors on GiniHealthSDK
razvancapra Mar 19, 2024
cd33d12
Merge branch 'ipc-health-sdk-update' into IPC-153_payment_review_screen
razvancapra Mar 19, 2024
c06813c
fix(GiniHealthSDK): Fix localizable and clean unused langs
razvancapra Mar 19, 2024
afba876
fix client privacy policy link
razvancapra Mar 20, 2024
d69ccd6
fix(GiniHealthSDK): Fix localize string for Payment Info questions
razvancapra Mar 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 5 additions & 25 deletions HealthSDK/GiniHealthSDK/Documentation/source/Integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,8 @@ let partialDocs = [PartialDocumentInfo(document: createdDocument.links.document)

## Check preconditions

There are three methods in GiniHealth:
There is a method in GiniHealth:

* `healthSDK.isAnyBankingAppInstalled(appSchemes: [String])` without a networking call, returns true when at least the one of the listed among `LSApplicationQueriesSchemes` in your `Info.plist` is installed on the device and can support Gini Pay functionality,
* `healthSDK.checkIfAnyPaymentProviderAvailable()` with a networking call, returns a list of availible payment provider or informs that there are no supported banking apps installed,
* `healthSDK.checkIfDocumentIsPayable(docId: String)` returns true if Iban was extracted.

## Fetching data for payment review screen
Expand Down Expand Up @@ -126,25 +124,7 @@ Payment component looks like this:
let paymentComponentsController = PaymentComponentsController(giniHealth: health)
```

#### 2. Pass the `paymentComponentsController` to the invoices/documents controller.
You should have a list of invoices/documents that confirm the `GiniDocument` protocol.

```swift
public protocol GiniDocument {
/// The document's unique identifier.
var documentID: String { get set }
/// The document's amount to pay.
var amountToPay: String? { get set }
/// The document's payment due date.
var paymentDueDate: String? { get set }
/// The document's recipient name.
var recipient: String? { get set }
/// Boolean value that indicates if the document is payable. This is obtained by calling the checkIfDocumentIsPayable method.
var isPayable: Bool? { get set }
}
```

#### 3. For each invoice/document, you need to call the `checkIfDocumentIsPayable` function from the `PaymentComponentsController` and store the value for each invoice in the `isPayable` field.
#### 2. For each invoice/document, you need to call the `checkIfDocumentIsPayable` function from the `PaymentComponentsController` and store the value for each invoice in the `isPayable` field.

```swift
public func checkIfDocumentIsPayable(docId: String, completion: @escaping (Result<Bool, GiniHealthError>) -> Void)
Expand All @@ -167,12 +147,12 @@ dispatchGroup.notify(queue: .main) {
}
```

#### 4. You have to load the payment providers by calling the `loadPaymentProviders` function from the `PaymentComponentsController` and listen to the `PaymentComponentsControllerProtocol`.
#### 3. You have to load the payment providers by calling the `loadPaymentProviders` function from the `PaymentComponentsController` and listen to the `PaymentComponentsControllerProtocol`.

> - We effectively handle situations where there are no payment providers available.
> - Based on the payment provider's colors, the `UIView` will automatically change its color.

#### 5. Depending on the value of `isPayable`, incorporate the corresponding payment component view into your cells using this function:
#### 4. Depending on the value of `isPayable`, incorporate the corresponding payment component view into your cells using this function:

```swift
public func paymentView(paymentProvider: PaymentProvider?) -> UIView
Expand All @@ -181,7 +161,7 @@ public func paymentView(paymentProvider: PaymentProvider?) -> UIView
> - We suggest placing this `UIView` within a vertical `UIStackView`. Additionally, in the `prepareForReuse()` function of each cell, remove the payment component view if it exists.
> - Furthermore, employing automatic dimension height in the `UITableView` containing the cells is recommended.

#### 6. `PaymentComponentsController` has 2 delegates that you can listen to: `PaymentComponentsControllerProtocol` and the `PaymentComponentViewProtocol`
#### 5. `PaymentComponentsController` has 2 delegates that you can listen to: `PaymentComponentsControllerProtocol` and the `PaymentComponentViewProtocol`

* `PaymentComponentsControllerProtocol` provides information when the `PaymentComponentsController` is loading. You can show/hide an `UIActivityIndicator` based on that.
* `PaymentComponentsControllerProtocol` provides completion handlers when `PaymentComponentsController` fetched successfully payment providers or when it failed with an error.
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,15 @@ extension String {
return false
}
}

public extension String {
var numberValue: NSNumber? {
let formatter = NumberFormatter()
formatter.numberStyle = .decimal
return formatter.number(from: self)
}

static func rgbaHexFrom(rgbHex: String) -> String {
return "#\(rgbHex)FF"
}
}
Loading
Loading