com.ibm.retail.saf.provider.kiosk
Class KioskSalesTransaction

java.lang.Object
  |
  +--com.ibm.retail.saf.provider.kiosk.KioskSalesTransaction
All Implemented Interfaces:
java.rmi.Remote, SalesTransaction, Transaction

public class KioskSalesTransaction
extends java.lang.Object
implements SalesTransaction

Provides an implementation of SalesTransaction for Kiosk applications.


Field Summary
protected  com.ibm.retail.saf.provider.CashReceiptImage cashReceiptImage
           
protected  com.ibm.retail.saf.provider.PaymentResult paymentResult
           
protected  com.ibm.retail.saf.provider.kiosk.KioskPOSProvider server
           
protected  com.ibm.retail.saf.provider.SalesTransaction serverTransaction
           
protected  com.ibm.retail.saf.provider.TransactionResult transactionResult
           
protected  com.ibm.retail.saf.provider.POSStatus transactionState
           
 
Constructor Summary
KioskSalesTransaction(com.ibm.retail.saf.provider.kiosk.KioskPOSProviderImpl provider)
          Constructor
 
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.
 com.ibm.retail.saf.provider.CashReceiptImage getCashReceiptImage()
          Get the image of the point-of-sale cash receipt produced by the transaction.
 com.ibm.retail.saf.provider.PaymentResult getPaymentResults()
          Returns the results from a payment operation on this transaction.
 com.ibm.retail.saf.provider.TransactionID getTransactionID()
          Get the transaction identifier.
 com.ibm.retail.saf.provider.TransactionTotals getTransactionTotals()
          Get the transaction totals.
 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

server

protected com.ibm.retail.saf.provider.kiosk.KioskPOSProvider server

serverTransaction

protected com.ibm.retail.saf.provider.SalesTransaction serverTransaction

transactionState

protected com.ibm.retail.saf.provider.POSStatus transactionState

transactionResult

protected com.ibm.retail.saf.provider.TransactionResult transactionResult

paymentResult

protected com.ibm.retail.saf.provider.PaymentResult paymentResult

cashReceiptImage

protected com.ibm.retail.saf.provider.CashReceiptImage cashReceiptImage
Constructor Detail

KioskSalesTransaction

public KioskSalesTransaction(com.ibm.retail.saf.provider.kiosk.KioskPOSProviderImpl provider)
                      throws TransactionInProgressException,
                             java.rmi.RemoteException,
                             POSException
Constructor

Parameters:
provider -
Throws:
TransactionInProgressException
java.rmi.RemoteException
POSException
Method Detail

performSales

public com.ibm.retail.saf.provider.TransactionResult performSales(com.ibm.retail.saf.provider.TransactionRequest transactionRequest)
                                                           throws TransactionStateException,
                                                                  java.rmi.RemoteException,
                                                                  POSException
Description copied from interface: SalesTransaction
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.

Specified by:
performSales in interface SalesTransaction
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:
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.
TransactionStateException - if the state of the transaction does not allow this request. is unable to process this request.
java.rmi.RemoteException

payBalance

public com.ibm.retail.saf.provider.PaymentResult payBalance(com.ibm.retail.saf.provider.PaymentRequest paymentRequest)
                                                     throws TransactionStateException,
                                                            TenderException,
                                                            java.rmi.RemoteException,
                                                            POSException
Description copied from interface: SalesTransaction
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.

Specified by:
payBalance in interface SalesTransaction
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:
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.
TransactionStateException - if the transaction is not in the proper state.
java.rmi.RemoteException

confirm

public void confirm()
             throws TransactionStateException,
                    java.rmi.RemoteException,
                    POSException
Description copied from interface: SalesTransaction
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.

Specified by:
confirm in interface SalesTransaction
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
Description copied from interface: SalesTransaction
Cancels the transaction.

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

getTransactionID

public com.ibm.retail.saf.provider.TransactionID getTransactionID()
Description copied from interface: Transaction
Get the transaction identifier.

The TransactionID is used to identify the transaction.

Specified by:
getTransactionID in interface Transaction
Returns:
transaction ID

getTransactionTotals

public com.ibm.retail.saf.provider.TransactionTotals getTransactionTotals()
Description copied from interface: Transaction
Get the transaction totals.

The TransactionTotals contain the totals produced by the processing of the transaction. This information includes the total amount and tax.

Specified by:
getTransactionTotals in interface Transaction
Returns:
totals for the transaction

getCashReceiptImage

public com.ibm.retail.saf.provider.CashReceiptImage getCashReceiptImage()
Description copied from interface: Transaction
Get the image of the point-of-sale cash receipt produced by the transaction.

The CashReceiptImage contains raw and formatted print lines that were sent to the point-of-sale receipt printer during the processing of the transaction.

Specified by:
getCashReceiptImage in interface Transaction
Returns:
image of the POS cash receipt

getPaymentResults

public com.ibm.retail.saf.provider.PaymentResult getPaymentResults()
Description copied from interface: Transaction
Returns the results from a payment operation on this transaction.

Specified by:
getPaymentResults in interface Transaction
Returns:
payment results from the transaction.

isSalesAllowed

public boolean isSalesAllowed()
Description copied from interface: SalesTransaction
Returns true if the transaction is in a state that allows sales operations to be performed.

Sales operations are invoked through the method performSales.

Specified by:
isSalesAllowed in interface SalesTransaction
Returns:
true if the transaction allows a sales operation to be performed.

isCancelAllowed

public boolean isCancelAllowed()
Description copied from interface: SalesTransaction
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.

Specified by:
isCancelAllowed in interface SalesTransaction
Returns:
true if the transaction allows a cancel operation to be performed.

isPaymentAllowed

public boolean isPaymentAllowed()
Description copied from interface: SalesTransaction
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.

Specified by:
isPaymentAllowed in interface SalesTransaction
Returns:
true if the transaction allows payment to be submitted.

isConfirmAllowed

public boolean isConfirmAllowed()
Description copied from interface: SalesTransaction
Returns true if the transaction is in a state that allows it to be confirmed.

A transaction is confirmed by invoking the confirm method.

Specified by:
isConfirmAllowed in interface SalesTransaction
Returns:
true if the transaction can be confirmed