Friday, February 28, 2014

Simple Way To Create Payment Group : ATG

 

Creating a Payment Group



A PaymentGroup contain information about the payment method that will be used to purchase a group of commerce items.


1. By default, a new Order has one default PaymentGroup.

2. As items are added to the Order, these items automatically become part of the default      PaymentGroup.

3. Once a second PaymentGroup is added to the Order, all the items in the Order are removed from the default PaymentGroup and must be explicitly added to one of the two payment groups.

4. Relationships must now be created to associate the items with payment groups.

5. Payment groups also contain a requisitionNumber property for orders that require approval before a means of payment can be specified.

6. Orders with requisition numbers are automatically assumed to require approval.



Follow these steps to create a new PaymentGroup and add it to an Order:



1. Call PaymentGroupManager.createPaymentGroup().

2. Make any changes to the PaymentGroup. For example, you could set the credit card number and expiration date.

3. Call PaymentGroupManager.addPaymentGroupToOrder(pOrder, pPaymentGroup) to add the payment group to the order.


Refer to the following example:



// Get a reference to the OrderManager
OrderManager orderManager = (OrderManager)
             request.resolveName("/atg/commerce/order/OrderManager");


// Create the PaymentGroup
PaymentGroup paymentGroup = paymentGroupManager.createPaymentGroup();

// Add the PaymentGroup to the Order
paymentGroupManager.addPaymentGroupToOrder(pOrder, paymentGroup);


Tips For Creating Multiple Payment Groups



1. Multiple payment groups (which implement Multipayment) on a commerce site permit a customer to split the cost of an order by amount and/or items. For example, suppose a customer begins the checkout process on a site that supports multiple payment methods for a single order. The customer chooses to partition payment by putting the first $1000 of a $1250 order on a Visa credit card. The customer then chooses to pay for the remaining $250 using points earned on the site during previous visits.


The following assumptions were made regarding Multipayment:



1. Customers can divide payment for an order or individual items by item quantity, percentage, or amount.

2. Customers can pay for part of a purchase using one payment method and use another payment method for the rest of the purchases.

3. Gift certificates are implemented as payment methods.


Note: The base commerce classes have built-in support for multiple payment methods. Multipayment allows customers to pay for purchases using multiple payment methods. For example, a customer can choose to pay for an order using two or more credit cards and a gift certificate. While customers can select payment methods by item level, amount level, or any combination of the two, you can limit the ways in which an order’s costs can be split, if necessary. The product UI for this component is entirely JSP-based.


Tuesday, February 11, 2014

Simple Way To Create Shipping Group : ATG

Creating Shipping Groups:


A ShippingGroup contains information on the shipping address and delivery method for a group of commerce items.

1. By default, a new Order has one default ShippingGroup.

2. As items are added to the Order, these items automatically become part of the default ShippingGroup.

3. Once a second ShippingGroup is added to the Order, all the items in the Order are removed from the default ShippingGroup and must be explicitly added to one of two shipping groups.

4. Relationships must now be created to associate the items with shipping groups.


Follow these steps to create a new ShippingGroup and add it to an Order:


 1. Call ShippingGroupManager.createShippingGroup().

 2. Make any changes to the ShippingGroup, such as setting the address.

 3. Call ShippingGroupManager.addShippingGroupToOrder(pOrder, pShippingGroup) to add the ShippingGroup to the Order.


Refer to the following example:


// Get a reference to the OrderManager
OrderManager orderManager = (OrderManager)
  request.resolveName("/atg/commerce/order/OrderManager");


// Create the ShippingGroup
ShippingGroup shippingGroup = shippingGroupManager.createShippingGroup();
 
// Add the ShippingGroup to the Order
shippingGroup.addShippingGroupToOrder(pOrder, shippingGroup);


When setting the shipping and billing addresses, normally you pass a RepositoryContactInfo object to setShippingAddress() or setBillingAddress(). If you want to use a ContactInfo object instead, but do not want to subclass RepositoryContactInfo (see defaultShippingGroupAddressType in the OrderTools section), you must modify some Nucleus components. List the properties of your address object in the savedProperties property of /atg/commerce/order/processor/SaveShippingGroupObjects and the loadProperties property of atg/commerce/order/processor/LoadShippingGroupObjects.


Tip For Multiple Shipping Groups   

 

1. Multiple shipping groups (which implement Multishipment) on a commerce site permit a customer to ship parts of an order to different addresses using different methods of delivery.

2. For example, suppose a customer enters the checkout process on a site that supports multiple shipping methods for a single order. The customer chooses to have the items shipped to different locations. The site must provide a UI that allows the customer to enter an address, and then associate it with a shipper, such as UPS or US Postal.

3. After the customer selects a shipper, a ShippingGroup is created. The site must then provide a UI that allows the customer to associate items with that shipping group. If there is only one shipping group, then all the items to be shipped will go into that shipping group. If more than one shipping group is associated with the order, then the customer must decide which items go into each group.






----------------------------------------------------------------------------------------------------------------------------

Popular Posts