Skip to content

Commit

Permalink
docs(GiniHealthSDK): Update Event Tracking guide and Testing guide
Browse files Browse the repository at this point in the history
IPC-218
  • Loading branch information
zladzeyka committed Mar 27, 2024
1 parent 12ea5fe commit 878f0b9
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 12 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ Event Tracking
The Gini Health SDK has the ability to track user events. In order to receive the events, implement the `GiniHealthTrackingDelegate` protocol and supply the delegate when initializing `PaymentReviewViewController`. For example:

```swift
let viewController = PaymentReviewViewController.instantiate(with: self.health,
document: document,
extractions: extractions,
trackingDelegate: self)
let viewController = paymentComponentsController.loadPaymentReviewScreenFor(documentID: documentId,
trackingDelegate: self)
```

## Events
Expand Down
49 changes: 41 additions & 8 deletions HealthSDK/GiniHealthSDK/Documentation/source/Testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,66 @@ An example banking app is available in the [Gini Mobile Monorepo iOS](https://gi
In order to test using our example banking app you need to use development client credentials. This will make sure
the Gini Health SDK uses a test payment provider which will open our example banking app. To inject your API credentials into the Bank example app you need to fill in your credentials in [Credentials.plist](https://github.com/gini/gini-mobile-ios/blob/main/BankSDK/GiniBankSDKExample/GiniBankSDKExampleBank/Credentials.plist).

#### End to end testing
### End to end testing

The app scheme in our banking example app: `ginipay-bank://`. Please, specify this scheme `LSApplicationQueriesSchemes` in your app in `Info.plist` file.

After you've set the client credentials in the example banking app and installed it on your device you can run your app
and verify that `healthSDK.isAnyBankingAppInstalled(appSchemes: [String])` returns true and check other preconditions.
After you've set the client credentials in the example banking app and installed it on your device you can run your app.

After following the integration steps above you'll arrive at the payment review screen.
#### Payment component

After following the integration steps above you'll arrive at the `Invoice list screen` which already has integrated the `Payment Component`.
The following screenshot shows a sample list of invoices where the `PaymentComponent` is shown for each invoice.

<br>
<center><img src="img/Integration guide/InvoiceListWithPaymentComponent.png" height="500"/></center>
</br>

#### Bank Selection Bottom sheet

You should see the `Gini-Test-Payment-Provider` preselected in every payment component view. By clicking the picker you should see the `BankSelectionBottomSheet` with the list of available banking apps (including Gini-Test-Payment-Provider and other testing and production apps)

<br>
<center><img src="img/Integration guide/BankSelectionBottomSheet.png" height="500"/></center>
</br>

#### More information and FAQ

By clicking either the more information or the info icon on the payment component view you should see the Payment feature Info screen with information about the payment feature and an FAQ section.

<br>
<center><img src="img/Integration guide/PaymentFeatureInformationScreen.png" height="500"/></center>
</br>

#### Payment Review

By clicking the `Pay the invoice` button on a payment component view you should see the ReviewFragment, which shows the invoice's pages and the payment information. It also allows editing the payment information. The `To the banking app` button should have the icon and colors of the banking app, which was selected in the payment component view.

Check that the extractions and the document preview are shown and then press the `Pay` button:

<br>
<center><img src="img/Customization guide/PaymentReview.PNG" height="500"/></center>
<center><img src="img/Integration guide/PaymentReviewScreen.png" height="500"/></center>
</br>

#### Execute payment

When clicking the `To the banking app` button on the payment review you should be redirected to the example banking app where the payment information will be fetched from Gini (including any changes you made on the payment review). Press the "Pay" button to execute a test payment which will mark the payment as paid in the [Gini Health API](https://health-api.gini.net/documentation/#gini-health-api-documentation).
You should be redirected to the example banking app where the final extractions are shown:

<br>
<center><img src="img/Integration guide/ReviewScreenBeforeResolvingPayment.PNG" height="500"/></center>
<center><img src="img/Integration guide/ReviewScreenBeforeResolvingPayment.png" height="500"/></center>
</br>

After you press the `Pay` button the Gini Bank SDK resolves the payment and allows you to return to your app:

<br>
<center><img src="img/Integration guide/ReviewScreenAfterResolvingPayment.PNG" height="500"/></center>
<center><img src="img/Integration guide/ReviewScreenAfterResolvingPayment.png" height="500"/></center>
</br>

#### Return to your app

After the test payment has been executed, the example banking app should show a "Return to Business" button which should take you back to your app.

For handling incoming url in your app after redirecting back from the banking app you need to implement to handle the incoming url:
The following is an example for the url `gini-pay://payment-requester`:

Expand All @@ -63,7 +96,7 @@ The following is an example for the url `gini-pay://payment-requester`:
With these steps completed you have verified that your app, the Gini Health API, the Gini Health SDK and the Gini
Bank SDK work together correctly.

#### Testing in production
### Testing in production

The steps are the same but instead of the development client credentials you will need to use production client
credentials. This will make sure the Gini Health SDK receives real payment providers which open real banking apps.
Expand Down

0 comments on commit 878f0b9

Please sign in to comment.