pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.component.shop.checkout
Class PaymentControllerUtils

java.lang.Object
  extended by org.torweg.pulse.component.shop.checkout.PaymentControllerUtils

public final class PaymentControllerUtils
extends java.lang.Object

The PaymentControllerUtils.

Version:
$Revision$
Author:
Christian Schatt

Method Summary
protected static java.lang.String createTransactionId(java.lang.Long uid)
          Returns a generated transaction id.
protected static boolean matchUsers(ServiceRequest request, Order.OrderBuilder orderBuilder)
          Determines whether the id of the User matches the Customer's user id.
protected static Order saveOrder(Order order)
          Merges the state of the given Order into the database.
protected static void sendErrorReport(java.lang.Exception exc, EmailConfiguration config)
          Sends an error report email.
protected static void setRedirectEvent(ServiceRequest request, java.lang.String action)
          Adds a RedirectEvent to the EventManager.
protected static void setRedirectEvent(ServiceRequest request, java.lang.String action, java.util.Map<java.lang.String,java.lang.String> params)
          Adds a RedirectEvent to the EventManager.
protected static void setRedirectEvent(ServiceRequest request, java.lang.String action, java.lang.String paramName, java.lang.String paramValue)
          Adds a RedirectEvent to the EventManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

matchUsers

protected static boolean matchUsers(ServiceRequest request, Order.OrderBuilder orderBuilder)
Determines whether the id of the User matches the Customer's user id.

Parameters:
request - the ServiceRequest.
orderBuilder - the OrderBuilder.
Returns:
true, if the id of the User matches the Customer's user id. Returns false, otherwise.

createTransactionId

protected static java.lang.String createTransactionId(java.lang.Long uid)
Returns a generated transaction id.

Parameters:
uid - the id of the User or null, if the user is not logged in.
Returns:
the transaction id.

saveOrder

protected static Order saveOrder(Order order)
Merges the state of the given Order into the database.

Parameters:
order - the Order to be merged.
Returns:
the merged Order.
Throws:
PulseException - if the given Order cannot be merged.

setRedirectEvent

protected static void setRedirectEvent(ServiceRequest request,
                                       java.lang.String action)
Adds a RedirectEvent to the EventManager.

Parameters:
request - the ServiceRequest.
action - the name of the action used when redirecting.

setRedirectEvent

protected static void setRedirectEvent(ServiceRequest request,
                                       java.lang.String action,
                                       java.lang.String paramName,
                                       java.lang.String paramValue)
Adds a RedirectEvent to the EventManager.

Parameters:
request - the ServiceRequest.
action - the name of the action used when redirecting.
paramName - the name of the parameter to set.
paramValue - the value of the parameter to set.

setRedirectEvent

protected static void setRedirectEvent(ServiceRequest request,
                                       java.lang.String action,
                                       java.util.Map<java.lang.String,java.lang.String> params)
Adds a RedirectEvent to the EventManager.

Parameters:
request - the ServiceRequest.
action - the name of the action used when redirecting.
params - the parameters to set.

sendErrorReport

protected static void sendErrorReport(java.lang.Exception exc, EmailConfiguration config)
Sends an error report email.

Parameters:
exc - the Exception which is the basis of the error report.
config - the EmailConfiguration.