Setu provides ready to use URLs for iOS integration. Contact Setu to update your logo, colours, fonts as per your branding. You can reach out to firstname.lastname@example.org for any further clarifications. This quickstart page provides the sample code for the following specs—
Programming language — Swift 5.* (Latest version 5.3)
Interface — Storyboard
Life Cycle delegation — UI Kit
iOS versions supported — 12+ (Latest version 14.4)
This step gives a one time Setu URL to be used by your customer for the bill fetch or payment flow. The Create link API needs to be called when Android app wants to obtain a one time link to load Setu’s screen flow inside a webview.
None of the parameters aside from mobile number are mandatory, but depending on what is passed the returned link will display different UI.
You can have the following scenarios—
If no other input is passed, it will take the user to the home page with all BBPS categories.
If category code is passed, it will show user a list of billers in that category.
If category code and biller ID is passed, it will show the bill fetch form where a customer can enter their identifers (biller specified parameters)
If the category code, biller ID and parameters are passed, it will show the bill directly.
All query parameters should be url-encoded to escape special characters
The above request will return URL based on the input params. Here’s a sample—
The link returned by the API should be loaded within WKWebView in a ViewController which implements UIViewController, and WKScriptMessageHandler. The controller must also extend and use a custom WKNavigationDelegate class to intercept and download PDF files.
The userContentController will need to implement two functions—
initiate_payment — Used to initiate payment and transfer control from webview to iOS application
unload — Used by the parent app to dismiss the webview
This step requires setting up and sharing a webhook URL to Setu which is capable of receiving the transaction notifications. The URL to setup this webhook must be shared with Setu via email to email@example.com.
The notification consists of body an authentication header as well as a body/payload. The authentication header will be sent as X-BILL-WEBHOOK-API-KEY. The value for the same shall be communicated over email.
The following data will be sent as the payload via a POST call on the URL shared to receive the API notification. It will be triggered on completion of a transaction be it either success or failure.
The status field will contain one of the following values: