Card91 Transaction List iOS Framework Integration with Native iOS Apps
Card91 Transaction iOS Framework
Card91 Transaction List iOS Framework Integration with Native iOS Apps
Description
Purpose of this document is to illustrate the method to add Card91 ‘Card91Transactions’ library to any iOS native application written in swift invoked either from a ViewController or an UIView.
Card91 Card91Transactions Framework allows developers to add the webview component into their layout as per design.
Developers need to get the view onto their UIView and through invoking the viewDidLoad method with certain required parameters mentioned below and a library for viewing the card details can be utilised.
Installation
iOS Minimum Requirements :
Deployment Target - 14.0 or above
Usage
Below steps followed to integrate the Framework
Adding the framework
Add the xcframework file provided by us by drag and drop into the project "Frameworks,Libraries, and Embedded Content’ to “Embed & Sign".
Importing the framework
Framework will be ready to use after their adding on ViewController.
Create an IBOutlet of View(xib) and assign the “TransactionsList” class to the view in the storyboard
Use this Card91Transactions framework by importing.
Make sure not to keep any background colour of the webview since it is supposed to be transparent.
Initialising the Card91Transactions Instance
Get the instance of the added Card91Transactions onto your ViewController.
As shown in the example below .
Set the Listener as given below
@IBOutlet weak var card91Transaction: TransactionsList!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
let popView = TransactionsList.instanceFromNib(self,
cardId: "*****", //Enter the cardId
token: "*****", //Enter the sdkAuthToken
env: "*****", //Enter the env
height: self.card91Transaction.frame.height, //Enter the height of the outlet
width: self.card91Transaction.frame.width, //Enter the width of the outlet
xAxis: UIScreen.main.bounds.origin.x, //Enter the origin x-Coordinates
yAxis: UIScreen.main.bounds.origin.y, //Enter the origin y-coordinates
templateId: "***") //Enter the template Id
popView.delegate = self
self.card91Transaction.addSubview(popView)
}
Input parameters
Call the init() method of the Card91ResetAtmPin with the below parameter .
Name | Type | Required | Description |
---|---|---|---|
cardId | string | true | cardId which has been received form login token service (Card91 API) |
token | string | true | Auth Token received from the Card91 APIs |
templateId | string | true | Template id by default its "xoltt" or "default" |
env | string | true | "PROD" in case of production and "PROD_SANDBOX" on sandbox environment |
height | double | true | Enter the Outlet frame height |
width | double | true | Enter the Outlet frame width |
xAxis | double | true | Enter the origin X-coordinates |
yAxis | double | true | Enter the origin Y-coordinates |
Call Back methods
Extend the protocol WebViewListener for listening to the call back event from the webview.
Interface has below and their usage.
func onPageFinished(message: String) {
print(message)
}
func onPageStarted(message: String) {
print(message)
}
func onPageError(message: String) {
print(message)
}
func onTransactionEvent(message: String) {
print(message)
}
onPageStarted is called when the webpage is loaded.
onPageFinished is called when webpage loading is finished .
onPageError is called when there is any error while loading the page.
onTransactionEvent is called when transaction is initialised, detail is show, error or success event has happened.
DIFFERENT CALLBACLK EVENTS
The events are as follows:
Event Name | Description |
---|---|
c91_TXN_SCREEN_SUCCESS | Called when the server-side APIs load data successfully. |
C91_TXN_AUTHENTICATION_FAILURE | Call back event type when client is passing incorrect or expired auth token. |
C91_TXN_MISSING_PARAMETER | Call back event type when client is not passing any required/blank parameter . |
C91_TXN_SERVER_FAILURE | Call back event type when there is server service exception with error code 500 to 599 |
C91_TXN_SCREEN_INITIALISED | Called when the transaction list is initialised. |
C91_TXN_API_FAILURE | Called when the server-side api failed. |