com.ibm.commerce.rest.order.handler

Class AssignedPromotionCodeHandler

  • All Implemented Interfaces:
    DocumentedResourceHandler, IResourceHandler


    @Path(value="store/{storeId}/cart/@self/assigned_promotion_code")
     @Encoded
    public class AssignedPromotionCodeHandler
    extends AbstractResourceHandler
    This class provides RESTful services to add, get, update, and delete assigned promotion codes for the current shopping cart.
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM Copyright notice field.
        See Also:
        Constant Field Values
      • RESOURCE_NAME

        public static final java.lang.String RESOURCE_NAME
        The Constant RESOURCE_NAME.
        See Also:
        Constant Field Values
      • RESOURCE_MAPPING_KEY

        public static final java.lang.String RESOURCE_MAPPING_KEY
        The Constant RESOURCE_MAPPING_KEY.
        See Also:
        Constant Field Values
    • Constructor Detail

      • AssignedPromotionCodeHandler

        public AssignedPromotionCodeHandler()
    • Method Detail

      • getResourceName

        public java.lang.String getResourceName()
        Description copied from interface: IResourceHandler
        This method returns the name of the resource used primarily to determine the representation of the resource. This class can be overridden to change the name of the resource and therefore the representation, while keeping all the methods in this class.
        Returns:
        the resource name
      • getHelper

        public OrderHelper getHelper()
        This method returns the Payment instruction helper used to payment instructions (PI) contents
        Returns:
        PaymentInstructionHelper
      • getCalculationUsageIds

        public java.lang.String getCalculationUsageIds()
        This method returns the calculation usage ids.
        Returns:
        calulation usage ids.
      • setCalculationUsageIds

        public void setCalculationUsageIds(java.lang.String ids)
        This method sets the value for calculation usage ids.
        Parameters:
        ids - identifiers.
      • getAssignedPromotioncodeInfo

        @GET
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
        public javax.ws.rs.core.Response getAssignedPromotioncodeInfo(@PathParam(value="storeId")
                                                                                                                                                                                   java.lang.String storeId,
                                                                                                                                                                                   @QueryParam(value="responseFormat")
                                                                                                                                                                                   java.lang.String responseFormat)
        Get assigned promotion code info for the shopping cart.
        Parameters:
        storeId - the store id
        responseFormat - the response format
        Returns:
        the payment info
      • applyPromotioncode

        @POST
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
         @Consumes(value={"application/json","application/xml"})
        public javax.ws.rs.core.Response applyPromotioncode(@PathParam(value="storeId")
                                                                                                                                                                                                                                   java.lang.String storeId,
                                                                                                                                                                                                                                   @QueryParam(value="responseFormat")
                                                                                                                                                                                                                                   java.lang.String responseFormat)
        This method apply promotion code to the shopping cart.
        Parameters:
        storeId - the store id.
        responseFormat - the response format (xml, json, or atom).
        Returns:
        A map of String [] that contains the following response parameters: orderId, promoCode.
      • removePromotionCode

        @DELETE
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
         @Path(value="{promoCode}")
        public javax.ws.rs.core.Response removePromotionCode(@PathParam(value="storeId")
                                                                                                                                                                                                         java.lang.String storeId,
                                                                                                                                                                                                         @PathParam(value="promoCode")
                                                                                                                                                                                                         java.lang.String promoCode,
                                                                                                                                                                                                         @QueryParam(value="responseFormat")
                                                                                                                                                                                                         java.lang.String responseFormat)
        Remove a promotion code from the shopping cart.
        Parameters:
        storeId - the store Id.
        promoCode - the promotion code.
        responseFormat - the response format (xml, json, or atom).
        Returns:
        A map of String [] that contains the following response parameters: resourceId, resourceType