OSID Logo
OSID Specifications
billing payment package
Version 3.0.0
Release Candidate Preview
Interfaceosid.billing.payment.PaymentAdminSession
Implementsosid.OsidSession
Description

This session creates, updates, and deletes Payments. 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 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.

MethodgetBusinessId
Description

Gets the Business Id associated with this session.

Returnosid.id.Idthe Business Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetBusiness
Description

Gets the Business associated with this session.

Returnosid.billing.Businessthe business
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreatePayments
Description

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.

Returnboolean false if Payment creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreatePaymentWithRecordTypes
Description

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.

Parametersosid.type.Type[]paymentRecordTypesarray of payment record types
Returnboolean true if Payment creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT paymentRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetPaymentFormForCreate
Description

Gets the payer form for creating new payments. A new form should be requested for each create transaction.

Parametersosid.id.IdpayerIdthe Id of the associated Payer
osid.id.IdcustomerIdthe Id of the associated Customer
osid.type.Type[]paymentRecordTypesarray of payment record types
Returnosid.billing.payment.PaymentFormthe payment form
ErrorsNOT_FOUND payerId or customerId not found
NULL_ARGUMENT payerId, customerId, or paymentRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreatePayment
Description

Creates a new Payment.

Parametersosid.billing.payment.PaymentFormpaymentFormthe form for this Payment
Returnosid.billing.payment.Paymentthe new Payment
ErrorsILLEGAL_STATE paymentForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT paymentForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED entryForm did not originate from getPaymentFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdatePayments
Description

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.

Returnboolean false if Payment modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodgetPaymentFormForUpdate
Description

Gets the payment form for updating an existing payment. A new payment form should be requested for each update transaction.

Parametersosid.id.IdpaymentIdthe Id of the Payment
Returnosid.billing.payment.PaymentFormthe payment form
ErrorsNOT_FOUND paymentId is not found
NULL_ARGUMENT paymentId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdatePayment
Description

Updates an existing payment.

Parametersosid.billing.payment.PaymentFormpaymentFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE paymentForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT paymentForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED entryForm did not originate from getPaymentFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeletePayments
Description

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.

Returnboolean false if Payment deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeletePayment
Description

Deletes a Payment.

Parametersosid.id.IdpaymentIdthe Id of the Payment to remove
ErrorsNOT_FOUND paymentId not found
NULL_ARGUMENT paymentId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManagePaymentAliases
Description

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.

Returnboolean false if Payment aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasPayment
Description

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.

Parametersosid.id.IdpaymentIdthe Id of a Payment
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is in use as a primary Id
NOT_FOUND paymentId not found
NULL_ARGUMENT paymentId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.