Card91 SERVICES iOS Framework
This Library is used to access the bunch of Card91 fintech services from login with auth token to card setting and transferring money
Features
Library directly communicate with Card91 services.
Getting started
Add Card91 SERVICES library into your iOS application and call the required functions.
Installation
iOS Minimum Requirements :
Deployment Target version- 14.0 or above
Usage
Below steps is followed to integrate the Framework
Adding the framework
Add the xcframework file provided by us by dragging and dropping into the project's "Frameworks,Libraries, and Embedded Content’ to “Embed & Sign" section.
Importing the framework
Framework will be ready to use after it has been added into the specific project.
Create an IBOutlet of View(xib) and assign the “Card91WalletBalance” class to the view in the storyboard.
Use this Card91WalletBalance framework by importing.
Initialising the Customer SDK Function
Get the instance of the added Card91WalletBalance onto your ViewController.
As shown in the example below .
Set the Listener as given below
import UIKit
import Card91WalletBalance /// Import the framework class
@available(iOS 14.5, *)
class ViewController: UIViewController, Card91EventListener {
//Below is an overidden function that will receive the service response from the function that has been called
func onEvent(jsonObject: String, header: [AnyHashable : Any], statusCode: Int, success: Bool) {
print("------ Event Data --------");
print("jsonObject : ",jsonObject);/// Will contains the json reponse of the service
print("header : ",header); // Header value of the json response of the service
print("statusCode", statusCode); // Response code from service , please refere section "Service response code description" for the same
}
//Below is an overidden function that will receive the the exception from the SDK .
func onEventException(type: String, responseBody: String, statusCode: String) {
print("--- Event Exception ---")
print("Exception Type : ", type)
print("Response body : ", responseBody)
print("Status code : ", statusCode)
}
// Create the dynamic string array to create the request body for the service function .
func setWalletStatus() -> [String: Any] {
let setWalletStatusPayload: [String: Any] = [
"walletStatusMap": [
walletId: "INACTIVE" // Only ACTIVE or INACTIVE
]
]
return setWalletStatusPayload
}
override func viewDidLoad() {
super.viewDidLoad()
/// Below code initialized the service class by passing the env constant and card holder token, env will is "PROD_SANDBOX" in case of production sandbox and "PROD" in case of production environment
let remoteServices = Card91RemoteServices(env: "PROD_SANDBOX", mAuthToken: "card91Holder_token")
remoteServices.setWalletStatus(cardId: cardId, jsonObject: setWalletStatus())// Called the function for setting up status of the wallet.
}
}
Note
Clean and Build the iOS app to get the dependencies added on to the application
SUPPORTED SERVICE METHOD
Name | Description |
---|---|
loginWithAuthToken | Service return the card holder details with its card information. |
getCardFlags | Service return the card holder a particular card flags informations. Eg ATM transaction is enabled or not |
updateCardFlags | Service update the card holder a particular card flags informations.Eg ATM transaction is enabled or disable |
lockCard | Service freeze a particular card activity |
blockCardOTP | Service initiate the card permanent block with OTP generation . |
blockCardConfirmation | Service completes the card permanent block with OTP validation. |
getCardLimit | Service return the card holder a particular card setting limit information. |
setCardLimit | Service update the card holder a particular card setting limit information. |
getWalletDetail | Service will fetch the card wallet detail. |
setWalletStatus | Use this method to make the wallet lock or unlock |
addBeneficiary | Service to add beneficiary at the card holder level. |
getAllBeneficiary | Service to add beneficiary get all beneficiary |
getBeneficiaryDetails | Service to get beneficiary details |
updateBeneficiaryLimit | Service to update the beneficiary limits |
updateBeneficiaryLimitVerify | Service to update the beneficiary limit with OTP verification. |
getBeneficiaryTransactions | Service to get beneficiary transaction list |
transferMoneyToBeneficiary | Service to transfer money to beneficiary |
Implementation of the functions
Service request and response with example
Example request for loginWithAuthToken
func loginAuthPayload() -> [String: Any] {
let loginWithAuthTokenPayload = [
"mobile": phoneNumber, /// Card holder mobile number
"sdkAuthToken": "ypr89yBBBS0xXXXXXXXXXXXsAINH7krJNIQ=", // SDK auth token
"primaryOrgId": orgId /// Business org id need to pass here
]
return loginWithAuthTokenPayload
}
let remoteServices = Card91RemoteServices(env: "PROD_SANDBOX", mAuthToken: "") // This will be blank here only for loginWithAuthToken function
remoteServices.listener = self // in order to listen to callbacks event
print("-----------------loginAuthPayload-----------------------");
//Login Auth Token
remoteServices.loginWithAuthToken(jsonObject: loginAuthPayload())
Response:
Response header will contain will contain the "jwt_token" which is the card holder token which will be used to call rest of the api from request authentication as bearer token as card holder token.
jsonObject :
{
"customer": {
"createdTime": "2024-06-12T15:59:56.000+0000",
"createdBy": "230331054237284ID1UID5326707",
"modifiedTime": "2024-06-12T16:03:25.000+0000",
"modifiedBy": null,
"id": "240612155956396ID1CUSTID9850527",
"dob": null,
"gender": null,
"mobile": "917898986567",
"email": "",
"name": "Rajat Rawat",
"nameOnCard": "Card",
"invited": true,
"firstTimeSignUp": true,
"firstTimeLogin": true,
"saltHash": 0,
"wrongMpinCount": 0,
"mpinResetCount": 1,
"cardHolderPaymentSideId": null,
"locale": null,
"status": "ACTIVE",
"extCustomerRefNo": null
},
"cards": [
{
"id": "240612155956446ID1CARD2948976",
"status": "ACTIVE",
"customerId": "240612155956396ID1CUSTID9850527",
"lastFourDigits": "8932",
"cardMode": "PHYSICAL_NAMED_CARD",
"orgName": "Card",
"orgId": "240611191304633ID1OID8745066",
"cardImage": null,
"network": "RUPAY",
"programName": "NSDL Bank - Rupay",
"issuer": "NSDL",
"van": null,
"rootCardId": "240612155956446ID1CARD2948976",
"kitNumber": "240000214682",
"cardType": "GPR",
"addOnCard": false,
"primaryCard": true
},
{
"id": "240612164542331ID1CARD0692480",
"status": "ACTIVE",
"customerId": "240612111433609ID1CUSTID2822816",
"lastFourDigits": "5670",
"cardMode": "PHYSICAL_NAMED_CARD",
"orgName": "Card",
"orgId": "240611191304633ID1OID8745066",
"cardImage": null,
"network": "RUPAY",
"programName": "NSDL Bank - Rupay",
"issuer": "NSDL",
"van": null,
"rootCardId": "240612155956446ID1CARD2948976",
"kitNumber": "240000214691",
"cardType": "GPR",
"addOnCard": true,
"primaryCard": false
}
],
"mpinResetRequired": false
}
header : [AnyHashable("x-frame-options"): DENY, AnyHashable("Date"): Sat, 15 Jun 2024 05:47:39 GMT, AnyHashable("login_token"): C91IP_shKeQ/ih3TFR9ln/eQGysUj2rUMijTxCjPrNJaLhec0=, AnyHashable("scheme_id"): 240612155956396ID1CUSTID9850527, AnyHashable("jwt_token"): C91IP_shKeQ/ih3TFR9ln/eQGysUj2rUMijTxCjPrNJaLhec0=, AnyHashable("Pragma"): no-cache, AnyHashable("Cache-Control"): no-cache, no-store, max-age=0, must-revalidate, AnyHashable("Strict-Transport-Security"): max-age=31536000 ; includeSubDomains, AnyHashable("x-content-type-options"): nosniff, AnyHashable("Expires"): 0, AnyHashable("x-xss-protection"): 1; mode=block, AnyHashable("Vary"): Origin, Access-Control-Request-Method, Access-Control-Request-Headers, AnyHashable("Content-Type"): application/json]
statusCode 200
Example request for getCardFlags
func getCardFlagsPayload() -> String {
let getCardFlags = cardId
return getCardFlags
}
print("-----------------getCardFlagsPayload-----------------------");
let remoteServices = Card91RemoteServices(env: "PROD_SANDBOX", mAuthToken: "C91CHiwZDG3XXXXXaXxRFgIHiXdZ+wLwc=")
remoteServices.listener = self
remoteServices.getCardFlags(cardId: getCardFlagsPayload())
Response:
jsonObject :
{
"cardFlags": {
"CL_ENABLED": true,
"ATM_ENABLED": true,
"POS_ENABLED": true,
"ECOM_ENABLED": true
}
}
header : [AnyHashable("Cache-Control"): no-cache, no-store, max-age=0, must-revalidate, AnyHashable("x-content-type-options"): nosniff, AnyHashable("Content-Type"): application/json, AnyHashable("Pragma"): no-cache, AnyHashable("Strict-Transport-Security"): max-age=31536000 ; includeSubDomains, AnyHashable("Vary"): Origin, Access-Control-Request-Method, Access-Control-Request-Headers, AnyHashable("Expires"): 0, AnyHashable("x-xss-protection"): 1; mode=block, AnyHashable("Date"): Sat, 15 Jun 2024 06:54:32 GMT, AnyHashable("x-frame-options"): DENY]
statusCode 200
Example request for updateCardFlags
func updateCardFlags() -> [String: Any] {
let updateCardFlagsPayload: [String: Any] = [
"cardId": cardId,
"cardFlags": [
"ATM_ENABLED": true,
"POS_ENABLED": false,
"ECOM_ENABLED": true,
"CL_ENABLED": false
]
]
return updateCardFlagsPayload
}
let remoteServices = Card91RemoteServices(env: "PROD_SANDBOX", mAuthToken: "C91CHiwZDXXXXXXXAreciOS0SYmjJapDzIXdZ+wLwc=")
remoteServices.listener = self
print("-----------------updateCardFlags-----------------------");
//Update Card Flags
remoteServices.updateCardFlags(jsonObject: updateCardFlags())
Response:
jsonObject :
{
"cardFlags": {
"CL_ENABLED": false,
"ATM_ENABLED": true,
"POS_ENABLED": false,
"ECOM_ENABLED": true
}
}
header : [AnyHashable("Expires"): 0, AnyHashable("Strict-Transport-Security"): max-age=31536000 ; includeSubDomains, AnyHashable("Cache-Control"): no-cache, no-store, max-age=0, must-revalidate, AnyHashable("Content-Type"): application/json, AnyHashable("Date"): Sat, 15 Jun 2024 06:55:17 GMT, AnyHashable("x-content-type-options"): nosniff, AnyHashable("x-frame-options"): DENY, AnyHashable("Pragma"): no-cache, AnyHashable("Vary"): Origin, Access-Control-Request-Method, Access-Control-Request-Headers, AnyHashable("x-xss-protection"): 1; mode=block]
statusCode 200
Example request for lockCard
func LockCard() -> [String: Any] {
let updateCardFlagsPayload: [String: Any] = [
"cardId": cardId,
"lock": false
]
return updateCardFlagsPayload
}
let remoteServices = Card91RemoteServices(env: "PROD_SANDBOX", mAuthToken: "C91CHiwZDXXXXXXXAreciOS0SYmjJapDzIXdZ+wLwc=")
remoteServices.listener = self
//Lock Card
remoteServices.lockCard(jsonObject: LockCard())
Reponse:
jsonObject :
{
"message": "Card ending with 8932 is LOCKED",
"id": "240612155956446ID1CARD2948976",
"status": "LOCKED",
"lastFourDigits": "8932",
"cardMode": "PHYSICAL_NAMED_CARD",
"orgName": "Card",
"kitNumber": "240000214682"
}
header : [AnyHashable("Cache-Control"): no-cache, no-store, max-age=0, must-revalidate, AnyHashable("x-content-type-options"): nosniff, AnyHashable("Pragma"): no-cache, AnyHashable("x-frame-options"): DENY, AnyHashable("Vary"): Origin, Access-Control-Request-Method, Access-Control-Request-Headers, AnyHashable("x-xss-protection"): 1; mode=block, AnyHashable("Strict-Transport-Security"): max-age=31536000 ; includeSubDomains, AnyHashable("Date"): Sat, 15 Jun 2024 06:56:12 GMT, AnyHashable("Expires"): 0, AnyHashable("Content-Type"): application/json]
statusCode 200
Example request for blockCardOTP
func blockCardOTP() -> [String: Any] {
let blockCardOtpPayload: [String: Any] = [
"cardId": "240607063714331ID1CARD8078462"
]
return blockCardOtpPayload
}
let remoteServices = Card91RemoteServices(env: "PROD_SANDBOX", mAuthToken: "C91CHiwZDXXXXXXXAreciOS0SYmjJapDzIXdZ+wLwc=")
remoteServices.listener = self
//Block Card OTP
remoteServices.blockCardOTP(jsonObject:blockCardOTP() )
Response:
jsonObject : {"mobile":"918293621737","sessionId":"DUMMY-ID"}
header : [AnyHashable("Content-Type"): application/json, AnyHashable("Vary"): Origin, Access-Control-Request-Method, Access-Control-Request-Headers, AnyHashable("Expires"): 0, AnyHashable("Date"): Sat, 15 Jun 2024 07:53:17 GMT, AnyHashable("Cache-Control"): no-cache, no-store, max-age=0, must-revalidate, AnyHashable("x-xss-protection"): 1; mode=block, AnyHashable("Strict-Transport-Security"): max-age=31536000 ; includeSubDomains, AnyHashable("x-content-type-options"): nosniff, AnyHashable("Pragma"): no-cache, AnyHashable("x-frame-options"): DENY]
statusCode 200
Example request for blockCardConfirmation
func blockCardConfirmationPayload() -> [String: Any] {
let blockCardConfirmationPayload: [String: Any] = [
"cardId": "240607063714331ID1CARD8078462",
"reason": "LOST",
"sessionId": "DUMMY-ID",
"otp": "432081"
]
return blockCardConfirmationPayload
}
let remoteServices = Card91RemoteServices(env: "PROD_SANDBOX", mAuthToken: "C91CHiwZDXXXXXXXAreciOS0SYmjJapDzIXdZ+wLwc=")
remoteServices.listener = self
// Block Card Information
remoteServices.blockCardConfirmation(jsonObject: blockCardConfirmationPayload())
Response:
jsonObject :
{
"message": "Card ending with 3049 is BLOCKED",
"id": "240614132006383ID1CARD5992392",
"status": "BLOCKED",
"lastFourDigits": "3049",
"cardMode": "DIGITAL_ONLY_CARD",
"orgName": "sadfghgfdfdsa",
"cardImage": "https://card91-stag-docs.s3.ap-south-1.amazonaws.com/SANDBOX/240613112340122ID1FILE9731904.jpg",
"kitNumber": "240000258720"
}
header : [AnyHashable("x-xss-protection"): 1; mode=block, AnyHashable("Content-Type"): application/json, AnyHashable("Pragma"): no-cache, AnyHashable("Date"): Sat, 15 Jun 2024 07:54:22 GMT, AnyHashable("Cache-Control"): no-cache, no-store, max-age=0, must-revalidate, AnyHashable("x-content-type-options"): nosniff, AnyHashable("Strict-Transport-Security"): max-age=31536000 ; includeSubDomains, AnyHashable("x-frame-options"): DENY, AnyHashable("Vary"): Origin, Access-Control-Request-Method, Access-Control-Request-Headers, AnyHashable("Expires"): 0]
statusCode 200
Example request for getCardLimit
func getCardLimit() -> String {
let getCardLimitsPayload = cardId
return getCardLimitsPayload
}
let remoteServices = Card91RemoteServices(env: "PROD_SANDBOX", mAuthToken: "C91CHiwZDXXXXXXXAreciOS0SYmjJapDzIXdZ+wLwc=")
remoteServices.listener = self
//Get Card Limits
remoteServices.getCardLimit(cardId: getCardLimit())
Response:
jsonObject :
{
"cardRules": [
{
"txnType": "ECOM",
"period": "FY",
"maxLimit": "6000000",
"userLimit": "6000000",
"maxLimitPerTxn": "0",
"consumedLimit": "0",
"userLimitPerTxn": "0",
"enabled": true
},
{
"txnType": "ECOM",
"period": "M",
"maxLimit": "500000",
"userLimit": "500000",
"maxLimitPerTxn": "0",
"consumedLimit": "0",
"userLimitPerTxn": "0",
"enabled": true
},
{
"txnType": "ECOM",
"period": "D",
"maxLimit": "25000",
"userLimit": "25000",
"maxLimitPerTxn": "0",
"consumedLimit": "0",
"userLimitPerTxn": "0",
"enabled": true
},
{
"txnType": "ECOM",
"period": "T",
"maxLimit": "25000",
"userLimit": "25000",
"maxLimitPerTxn": "0",
"consumedLimit": "0",
"userLimitPerTxn": "0",
"enabled": true
},
{
"txnType": "ATM",
"period": "FY",
"maxLimit": "6000000",
"userLimit": "6000000",
"maxLimitPerTxn": "0",
"consumedLimit": "0",
"userLimitPerTxn": "0",
"enabled": true
},
{
"txnType": "ATM",
"period": "M",
"maxLimit": "500000",
"userLimit": "500000",
"maxLimitPerTxn": "0",
"consumedLimit": "0",
"userLimitPerTxn": "0",
"enabled": true
},
{
"txnType": "ATM",
"period": "D",
"maxLimit": "20000",
"userLimit": "20000",
"maxLimitPerTxn": "0",
"consumedLimit": "0",
"userLimitPerTxn": "0",
"enabled": true
},
{
"txnType": "ATM",
"period": "T",
"maxLimit": "20000",
"userLimit": "20000",
"maxLimitPerTxn": "0",
"consumedLimit": "0",
"userLimitPerTxn": "0",
"enabled": true
},
{
"txnType": "POS",
"period": "FY",
"maxLimit": "6000000",
"userLimit": "6000000",
"maxLimitPerTxn": "0",
"consumedLimit": "0",
"userLimitPerTxn": "0",
"enabled": false
},
{
"txnType": "POS",
"period": "M",
"maxLimit": "500000",
"userLimit": "500000",
"maxLimitPerTxn": "0",
"consumedLimit": "0",
"userLimitPerTxn": "0",
"enabled": false
},
{
"txnType": "POS",
"period": "D",
"maxLimit": "50000",
"userLimit": "50000",
"maxLimitPerTxn": "0",
"consumedLimit": "0",
"userLimitPerTxn": "0",
"enabled": false
},
{
"txnType": "POS",
"period": "T",
"maxLimit": "50000",
"userLimit": "50000",
"maxLimitPerTxn": "0",
"consumedLimit": "0",
"userLimitPerTxn": "0",
"enabled": false
},
{
"txnType": "CL",
"period": "FY",
"maxLimit": "1800000",
"userLimit": "1800000",
"maxLimitPerTxn": "0",
"consumedLimit": "0",
"userLimitPerTxn": "0",
"enabled": false
},
{
"txnType": "CL",
"period": "M",
"maxLimit": "150000",
"userLimit": "150000",
"maxLimitPerTxn": "0",
"consumedLimit": "0",
"userLimitPerTxn": "0",
"enabled": false
},
{
"txnType": "CL",
"period": "D",
"maxLimit": "10000",
"userLimit": "10000",
"maxLimitPerTxn": "0",
"consumedLimit": "0",
"userLimitPerTxn": "0",
"enabled": false
},
{
"txnType": "CL",
"period": "T",
"maxLimit": "5000",
"userLimit": "5000",
"maxLimitPerTxn": "0",
"consumedLimit": "0",
"userLimitPerTxn": "0",
"enabled": false
}
],
"kitNumber": "240000214682"
}
header : [AnyHashable("x-xss-protection"): 1; mode=block, AnyHashable("Vary"): Origin, Access-Control-Request-Method, Access-Control-Request-Headers, AnyHashable("x-content-type-options"): nosniff, AnyHashable("Date"): Sat, 15 Jun 2024 06:57:36 GMT, AnyHashable("Strict-Transport-Security"): max-age=31536000 ; includeSubDomains, AnyHashable("Cache-Control"): no-cache, no-store, max-age=0, must-revalidate, AnyHashable("Expires"): 0, AnyHashable("x-frame-options"): DENY, AnyHashable("Content-Type"): application/json, AnyHashable("Pragma"): no-cache]
statusCode 200
Example request for setCardLimit
func setCardLimit() -> [String: Any] {
let setCardLimitsPayload: [String: Any] = [
"txnType": "ECOM",
"userLimit": "200",
"maxLimit": "1000",
"period": "M",
"enabled": true
]
return setCardLimitsPayload
}
let remoteServices = Card91RemoteServices(env: "PROD_SANDBOX", mAuthToken: "C91CHiwZDXXXXXXXAreciOS0SYmjJapDzIXdZ+wLwc=")
remoteServices.listener = self
//Set Card Limits
remoteServices.setCardLimit(cardId: cardId, jsonArray: Array(arrayLiteral: setCardLimit()))
Response:
jsonObject :
header : [AnyHashable("Expires"): 0, AnyHashable("Date"): Mon, 17 Jun 2024 13:15:58 GMT, AnyHashable("Vary"): Origin, Access-Control-Request-Method, Access-Control-Request-Headers, AnyHashable("Cache-Control"): no-cache, no-store, max-age=0, must-revalidate, AnyHashable("Pragma"): no-cache, AnyHashable("Content-Length"): 0, AnyHashable("x-xss-protection"): 1; mode=block, AnyHashable("x-content-type-options"): nosniff, AnyHashable("x-frame-options"): DENY, AnyHashable("Strict-Transport-Security"): max-age=31536000 ; includeSubDomains]
statusCode 200
Example request for getWalletDetail
let remoteServices = Card91RemoteServices(env: "PROD_SANDBOX", mAuthToken: "C91CHiwZDXXXXXXXAreciOS0SYmjJapDzIXdZ+wLwc=")
remoteServices.listener = self
remoteServices.getCardWalletDetails(cardId: "230704125202564ID1CARD6454931")
Response:
response body:
{
"wallets":[
{
"cardId":"230704125202564ID1CARD6454936",
"appId":"98d7faf5-432b-454f-b786-c37f761fa6bc",
"orgId":"230217024240504ID1OID6864550",
"ledgerOrgId":"230217024240504ID1OID6864550",
"groupId":"230630074826303ID1CP6003872",
"name":"Wallet",
"status":"ACTIVE",
"description":"Wallet",
"balanceType":"PREPAID",
"allowCustomerMoneyLoad":false,
"createdAt":"2023-07-04T12:52:02.000+00:00",
"createdBy":null,
"updatedAt":"2024-07-03T07:17:45.000+00:00",
"priority":1,
"splitTxn":"DISALLOW",
"closedLoop":false,
"balance":"90.0000",
"rulesJson":{
"version":"1",
"zeroFilterMatchBehaviour":"allow",
"balanceType":"PREPAID",
"rules":[
],
"cashbackRules":[
]
},
"ncmcVerified":0,
"allowWalletToLink":false
}
],
"ncmcWallets":[
{
"cardId":"230704125202564ID1CARD6454936",
"appId":"ncmc_fd79c176-293b-48ba-8911-14adb767ee11",
"orgId":"230217024240504ID1OID6864550",
"ledgerOrgId":"230217024240504ID1OID6864550",
"groupId":"230630074826303ID1CP6003872",
"name":"NCMC Wallet",
"status":"ACTIVE",
"description":"For NCMC transactions",
"balanceType":"PREPAID",
"allowCustomerMoneyLoad":null,
"createdAt":"2023-09-23T01:44:35.000+00:00",
"createdBy":null,
"updatedAt":"2023-09-23T01:44:35.000+00:00",
"priority":0,
"splitTxn":"DISALLOW",
"closedLoop":false,
"balance":"0.0000",
"rulesJson":null,
"ncmcVerified":1,
"allowWalletToLink":false
}
]
}
statusCode 200
Example request for setWalletStatus
func setWalletStatus() -> [String: Any] {
let setWalletStatusPayload: [String: Any] = [
"walletStatusMap": [
walletId: "INACTIVE" // Only ACTIVE or INACTIVE
]
]
return setWalletStatusPayload
}
let remoteServices = Card91RemoteServices(env: "PROD_SANDBOX", mAuthToken: "C91CHiwZDXXXXXXXAreciOS0SYmjJapDzIXdZ+wLwc=")
remoteServices.listener = self
//Set Wallet Status
remoteServices.setWalletStatus(cardId: cardId, jsonObject: setWalletStatus())
Response:
jsonObject : {"message":"Wallet statuses updated successfully"}
header : [AnyHashable("Date"): Sat, 15 Jun 2024 07:48:54 GMT, AnyHashable("Expires"): 0, AnyHashable("Vary"): Origin, Access-Control-Request-Method, Access-Control-Request-Headers, AnyHashable("x-xss-protection"): 1; mode=block, AnyHashable("x-frame-options"): DENY, AnyHashable("Cache-Control"): no-cache, no-store, max-age=0, must-revalidate, AnyHashable("x-content-type-options"): nosniff, AnyHashable("Pragma"): no-cache, AnyHashable("Strict-Transport-Security"): max-age=31536000 ; includeSubDomains, AnyHashable("Content-Type"): application/json]
statusCode 200
Example request for addBeneficiary
let remoteServices = Card91RemoteServices(env: "PROD_SANDBOX", mAuthToken: "")
remoteServices.listener = self
func addBeneficiaryPayload() -> [String: Any] {
let addBeneficiary: [String: Any] = [
"issuerCode":"NSDL",
"accountNumber":"973779399",
"ifscCode":"KJHF0837773",
"name":"",
]
return addBeneficiary
}
print("-----------------addBeneficiary-----------------------");
remoteServices.addBeneficiary(mobile: phoneNumber, jsonObject: addBeneficiaryPayload())
Response:
jsonObject : {""beneficiaryId"":""240614170042649ID1BENF3670844""}
header : [AnyHashable(""Content-Type""): application/json, AnyHashable(""Pragma""): no-cache, AnyHashable(""Expires""): 0, AnyHashable(""x-xss-protection""): 1; mode=block, AnyHashable(""Date""): Fri, 14 Jun 2024 17:00:42 GMT, AnyHashable(""x-frame-options""): DENY, AnyHashable(""Cache-Control""): no-cache, no-store, max-age=0, must-revalidate, AnyHashable(""Vary""): Origin, Access-Control-Request-Method, Access-Control-Request-Headers, AnyHashable(""x-content-type-options""): nosniff, AnyHashable(""Strict-Transport-Security""): max-age=31536000 ; includeSubDomains]
statusCode 200
Example request for getAllBeneficiary
let remoteServices = Card91RemoteServices(env: "PROD_SANDBOX", mAuthToken: "")
remoteServices.listener = self
remoteServices.getAllBeneficiary(mobile: phoneNumber,issuerCode: "",page: "", perPage: "",ifscCode: "",name: "")
Response:
jsonObject :
{
"recordsCurrentPage": 4,
"currentPage": 1,
"totalPages": 1,
"totalRecords": 4,
"beneficiaries": [
{
"id": "240614170042649ID1BENF3670844",
"name": "Akil Akkineni",
"accountNumber": "287626876",
"ifscCode": "SBIN0000865",
"associatedIssuer": "NSDL",
"createdTime": "2024-06-14T17:00:43.000+00:00",
"lastModifiedTime": "2024-06-14T17:00:43.000+00:00",
"dailyRequestLimit": null,
"dailyTransferRequestAllowed": "5",
"maxMonthlyLimit": null,
"kycLimit": null
},
{
"id": "240614165653394ID1BENF0023936",
"name": "Ravi Teja",
"accountNumber": "287656876",
"ifscCode": "SBIN0000865",
"associatedIssuer": "NSDL",
"createdTime": "2024-06-14T16:56:53.000+00:00",
"lastModifiedTime": "2024-06-14T16:56:53.000+00:00",
"dailyRequestLimit": null,
"dailyTransferRequestAllowed": "5",
"maxMonthlyLimit": null,
"kycLimit": null
},
{
"id": "240612055950390ID1BENF9301040",
"name": "TEST ",
"accountNumber": "89789390000907",
"ifscCode": "SBIN0000898",
"associatedIssuer": "NSDL",
"createdTime": "2024-06-12T05:59:50.000+00:00",
"lastModifiedTime": "2024-06-12T05:59:50.000+00:00",
"dailyRequestLimit": null,
"dailyTransferRequestAllowed": "5",
"maxMonthlyLimit": null,
"kycLimit": null
},
{
"id": "240612055908024ID1BENF8177765",
"name": "TEST ",
"accountNumber": "897893900907",
"ifscCode": "SBIN0000898",
"associatedIssuer": "NSDL",
"createdTime": "2024-06-12T05:59:08.000+00:00",
"lastModifiedTime": "2024-06-12T05:59:08.000+00:00",
"dailyRequestLimit": null,
"dailyTransferRequestAllowed": "5",
"maxMonthlyLimit": null,
"kycLimit": null
}
]
}
header : [AnyHashable("Date"): Fri, 14 Jun 2024 17:05:10 GMT, AnyHashable("x-frame-options"): DENY, AnyHashable("x-xss-protection"): 1; mode=block, AnyHashable("x-content-type-options"): nosniff, AnyHashable("Pragma"): no-cache, AnyHashable("Vary"): Origin, Access-Control-Request-Method, Access-Control-Request-Headers, AnyHashable("Expires"): 0, AnyHashable("Content-Type"): application/json, AnyHashable("Strict-Transport-Security"): max-age=31536000 ; includeSubDomains, AnyHashable("Cache-Control"): no-cache, no-store, max-age=0, must-revalidate]
statusCode 200
Example request for getBeneficiaryDetail
let remoteServices = Card91RemoteServices(env: "PROD_SANDBOX", mAuthToken: "")
remoteServices.listener = self
remoteServices.getBeneficiaryDetail(beneficiaryId: beneficiaryId) // pass the added beneficiary id here
Response:
jsonObject :
{
"id": "240612055950390ID1BENF9301040",
"name": "TEST ",
"accountNumber": "89789390000907",
"ifscCode": "SBIN0000898",
"associatedIssuer": "NSDL",
"maxPermissibleLimit": "200000.0000",
"createdTime": "2024-06-12T05:59:50.000+00:00",
"lastModifiedTime": "2024-06-12T05:59:50.000+00:00",
"dailyRequestLimit": null,
"dailyTransferRequestAllowed": "5",
"maxMonthlyLimit": "200000.0000",
"kycLimit": "200000"
}
header : [AnyHashable("x-xss-protection"): 1; mode=block, AnyHashable("x-frame-options"): DENY, AnyHashable("Date"): Fri, 14 Jun 2024 17:07:44 GMT, AnyHashable("x-content-type-options"): nosniff, AnyHashable("Cache-Control"): no-cache, no-store, max-age=0, must-revalidate, AnyHashable("Pragma"): no-cache, AnyHashable("Content-Type"): application/json, AnyHashable("Strict-Transport-Security"): max-age=31536000 ; includeSubDomains, AnyHashable("Vary"): Origin, Access-Control-Request-Method, Access-Control-Request-Headers, AnyHashable("Expires"): 0]
statusCode 200
Example request for updateBeneficiaryLimit
let remoteServices = Card91RemoteServices(env: "PROD_SANDBOX", mAuthToken: "")
remoteServices.listener = self
func updateBeneficiaryLimitPayload() -> [String: Any] {
let updateBeneficiary: [String: Any] = [
"maxMonthlyLimit": 1000,
"dailyTransferRequestAllowed": 4
]
return updateBeneficiary
}
remoteServices.updateBeneficiaryLimit(beneficiaryId: beneficiaryId, jsonObject: updateBeneficiaryLimitPayload())
Response:
jsonObject : {"sessionId":null}
header : [AnyHashable("Strict-Transport-Security"): max-age=31536000 ; includeSubDomains, AnyHashable("x-xss-protection"): 1; mode=block, AnyHashable("Expires"): 0, AnyHashable("Pragma"): no-cache, AnyHashable("Cache-Control"): no-cache, no-store, max-age=0, must-revalidate, AnyHashable("x-frame-options"): DENY, AnyHashable("Vary"): Origin, Access-Control-Request-Method, Access-Control-Request-Headers, AnyHashable("x-content-type-options"): nosniff, AnyHashable("Content-Type"): application/json, AnyHashable("Date"): Fri, 14 Jun 2024 17:10:07 GMT]
statusCode 200
Example request for updateBeneficiaryLimitVerify
Note
updateBeneficiaryLimitVerify only used for YES bank issuer.
let remoteServices = Card91RemoteServices(env: "PROD_SANDBOX", mAuthToken: "")
remoteServices.listener = self
func updateBeneficiaryLimitVerifyPayload() -> [String: Any] {
let updateBeneficiaryVerify: [String: Any] = [
"sessionId": "35578",
"otp": "111111",
"maxMonthlyLimit": 450,
"dailyTransferRequestAllowed": 4
]
return updateBeneficiaryVerify
}
remoteServices.updateBeneficiaryLimitVerify(beneficiaryId: beneficiaryId, jsonObject: updateBeneficiaryLimitVerifyPayload())
Response:
jsonObject : {"sessionId":null}
header : [AnyHashable("Strict-Transport-Security"): max-age=31536000 ; includeSubDomains, AnyHashable("x-xss-protection"): 1; mode=block, AnyHashable("Expires"): 0, AnyHashable("Pragma"): no-cache, AnyHashable("Cache-Control"): no-cache, no-store, max-age=0, must-revalidate, AnyHashable("x-frame-options"): DENY, AnyHashable("Vary"): Origin, Access-Control-Request-Method, Access-Control-Request-Headers, AnyHashable("x-content-type-options"): nosniff, AnyHashable("Content-Type"): application/json, AnyHashable("Date"): Fri, 14 Jun 2024 17:10:07 GMT]
statusCode 200
Example request for transferMoneyToBeneficiary
let remoteServices = Card91RemoteServices(env: "PROD_SANDBOX", mAuthToken: "")
remoteServices.listener = self
func transferMoneyToBeneficiaryPayload() -> [String: Any] {
let transferMoneyToBeneficiary: [String: Any] = [
"beneficiaryId": beneficiaryId,
"amount": 5,
"transferMethod": "IMPS",
"narration": "fweew"
]
return transferMoneyToBeneficiary
}
remoteServices.transferMoneyToBeneficiary(cardId: cardId, jsonObject: transferMoneyToBeneficiaryPayload())
Response:
jsonObject :
{
"status": "SUCCESS",
"txnPartnerReferenceId": "C91489228125",
"txnReferenceId": "C91489228125"
}
header : [AnyHashable("Vary"): Origin, Access-Control-Request-Method, Access-Control-Request-Headers, AnyHashable("Strict-Transport-Security"): max-age=31536000 ; includeSubDomains, AnyHashable("x-content-type-options"): nosniff, AnyHashable("x-frame-options"): DENY, AnyHashable("Expires"): 0, AnyHashable("Date"): Fri, 14 Jun 2024 17:12:06 GMT, AnyHashable("x-xss-protection"): 1; mode=block, AnyHashable("Content-Type"): application/json, AnyHashable("Cache-Control"): no-cache, no-store, max-age=0, must-revalidate, AnyHashable("Pragma"): no-cache]
statusCode 200
Example request for getBeneficiaryTransactions
let remoteServices = Card91RemoteServices(env: "PROD_SANDBOX", mAuthToken: "")
remoteServices.listener = self
remoteServices.getBeneficiaryTransactions(beneficiaryId: beneficiaryId, page: "", perPage: "", from: "", to: "") // all values are in string, date format "2022-10-01"
Response:
jsonObject :
{
"status": "SUCCESS",
"txnPartnerReferenceId": "C91489228125",
"txnReferenceId": "C91489228125"
}
header : [AnyHashable("Vary"): Origin, Access-Control-Request-Method, Access-Control-Request-Headers, AnyHashable("Strict-Transport-Security"): max-age=31536000 ; includeSubDomains, AnyHashable("x-content-type-options"): nosniff, AnyHashable("x-frame-options"): DENY, AnyHashable("Expires"): 0, AnyHashable("Date"): Fri, 14 Jun 2024 17:12:06 GMT, AnyHashable("x-xss-protection"): 1; mode=block, AnyHashable("Content-Type"): application/json, AnyHashable("Cache-Control"): no-cache, no-store, max-age=0, must-revalidate, AnyHashable("Pragma"): no-cache]
statusCode 200
Service response code description
Response can be traced on the call back event onEvent
Response code | Description |
---|---|
200-299 | Between 200-299 is considered as success response. |
400-499 | 401 Invalid auth token, 403 Forbidden, 400 Request structure is malformed or incorrect 415 Missing header request etc |
500-599 | Server Error |