OSID Logo
OSID Specifications
billing package
Version 3.0.0
Release Candidate Preview
Interfaceosid.billing.CustomerAdminSession
Implementsosid.OsidSession
Description

This session creates, updates, and deletes Customers. The data for create and update is provided by the consumer via the form object. OsidForms are requested for each create or update and may not be reused.

Create and update operations differ in their usage. To create a Customer, a CustomerForm is requested using getCustomerFormForCreate() specifying the desired resource and record Types or none if no record Types are needed. The returned CustomerForm will indicate that it is to be used with a create operation and can be used to examine metdata or validate data prior to creation. Once the CustomerForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each CustomerForm corresponds to an attempted transaction.

For updates, CustomerForms are requested to the Customer Id that is to be updated using getCustomerFormForUpdate(). Similarly, the CustomerForm has metadata about the data that can be updated and it can perform validation before submitting the update. The CustomerForm can only be used once for a successful update and cannot be reused.

The delete operations delete Customers. To unmap a Customer from the current Business, the CustomerBusinessAssignmentSession should be used. These delete operations attempt to remove the Customer itself thus removing it from all known Business catalogs.

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

MethodgetBusinessId
Description

Gets the Business Id associated with this session.

Returnosid.id.Idthe Business Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetBusiness
Description

Gets the Business associated with this session.

Returnosid.billing.Businessthe business
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateCustomers
Description

Tests if this user can create Customers. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Customer will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.

Returnboolean false if Customer creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateCustomerWithRecordTypes
Description

Tests if this user can create a single Customer using the desired record types. While BillingManager.getCustomerRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Customer. Providing an empty array tests if a Customer can be created with no records.

Parametersosid.type.Type[]customerRecordTypesarray of customer record types
Returnboolean true if Customer creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT customerRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetCustomerFormForCreate
Description

Gets the customer form for creating new customers. A new form should be requested for each create transaction.

Parametersosid.id.IdresourceIda resource Id
osid.type.Type[]customerRecordTypesarray of customer record types
Returnosid.billing.CustomerFormthe customer form
ErrorsNOT_FOUND resourceId is not found
NULL_ARGUMENT customerRecordTypes or resourceId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateCustomer
Description

Creates a new Customer.

Parametersosid.billing.CustomerFormcustomerFormthe form for this Customer
Returnosid.billing.Customerthe new Customer
ErrorsILLEGAL_STATE customerForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT customerForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED customerForm did not originate from getCustomerFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateCustomers
Description

Tests if this user can update Customers. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Customer will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.

Returnboolean false if Customer modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodgetCustomerFormForUpdate
Description

Gets the customer form for updating an existing customer. A new customer form should be requested for each update transaction.

Parametersosid.id.IdcustomerIdthe Id of the Customer
Returnosid.billing.CustomerFormthe customer form
ErrorsNOT_FOUND customerId is not found
NULL_ARGUMENT customerId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateCustomer
Description

Updates an existing customer.

Parametersosid.billing.CustomerFormcustomerFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE customerForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT customerForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED customerForm did not originate from getCustomerFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteCustomers
Description

Tests if this user can delete Customers. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Customer will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.

Returnboolean false if Customer deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeleteCustomer
Description

Deletes a Customer.

Parametersosid.id.IdcustomerIdthe Id of the Customer to remove
ErrorsNOT_FOUND customerId not found
NULL_ARGUMENT customerId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageCustomerAliases
Description

Tests if this user can manage Id aliases for Customers. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.

Returnboolean false if Customer aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasCustomer
Description

Adds an Id to a Customer for the purpose of creating compatibility. The primary Id of the Customer is determined by the provider. The new Id performs as an alias to the primary Id. If the alias is a pointer to another customer, it is reassigned to the given customer Id.

Parametersosid.id.IdcustomerIdthe Id of a Customer
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is in use as a primary Id
NOT_FOUND customerId not found
NULL_ARGUMENT customerId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.