Remit SDK for Android¶
The Remit SDK is a solution to ease the integration with the Alviere services.
Features¶
- Beneficiary Management
- Global Payments
- Cash-pickup
- Payout Methods
Requirements¶
- Android Studio Ladybug or above
- Android 7.0 (API level 24) or above
- Java 11+
Installation¶
Maven Central¶
1. Add Maven Central to project repositories
repositories {
// ...
mavenCentral()
}
2. Add SDK dependency to module's build.gradle file using the latest version.
dependencies {
// ...
implementation 'com.alviere.android:remit:X.Y.Z'
}
Manual¶
1. Get the latest version of Remit SDK provided by Alviere and add the files to your .m2 path location. Depending on your operation system, these are the default paths.
- Windows:
C:\Users\<User_Name>\.m2 - Linux:
/home/<User_Name>/.m2 - Mac:
/Users/<user_name>/.m2
2. Add a maven path to include the .m2 path location in project repositories.
Add the new path before mavenCentral() to respect fetch order.
repositories {
// ...
maven { url "file:/path/to/repo/m2repository/" } // Or use mavenLocal() for default path.
mavenCentral()
}
3. Add SDK dependency to module's build.gradle file using the version provided by Alviere.
dependencies {
// ...
implementation 'com.alviere.android:remit:X.Y.Z'
}
Java Version Support¶
Make sure you have enabled Java 11 language feature support. To do so, guarantee that the following configurations are on the module's build.gradle file.
android {
// ...
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
}
Usage¶
On your android application class, setup Alviere Initialization.
class AndroidApplication : Application() {
override fun onCreate() {
super.onCreate()
Alviere.init(this, EnvironmentOption.SND)
}
}
Beneficiary Management¶
This section outlines the integration with Alviere to manage beneficiaries. To start, get the RemitSdk service interface instance or use with Dependency Injection.
private val remitService = RemitSdk.service
Coroutine Usage¶
Every SDK entry function without UI is a suspend function to run inside a kotlin coroutine.
Internal code will run with withContext(Dispatchers.IO) and will return an object of type Response<T>.
val response = remitService.request(...)
when (response) {
is Response.Success -> { response.data }
is Response.Error -> { response.metadata }
}
Callback Usage¶
For every suspend function there is a callback function. UI functions will always work only thru callbacks and callbacks will always run on the main thread. Callbacks Source
Create Beneficiary¶
To create a beneficiary, use the Remit SDK service method remitService.createBeneficiary. Pass
the session_token, the account_uuid and the BeneficiaryRequest model.
val model = BeneficiaryRequest(...)
remitService.createBeneficiary(
token = session_token,
accountUuid = account_uuid,
data = model,
)
The result of this action will return the newly created BeneficiaryDetailsModel on
Response.Success and any errors will be returned on Response.Error.
List Beneficiaries¶
To get a list of beneficiaries from an account, use the Remit SDK service method remitService.listBeneficiaries. Pass
the session_token, the account_uuid and the limit/offset/type/status/legalType/withTransactionsOnly optionally.
remitService.listBeneficiaries(
token = session_token,
accountUuid = account_uuid,
)
The result of this action will return the account's beneficiaries List<BeneficiaryDetailsModel> on
Response.Success and any errors will be returned on Response.Error.
Get Beneficiary¶
To get a beneficiary, use the Remit SDK service method remitService.getBeneficiary. Pass
the session_token, the account_uuid and the beneficiary_uuid.
remitService.getBeneficiary(
token = session_token,
accountUuid = account_uuid,
beneficiaryUuid = beneficiary_uuid,
)
The result of this action will return the beneficiary of an account BeneficiaryDetailsModel on
Response.Success and any errors will be returned on Response.Error.
Update Beneficiary¶
To update a beneficiary, use the Remit SDK service method remitService.updateBeneficiary. Pass
the session_token, the account_uuid, the beneficiary_uuid and the BeneficiaryUpdateRequest model to
be updated.
val beneficiaryDetails = BeneficiaryUpdateRequest(...)
remitService.updateBeneficiary(
sessionToken = session_token,
accountUuid = account_uuid,
beneficiaryUuid = beneficiary_uuid,
data = beneficiaryDetails,
)
The result of this action will return the updated beneficiary BeneficiaryDetailsModel on
Response.Success and any errors will be returned on Response.Error.
Delete Beneficiary¶
To delete a beneficiary, use the Remit SDK service method remitService.deleteBeneficiary. Pass
the session_token, the account_uuid and the beneficiary_uuid.
remitService.deleteBeneficiary(
sessionToken = session_token,
accountUuid = account_uuid,
beneficiaryUuid = beneficiary_uuid,
)
The result of this action will return on
Response.Success and any errors will be returned on Response.Error.
Global Payments¶
This section outlines the integration with Alviere to manage global payments. To start, get the RemitSdk service interface instance or use with Dependency Injection.
private val remitService = RemitSdk.service
Coroutine Usage¶
Every SDK entry function without UI is a suspend function to run inside a kotlin coroutine.
Internal code will run with withContext(Dispatchers.IO) and will return an object of type Response<T>.
val response = remitService.request(...)
when (response) {
is Response.Success -> { response.data }
is Response.Error -> { response.metadata }
}
Callback Usage¶
For every suspend function there is a callback function. UI functions will always work only thru callbacks and callbacks will always run on the main thread. Callbacks Source
Get Quote Preview¶
To get a quote preview, use the Remit SDK service method remitService.getQuotePreview. Pass
the session_token and the QuotePreviewRequest model.
val model = QuotePreviewRequest(...)
remitService.getQuotePreview(
token = session_token,
data = model,
)
The result of this action will return the newly created QuotePreviewDetailsModel on
Response.Success and any errors will be returned on Response.Error.
Create Quote¶
To create a quote, use the Remit SDK service method remitService.createQuote. Pass
the session_token, the wallet_uuid and the QuoteRequest model.
val model = QuoteRequest(...)
remitService.createQuote(
token = session_token,
walletUuid = wallet_uuid,
data = model,
)
The result of this action will return the newly created QuoteDetailsModel on
Response.Success and any errors will be returned on Response.Error.
Create Remittance¶
To create a remittance transaction, use the Remit SDK service method remitService.createRemittance. Pass
the session_token, the wallet_uuid and the RemittanceRequest model.
val model = RemittanceRequest(...)
remitService.createRemittance(
token = session_token,
walletUuid = wallet_uuid,
data = model,
)
The result of this action will return the newly created RemittanceModel on
Response.Success and any errors will be returned on Response.Error.
Cash-pickup¶
This section outlines the integration with Alviere to manage cash-pickup. To start, get the RemitSdk service interface instance or use with Dependency Injection.
private val remitService = RemitSdk.service
Coroutine Usage¶
Every SDK entry function without UI is a suspend function to run inside a kotlin coroutine.
Internal code will run with withContext(Dispatchers.IO) and will return an object of type Response<T>.
val response = remitService.request(...)
when (response) {
is Response.Success -> { response.data }
is Response.Error -> { response.metadata }
}
Callback Usage¶
For every suspend function there is a callback function. UI functions will always work only thru callbacks and callbacks will always run on the main thread. Callbacks Source
List Cash-pickup cities¶
To get a list of cash-pickup cities, use the Remit SDK service method remitService.listCashPickupCities. Pass
the session_token and the country/state/city optionally.
remitService.listCashPickupCities(
token = session_token,
)
The result of this action will return the list of cash-pickup cities List<CashPickupCityModel> on
Response.Success and any errors will be returned on Response.Error.
List Cash-pickup locations¶
To get a list of cash-pickup locations, use the Remit SDK service method remitService.listCashPickupLocations. Pass
the session_token, the, city_uuid and the network optionally.
remitService.listCashPickupLocations(
token = session_token,
cityUuid = city_uuid,
)
The result of this action will return the list of cash-pickup locations List<CashPickupLocationModel> on
Response.Success and any errors will be returned on Response.Error.
Get Cash-pickup location¶
To get a cash-pickup location, use the Remit SDK service method remitService.getCashPickupLocation. Pass
the session_token and the cash_pickup_location_uuid.
remitService.getCashPickupLocation(
token = session_token,
cashPickupLocationUuid = cash_pickup_location_uuid,
)
The result of this action will return the cash-pickup location CashPickupLocationModel on
Response.Success and any errors will be returned on Response.Error.
Payout Methods¶
This section outlines the integration with Alviere to manage payout methods from beneficiaries. To start, get the RemitSdk service interface instance or use with Dependency Injection.
private val remitService = RemitSdk.service
Coroutine Usage¶
Every SDK entry function without UI is a suspend function to run inside a kotlin coroutine.
Internal code will run with withContext(Dispatchers.IO) and will return an object of type Response<T>.
val response = remitService.request(...)
when (response) {
is Response.Success -> { response.data }
is Response.Error -> { response.metadata }
}
Callback Usage¶
For every suspend function there is a callback function. UI functions will always work only thru callbacks and callbacks will always run on the main thread. Callbacks Source
List Supported Currencies¶
To get a list of supported currencies for payout method, use the Remit SDK service method remitService.listSupportedCurrencies.
Pass the session_token.
remitService.listSupportedCurrencies(
token = session_token,
)
The result of this action will return the supported currencies SupportedCurrenciesModel on
Response.Success and any errors will be returned on Response.Error.
List Supported Banks¶
To get a list of supported banks, use the Remit SDK service method remitService.listSupportedBanks. Pass
the session_token and the country.
remitService.listSupportedBanks(
token = session_token,
country = country,
)
The result of this action will return the supported banks List<BankDetailsModel> on
Response.Success and any errors will be returned on Response.Error.
Get Bank Details¶
To get a bank details, use the Remit SDK service method remitService.getBankDetails. Pass
the session_token and the bankUuid.
remitService.getBankDetails(
token = session_token,
bankUuid = bankUuid,
)
The result of this action will return the bank details BankDetailsModel on
Response.Success and any errors will be returned on Response.Error.
Create Payout Method¶
To create a payout method, use the Remit SDK service method remitService.createPayoutMethod. Pass
the session_token, the beneficiary_uuid and the PayoutMethodRequest model.
val model = PayoutMethodRequest(...)
remitService.createPayoutMethod(
token = session_token,
beneficiaryUuid = beneficiary_uuid,
data = model,
)
The result of this action will return the newly created PayoutMethodModel on
Response.Success and any errors will be returned on Response.Error.
List Payout Methods¶
To get a list of payout methods from a beneficiary, use the Remit SDK service method remitService.listPayoutMethods. Pass
the session_token, the beneficiary_uuid and the limit/offset optionally.
remitService.listBeneficiaries(
token = session_token,
beneficiaryUuid = beneficiary_uuid,
)
The result of this action will return the beneficiary payout methods List<PayoutMethodModel> on
Response.Success and any errors will be returned on Response.Error.
Get Payout Method¶
To get a payout method, use the Remit SDK service method remitService.getPayoutMethod. Pass
the session_token and the payout_method_uuid.
remitService.getPayoutMethod(
token = session_token,
payoutMethodUuid = payout_method_uuid,
)
The result of this action will return the payout method PayoutMethodModel on
Response.Success and any errors will be returned on Response.Error.
Update Payout Method¶
To update a payout method, use the Remit SDK service method remitService.updatePayoutMethod. Pass
the session_token, the payout_method_uuid and the PayoutMethodUpdateRequest model to
be updated.
val model = PayoutMethodUpdateRequest(...)
remitService.updatePayoutMethod(
sessionToken = session_token,
payoutMethodUuid = payout_method_uuid,
data = model,
)
The result of this action will return the updated beneficiary BeneficiaryDetailsModel on
Response.Success and any errors will be returned on Response.Error.
Delete Payout Method¶
To delete a payout method, use the Remit SDK service method remitService.deletePayoutMethod. Pass
the session_token and the payout_method_uuid.
remitService.deletePayoutMethod(
sessionToken = session_token,
payoutMethodUuid = payout_method_uuid,
)
The result of this action will return on
Response.Success and any errors will be returned on Response.Error.