Get company name
To get a company name, call thegetCompanyName
function.info
You need to register a user token and provide a valid organisation number to get a successful response.
Getting company name
Parameter | Description |
---|---|
organisationNumber | A valid organisation number |
receiveOn | The dispatch queue used when invoking the result callback handler. Defaults to main. |
onResult | Result callback handler. |
Please note
SveaWalletClient
is deprecated in version 3.1.0. Use new class SveaAppWallet
instead.
SveaAppWalletSveaWalletClient (deprecated)
let organizationNumber = "a valid organisation number"
SveaAppWallet.shared.getCompanyName(organizationNumber: organizationNumber) { [weak self] result in
switch result {
case .success(let companyName):
print("Company name \(companyName)")
case .failure(let error):
print("Company name could not be fetch, got error \(error)")
}
}
let organizationNumber = "a valid organisation number"
SveaWalletClient.shared.getCompanyName(organizationNumber: organizationNumber) { [weak self] result in
switch result {
case .onSuccess(let companyName):
print("Company name \(companyName)")
case .onFailure(let error):
print("Company name could not be fetch, got error \(error)")
}
}
onSuccess
Returned if successful, includes a String containing the company name.
onFailure
Returned if the request to fetch the company name failed.
Possible errors
case noUserTokenProvided // A user token has not been provided.
case invalidOrganizationNumber // The organisation number is not valid.
case companyNotFound // No Swedish company could be found with the provided registration number.
case unknownError // An unknown error occurred.