Interface PaymentAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
PaymentBatchAdminSession
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 Summary
Modifier and TypeMethodDescriptionvoidaliasPayment(Id paymentId, Id aliasId) Adds anIdto aPaymentfor the purpose of creating compatibility.booleanTests if this user can createPayments.booleancanCreatePaymentWithRecordTypes(Type[] paymentRecordTypes) Tests if this user can create a singlePaymentusing the desired record types.booleanTests if this user can deletePayments.booleanTests if this user can manageIdaliases forPayments.booleanTests if this user can updatePayments.createPayment(PaymentForm paymentForm) Creates a newPayment.voiddeletePayment(Id paymentId) Deletes aPayment.Gets theBusinessassociated with this session.Gets theBusinessIdassociated with this session.getPaymentFormForCreate(Id payerId, Id customerId, Type[] paymentRecordTypes) Gets the payer form for creating new payments.getPaymentFormForUpdate(Id paymentId) Gets the payment form for updating an existing payment.voidupdatePayment(PaymentForm paymentForm) Updates an existing payment.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getBusinessId
Id getBusinessId()Gets theBusinessIdassociated with this session.- Returns:
- the
Business Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getBusiness
Gets theBusinessassociated with this session.- Returns:
- the business
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreatePayments
boolean canCreatePayments()Tests if this user can createPayments. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aPaymentwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifPaymentcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreatePaymentWithRecordTypes
Tests if this user can create a singlePaymentusing the desired record types. WhileBillingPaymentManager.getPaymentRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificPayment. Providing an empty array tests if aPaymentcan be created with no records.- Parameters:
paymentRecordTypes- array of payment record types- Returns:
trueifPaymentcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-paymentRecordTypesisnull- 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 associatedPayercustomerId- the Id of the associatedCustomerpaymentRecordTypes- array of payment record types- Returns:
- the payment form
- Throws:
NotFoundException-payerIdorcustomerIdnot foundNullArgumentException-payerId, customerId, orpaymentRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createPayment
Payment createPayment(PaymentForm paymentForm) throws OperationFailedException, PermissionDeniedException Creates a newPayment.- Parameters:
paymentForm- the form for thisPayment- Returns:
- the new
Payment - Throws:
IllegalStateException-paymentFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-paymentFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-entryForm did not originate from getPaymentFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdatePayments
boolean canUpdatePayments()Tests if this user can updatePayments. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aPaymentwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifPaymentmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getPaymentFormForUpdate
PaymentForm getPaymentFormForUpdate(Id paymentId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the payment form for updating an existing payment. A new payment form should be requested for each update transaction.- Parameters:
paymentId- theIdof thePayment- Returns:
- the payment form
- Throws:
NotFoundException-paymentIdis not foundNullArgumentException-paymentIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- 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-paymentFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-paymentFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-entryForm did not originate from getPaymentFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeletePayments
boolean canDeletePayments()Tests if this user can deletePayments. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aPaymentwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifPaymentdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deletePayment
void deletePayment(Id paymentId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aPayment.- Parameters:
paymentId- theIdof thePaymentto remove- Throws:
NotFoundException-paymentIdnot foundNullArgumentException-paymentIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManagePaymentAliases
boolean canManagePaymentAliases()Tests if this user can manageIdaliases forPayments. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifPaymentaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasPayment
void aliasPayment(Id paymentId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aPaymentfor the purpose of creating compatibility. The primaryIdof thePayeris determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another payment, it is reassigned to the given paymentId.- Parameters:
paymentId- theIdof aPaymentaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis in use as a primaryIdNotFoundException-paymentIdnot foundNullArgumentException-paymentIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-