Class LineItem

java.lang.Object
paypal.payflow.LineItem

public final class LineItem extends Object
This class holds the line item related information.

Line item data describes the details of the item purchased and can be can be passed for each transaction. The convention for passing line item data in name/value pairs is that each name/value starts with L_ and ends with n where n is the line item number. For example L_QTY0=1 is the quantity for line item 0 and is equal to 1, with n starting at 0

Following example shows how to use line item.

................. //inv is the Invoice object. ................. // Create a line item. LineItem item = new LineItem(); // Add first item. Currency lnamt = new Currency(new Double(8.95), "USD"); item.setAmt(lnamt); item.setDesc("Line 1"); item.setQty(1); item.setItemNumber("1"); // Add line item to invoice. inv.addLineItem(item); // Create a line item. LineItem item1 = new LineItem(); // Add second item. Currency lnamt1 = new Currency(new Double(5.25), "USD"); item1.setAmt(lnamt); item1.setDesc("Line 2"); item1.setQty(2); item1.setItemNumber("2"); // Add line item to invoice. inv.addLineItem(item1); ..................

  • Constructor Details

    • LineItem

      public LineItem()
      Constructor.

      Line item data describes the details of the item purchased and can be can be passed for each transaction. The convention for passing line item data in name/value pairs is that each name/value starts with L_ and ends with n where n is the line item number. For example L_QTY0=1 is the quantity for line item 0 and is equal to 1, with n starting at 0

      Following example shows how to use line item.

      ................. //inv is the Invoice object. ................. // Create a line item. LineItem item = new LineItem(); // Add first item. Currency lnamt = new Currency(new Double(8.95), "USD"); item.setAmt(lnamt); item.setDesc("Line 1"); item.setQty(1); item.setItemNumber("1"); // Add line item to invoice. inv.addLineItem(item); // Create a line item. LineItem item1 = new LineItem(); // Add second item. Currency lnamt1 = new Currency(new Double(5.25), "USD"); item1.setAmt(lnamt); item1.setDesc("Line 2"); item1.setQty(2); item1.setItemNumber("2"); // Add line item to invoice. inv.addLineItem(item1); ..................

  • Method Details

    • getAmt

      public Currency getAmt()
      Gets the Line Item Amount

      Total line item amount including tax and discount. + for debit, - for credits. Amount should always be a decimal. Exact amount to the cent (34.00, not 34). Do not include comma separators. Use 1199.95 instead of 1,199.95.

      Returns:
      amt

      Maps to Payflow Parameter: L_AMTn

    • setAmt

      public void setAmt(Currency amt)
      Sets the Line Item Amount

      Total line item amount including tax and discount. + for debit, - for credits. Amount should always be a decimal. Exact amount to the cent (34.00, not 34). Do not include comma separators. Use 1199.95 instead of 1,199.95.

      Parameters:
      amt - Currency

      Maps to Payflow Parameter: L_AMTn

    • getCost

      public Currency getCost()
      Gets the Line Item Cost

      Cost per item, excluding tax. Amount should always be a decimal. Exact amount to the cent (34.00, not 34). Do not include comma separators. Use 1199.95 instead of 1,199.95.

      Returns:
      cost

      Maps to Payflow Parameter: L_COSTn

    • setCost

      public void setCost(Currency cost)
      Sets the Line item cost

      Cost per item, excluding tax. Amount should always be a decimal. Exact amount to the cent (34.00, not 34). Do not include comma separators. Use 1199.95 instead of 1,199.95.

      Parameters:
      cost - Currency

      Maps to Payflow Parameter: L_COSTn

    • getFreightAmt

      public Currency getFreightAmt()
      Gets the line item FreightAmt.

      Freight Amount per item. Amount should always be a decimal. Exact amount to the cent (34.00, not 34). Do not include comma separators. Use 1199.95 instead of 1,199.95.

      Returns:
      freightAmt

      Maps to Payflow Parameter: L_FREIGHTAMTn

    • setFreightAmt

      public void setFreightAmt(Currency freightAmt)
      Sets the line item FreightAmt.

      UFreight Amount per item. Amount should always be a decimal. Exact amount to the cent (34.00, not 34). Do not include comma separators. Use 1199.95 instead of 1,199.95.

      Parameters:
      freightAmt - Currency

      Maps to Payflow Parameter: L_FREIGHTAMTn

    • getTaxAmt

      public Currency getTaxAmt()
      Gets the line item tax amount.

      Tax Amount per item. Amount should always be a decimal. Exact amount to the cent (34.00, not 34). Do not include comma separators. Use 1199.95 instead of 1,199.95.

      Returns:
      taxAmt

      Maps to Payflow Parameter: L_TAXAMTn

    • setTaxAmt

      public void setTaxAmt(Currency taxAmt)
      Sets the line item tax amount.

      Tax Amount per item. Amount should always be a decimal. Exact amount to the cent (34.00, not 34). Do not include comma separators. Use 1199.95 instead of 1,199.95.

      Parameters:
      taxAmt - Currency

      Maps to Payflow Parameter: L_TAXAMTn

    • getUom

      public String getUom()
      Gets the Line item UOM

      Item unit of measure.

      Returns:
      uom

      Maps to Payflow Parameter: L_UOMn

    • setUom

      public void setUom(String uom)
      Sets the Line item UOM

      Item unit of measure.

      Parameters:
      uom - String

      Maps to Payflow Parameter: L_UOMn

    • getPickupStreet

      public String getPickupStreet()
      Gets the line item PickupStreet.

      Item drop-off address1.

      Returns:
      pickupStreet

      Maps to Payflow Parameter: L_PICKUPSTREETn

    • setPickupStreet

      public void setPickupStreet(String pickupStreet)
      Sets the line item PickupStreet.

      Item drop-off address1.

      Parameters:
      pickupStreet - String

      Maps to Payflow Parameter: L_PICKUPSTREETn

    • getPickupState

      public String getPickupState()
      Gets the line item PickupState.

      Item drop-off state.

      Returns:
      pickupState

      Maps to Payflow Parameter: L_PICKUPSTATEn

    • setPickupState

      public void setPickupState(String pickupState)
      Sets the line item PickupState.

      Item drop-off state.

      Parameters:
      pickupState - String

      Maps to Payflow Parameter: L_PICKUPSTATEn

    • getPickupCountry

      public String getPickupCountry()
      Gets the line item PickupCountry.

      Item drop-off country.

      Returns:
      pickupCountry

      Maps to Payflow Parameter: L_PICKUPCOUNTRYn

    • setPickupCountry

      public void setPickupCountry(String pickupCountry)
      Sets the line item PickupCountry.

      Item drop-off country.

      Parameters:
      pickupCountry - String

      Maps to Payflow Parameter: L_PICKUPCOUNTRYn

    • getPickupCity

      public String getPickupCity()
      Gets the line item PickupCity.

      Item drop-off city.

      Returns:
      pickupCity

      Maps to Payflow Parameter: L_PICKUPCITYn

    • setPickupCity

      public void setPickupCity(String pickupCity)
      Sets the line item PickupCity.

      Item drop-off city.

      Parameters:
      pickupCity - String

      Maps to Payflow Parameter: L_PICKUPCITYn

    • getPickupZip

      public String getPickupZip()
      Gets the line item PickupZip.

      Item drop-off zip.

      Returns:
      pickupZip

      Maps to Payflow Parameter: L_PICKUPZIPn

    • setPickupZip

      public void setPickupZip(String pickupZip)
      Sets the line item PickupZip.

      Item drop-off zip.

      Parameters:
      pickupZip - String

      Maps to Payflow Parameter: L_PICKUPZIPn

    • getDesc

      public String getDesc()
      Gets the Line Item description
      Returns:
      desc

      Maps to Payflow Parameter: L_DESCn

    • setDesc

      public void setDesc(String desc)
      Sets the Line Item description
      Parameters:
      desc - String

      Maps to Payflow Parameter: L_DESCn

    • getDiscount

      public Currency getDiscount()
      Gets the line item Discount.

      Discount Amount per item. Amount should always be a decimal. Exact amount to the cent (34.00, not 34). Do not include comma separators. Use 1199.95 instead of 1,199.95.

      Returns:
      discount

      Maps to Payflow Parameter: L_DISCOUNTn

    • setDiscount

      public void setDiscount(Currency discount)
      Sets the line item Discount.

      Discount Amount per item. Amount should always be a decimal. Exact amount to the cent (34.00, not 34). Do not include comma separators. Use 1199.95 instead of 1,199.95.

      Parameters:
      discount - String

      Maps to Payflow Parameter: L_DISCOUNTn

    • getManufacturer

      public String getManufacturer()
      Gets the line item Manufacturer.
      Returns:
      manufacturer

      Maps to Payflow Parameter: L_MANUFACTURERn

    • setManufacturer

      public void setManufacturer(String manufacturer)
      Sets the line item Manufacturer.
      Parameters:
      manufacturer - String

      Maps to Payflow Parameter: L_MANUFACTURERn

    • getProdCode

      public String getProdCode()
      Gets the Item product code.
      Returns:
      prodCode

      Maps to Payflow Parameter: L_PRODCODEn

    • setProdCode

      public void setProdCode(String prodCode)
      Sets the Item product code.
      Parameters:
      prodCode - String

      Maps to Payflow Parameter: L_PRODCODEn

    • getQty

      public long getQty()
      Gets the Quantity per item.
      Returns:
      qty

      Maps to Payflow Parameter: L_QTYn

    • setQty

      public void setQty(long qty)
      Sets the Quantity per item.
      Parameters:
      qty - long

      Maps to Payflow Parameter: L_QTYn

    • getSku

      public String getSku()
      Gets the Item SKU.
      Returns:
      sku

      Maps to Payflow Parameter: L_SKUn

    • setSku

      public void setSku(String sku)
      Sets the Item SKU.
      Parameters:
      sku - String

      Maps to Payflow Parameter: L_SKUn

    • getTaxRate

      public Currency getTaxRate()
      Gets the Line item tax rate.

      Tax Rate Amount. Amount should always be a decimal. Exact amount to the cent (34.00, not 34). Do not include comma separators. Use 1199.95 instead of 1,199.95.

      Returns:
      taxRate

      Maps to Payflow Parameter: L_TAXRATEn

    • setTaxRate

      public void setTaxRate(Currency taxRate)
      Sets the Line item tax rate.

      Tax Rate Amount. Amount should always be a decimal. Exact amount to the cent (34.00, not 34). Do not include comma separators. Use 1199.95 instead of 1,199.95.

      Parameters:
      taxRate - Currency

      Maps to Payflow Parameter: L_TAXRATEn

    • getTaxType

      public String getTaxType()
      Gets the line item TaxType
      Returns:
      taxType

      Maps to Payflow Parameter: L_TAXTYPEn

    • setTaxType

      public void setTaxType(String taxType)
      Sets the line item TaxType
      Parameters:
      taxType - String

      Maps to Payflow Parameter: L_TAXTYPEn

    • getType

      public String getType()
      Gets the line item Type.
      Returns:
      String

      Maps to Payflow Parameter: L_TYPEn

    • setType

      public void setType(String type)
      Sets the line item Type.
      Parameters:
      type - String

      Maps to Payflow Parameter: L_TYPEn

    • getCommCode

      public String getCommCode()
      Gets the line item CommCode

      Use this method to get the Commodity Code for the line item.

      Returns:
      commCode

      Maps to Payflow Parameter: L_COMMCODEn

    • setCommCode

      public void setCommCode(String commCode)
      Sets the line item CommCode

      Use this method to set the Commodity Code for the line item.

      Parameters:
      commCode - String

      Maps to Payflow Parameter: L_COMMCODEn

    • getTrackingNum

      public String getTrackingNum()
      Gets the line item TrackingNum.
      Returns:
      trackingNum

      Maps to Payflow Parameter: L_TRACKINGNUMn

    • setTrackingNum

      public void setTrackingNum(String trackingNum)
      Sets the line item TrackingNum.
      Parameters:
      trackingNum - String

      Maps to Payflow Parameter: L_TRACKINGNUMn

    • getCostCenterNum

      public String getCostCenterNum()
      Gets the line item CostCenterNum.
      Returns:
      costCenterNum

      Maps to Payflow Parameter: L_COSTCENTERNUMn

    • setCostCenterNum

      public void setCostCenterNum(String costCenterNum)
      Sets the line item CostCenterNum.
      Parameters:
      costCenterNum - String

      Maps to Payflow Parameter: L_COSTCENTERNUMn

    • getCatalogNum

      public String getCatalogNum()
      Gets the line item CatalogNum.
      Returns:
      catalogNum

      Maps to Payflow Parameter: L_CATALOGNUMn

    • setCatalogNum

      public void setCatalogNum(String catalogNum)
      Sets the line item CatalogNum.
      Parameters:
      catalogNum - String

      Maps to Payflow Parameter: L_CATALOGNUMn

    • getUpc

      public String getUpc()
      Gets the line item universal product code.
      Returns:
      upc

      Maps to Payflow Parameter: L_UPCn

    • setUpc

      public void setUpc(String upc)
      Sets the line item universal product code.
      Parameters:
      upc - String

      Maps to Payflow Parameter: L_UPCn

    • getHandlingAmt

      public Currency getHandlingAmt()
      Gets the line item HandlingAmt.

      Item Handling Amount. Amount should always be a decimal. Exact amount to the cent (34.00, not 34). Do not include comma separators. Use 1199.95 instead of 1,199.95.

      Returns:
      handlingAmt

      Maps to Payflow Parameter: L_HANDLINGAMTn

    • setHandlingAmt

      public void setHandlingAmt(Currency handlingAmt)
      Sets the line item HandlingAmt.

      UItem Handling Amount. Amount should always be a decimal. Exact amount to the cent (34.00, not 34). Do not include comma separators. Use 1199.95 instead of 1,199.95.

      Parameters:
      handlingAmt - String

      Maps to Payflow Parameter: L_HANDLINGAMTn

    • getUnspscCode

      public String getUnspscCode()
      Gets the line item unspsc code
      Returns:
      unspscCode

      Maps to Payflow Parameter: L_UNSPSCCODEn

    • setUnspscCode

      public void setUnspscCode(String unspscCode)
      Sets the line item unspsc code
      Parameters:
      unspscCode - String

      Maps to Payflow Parameter: L_UNSPSCCODEn

    • getAltTaxAmt

      public String getAltTaxAmt()
      Gets the line item alternate tax amount
      Returns:
      altTaxAmt

      Maps to Payflow Parameter: L_ALTTAXAMTn

    • setAltTaxAmt

      public void setAltTaxAmt(String altTaxAmt)
      Sets the line item alternate tax amount
      Parameters:
      altTaxAmt - String

      Maps to Payflow Parameter: L_ALTTAXAMTn

    • getAltTaxId

      public String getAltTaxId()
      Gets the line item alternate tax id
      Returns:
      altTaxId

      Maps to Payflow Parameter: L_ALTTAXIDn

    • setAltTaxId

      public void setAltTaxId(String altTaxId)
      Sets the line item alternate tax id
      Parameters:
      altTaxId - String

      Maps to Payflow Parameter: L_ALTTAXIDn

    • getAltTaxRate

      public String getAltTaxRate()
      Gets the line item alternate tax rate
      Returns:
      altTaxRate

      Maps to Payflow Parameter: L_ALTTAXRATEn

    • setAltTaxRate

      public void setAltTaxRate(String altTaxRate)
      Sets the line item alternate tax rate
      Parameters:
      altTaxRate - String

      Maps to Payflow Parameter: L_ALTTAXRATEn

    • getCarrierServiceLevelCode

      public String getCarrierServiceLevelCode()
      Gets the line item carrier service level code
      Returns:
      carrierServiceLevelCode

      Maps to Payflow Parameter: L_CARRIERSERVICELEVELCODEn

    • setCarrierServiceLevelCode

      public void setCarrierServiceLevelCode(String carrierServiceLevelCode)
      Sets the line item carrier service level code
      Parameters:
      carrierServiceLevelCode - String

      Maps to Payflow Parameter: L_CARRIERSERVICELEVELCODEn

    • getExtAmt

      public String getExtAmt()
      Gets the line item extended item amount.
      Returns:
      extAmt

      Maps to Payflow Parameter: L_EXTAMTn

    • setExtAmt

      public void setExtAmt(String extAmt)
      Sets the line item extended item amount.
      Parameters:
      extAmt - String

      Maps to Payflow Parameter: L_EXTAMTn

    • getItemNumber

      public String getItemNumber()
      Gets the Line item number.
      Returns:
      itemNumber

      Maps to Payflow Parameter: L_xxxxn

    • setItemNumber

      public void setItemNumber(String itemNumber)
      Sets the Line item number.
      Parameters:
      itemNumber - String

      Maps to Payflow Parameter: L_xxxxn

    • generateRequest

      protected void generateRequest(int Index)
    • getContext

      protected Context getContext()
    • setContext

      protected void setContext(Context context)
    • getRequestBuffer

      protected StringBuffer getRequestBuffer()
      Gets the Requestbuffer used for creating the actual request string.
      Returns:
      mRequestBuffer StringBuffer
    • setRequestBuffer

      protected void setRequestBuffer(StringBuffer value)
      sets the StringBuffer to hold the request string.
      Parameters:
      value - StringBuffer
    • generateRequest

      protected void generateRequest()