public interface PayerAdminSession extends OsidSession
This session creates, updates, and deletes Payers. 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
Payer, a PayerForm is requested using
getPayerFormForCreate() specifying the desired resource and record
Types or none if no record Types are needed.
The returned PayerForm 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 PayerForm is submiited to
a create operation, it cannot be reused with another create operation
unless the first operation was unsuccessful. Each PayerForm
corresponds to an attempted transaction.
For updates, PayerForms are requested to the
Payer Id that is to be updated using
getPayerFormForUpdate(). Similarly, the PayerForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The PayerForm can
only be used once for a successful update and cannot be reused.
The delete operations delete Payers. To unmap a
Payer from the current Business, the
PayerBusinessAssignmentSession should be used. These delete
operations attempt to remove the Payer 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.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasPayer(Id payerId,
Id aliasId)
Adds an
Id to a Payer for the purpose of
creating compatibility. |
boolean |
canCreatePayers()
Tests if this user can create
Payers. |
boolean |
canCreatePayerWithRecordTypes(Type[] payerRecordTypes)
Tests if this user can create a single
Payer using the
desired record types. |
boolean |
canDeletePayers()
Tests if this user can delete
Payers. |
boolean |
canManagePayerAliases()
Tests if this user can manage
Id aliases for
Payers. |
boolean |
canUpdatePayers()
Tests if this user can update
Payers. |
Payer |
createPayer(PayerForm payerForm)
Creates a new
Payer. |
void |
deletePayer(Id payerId)
Deletes a
Payer. |
Business |
getBusiness()
Gets the
Business associated with this session. |
Id |
getBusinessId()
Gets the
Business Id associated with
this session. |
PayerForm |
getPayerFormForCreate(Id resourceId,
Type[] payerRecordTypes)
Gets the payer form for creating new payers.
|
PayerForm |
getPayerFormForUpdate(Id payerId)
Gets the payer form for updating an existing payer.
|
void |
updatePayer(PayerForm payerForm)
Updates an existing payer.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getBusinessId()
Business Id associated with
this session. Business Id associated with this sessionmandatory - This method must be implemented. Business getBusiness() throws OperationFailedException, PermissionDeniedException
Business associated with this session.OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canCreatePayers()
Payers. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating a Payer 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. false if Payer creation is not
authorized, true otherwisemandatory - This method must be implemented. boolean canCreatePayerWithRecordTypes(Type[] payerRecordTypes)
Payer using the
desired record types. While
BillingPaymentManager.getPayerRecordTypes() can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Payer. Providing
an empty array tests if a Payer can be created with no
records.payerRecordTypes - array of payer record types true if Payer creation using the
specified record Types is supported,
false otherwiseNullArgumentException - payerRecordTypes
is null mandatory - This method must be implemented. PayerForm getPayerFormForCreate(Id resourceId, Type[] payerRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
resourceId - a resource Id payerRecordTypes - array of payer record typesNotFoundException - resourceId is not
foundNullArgumentException - payerRecordTypes
or resourceId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Payer createPayer(PayerForm payerForm) throws OperationFailedException, PermissionDeniedException
Payer. payerForm - the form for this Payer Payer IllegalStateException - payerForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - payerForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - payerForm did not
originate from getPayerFormForCreate() mandatory - This method must be implemented. boolean canUpdatePayers()
Payers. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating a Payer 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. false if Payer modification is
not authorized, true otherwisemandatory - This method must be implemented. PayerForm getPayerFormForUpdate(Id payerId) throws NotFoundException, OperationFailedException, PermissionDeniedException
payerId - the Id of the Payer NotFoundException - payerId is not foundNullArgumentException - payerId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updatePayer(PayerForm payerForm) throws OperationFailedException, PermissionDeniedException
payerForm - the form containing the elements to be updatedIllegalStateException - payerForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - payerForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - payerForm did not
originate from getPayerFormForUpdate() mandatory - This method must be implemented. boolean canDeletePayers()
Payers. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting a Payer 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. false if Payer deletion is not
authorized, true otherwisemandatory - This method must be implemented. void deletePayer(Id payerId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Payer. payerId - the Id of the Payer to
removeNotFoundException - payerId not foundNullArgumentException - payerId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManagePayerAliases()
Id aliases for
Payers. 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. false if Payer aliasing is not
authorized, true otherwisemandatory - This method must be implemented. void aliasPayer(Id payerId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to a Payer for the purpose of
creating compatibility. The primary Id of the
Payer is determined by the provider. The new Id
performs as an alias to the primary Id. If the alias is
a pointer to another payer, it is reassigned to the given payer
Id. payerId - the Id of a Payer aliasId - the alias Id AlreadyExistsException - aliasId is in
use as a primary Id NotFoundException - payerId not foundNullArgumentException - payerId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.