ATG Commerce Order, Shipping, Payment Status Code

Order States: The status of an order indicates where the order is in the order process. You can view the order order’s status in the commerce service canter on the order Details page.

Order Statuses
Description
Approved
The order has been approved by either an approver of the organization or an agent.
Remove
The Order has been cancelled. It will not be shipped to customer.
Submit
The order has been submitted to the warehouse staff to begin fulfilment.
Incomplete
The Order is unfinished and has not been checked out by the customer.
No Pending Action
The order has shipped.
Pending Approval
The Order requires the approval of an approval of the organization or the agent before it can complete the checkout process.
Pending Remove
The Order is in the process of being cancelled.
Processing
The Order is being packed and prepared for shipment to the customer.


Shipping Group Statuses: The Status of a shipping group indicates where the individual shipping group is in the shipping process. Note that for orders with multiple shipping addresses, each shipping address has its own states. The following table describes each shipping group states.

Shipping Status
Description
Initial
The beginning state of a shipping group.
No Pending Action
The items in the shipping group have shipped. They are en route to the designed shipping address.
Pending Shipment Action
The items in the shipping group are packages and ready to ship.
Processing
The items in the shipping group are being prepared for shipment
   
Payment Group Statuses: The status of a payment group indicates where the payment group, typically a credit card, is in the payment process. You can view the status of each payment group for an order on the Order Payment page. The following table describes each payment group status.

Payment Status
Description
Authorized
Authorization for a charge to the credit card has succeeded.
Authorize Failed
Authorization for a charge to the credit card has failed.
Credit Failed
A credit of a specific amount has failed to be applied to the credit card.
Initial
The beginning state of a credit card.
Settle Failed
A charge of a specific amount has failed to be applied to the credit card.
Settled
A charge of a specific amount has been applied successfully to the credit card.

Design Pattern - Front Controller

 The front controller design pattern means that all requests that come for a resource in an application will be handled by a single handler and then dispatched to the appropriate handler for that type of request. The front controller may use other helpers to achieve the dispatching mechanism. 
In ActionServlet in Struts 1 or Dispatchers in Struts 2. Both of them are implementations of Front controller design pattern. The Front Controller design pattern is applicable and useful for all kind of applications be it web or desktop applications and is not limited to any single programming language or framework.

Several web-tier application frameworks implement the Front Controller pattern, among them:MVC frameworks (Struts and Spring),.Front controllers can be reduce duplication of code in JSP pages, see in below diagram, determining the user view with a from controller.


Design Pattern - Facade

Facades as the name suggests means the face of the building ,Operating System are one such example, You don't see all the inner workings of your computer, but the OS provides a simplified interface to use the machine, buildings also have a facade-the exterior of the building.
Facades design pattern hides the complexities of the system and provide one interface to the client for where the client can access the system, In Java JDBC can be called facade, we a users or clients create connection using the “java.sql.Connection” interface, the implementation of which we are not concerned about. The implementation is left to the vender of drive. 
Following sequence diagram illustrates how the pattern is used by a client:



Facade makes the API and libraries to use which is good for maintenance and readability .It can also collate and abstract various poorly designed APIs with a single simplified API.
Code Example:

ShippingGroup.java
public class ShippingGroup{
  public String checkShippingGroup(String OrderId) {
       return 'ShippingGroup checked';
   }
 }
PaymentGroup.java
public class PaymentGroup {
   public String deductPaymentGroup(String orderID) {
       return 'Payment deducted successfully';  
   }
}
OrderManager.java
public class OrderManager{
   private PaymentGroup pymt = new PaymentGroup();
   private ShippingGroup ship = new ShippingGroup();
 
   public void placeOrder(String orderId) {
       String step1 = ship.checkShippingGroup(orderId);
       String step2 = pymt.checkPaymentGroup(orderId);
       System.out.println('Following steps completed:' + step1  + ' & ' + step2);
   }
}
Client.java
public class Client {
  public static void main(String args[]){
    OrderManager ordermanager = new OrderManager();
    OrderManager.placeOrder('OR123456');
    System.out.println('Order processing completed');
  }
}