Interface PayerAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
All Known Subinterfaces:
PayerBatchAdminSession

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. 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.

  • Method Details

    • getBusinessId

      Id getBusinessId()
      Gets the Business Id associated with this session.
      Returns:
      the Business Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getBusiness

      Gets the Business associated with this session.
      Returns:
      the business
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canCreatePayers

      boolean canCreatePayers()
      Tests if this user can create 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.
      Returns:
      false if Payer creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreatePayerWithRecordTypes

      boolean canCreatePayerWithRecordTypes(Type[] payerRecordTypes)
      Tests if this user can create a single 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.
      Parameters:
      payerRecordTypes - array of payer record types
      Returns:
      true if Payer creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - payerRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getPayerFormForCreate

      PayerForm getPayerFormForCreate(Id resourceId, Type[] payerRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the payer form for creating new payers. A new form should be requested for each create transaction.
      Parameters:
      resourceId - a resource Id
      payerRecordTypes - array of payer record types
      Returns:
      the payer form
      Throws:
      NotFoundException - resourceId is not found
      NullArgumentException - payerRecordTypes or resourceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createPayer

      Creates a new Payer .
      Parameters:
      payerForm - the form for this Payer
      Returns:
      the new Payer
      Throws:
      IllegalStateException - payerForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - payerForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - payerForm did not originate from getPayerFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdatePayers

      boolean canUpdatePayers()
      Tests if this user can update 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.
      Returns:
      false if Payer modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getPayerFormForUpdate

      Gets the payer form for updating an existing payer. A new payer form should be requested for each update transaction.
      Parameters:
      payerId - the Id of the Payer
      Returns:
      the payer form
      Throws:
      NotFoundException - payerId is not found
      NullArgumentException - payerId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updatePayer

      void updatePayer(PayerForm payerForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing payer.
      Parameters:
      payerForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - payerForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - payerForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - payerForm did not originate from getPayerFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeletePayers

      boolean canDeletePayers()
      Tests if this user can delete 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.
      Returns:
      false if Payer deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deletePayer

      Deletes a Payer .
      Parameters:
      payerId - the Id of the Payer to remove
      Throws:
      NotFoundException - payerId not found
      NullArgumentException - payerId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManagePayerAliases

      boolean canManagePayerAliases()
      Tests if this user can manage 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.
      Returns:
      false if Payer aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasPayer

      Adds an 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 .
      Parameters:
      payerId - the Id of a Payer
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is in use as a primary Id
      NotFoundException - payerId not found
      NullArgumentException - payerId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.