Interface PaymentBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, PaymentAdminSession
This session creates, updates, and deletes Payments in bulk.
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
Payment , a PaymentForm is requested using
getPaymentFormsForCreate() specifying the desired payer, customer, and
record Types or none if no record Types are needed. Each
of the returned PaymentForms 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 a 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.
The PaymentForms returned from
getPaymentFormsForCreate() may be linked to the originating request
through the peer Ids of the PaymentForm . In the case
where there may be duplicates, any PaymentForm of the same peer
Ids may be used for a create operation.
Once a batch of PaymentForms are submitted for create, a
CreateResponse is returned for each PaymentForm , although
the ordering is not defined. Only errors that pertain to the entire create
operation are returned from createPayments() , errors specific to
an individual PaymentForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the
originating PaymentForm through the PaymentForm Id
.
For updates, PaymentForms are requested to the Payment
Id that is to be updated using getPaymentFormsForUpdate()
where the reference Id in the PaymentForm may be used to
link the request. 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.
Once a batch of PaymentForms are submitted for update, an
UpdateResponse is returned for each PaymentForm , although
the ordering is not defined. Only errors that pertain to the entire update
operation are returned from updatePayments() , errors specific to
an individual PaymentForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the
originating PaymentForm through the PaymentForm Id
.
The delete operations delete Payments in bulk. 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. Bulk delete operations return the results
in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasPayments(AliasRequestList aliasRequests) Adds anIdto aPaymentfor the purpose of creating compatibility.createPayments(PaymentBatchFormList paymentForms) Creates a new set ofPayments.Deletes allPaymentsin thisBusiness.deletePayments(IdList paymentIds) Deletes payments for the givenIds.deletePaymentsForCustomer(Id customerId) Deletes payments for the given customer.deletePaymentsForPayer(Id payerId) Deletes payments for the given payer.getPaymentFormsForCreate(PaymentPeerList peers, Type[] paymentRecordTypes) Gets the payment forms for creating a bunch of new payments.getPaymentFormsForUpdate(IdList paymentIds) Gets the payment forms for updating an existing set of payments.updatePayments(PaymentBatchFormList paymentForms) Updates existing payments.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.Methods inherited from interface PaymentAdminSession
aliasPayment, canCreatePayments, canCreatePaymentWithRecordTypes, canDeletePayments, canManagePaymentAliases, canUpdatePayments, createPayment, deletePayment, getBusiness, getBusinessId, getPaymentFormForCreate, getPaymentFormForUpdate, updatePaymentModifier 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.
-
Method Details
-
getPaymentFormsForCreate
PaymentBatchFormList getPaymentFormsForCreate(PaymentPeerList peers, Type[] paymentRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the payment forms for creating a bunch of new payments. A form is returned for each set of payment peers.- Parameters:
peers- a list of payment peerspaymentRecordTypes- array of payment record types to be included in each create operation or an empty list if none- Returns:
- the payment forms
- Throws:
NotFoundException- a node is not foundNullArgumentException- apayerId, customerId, orpaymentRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createPayments
CreateResponseList createPayments(PaymentBatchFormList paymentForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofPayments. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
paymentForms- the payment forms- Returns:
- the create responses
- Throws:
NullArgumentException-paymentFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getPaymentFormsForUpdate
PaymentBatchFormList getPaymentFormsForUpdate(IdList paymentIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the payment forms for updating an existing set of payments. A new payment form should be requested for each update transaction.- Parameters:
paymentIds- theIdsof thePayment- Returns:
- the payment form
- Throws:
NotFoundException- apaymentIdis not foundNullArgumentException-paymentIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updatePayments
UpdateResponseList updatePayments(PaymentBatchFormList paymentForms) throws OperationFailedException, PermissionDeniedException Updates existing payments. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
paymentForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-paymentFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllPayments
Deletes allPaymentsin thisBusiness.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deletePayments
DeleteResponseList deletePayments(IdList paymentIds) throws OperationFailedException, PermissionDeniedException Deletes payments for the givenIds.- Parameters:
paymentIds- theIdsof the payments to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-paymentIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deletePaymentsForPayer
DeleteResponseList deletePaymentsForPayer(Id payerId) throws OperationFailedException, PermissionDeniedException Deletes payments for the given payer.- Parameters:
payerId- theIdof a payer- Returns:
- the delete responses
- Throws:
NullArgumentException-payerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deletePaymentsForCustomer
DeleteResponseList deletePaymentsForCustomer(Id customerId) throws OperationFailedException, PermissionDeniedException Deletes payments for the given customer.- Parameters:
customerId- theIdof a customer- Returns:
- the delete responses
- Throws:
NullArgumentException-customerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasPayments
AliasResponseList aliasPayments(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aPaymentfor the purpose of creating compatibility. The primaryIdof thePaymentis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another payment, it is reassigned to the given paymentId.- Parameters:
aliasRequests- the alias requests- Returns:
- the alias responses
- Throws:
NullArgumentException-aliasRequestsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-