Version 1.1.1
1.1. What is Budget Control SDK?
2.1. Basic information
2.2. Basic configuration
2.4. Error handling
3.1. getInvitation
3.2. initializeRedeemCard (deprecated)
3.3. finalizeRedeemCard (deprecated)
3.4. getVcnDetails
3.5. getCards
3.6. getCardDetails
3.7. getAlerts
3.8. deleteAlert
3.10. addApproval
3.11. redeemInvitation
4.1 Version 1.0.0
4.2 Version 1.0.1
4.3 Version 1.0.2
Budget Control sdk is a closed framework providing services for business card management. By using an invitation, you can join the programme and use payment cards assigned to your account by the administrator.
Services provide methods to:
Budget Control SDK requires Mobile DC as a dependency. It’s required for the Budget Control SDK to work correctly and handles user’s session and data. Please read the Mobile DC SDK’s documentation to see more details about the installation and integration process
In order to incorporate this SDK into your app, see Basic configuration
SDK is based on semantic versioning.
For example: 1.0.0 ( MAJOR.MINOR.PATCH )
Changes not breaking compatibility:
This section describes basic information about Budget Control SDK setup and available methods.
Facade is an entry point to communication with Budget Control SDK.
Budget Control SDK provides two public API's with same functionalities, the API's are:
The difference between the API's is a way of providing data to SDK methods and getting the results from them.
Input and output as an data models are the same.
This documentation presents I/O types in a Kotlin way as it's easier to mark nullable fields (as question mark).
Every method description has same structure.
Execution type:
Method type:
Input
Input parameters with name,
type and description.
Output
Result delivered by standard Callback with data or result is suspended until the Coroutine
completes <Multiple facade
types>
.
The minSdkVersion must be at least 23 (Android 6.0).
SDK is available on Verestro maven repository and can be configured in project using Gradle build system.
Username and password are provided by Verestro.
repositories {
maven {
credentials {
username "<enter_username_here>"
password "<enter_password_here>"
}
url "https://artifactory.upaid.pl/artifactory/libs-release-local/"
}
}
Budget Control SDK is available in two versions:
debug and release.
The difference between version is debug allows to use application with debugger connected.
Debug version is ended with appendix "-debug" in version name.
Samples below.
For release version, used on production environment in application uploaded to Google Play:
dependencies {
implementation 'com.verestro.sdk:bc:${version}'
implementation 'pl.upaid.module:mobiledc:{version}'
}
For debugging purposes:
dependencies {
implementation 'com.verestro.sdk:bc-dev:${version}-debug'
implementation 'pl.upaid.module:mobiledc:{version}-debug'
}
As SDK is written in Kotlin language we recommend to add following code to gradle configuration:
android {
...
kotlinOptions {
freeCompilerArgs = [
'-Xno-param-assertions',
'-Xno-call-assertions',
'-Xno-receiver-assertions'
]
}
packagingOptions { exclude '/kotlin_metadata/**' }
...
}
Then use newest tools for code shrinking, optimization and obfuscation from Google by enabling R8 instead Proguard in gradle.properties file:
android.enableR8=true
Available configuration methods:
Configuration
Parameter | Type | Description |
---|---|---|
configuration | Configuration | Configuration model |
Configuration
Parameter | Type | Description |
---|---|---|
url | String | API hostname URL |
certificateHashes | List<String> | API hostname Pin SHA256 |
BudgetControlCoroutineApi
fun init(configuration: Configuration) {
BudgetControlCoroutineApi.init(configuration)
}
BudgetControlStdApi
fun init(configuration: Configuration) {
BudgetControlStdApi.init(configuration)
}
SDK returns errors by BcSdkException, which could be catched by application and shown on UI with detailed message.
Table below describes general exception types.
Exception type | Exception class | Description |
---|---|---|
Backend | BcSdkException | Provides additional validation or error on backend side. Application should get reason code and show suitable message or made action. Message should be never shown to user. Could be logged for error reporting and for developers. List of available exceptions in table below |
BcSdkException
Exception | Parameters | Description |
---|---|---|
HttpApiException | code: Int, message: String? | HTTP API exception. |
TechnicalException | message: String? | Technical exception. |
NoSessionException | User is unauthorized - session expired. | |
RequestCancelled | Request was canceled. | |
UnknownErrorStatus | status: String? | An unknown error occurred. |
InvalidInvitationCode | Invalid invitation code. | |
ResourceNotFound | Resource not found. | |
InvalidId | Invalid id. | |
ApprovalRequestExist | Approval request exist. | |
CardAssignedToAnotherUser | Card assigned to another user. | |
NoCertificatePinningException | No certificate pinning. | |
UnknownApprovalStatus | Unknown approval status | |
UnknownTimeUnit | An unknown time unit - available 3 types DAILY, WEEKLY, MONTHLY. | |
ValidationException | Contains list of ValidationError. | |
ParseValidationErrorException | Error occurs while validation exception parsing. |
ValidationException
Parameter | Type | Description |
---|---|---|
validationErrors | List<ValidationError> | List of errors |
ValidationError
Parameter | Type | Description |
---|---|---|
errorReason | ValidationErrorReason | Validation error reason |
errorMessage | String | Error message |
ValidationErrorReason
Reason | Description |
---|---|
InvalidDateTo | Invalid date to |
InvalidDateFrom | Invalid date form |
InvalidAmount | Invalid amount |
Asynchronous. Online.
This method provides invitation code from Budget Control backend.
InvitationData
Parameter | Type | Description |
---|---|---|
invitationData | InvitationData | Get invitation data model |
InvitationData
Parameter | Type | Description |
---|---|---|
invitationCode | String | Invitation code that will be required for initialize user registration process |
Success callback with InvitationResult model.
InvitationResult
Parameter | Type | Description |
---|---|---|
getInvitation | InvitationResult | Get invitation result model |
InvitationResult
Parameter | Type | Description |
---|---|---|
invitation | InvitationModel | Invitation model |
InvitationModel
Parameter | Type | Description |
---|---|---|
invitationCode | String | Invitation code |
phonePrefix | String | Phone prefix |
phoneNumber | String | User's phone number |
String | User's email | |
termsAndConditions | List<TermsAndConditionsModel> | List of terms and conditions to be accepted |
TermsAndConditionsModel
Parameter | Type | Description |
---|---|---|
id | String | Id of T&C |
header | String | Header of T&C |
content | String | Content of T&C |
Failure callback with throwable.
BcSdkException
Exception | Parameters | Description |
---|---|---|
HttpApiException | code: Int, message: String? | HTTP API exception |
TechnicalException | message: String? | Technical exception |
NoSessionException | User is unauthorized - session expired | |
RequestCancelled | Request was canceled | |
UnknownErrorStatus | status: String? | An unknown error occurred |
ResourceNotFound | Resource not found | |
InvalidId | Invalid id | |
InvalidInvitationCode | Invalid invitation code |
Standard
Callback
fun getInvitation(invitationData : InvitationData) {
BudgetControlStdApi
.BudgetControlStdService
.getInvitation(
invitationData = invitationData,
callback = object : ApiCallback<InvitationResult> {
override fun onSuccess(response: InvitationResult) {
/*TODO: do something with get invitation result*/
}
override fun onFailure(error: Throwable) {
/*TODO: something went wrong*/
}
}
)
}
Kotlin
Coroutines
suspend fun getInvitation(invitationData : InvitationData): InvitationResult =
BudgetControlCoroutineApi
.BudgetControlCoroutineService
.getInvitation(invitationData = invitationData)
Asynchronous. Online.
Initialize reedem card process.
RedeemCardData
Parameter | Type | Description |
---|---|---|
redeemCardData | RedeemCardData | Redeem card data model |
RedeemCardData
Parameter | Type | Description |
---|---|---|
invitationCode | String | Invitation code that will be required to initialize invitation acceptance process |
Success callback with InitializeRedeemCardResult model.
InitializeRedeemCardResult
InitializeRedeemCardResult is an empty class.
Failure callback with throwable.
BcSdkException
Exception | Parameters | Description |
---|---|---|
HttpApiException | code: Int, message: String? | HTTP API exception |
TechnicalException | message: String? | Technical exception |
NoSessionException | User is unauthorized - session expired | |
RequestCancelled | Request was canceled | |
UnknownErrorStatus | status: String? | An unknown error occurred |
ResourceNotFound | Resource not found | |
InvalidId | Invalid id |
Standard
Callback
fun initializeRedeemCard(redeemCardData : RedeemCardData) {
BudgetControlStdApi
.BudgetControlStdService
.initializeRedeemCard(
redeemCardData = redeemCardData,
callback = object : ApiCallback<InitializeRedeemCardResult> {
override fun onSuccess(response: InitializeRedeemCardResult) {
/*TODO: do something with response*/
}
override fun onFailure(error: Throwable) {
/*TODO: something went wrong*/
}
}
)
}
Kotlin
Coroutines
suspend fun initializeRedeemCard(redeemCardData : RedeemCardData): InitializeRedeemCardResult =
BudgetControlCoroutineApi
.BudgetControlCoroutineService
.initializeRedeemCard(redeemCardData = redeemCardData)
Asynchronous. Online.
Finalize redeem card.
FinalizeRedeemCardData
Parameter | Type | Description |
---|---|---|
finalizeRedeemCardData | FinalizeRedeemCardData | Finalize redeem card data model |
FinalizeRedeemCardData
Parameter | Type | Description |
---|---|---|
invitationCode | String | Invitation code that will be required to initialize invitation acceptance process |
confirmationCode | String | One time password (sent via SMS ) |
Success callback with FinalizeRedeemCardResult model.
FinalizeRedeemCardResult
FinalizeRedeemCardResult is an empty class.
Failure callback with throwable.
Standard
Callback
fun finalizeRedeemCard(
finalizeRedeemCardData : FinalizeRedeemCardData
) {
BudgetControlStdApi
.BudgetControlStdService
.finalizeInvitationAcceptance(
finalizeRedeemCardData = finalizeRedeemCardData,
callback = object : ApiCallback<FinalizeRedeemCardResult> {
override fun onSuccess(response: FinalizeRedeemCardResult) {
/*TODO: do something with response*/
}
override fun onFailure(error: Throwable) {
/*TODO: something went wrong*/
}
}
)
}
Kotlin
Coroutines
suspend fun finalizeRedeemCard(
finalizeRedeemCardData : FinalizeRedeemCardData
): FinalizeRedeemCardResult =
BudgetControlCoroutineApi
.BudgetControlCoroutineService
.finalizeInvitationAcceptance(finalizeRedeemCardData = finalizeRedeemCardData)
BcSdkException
Exception | Parameters | Description |
---|---|---|
HttpApiException | code: Int, message: String? | HTTP API exception |
TechnicalException | message: String? | Technical exception |
NoSessionException | User is unauthorized - session expired | |
RequestCancelled | Request was canceled | |
UnknownErrorStatus | status: String? | An unknown error occurred |
ResourceNotFound | Resource not found | |
InvalidId | Invalid id |
Asynchronous. Online.
Provide vcn details from Budget Control backend. When communicating with the API, the encrypted PAN number is used.
Decryption on the sdk side.
Sensitive data processed in arrays and should be cleared after use.
VcnDetailsData
Parameter | Type | Description |
---|---|---|
vcnDetailsData | VcnDetailsData | Get vcn details data model |
VcnDetailsData
Parameter | Type | Description |
---|---|---|
cardId | Long | Card identifier |
Success callback with VcnDetailsResult model.
VcnDetailsResult
Parameter | Type | Description |
---|---|---|
getVcnDetails | VcnDetailsResult | Get vcn details result model |
VcnDetailsResult
Parameter | Type | Description |
---|---|---|
vcnDetails | VcnDetailsModel | Vcn details model |
VcnDetailsModel
Parameter | Type | Description |
---|---|---|
pan | CharArray | Card number |
expireDate | CharArray | Card expire date |
cvc | CharArray | Card verification code |
Failure callback with throwable.
BcSdkException
Exception | Parameters | Description |
---|---|---|
HttpApiException | code: Int, message: String? | HTTP API exception |
TechnicalException | message: String? | Technical exception |
NoSessionException | User is unauthorized - session expired | |
RequestCancelled | Request was canceled | |
UnknownErrorStatus | status: String? | An unknown error occurred |
ResourceNotFound | Resource not found | |
InvalidId | Invalid id |
Standard
Callback
fun getVcnDetails(vcnDetailsData : VcnDetailsData) {
BudgetControlStdApi
.BudgetControlStdService
.getVcnDetails(
vcnDetailsData = vcnDetailsData,
callback = object : ApiCallback<VcnDetailsResult> {
override fun onSuccess(response: VcnDetailsResult) {
/*TODO: do something with vcn details result , clear sensitive data by using clear() method*/
}
override fun onFailure(error: Throwable) {
/*TODO: something went wrong*/
}
}
)
}
Kotlin
Coroutines
suspend fun getVcnDetails(vcnDetailsData : VcnDetailsData): VcnDetailsResult =
BudgetControlCoroutineApi
.BudgetControlCoroutineService
.getVcnDetails(vcnDetailsData = vcnDetailsData)
Asynchronous. Online.
Provides user cards from Budget Control backend.
No input parameters.
Success callback with CardsResult model.
CardsResult
Parameter | Type | Description |
---|---|---|
getCards | CardsResult | Get cards result model |
CardsResult
Parameter | Type | Description |
---|---|---|
cards | List<CardModel> | List of user cards |
CardModel
Parameter | Type | Description |
---|---|---|
id | Long | Card id |
lastFourDigits | String? | Last four digits of user card |
samsungPay | Boolean | Flag indicating support for Samsung Pay |
applePay | Boolean | Flag indicating support for Apple Pay |
mdes | Boolean | flag indicating support for contactless payment |
googlePay | Boolean | Flag indicating support for Google Pay |
startDate | String? | Start date of assigning the card for a specific period |
endDate | String? | End date of assigning the card for a specific period |
cumulativeLimitMinor | Long | Card limit to be used |
currency | CurrencyModel | Currency model |
hasVcn | Boolean | Flag indicating if card has vcn |
CurrencyModel
Parameter | Type | Description |
---|---|---|
code | String | Currency code (ISO 4217, three letter code) |
numeric | Int | Currency numeric (ISO 4217) |
Failure callback with throwable.
BcSdkException
Exception | Parameters | Description |
---|---|---|
HttpApiException | code: Int, message: String? | HTTP API exception |
TechnicalException | message: String? | Technical exception |
NoSessionException | User is unauthorized - session expired | |
RequestCancelled | Request was canceled | |
UnknownErrorStatus | status: String? | An unknown error occurred |
ResourceNotFound | Resource not found | |
InvalidId | Invalid id |
Standard
Callback
fun getCards() {
BudgetControlStdApi
.BudgetControlStdService
.getCards(
callback = object : ApiCallback<CardsResult> {
override fun onSuccess(response: CardsResult) {
/*TODO: do something with get cards result*/
}
override fun onFailure(error: Throwable) {
/*TODO: something went wrong*/
}
}
)
}
Kotlin
Coroutines
suspend fun getCards(): CardsResult =
BudgetControlCoroutineApi
.BudgetControlCoroutineService
.getCards()
Asynchronous. Online.
Provides user card details from Budget Control backend.
CardDetailsData
Parameter | Type | Description |
---|---|---|
cardDetailsData | CardDetailsData | Get card details data model |
CardDetailsData
Parameter | Type | Description |
---|---|---|
cardId | Long | Card identifier |
Success callback with CardDetailsResult model.
CardDetailsResult
Parameter | Type | Description |
---|---|---|
getCardDetails | CardDetailsResult | Get card details result model |
CardDetailsResult
Parameter | Type | Description |
---|---|---|
cardDetails | CardDetailsModel | Details of user card |
CardDetailsModel
Parameter | Type | Description |
---|---|---|
id | Long | Card id |
budgetMinor | Long | User's balance |
cumulativeMinor | Long | Card limit to be used |
periodicLimits | List<PeriodicLimitModel | List of limits to be used in a specific time |
currency | CurrencyModel | Currency model |
pendingApproval | PendingApprovalModel? | Pending approval of data change assignment |
isGooglePaySupported | Boolean | Flag information about Google Pay support |
isSamsungPaySupported | Boolean | Flag information about Samsung Pay support |
lastFourDigits | CharArray | Last four digits of user card |
hasVcn | Boolean | Flag indicating if card has vcn |
endDate | String | End date of assigning the card for a specific period |
startDate | String | Start date of assigning the card for a specific period |
isOneTimeVcn | Boolean | Flag information about if card is one time use |
PeriodicLimitModel
Parameter | Type | Description |
---|---|---|
limitMinor | Long | Card limit to be used |
timeUnit | TimeUnitModel | Time unit |
TimeUnitModel
Time | Description |
---|---|
DAILY | Daily limit time unit |
WEEKLY | Weekly limit time unit |
MONTHLY | Monthly limit time unit |
CurrencyModel
Parameter | Type | Description |
---|---|---|
code | String | Currency code (ISO 4217, three letter code) |
numeric | Int | Currency numeric (ISO 4217) |
PendingApprovalModel
Parameter | Type | Description |
---|---|---|
endDate | String | End date of assigning the card for a specific period |
cumulativeLimitMinor | Int | Card limit to be used |
periodicLimits | List<PeriodicLimitModel> | List of limits to be used in a specific time |
Failure callback with throwable.
BcSdkException
Exception | Parameters | Description |
---|---|---|
HttpApiException | code: Int, message: String? | HTTP API exception |
TechnicalException | message: String? | Technical exception |
NoSessionException | User is unauthorized - session expired | |
RequestCancelled | Request was canceled | |
UnknownErrorStatus | status: String? | An unknown error occurred |
ResourceNotFound | Resource not found | |
InvalidId | Invalid id | |
UnknownTimeUnit | An unknown time unit - available 3 types DAILY, WEEKLY, MONTHLY |
Standard
Callback
fun getCardDetails(cardDetailsData : CardDetailsData) {
BudgetControlStdApi
.BudgetControlStdService
.getCardDetails(
cardDetailsData = cardDetailsData,
callback = object : ApiCallback<CardDetailsResult> {
override fun onSuccess(response: CardDetailsResult) {
/*TODO: do something with get card details result*/
}
override fun onFailure(error: Throwable) {
/*TODO: something went wrong*/
}
}
)
}
Kotlin
Coroutines
suspend fun getCardDetails(cardDetailsData : CardDetailsData): CardDetailsResult =
BudgetControlCoroutineApi
.BudgetControlCoroutineService
.getCardDetails(cardDetailsData = cardDetailsData)
Asynchronous. Online.
Provides user alerts from Budget Control backend.
No input parameters.
Success callback with AlertsResult model.
AlertsResult
Parameter | Type | Description |
---|---|---|
getAlerts | AlertsResult | Get alerts result model |
AlertsResult
Parameter | Type | Description |
---|---|---|
alerts | AlertsModel | List with different types of alerts |
AlertsModel
Parameter | Type | Description |
---|---|---|
issuerTermsAndConditions | List<IssuerTermsAndConditionsModel> | List of terms and conditions to be approved for a specific issuer |
notifications | List<NotificationModel> | List of notifications |
IssuerTermsAndConditionsModel
Parameter | Type | Description |
---|---|---|
issuer | IssuerModel | Issuer model |
termsAndConditions | List<TermsAndConditionsModel> | List of terms and conditions |
IssuerModel
Parameter | Type | Description |
---|---|---|
id | String | Issuer id |
name | String | Issuer name |
TermsAndConditionsModel
Parameter | Type | Description |
---|---|---|
id | String | Id of T&C |
header | String | Header of T&C |
content | String | Content of T&C |
NotificationModel
Parameter | Type | Description |
---|---|---|
id | String | Id of notification |
header | String | Header of notification |
content | String | Content of notification |
type | String | Notification type |
createdAt | String | Creation date of the notification |
notificationDetails | NotificationDetailsModel? | Notification details model |
NotificationDetailsModel
Parameter | Type | Description |
---|---|---|
cumulativeLimitMinor | String | Card limit to be used |
endDate | Long | End date of assigning the card for a specific period |
periodicLimits | List<PeriodicLimitModel> | List of limits to be used in a specific time |
approvalStatus | ApprovalStatus | Approval status |
lastFourDigits | CharArray | Last four digits of user card |
currencyCode | String | Currency code (ISO 4217, three letter code) |
ApprovalStatus
Reason | Description |
---|---|
ACCEPTED | Approval status accepted |
REJECTED | Approval status rejected |
PeriodicLimitModel
Parameter | Type | Description |
---|---|---|
limitMinor | Long | Card limit to be used |
timeUnit | TimeUnitModel | Time unit |
TimeUnitModel
Time | Description |
---|---|
DAILY | Daily limit time unit |
WEEKLY | Weekly limit time unit |
MONTHLY | Monthly limit time unit |
Failure callback with throwable.
BcSdkException
Exception | Parameters | Description |
---|---|---|
HttpApiException | code: Int, message: String? | HTTP API exception |
TechnicalException | message: String? | Technical exception |
NoSessionException | User is unauthorized - session expired | |
RequestCancelled | Request was canceled | |
UnknownErrorStatus | status: String? | An unknown error occurred |
ResourceNotFound | Resource not found | |
InvalidId | Invalid id | |
UnknownApprovalStatus | Unknown approval status | |
UnknownTimeUnit | An unknown time unit - available 3 types DAILY, WEEKLY, MONTHLY |
Standard
Callback
fun getAlerts() {
BudgetControlStdApi
.BudgetControlStdService
.getAlerts(
callback = object : ApiCallback<AlertsResult> {
override fun onSuccess(response: AlertsResult) {
/*TODO: do something with get alerts result*/
}
override fun onFailure(error: Throwable) {
/*TODO: something went wrong*/
}
}
)
}
Kotlin
Coroutines
suspend fun getAlerts(): AlertsResult =
BudgetControlCoroutineApi
.BudgetControlCoroutineService
.getAlerts()
Asynchronous. Online.
Delete alert with given alert id.
DeleteAlertData
Parameter | Type | Description |
---|---|---|
deleteAlertData | DeleteAlertData | Delete alert data model |
DeleteAlertData
Parameter | Type | Description |
---|---|---|
alertId | String | Id of deleting alert |
Success callback with DeleteAlertResult model.
DeleteAlertResult
DeleteAlertResult is an empty class.
Failure callback with throwable.
BcSdkException
Exception | Parameters | Description |
---|---|---|
HttpApiException | code: Int, message: String? | HTTP API exception |
TechnicalException | message: String? | Technical exception |
NoSessionException | User is unauthorized - session expired | |
RequestCancelled | Request was canceled | |
UnknownErrorStatus | status: String? | An unknown error occurred |
ResourceNotFound | Resource not found | |
InvalidId | Invalid id |
Standard
Callback
fun deleteAlert(deleteAlertData: DeleteAlertData) {
BudgetControlStdApi
.BudgetControlStdService
.deleteAlert(
deleteAlertData = deleteAlertData,
callback = object : ApiCallback<DeleteAlertResult> {
override fun onSuccess(response: DeleteAlertResult) {
/*TODO: do something with delete alert result*/
}
override fun onFailure(error: Throwable) {
/*TODO: something went wrong*/
}
}
)
}
Kotlin
Coroutines
suspend fun deleteAlert(deleteAlertData: DeleteAlertData): DeleteAlertResult =
BudgetControlCoroutineApi
.BudgetControlCoroutineService
.deleteAlert(deleteAlertData = deleteAlertData)
Asynchronous. Online.
Accept terms and conditions with given issuer id.
IssuerData
Parameter | Type | Description |
---|---|---|
issuerData | IssuerData | Issuer Data model. |
IssuerData
Parameter | Type | Description |
---|---|---|
issuerId | String | Issuer identifier. |
Success callback with AcceptTermsAndConditionsResult model.
AcceptTermsAndConditionsResult
AcceptTermsAndConditionsResult is an empty class.
Failure callback with throwable.
BcSdkException
Exception | Parameters | Description |
---|---|---|
HttpApiException | code: Int, message: String? | HTTP API exception |
TechnicalException | message: String? | Technical exception |
NoSessionException | User is unauthorized - session expired | |
RequestCancelled | Request was canceled | |
UnknownErrorStatus | status: String? | An unknown error occurred |
ResourceNotFound | Resource not found | |
InvalidId | Invalid id |
Standard
Callback
fun acceptTermsAndConditions(issuerData: IssuerData) {
BudgetControlStdApi
.BudgetControlStdService
.acceptTermsAndConditions(
issuerData = issuerData,
callback = object : ApiCallback<AcceptTermsAndConditionsResult> {
override fun onSuccess(response: AcceptTermsAndConditionsResult) {
/*TODO: do something with accept t&c result*/
}
override fun onFailure(error: Throwable) {
/*TODO: something went wrong*/
}
}
)
}
Kotlin
Coroutines
suspend fun acceptTermsAndConditions(issuerData: IssuerData): AcceptTermsAndConditionsResult =
BudgetControlCoroutineApi
.BudgetControlCoroutineService
.acceptTermsAndConditions(issuerData = issuerData)
Asynchronous. Online.
Add approval request to change the assigned card limits.
AddApprovalData
Parameter | Type | Description |
---|---|---|
addApprovalData | AddApprovalData | Add approval data model |
AddApprovalData
Parameter | Type | Description |
---|---|---|
cardId | Long | Card identifier |
endDate | String | End date of assigning the card for a specific period |
cumulativeLimitMinor | Long | Card limit to be used |
periodicLimits | List<PeriodicLimitModel> | List of limits to be used in a specific time |
PeriodicLimitModel
Parameter | Type | Description |
---|---|---|
limitMinor | Long | Card limit to be used |
timeUnit | TimeUnit | Time unit |
TimeUnit
Periodic | Description |
---|---|
DAILY | Daily limit time unit |
WEEKLY | Weekly limit time unit |
MONTHLY | Monthly limit time unit |
Success callback with AddApprovalResult model.
AddApprovalResult
AddApprovalResult is an empty class.
Failure callback with throwable.
BcSdkException
Exception | Parameters | Description |
---|---|---|
HttpApiException | code: Int, message: String? | HTTP API exception |
TechnicalException | message: String? | Technical exception |
NoSessionException | User is unauthorized - session expired | |
RequestCancelled | Request was canceled | |
UnknownErrorStatus | status: String? | An unknown error occurred |
ResourceNotFound | Resource not found | |
InvalidId | Invalid id | |
ApprovalRequestExist | Approval request exist | |
CardAssignedToAnotherUser | Card assigned to another user | |
UnknownTimeUnit | An unknown time unit - available 3 types DAILY, WEEKLY, MONTHLY |
Standard
Callback
fun addApproval(addApprovalData: AddApprovalData) {
BudgetControlStdApi
.BudgetControlStdService
.addApproval(
addApprovalData = addApprovalData,
callback = object : ApiCallback<AddApprovalResult> {
override fun onSuccess(response: AddApprovalResult) {
/*TODO: do something with add approval result*/
}
override fun onFailure(error: Throwable) {
/*TODO: something went wrong*/
}
}
)
}
Kotlin
Coroutines
suspend fun addApproval(addApprovalData: AddApprovalData): AddApprovalResult =
BudgetControlCoroutineApi
.BudgetControlCoroutineService
.addApproval(addApprovalData = addApprovalData)
Asynchronous. Online.
Initialize reedem card process.
RedeemInvitationData
Parameter | Type | Description |
---|---|---|
invitationCode | String | Invitation code that will be required to initialize invitation acceptance process |
Success callback with RedeemInvitationResult model.
RedeemInvitationResult
Parameter | Type | Description |
---|---|---|
redeemInvitation | RedeemInvitationModel | Redeem Invitation model |
RedeemInvitationModel
Parameter | Type | Description |
---|---|---|
phonePrefix | String | Phone prefix |
phoneNumber | String | User's phone number |
Failure callback with throwable.
BcSdkException
Exception | Description |
---|---|
ResourceNotFound | Resource not found |
Standard
Callback
fun redeemInvitation(redeemInvitationData : RedeemInvitationData) {
BudgetControlStdApi
.BudgetControlStdService
.redeemInvitation(
redeemInvitationData = redeemInvitationData,
callback = object : ApiCallback<RedeemInvitationResult> {
override fun onSuccess(response: RedeemInvitationResult) {
/*TODO: do something with response*/
}
override fun onFailure(error: Throwable) {
/*TODO: something went wrong*/
}
}
)
}
Kotlin
Coroutines
suspend fun redeemInvitation(redeemInvitationData : RedeemInvitationData): RedeemInvitationResult =
BudgetControlCoroutineApi
.BudgetControlCoroutineService
.redeemInvitation(redeemInvitationData = redeemInvitationData)
Asynchronous. Online.
Finalize redeem card.
RedeemInvitationConfirmationCodeData
Parameter | Type | Description |
---|---|---|
invitationCode | String | Invitation code that will be required to initialize invitation acceptance process |
confirmationCode | String | One time password (sent via SMS ) |
Success callback with RedeemInvitationConfirmationCodeResult model. RedeemInvitationConfirmationCodeResult is an empty class.
Failure callback with throwable.
Standard
Callback
fun redeemInvitationConfirmationCode(
redeemInvitationConfirmationCodeData : RedeemInvitationConfirmationCodeData
) {
BudgetControlStdApi
.budgetControlStdService
.redeemInvitationConfirmationCode(
redeemInvitationConfirmationCodeData = redeemInvitationConfirmationCodeData,
callback = object : ApiCallback<RedeemInvitationConfirmationCodeResult> {
override fun onSuccess(response: RedeemInvitationConfirmationCodeResult) {
/*TODO: do something with response*/
}
override fun onFailure(error: Throwable) {
/*TODO: something went wrong*/
}
}
)
}
Kotlin
Coroutines
suspend fun redeemInvitationConfirmationCode(
redeemInvitationConfirmationCodeData : RedeemInvitationConfirmationCodeData
): RedeemInvitationConfirmationCodeResult =
BudgetControlCoroutineApi
.budgetControlCoroutineService
.redeemInvitationConfirmationCode(redeemInvitationConfirmationCodeData = redeemInvitationConfirmationCodeData)
BcSdkException
Exception | Parameters | Description |
---|---|---|
ResourceNotFound | Resource not found |
redeemInvitation
,
redeemInvitationConfirmationCode
initializeRedeemCard
and finalizeRedeemCard
have been deprecated