Android
Connect your Android app with SingleView SDK
Connect your Android app with SingleView SDK with the following steps:
- Add the SingleviewSDK.arr file into the project’s
libs
directory - Add the below line in your
build.gradle
(App Level) inside dependencies scopeimplementation(files("libs/SingleViewSDK.aar"))
- Enable
viewbinding
by adding the code below to yourbuild.gradle
(App Level)
android {
..
buildFeatures {
viewBinding = true
}
}
Usage with View Controllers
Initialize
Connect
.connect()
Ensure proper setup of the SingleView SDK and make it ready to handle your requests, call SingleViewSDK.connect(context:Context, clientID:String, clientCode: String, version: String, merchantID: String?, language: SingleViewSDK.Companion.Language, customization: SingleViewSDK.Companion.Customization, callback: (result: Any) -> Unit)
in onCreate()
or before making any calls to the SDK. This will initialize the SDK with the necessary parameters, making it ready to function as expected within your app.
Begin by invoking the .connect()
method of SingleViewSDK in the ViewDidLoad
. To do this, you must pass the following parameters:
clientID
clientCode
version
merchantID
language
customization
It is mandatory to provide Merchant ID
to access all the methods available within SingleView SDK. As for the language parameter, you can choose between English and Arabic using the SingleViewSDK.Companion.Language.
Enum.
class Activity : AppCompatActivity() {
private var context: Context = Activity.this
private var clientID: String = "Your-Client-Id"
private var clientCode: String = "Your-Client-Code"
private var merchantID: String = "Your-Merchant-ID"
private var version: String = "Version"
private var customization: String = SingleViewSDK.Companion.SVSDK.Customization
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity)
// Initializing SingleView SDK
SingleViewSDK.connect(
context,
clientID,
clientCode,
version,
merchantID,
true,
SingleViewSDK.Companion.Language.ENGLISH,
customization
) { result ->
println("$response")
}
}
public class Activity extends AppCompatActivity{
private final Context context = this;
private ActivityBinding binding;
private final String version= "Version";
private final String clientID = "Your-Client-ID";
private final String clientCode = "Your-Client-Code";
private final String merchantID = "Your-Merchant-ID";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
Language language = Language.ENGLISH;
// Initializing SingleView SDK with Merchant
SingleViewSDK.Companion.connect(
context,
clientID,
clientCode,
version,
merchantID,
true,
language,
null,
o -> { println("$response")
return null;
});
}
}
🪧Note
Make sure to replace the above with the actual values or variables needed for the setup.
Set Callback
.setCallback()
Call SingleViewSDK.setCallback(callback:SingleViewSDKCallback)
before using any of the SDK usecase services and implementing SingleViewSDKCallback
Listener. This is a mandatory step that helps in generating a response in consent creation.
class Activity : AppCompatActivity() , SingleViewSDKCallback {
private var context: Context = Activity.this
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity)
SingleViewSDK.setCallback(this)
}
override fun onConsentCreation(response: Any) {
println("$response")
}
override fun onSDKError(error: Any) {
println("$error")
}
}
public class Activity extends AppCompatActivity implements SingleViewSDKCallback {
private final Context context = this;
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity)
SingleViewSDK.Companion.setCallback(this);
}
@Override
public void onConsentCreation(@NonNull Object o) {
System.out.println("onConsentCreation => Object = " + o);
}
@Override
public void onSDKError(@NonNull Object o) {
System.out.println("onSDKError => Object = " + o);
}
}
Setup Merchant ID
.setupMerchantID()
⚙️Merchant ID can be set up during the initial setup or through the .setupMerchantID
method.
SingleViewSDK.setupMerchantID(context:Context, merchantID: String)
is used to ensure that the merchantID
is set correctly and is ready to be used throughout your interactions with the SingleView SDK services.
Here's how you can initiate the method to .setupMerchantID
:
class Activity : AppCompatActivity() {
private var context: Context = Activity.this
private var merchantID: String = "Your-Merchant-ID"
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity)
SingleViewSDK.setMerchantId(context,merchantID){ result ->
println("$response")
}
}
public class Activity extends AppCompatActivity{
private final Context context = this;
private String merchantID = "Your-Merchant-ID"
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity)
SingleViewSDK.Companion.setMerchantId(context,merchantID,o -> {
System.out.println(“”+ o)
return null;
});
}
Manage Merchant
Create New Merchant
.createNewMerchant()
.createNewMerchant()
is a method to create a new merchant in the SingleView SDK that requires the name
, email
and mobile
parameter.
SingleViewSDK.createNewMerchant(
context: Context,
name: String,
email: String,
mobile: String)
{ result ->
println("$response")
}
}
SingleViewSDK.Companion.createNewMerchant(
Context context,
String name,
String email,
String mobile,o -> {
System.out.println(“”+ o)
return null;
});
}
View Merchants
.getAllMerchants()
The .getAllMerchants()
method serves the purpose of retrieving the list of all the Merchants' information that are mapped with a particular clientID
and clientCode
.
SingleViewSDK.getAllMerchants(
context: Context, pageNo: String, pageCount: String){ result ->
println("$response")
}
}
SingleViewSDK.Companion.getAllMerchants(
Context context, String pageNo, String pageCount,o -> {
System.out.println(“”+ o)
return null;
});
}
Consent Management
Create Consent
.createConsent()
The .createConsent()
method facilitates the addition or creation of a consent for a bank account, allowing the retrieval of balance and transaction information. For the use case parameter, you can select one of the use cases available in our SDK's Usecases Enum.
SingleViewSDK.createConsent(context: Context, type: UseCase)
SingleViewSDK.Companion.createConsent(Context context, UseCase type);
On successful creation, user will receive the positive & negative responses in the following respectively:
override fun onConsentCreation(response: Any) {
println("$response")
}
override fun onSDKError(error: Any) {
println("$error")
}
@Override
public void onConsentCreation(@NonNull Object o) {
System.out.println("onConsentCreation => Object = " + o);
}
@Override
public void onSDKError(@NonNull Object o) {
System.out.println("onSDKError => Object = " + o);
}
Revoke Consent
.revokeConsent()
The revokeConsent()
method is designed to invalidate a consent that has been previously created and is active. To execute this method, you are required to provide the bank object with bankCode
and ConsentID
as parameters. The bank object is of type SVRequestBank
, which contains the code for which the Consent ID is mapped to. Consent ID represents the unique identifier that was authorized by the Bank for specific account(s).
SingleViewSDK.revokeConsent(context: Context,
bank: MutableList<SVRequestBank>)
{result -> println("$response") }
}
SingleViewSDK.Companion.revokeConsent(Context context, ArrayList<SVRequestBank> bank,o -> {
System.out.println(“”+ o)
return null;
});
}
Use Case Methods
Accounts
.allAccountsCheck()
The .allAccountsCheck()
method is used to retrieve a list of accounts that are linked with a specific consent. To use this method, you must provide the bank object with bankCode
and ConsentID
as parameters. The bank object is of type SVRequestBank
, which contains the code to which the consent ID is mapped.
Consent ID represents the unique identifier that is authorized by the Bank for the specific account(s). Using this information, the method will return a list of connected accounts associated with the provided consent.
SingleViewSDK.allAccountsCheck(
context: Context, bank: MutableList<SVRequestBank>)
{result -> println("$response") }
}
SingleViewSDK.Companion.allAccountsCheck(Context context, ArrayList<SVRequestBank> bank,o -> {
System.out.println(“”+ o)
return null;
});
}
Balance
.getAllAccountsBalance()
The .getAllAccountsBalance()
method is used to obtain a list of balances for accounts associated with a specific consent. To use this method, you must provide the bank object with bankCode
and ConsentID
as parameters. The bank object is of type SVRequestBank
, which contains the code to which the consent ID is mapped.
Consent ID represents the unique identifier that was authorized by the Bank for the specific consent. By using this information, the method will return a list of balances for all accounts linked to the provided consent.
SingleViewSDK.getAllAccountsBalance(
context: Context, bank: MutableList<SVRequestBank>)
{result -> println("$response") }
}
SingleViewSDK.Companion.getAllAccountsBalance(Context context, ArrayList<SVRequestBank> bank,o -> {
System.out.println(“”+ o)
return null;
});
}
.getAccountsBalanceByAccount()
The getAccountsBalanceByAccount()
method is designed to provide the balance of a specific account. To use this method, you need to provide the bank object with bankCode
, ConsentID
, and also AccountID
as parameters.
The bank object is of type SVRequestBank
, which contains the code to which the consent ID is mapped. Consent ID represents the unique identifier that was authorized by the Bank for the specific consent. Account ID is the identification of the account for which the balance is required.
By using this information, the method will fetch and return the balance for the specified account associated with the given consent and bank.
SingleViewSDK.getAccountsBalanceByAccount(
context: Context, bank: MutableList<SVRequestBank>)
{result -> println("$response") }
}
SingleViewSDK.Companion.getAccountsBalanceByAccount(Context context, ArrayList<SVRequestBank> bank,o -> {
System.out.println(“”+ o)
return null;
});
}
Transactions
.getAllAccountsTransactions()
The getAllAccountsTransactions()
method is designed to provide a list of transactions for all accounts associated with a specific consent. To use this method, you must provide the bank object with bankCode
and ConsentID
as parameters.
The bank object is of type SVRequestBank
, which contains the code to which the consent ID is mapped. Consent ID represents the unique identifier that was authorized by the Bank for the specific consent. By providing this information, the method will retrieve and return a list of transactions for all accounts linked to the provided consent and bank. These transactions will include details such as transaction amount, date, description, and other relevant information related to each transaction for all the connected accounts.
SingleViewSDK.getAllAccountsTransactions(
context: Context, fromDate: String, toDate: String,
bank: MutableList<SVRequestBank>)
{result -> println("$response") }
}
SingleViewSDK.Companion.getAllAccountsTransactions(
Context context, String fromDate, String toDate,
ArrayList<SVRequestBank> bank,o -> {
System.out.println(“”+ o)
return null;
});
}
.getTransactionsByAccount()
The getTransactionsByAccount()
method is intended to provide specific account transactions for a given account. To utilize this method, you need to provide the bank object with bankCode
, ConsentID
, and also Account ID
as parameters.
SingleViewSDK.getTransactionsByAccount(
context: Context, bank: MutableList<SVRequestBank>)
{result -> println("$response") }
}
SingleViewSDK.Companion.getTransactionsByAccount(
Context context,
ArrayList<SVRequestBank> bank,o -> {
System.out.println(“”+ o)
return null;
});
}
Direct Debits
.getAllAccountsDirectDebits()
The getAllAccountsDirectDebits()
method is used to retrieve a list of direct debits for all accounts associated with a specific consent. To use this method, you must provide the bank object with bankCode
and ConsentID
as parameters.
The bank object is of type SVRequestBank
, which contains the code to which the consent ID is mapped. Consent ID represents the unique identifier that was authorized by the Bank for the specific consent. By providing this information, the method will fetch and return a list of direct debits for all accounts linked to the provided consent and bank.
SingleViewSDK.getAllAccountsDirectDebits(
context: Context, bank: MutableList<SVRequestBank>)
{result -> println("$response") }
}
SingleViewSDK.Companion.getAllAccountsDirectDebits(
Context context,
ArrayList<SVRequestBank> bank,o -> {
System.out.println(“”+ o)
return null;
});
}
.getDirectDebitsByAccount()
The getDirectDebitsByAccount()
function allows you to retrieve the Direct Debits associated with a particular account. To use this method, you must provide the bank object with the bankCode
, ConsentID
, and the Account ID
as parameters.
SingleViewSDK.getDirectDebitsByAccount(
context: Context, bank: MutableList<SVRequestBank>)
{result -> println("$response") }
}
SingleViewSDK.Companion.getDirectDebitsByAccount(
Context context,
ArrayList<SVRequestBank> bank,o -> {
System.out.println(“”+ o)
return null;
});
}
Standing Orders
.getAllAccountsStandingOrders()
The getAllAccountsStandingOrders()
method is designed to provide a list of standing orders for all accounts associated with a specific consent. To utilize this method, you must provide the bank object with bankCode
and ConsentID
as parameters.
By providing this information, the method will retrieve and return a list of standing orders for all accounts linked to the provided consent and bank.
SingleViewSDK.getAllAccountsStandingOrders(
context: Context, bank: MutableList<SVRequestBank>)
{result -> println("$response") }
}
SingleViewSDK.Companion.getAllAccountsStandingOrders(
Context context,
ArrayList<SVRequestBank> bank,o -> {
System.out.println(“”+ o)
return null;
});
}
.getStandingOrdersByAccount()
The getTransactionsByAccount()
function is designed to retrieve the Standing Orders associated with a particular account. To use of this method, you must provide the bank object with the bankCode
, ConsentID
, and the Account ID
as parameters.
SingleViewSDK.getStandingOrdersByAccount(
context: Context, bank: MutableList<SVRequestBank>)
{result -> println("$response") }
}
SingleViewSDK.Companion.getStandingOrdersByAccount(
Context context,
ArrayList<SVRequestBank> bank,o -> {
System.out.println(“”+ o)
return null;
});
}
Scheduled Payments
.getAllAccountsSchedulePayments()
The getAllAccountsSchedulePayments()
method is used to retrieve a list of scheduled payments for all accounts associated with a specific consent. To use this method, you must provide the bank object with bankCode
and ConsentID
as parameters.
By providing this information, the method will fetch and return a list of scheduled payments for all accounts linked to the provided consent and bank.
SingleViewSDK.getAllAccountsSchedulePayments(
context: Context, bank: MutableList<SVRequestBank>)
{result -> println("$response") }
}
SingleViewSDK.Companion.getAllAccountsSchedulePayments(
Context context,
ArrayList<SVRequestBank> bank,o -> {
System.out.println(“”+ o)
return null;
});
}
.getSchedulePaymentsByAccount()
The getSchedulePaymentsByAccount()
method is designed to retrieve specific account schedule payments. It requires the bank object containing bankCode
and ConsentID
and the AccountID
to fetch the schedule payments for the specified account.
SingleViewSDK.getSchedulePaymentsByAccount(
context: Context, bank: MutableList<SVRequestBank>)
{result -> println("$response") }
}
SingleViewSDK.Companion.getSchedulePaymentsByAccount(
Context context,
ArrayList<SVRequestBank> bank,o -> {
System.out.println(“”+ o)
return null;
});
}
Use cases
Account Aggregation
.getAccountAggregationData()
The getAccountAggregationData()
method will fetch the account data like balance and transactions. For this method you need to provide the bank object with bankCode
and ConsentID
and also formDate
and toDate
as a param. Here the bank is the SVRequestBank
object which contains for which the Consent ID is mapped to, and ConsentID
is the identification that is authorised by the Bank. And formDate
param is used to get the statement from, toDate
to get the statement to, and Date should be in ISO format Ex: 2022-07-12T11:11:29.245Z.
SingleViewSDK.getAccountAggregationData(
context: Context,
fromDate: String,
toDate: String,
bank: MutableList<SVRequestBank>)
{result -> println("$response") }
}
SingleViewSDK.Companion.getAccountAggregationData(
Context context, String fromDate, String toDate,
ArrayList<SVRequestBank> bank,o -> {
System.out.println(“”+ o)
return null;
});
}
E-Statement
.getEStatementData()
The getEStatementData()
method will fetch account transactions for the specified date range. For this method you need to provide the bank object with bankCode
and ConsentID
and also formDate
and toDate
as a param. Here the bank is the SVRequestBank
object which contains for which the Consent ID is mapped to, and ConsentID
is the identification that is authorised by the Bank. And formDate
param is used to get the statement from, toDate
to get the statement to, and Date should be in ISO format Ex: 2022-07-12T11:11:29.245Z.
SingleViewSDK.Companion.getEStatementData(
context: Context,
fromDate: String,
toDate: String,
bank: MutableList<SVRequestBank>)
{result -> println("$response") }
}
SingleViewSDK.Companion.getEStatementData(
Context context, String fromDate, String toDate,
ArrayList<SVRequestBank> bank,o -> {
System.out.println(“”+ o)
return null;
});
}
Income Check
.getIncomeCheckData()
The getIncomeCheckData()
method will give you the Income check data of the account(s) for a specific date range. For this method you need to provide the bank object with bankCode
and ConsentID
and also formDate
and toDate
as parameters.
SingleViewSDK.getIncomeCheckData(
context: Context,
fromDate: String,
toDate: String,
timeline: String,
bank: MutableList<SVRequestBank>)
{result -> println("$response") }
}
SingleViewSDK.Companion.getIncomeCheckData(
Context context, String fromDate, String toDate,
ArrayList<SVRequestBank> bank,o -> {
System.out.println(“”+ o)
return null;
});
}
Expense Check
.getExpenseCheckData()
The getExpenseCheckData()
method gives you the expenses data for a specific date range. For this method you need to provide the bank object with bankCode
and ConsentID
and also formDate
and toDate
as parameter.
SingleViewSDK.getExpenseCheckData(
context: Context,
fromDate: String,
toDate: String,
timeline: String,
bank: MutableList<SVRequestBank>)
{result -> println("$response") }
}
SingleViewSDK.Companion.getExpenseCheckData(
Context context, String fromDate, String toDate,
ArrayList<SVRequestBank> bank,o -> {
System.out.println(“”+ o)
return null;
});
}
KYC Info
.getKYCInfoData()
The getKYCInfoData()
method fetches the KYC info data from the bank for the specified bank account for a specific date range. For this method you need to provide the bank object with bankCode
and ConsentID
and also formDate
and toDate
as parameters.
SingleViewSDK.getKYCInfoData(
context: Context,
fromDate: String,
toDate: String,
bank: MutableList<SVRequestBank>)
{result -> println("$response") }
}
SingleViewSDK.Companion.getKYCInfoData(
Context context, String fromDate, String toDate,
ArrayList<SVRequestBank> bank,o -> {
System.out.println(“”+ o)
return null;
});
}
Credit Check
.getCreditCheckData()
The getCreditCheckData()
method fetches the account info and data needed to perform credit check from the bank for the specified bank account and date range. For this method you need to provide the bank object with bankCode
and ConsentID
and also formDate
and toDate
as parameters.
SingleViewSDK.getCreditCheckData(
context: Context,
fromDate: String,
toDate: String,
bank: MutableList<SVRequestBank>)
{result -> println("$response") }
}
SingleViewSDK.Companion.getCreditCheckData(
Context context, String fromDate, String toDate,
ArrayList<SVRequestBank> bank,o -> {
System.out.println(“”+ o)
return null;
});
}
IBAN Verification
.getIBANVerificationForAllAccountsResponse()
The .getIBANVerificationForAllAccountsResponse()
method fetches validates the given IBANs. For this method you need to provide the bank object with bankCode
and ConsentID
and also formDate
and toDate
as parameters.
Here the bank is the SVRequestBank object which contains code for which the consentid is mapped to, and ConsentID is the ID which is authorised from the Bank. And iban number which needs to be validated.
SingleViewSDK.getIBANVerificationForAllAccountsResponse(
context: Context, bank: MutableList<SVRequestBank>)
{result -> println("$response") }
}
SingleViewSDK.Companion.getIBANVerificationForAllAccountsResponse(
Context context,
ArrayList<SVRequestBank> bank,o -> {
System.out.println(“”+ o)
return null;
});
}
.getIBANVerificationByAccountResponse()
The .getIBANVerificationByAccountResponse()
method fetches validates the given IBAN for an account. This method requires you need to provide the bank object with bankCode
and ConsentID
and also formDate
and toDate
as parameters.
Here the bank is the SVRequestBank object which contains code for which the consentid is mapped to, and ConsentID is the ID which is authorised from the Bank. And iban number which needs to be validated.
SingleViewSDK.getIBANVerificationByAccountResponse(
context: Context, bank: MutableList<SVRequestBank>)
{result -> println("$response") }
}
SingleViewSDK.Companion.getIBANVerificationByAccountResponse(
Context context,
ArrayList<SVRequestBank> bank,o -> {
System.out.println(“”+ o)
return null;
});
}
Customer Verification
.getCustomerVerificationResponse()
The getCustomerVerificationResponse()
method will give you the customer verification response. For this method you need to provide the bank object with bankCode
as a parameter. Here the bank is the SVRequestBank
object which contains code for which the consentid
is mapped and authorized by the Bank.
SingleViewSDK.getCustomerVerificationResponse(
context: Context, bank: MutableList<SVRequestBank>)
{result -> println("$response") }
}
SingleViewSDK.Companion.getCustomerVerificationResponse(
Context context,
ArrayList<SVRequestBank> bank,o -> {
System.out.println(“”+ o)
return null;
});
}
Tax Filing
.getTaxFilingData()
The getTaxFilingData()
method will give you the Tax filing report data for a specific date range and mentioned Consent ID. For this method you need to provide the bank object with bankCode
and ConsentID
and also formDate
and toDate
as a parameters. Here the bank is the SVRequestBank
object which contains code for which the consentid
mapped to an account authorized by the Bank. formDate
parameter is used to get the Tax filing report from till the toDate
mentioned in the ISO format Ex: 2022-07-12T11:11:29.245Z.
SingleViewSDK.getTaxFilingData(
context: Context,
fromDate: String,
toDate: String,
timeline: String,
bank: MutableList<SVRequestBank>)
{result -> println("$response") }
}
SingleViewSDK.Companion.getCustomerVerificationResponse(
Context context, String fromDate, String toDate, String timeline,
ArrayList<SVRequestBank> bank,o -> {
System.out.println(“”+ o)
return null;
});
}
Customization
Language
ar | Arabic |
en | English |
Updated 7 months ago