Reset ATM PIN iOS Framework

Card91 Reset ATM PIN iOS Framework

Card91 Reset ATM PIN iOS Framework Integration with Native iOS Apps

Description

Purpose of this document is to illustrate the method to add Card91 ‘Card91ResetAtmPin’ framework to any iOS native application written in Swift invoked either from a ViewController or an UIView.

Card91 'Card91ResetAtmPin' framework allows developers to add the custom webview component 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 framework for changing the atm pin.

Installation

iOS Minimum Requirements :

Deployment Target Version - 14.0 or above

Usage

Below steps is defined to followed to integrate the Framework

Step:1

Add the xcframework file provided by us by drag and drop into the project "Frameworks,Libraries, and Embedded Content’ to “Embed & Sign".

ADD RESET ATM PIN VIEW COMPONENT ON UIVIEW

Framework will be ready to use after their adding on ViewController.
Create an IBOutlet of View(xib) and assign the “PinView” class to the view in the storyboard
Use this Card91ResetAtmPin framework by importing.
Make sure not to keep any background colour of the webview since it is supposed to be transparent.

SETUP RESET PIN VIEW COMPONENT

Get the instance of the added card91ResetAtmPin onto your ViewController.
As shown in the example below .
Set the Listener as given below

   @IBOutlet weak var card91View: PinView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        let popView = PinView.instanceFromNib(
         self, 
         cardId: "****", 
         phoneNumber: "*****",
         token: "**********", 
         env: "********", 
         height: self.card91ResetAtmPin.frame.height,
         width: self.card91ResetAtmPin.frame.width,
         xAxis: UIScreen.main.bounds.origin.x,
         yAxis: UIScreen.main.bounds.origin.y)
    
        popView.delegate = self
        self.card91ResetAtmPin.addSubview(popView)
    }

INPUT PARAMETER DETAILS

Call the init() method of the Card91ResetAtmPin with the below parameter .

NameTypeRequiredDescription
contextContexttrueActivity context or Fragment activity context is passed here
cardIdstringtruecardId which has been received form login token service (Card91 API)
tokenstringtrueAuth Token received from the Card91 APIs
mobilestringtrueMobile number of the card holder ( format +91-88**23 )
envstringtrue"PROD" in case of production and "PROD_SANDBOX" on sandbox environment
heightdoubletrueEnter the Outlet frame height
widthdoubletrueEnter the Outlet frame width
xAxisdoubletrueEnter the origin X-coordinates
yAxisdoubletrueEnter the origin Y-coordinates

SUBSCRIBE FOR LISTENING CALLBACK EVENTS

Extend the protocol ResetAtmPinListener 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 onCard91ResetPinEvent(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.
onResetAtmEvent is called when card is initialised, detail is show, CVV is shown or copy card number event has happened.

DIFFERENT CALLBACLK EVENTS

The events are as follows:

Event NameDescription
C91_RESET_PIN_SUCCESSCalled when the server-side APIs load successfully. At this time, ATM pin change is successfully done.
C91_RESET_PIN_AUTHENTICATION_FAILURECall back event type when client is passing incorrect or expired auth token.
C91_RESET_PIN_MISSING_PARAMETERCall back event type when client is not passing any required/blank parameter .
C91_RESET_PIN_SERVER_FAILURECall back event type when there is server service exception with error code 500 to 599
C91_RESET_PIN_OTP_SCREEN_INITIALISEDCalled when the server-side ATM pin changes OTP screen loads successfully.