Interface PaymentAdminSession

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

public interface PaymentAdminSession extends OsidSession

This session creates, updates, and deletes Payments . 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 Payment , a PaymentForm is requested using getPaymentFormForCreate() specifying the desired payer, customer, and record Types or none if no record Types are needed. The returned PaymentForm 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 PaymentForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each PaymentForm corresponds to an attempted transaction.

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

The delete operations delete Payments . To unmap a Payment from the current Business , the PaymentBusinessAssignmentSession should be used. These delete operations attempt to remove the Payment 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.
    • canCreatePayments

      boolean canCreatePayments()
      Tests if this user can create Payments . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Payment 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 Payment creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreatePaymentWithRecordTypes

      boolean canCreatePaymentWithRecordTypes(Type[] paymentRecordTypes)
      Tests if this user can create a single Payment using the desired record types. While BillingPaymentManager.getPaymentRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Payment . Providing an empty array tests if a Payment can be created with no records.
      Parameters:
      paymentRecordTypes - array of payment record types
      Returns:
      true if Payment creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - paymentRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getPaymentFormForCreate

      PaymentForm getPaymentFormForCreate(Id payerId, Id customerId, Type[] paymentRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the payer form for creating new payments. A new form should be requested for each create transaction.
      Parameters:
      payerId - the Id of the associated Payer
      customerId - the Id of the associated Customer
      paymentRecordTypes - array of payment record types
      Returns:
      the payment form
      Throws:
      NotFoundException - payerId or customerId not found
      NullArgumentException - payerId, customerId , or paymentRecordTypes 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.
    • createPayment

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

      boolean canUpdatePayments()
      Tests if this user can update Payments . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Payment 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 Payment modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getPaymentFormForUpdate

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

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

      boolean canDeletePayments()
      Tests if this user can delete Payments . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Payment 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 Payment deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deletePayment

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

      boolean canManagePaymentAliases()
      Tests if this user can manage Id aliases for Payments . 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 Payment aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasPayment

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