com.ibm.retail.saf.provider
Interface SalesTransaction

All Superinterfaces:
java.rmi.Remote, Transaction
All Known Implementing Classes:
KioskSalesTransaction

public interface SalesTransaction
extends Transaction

Provides an interface to perform point-of-sale operations with an active POS transaction.

A SimpleSalesTransaction is an object that corresponds to an active transaction on the point-of-sale system. SimpleSalesTransaction provides a basic API to process items sales and complete the transaction with payment and confirm the results.


Method Summary
 void cancel()
          Cancels the transaction.
 void confirm()
          Provides confirmation that the client has received the results from a point-of-sale transaction request.
 boolean isCancelAllowed()
          Returns true if the transaction is in a state that allows it to be cancelled.
 boolean isConfirmAllowed()
          Returns true if the transaction is in a state that allows it to be confirmed.
 boolean isPaymentAllowed()
          Returns true if the transaction is in a state that allows a payment operation to be performed.
 boolean isSalesAllowed()
          Returns true if the transaction is in a state that allows sales operations to be performed.
 com.ibm.retail.saf.provider.PaymentResult payBalance(com.ibm.retail.saf.provider.PaymentRequest paymentRequest)
          Sends a request to the point-of-sale system to tender payment for the balance and complete the transaction.
 com.ibm.retail.saf.provider.TransactionResult performSales(com.ibm.retail.saf.provider.TransactionRequest transactionRequest)
          Sends a transaction request to the point-of-sale system to perform the sales operations on the transaction.
 
Methods inherited from interface com.ibm.retail.saf.provider.Transaction
getCashReceiptImage, getPaymentResults, getTransactionID, getTransactionTotals
 

Method Detail

performSales

public com.ibm.retail.saf.provider.TransactionResult performSales(com.ibm.retail.saf.provider.TransactionRequest transactionRequest)
                                                           throws TransactionStateException,
                                                                  POSException,
                                                                  java.rmi.RemoteException
Sends a transaction request to the point-of-sale system to perform the sales operations on the transaction.

This method provides a means to submit sales information to the point-of-sale system to initiate processing of a sales transaction.

The TransactionRequest provided by the caller must include all the items to be included in the transaction. Additional information such as customer loyalty information may also be included in the request. The point-of-sale system will process the request and will return an TransationResult object if no exceptions occur. If the processing of the items is unsuccessful, an exception is thrown detailing the error condition.

If the transaction processing is successfully performed on the POS and no exceptions are thrown, a TransationResult object is returned to the client containing the results.

If the POS is not able to receive and process the request, an exception is thrown which details the error condition.

Parameters:
transactionRequest - contains the information for the point-of-sale to process this request.
Returns:
active transaction contains the results from the point-of-sale system.
Throws:
TransactionStateException - if the state of the transaction does not allow this request. is unable to process this request.
POSException - if the point-of-sale system is unable to process the request. The exception wrappers the cause and provides further details on the current condition.
java.rmi.RemoteException

payBalance

public com.ibm.retail.saf.provider.PaymentResult payBalance(com.ibm.retail.saf.provider.PaymentRequest paymentRequest)
                                                     throws TransactionStateException,
                                                            TenderException,
                                                            POSException,
                                                            java.rmi.RemoteException
Sends a request to the point-of-sale system to tender payment for the balance and complete the transaction.

This method provides a means to submit the payment information to the point-of-sale system for completion of the sales transaction.

The PaymentRequest provided by the caller includes the customer payment information needed for the point-of-sale system to complete payment for the transaction. The point-of-sale system will process the request and put the results of the operation into the PaymentResult object.

If the POS is not able to receive and process the request, an exception is thrown which details the error condition.

Parameters:
paymentRequest - contains the information for the point-of-sale to process this request
Returns:
paymentResult contains the results from the point-of-sale system
Throws:
TransactionStateException - if the transaction is not in the proper state.
TenderException - if the payment request failed on the point-of-sale system.
POSException - if the point-of-sale system is unable to process the request.
java.rmi.RemoteException

isSalesAllowed

public boolean isSalesAllowed()
                       throws java.rmi.RemoteException
Returns true if the transaction is in a state that allows sales operations to be performed.

Sales operations are invoked through the method performSales.

Returns:
true if the transaction allows a sales operation to be performed.
Throws:
POSException - if the point-of-sale system is unable to process the request.
java.rmi.RemoteException

isCancelAllowed

public boolean isCancelAllowed()
                        throws java.rmi.RemoteException
Returns true if the transaction is in a state that allows it to be cancelled.

A transaction is cancelled by invoking the cancel method.

The current transaction must be confirmed or cancelled before a POSProvider will make a new transaction.

Returns:
true if the transaction allows a cancel operation to be performed.
Throws:
POSException - if the point-of-sale system is unable to process the request.
java.rmi.RemoteException

isPaymentAllowed

public boolean isPaymentAllowed()
                         throws java.rmi.RemoteException
Returns true if the transaction is in a state that allows a payment operation to be performed.

A payment operation is performed by invoking the payBalance method.

Returns:
true if the transaction allows payment to be submitted.
Throws:
POSException - if the point-of-sale system is unable to process the request.
java.rmi.RemoteException

isConfirmAllowed

public boolean isConfirmAllowed()
                         throws java.rmi.RemoteException
Returns true if the transaction is in a state that allows it to be confirmed.

A transaction is confirmed by invoking the confirm method.

Returns:
true if the transaction can be confirmed
Throws:
POSException - if the point-of-sale system is unable to process the request.
java.rmi.RemoteException

confirm

public void confirm()
             throws TransactionStateException,
                    java.rmi.RemoteException,
                    POSException
Provides confirmation that the client has received the results from a point-of-sale transaction request.

This method provides a means for the client to acknowledge receipt of the payment results from the complete method and is used to ensure integrity of the payment processing operation. Transactions that are not confirmed are handled as exceptions.

A SalesTransation must be in the complete state before this method can be called. A SalesTransation is complete after it has been successfully tendered using the complete method.

Throws:
TransactionStateException - if the transaction is not in the proper state.
POSException - if the point-of-sale system is unable to process the request.
java.rmi.RemoteException

cancel

public void cancel()
            throws TransactionStateException,
                   java.rmi.RemoteException,
                   POSException
Cancels the transaction.

Throws:
TransactionStateException - if the transaction is not in the proper state.
POSException - if the point-of-sale system is unable to process the request.
java.rmi.RemoteException