Class LineItem
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidgenerateRequest(int Index) Gets the line item alternate tax amountGets the line item alternate tax idGets the line item alternate tax rategetAmt()Gets the Line Item AmountGets the line item carrier service level codeGets the line item CatalogNum.Gets the line item CommCodeprotected ContextgetCost()Gets the Line Item CostGets the line item CostCenterNum.getDesc()Gets the Line Item descriptionGets the line item Discount.Gets the line item extended item amount.Gets the line item FreightAmt.Gets the line item HandlingAmt.Gets the Line item number.Gets the line item Manufacturer.Gets the line item PickupCity.Gets the line item PickupCountry.Gets the line item PickupState.Gets the line item PickupStreet.Gets the line item PickupZip.Gets the Item product code.longgetQty()Gets the Quantity per item.protected StringBufferGets the Requestbuffer used for creating the actual request string.getSku()Gets the Item SKU.Gets the line item tax amount.Gets the Line item tax rate.Gets the line item TaxTypeGets the line item TrackingNum.getType()Gets the line item Type.Gets the line item unspsc codegetUom()Gets the Line item UOMgetUpc()Gets the line item universal product code.voidsetAltTaxAmt(String altTaxAmt) Sets the line item alternate tax amountvoidsetAltTaxId(String altTaxId) Sets the line item alternate tax idvoidsetAltTaxRate(String altTaxRate) Sets the line item alternate tax ratevoidSets the Line Item AmountvoidsetCarrierServiceLevelCode(String carrierServiceLevelCode) Sets the line item carrier service level codevoidsetCatalogNum(String catalogNum) Sets the line item CatalogNum.voidsetCommCode(String commCode) Sets the line item CommCodeprotected voidsetContext(Context context) voidSets the Line item costvoidsetCostCenterNum(String costCenterNum) Sets the line item CostCenterNum.voidSets the Line Item descriptionvoidsetDiscount(Currency discount) Sets the line item Discount.voidSets the line item extended item amount.voidsetFreightAmt(Currency freightAmt) Sets the line item FreightAmt.voidsetHandlingAmt(Currency handlingAmt) Sets the line item HandlingAmt.voidsetItemNumber(String itemNumber) Sets the Line item number.voidsetManufacturer(String manufacturer) Sets the line item Manufacturer.voidsetPickupCity(String pickupCity) Sets the line item PickupCity.voidsetPickupCountry(String pickupCountry) Sets the line item PickupCountry.voidsetPickupState(String pickupState) Sets the line item PickupState.voidsetPickupStreet(String pickupStreet) Sets the line item PickupStreet.voidsetPickupZip(String pickupZip) Sets the line item PickupZip.voidsetProdCode(String prodCode) Sets the Item product code.voidsetQty(long qty) Sets the Quantity per item.protected voidsetRequestBuffer(StringBuffer value) sets the StringBuffer to hold the request string.voidSets the Item SKU.voidSets the line item tax amount.voidsetTaxRate(Currency taxRate) Sets the Line item tax rate.voidsetTaxType(String taxType) Sets the line item TaxTypevoidsetTrackingNum(String trackingNum) Sets the line item TrackingNum.voidSets the line item Type.voidsetUnspscCode(String unspscCode) Sets the line item unspsc codevoidSets the Line item UOMvoidSets the line item universal product code.
-
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
Gets the Line Item AmountTotal 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
Sets the Line Item AmountTotal 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- CurrencyMaps to Payflow Parameter: L_AMTn
-
getCost
Gets the Line Item CostCost 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
Sets the Line item costCost 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- CurrencyMaps to Payflow Parameter: L_COSTn
-
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
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- CurrencyMaps to Payflow Parameter: L_FREIGHTAMTn
-
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
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- CurrencyMaps to Payflow Parameter: L_TAXAMTn
-
getUom
Gets the Line item UOMItem unit of measure.
- Returns:
- uom
Maps to Payflow Parameter: L_UOMn
-
setUom
Sets the Line item UOMItem unit of measure.
- Parameters:
uom- StringMaps to Payflow Parameter: L_UOMn
-
getPickupStreet
Gets the line item PickupStreet.Item drop-off address1.
- Returns:
- pickupStreet
Maps to Payflow Parameter: L_PICKUPSTREETn
-
setPickupStreet
Sets the line item PickupStreet.Item drop-off address1.
- Parameters:
pickupStreet- StringMaps to Payflow Parameter: L_PICKUPSTREETn
-
getPickupState
Gets the line item PickupState.Item drop-off state.
- Returns:
- pickupState
Maps to Payflow Parameter: L_PICKUPSTATEn
-
setPickupState
Sets the line item PickupState.Item drop-off state.
- Parameters:
pickupState- StringMaps to Payflow Parameter: L_PICKUPSTATEn
-
getPickupCountry
Gets the line item PickupCountry.Item drop-off country.
- Returns:
- pickupCountry
Maps to Payflow Parameter: L_PICKUPCOUNTRYn
-
setPickupCountry
Sets the line item PickupCountry.Item drop-off country.
- Parameters:
pickupCountry- StringMaps to Payflow Parameter: L_PICKUPCOUNTRYn
-
getPickupCity
Gets the line item PickupCity.Item drop-off city.
- Returns:
- pickupCity
Maps to Payflow Parameter: L_PICKUPCITYn
-
setPickupCity
Sets the line item PickupCity.Item drop-off city.
- Parameters:
pickupCity- StringMaps to Payflow Parameter: L_PICKUPCITYn
-
getPickupZip
Gets the line item PickupZip.Item drop-off zip.
- Returns:
- pickupZip
Maps to Payflow Parameter: L_PICKUPZIPn
-
setPickupZip
Sets the line item PickupZip.Item drop-off zip.
- Parameters:
pickupZip- StringMaps to Payflow Parameter: L_PICKUPZIPn
-
getDesc
Gets the Line Item description- Returns:
- desc
Maps to Payflow Parameter: L_DESCn
-
setDesc
Sets the Line Item description- Parameters:
desc- StringMaps to Payflow Parameter: L_DESCn
-
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
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- StringMaps to Payflow Parameter: L_DISCOUNTn
-
getManufacturer
Gets the line item Manufacturer.- Returns:
- manufacturer
Maps to Payflow Parameter: L_MANUFACTURERn
-
setManufacturer
Sets the line item Manufacturer.- Parameters:
manufacturer- StringMaps to Payflow Parameter: L_MANUFACTURERn
-
getProdCode
Gets the Item product code.- Returns:
- prodCode
Maps to Payflow Parameter: L_PRODCODEn
-
setProdCode
Sets the Item product code.- Parameters:
prodCode- StringMaps 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- longMaps to Payflow Parameter: L_QTYn
-
getSku
Gets the Item SKU.- Returns:
- sku
Maps to Payflow Parameter: L_SKUn
-
setSku
Sets the Item SKU.- Parameters:
sku- StringMaps to Payflow Parameter: L_SKUn
-
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
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- CurrencyMaps to Payflow Parameter: L_TAXRATEn
-
getTaxType
Gets the line item TaxType- Returns:
- taxType
Maps to Payflow Parameter: L_TAXTYPEn
-
setTaxType
Sets the line item TaxType- Parameters:
taxType- StringMaps to Payflow Parameter: L_TAXTYPEn
-
getType
Gets the line item Type.- Returns:
- String
Maps to Payflow Parameter: L_TYPEn
-
setType
Sets the line item Type.- Parameters:
type- StringMaps to Payflow Parameter: L_TYPEn
-
getCommCode
Gets the line item CommCodeUse this method to get the Commodity Code for the line item.
- Returns:
- commCode
Maps to Payflow Parameter: L_COMMCODEn
-
setCommCode
Sets the line item CommCodeUse this method to set the Commodity Code for the line item.
- Parameters:
commCode- StringMaps to Payflow Parameter: L_COMMCODEn
-
getTrackingNum
Gets the line item TrackingNum.- Returns:
- trackingNum
Maps to Payflow Parameter: L_TRACKINGNUMn
-
setTrackingNum
Sets the line item TrackingNum.- Parameters:
trackingNum- StringMaps to Payflow Parameter: L_TRACKINGNUMn
-
getCostCenterNum
Gets the line item CostCenterNum.- Returns:
- costCenterNum
Maps to Payflow Parameter: L_COSTCENTERNUMn
-
setCostCenterNum
Sets the line item CostCenterNum.- Parameters:
costCenterNum- StringMaps to Payflow Parameter: L_COSTCENTERNUMn
-
getCatalogNum
Gets the line item CatalogNum.- Returns:
- catalogNum
Maps to Payflow Parameter: L_CATALOGNUMn
-
setCatalogNum
Sets the line item CatalogNum.- Parameters:
catalogNum- StringMaps to Payflow Parameter: L_CATALOGNUMn
-
getUpc
Gets the line item universal product code.- Returns:
- upc
Maps to Payflow Parameter: L_UPCn
-
setUpc
Sets the line item universal product code.- Parameters:
upc- StringMaps to Payflow Parameter: L_UPCn
-
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
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- StringMaps to Payflow Parameter: L_HANDLINGAMTn
-
getUnspscCode
Gets the line item unspsc code- Returns:
- unspscCode
Maps to Payflow Parameter: L_UNSPSCCODEn
-
setUnspscCode
Sets the line item unspsc code- Parameters:
unspscCode- StringMaps to Payflow Parameter: L_UNSPSCCODEn
-
getAltTaxAmt
Gets the line item alternate tax amount- Returns:
- altTaxAmt
Maps to Payflow Parameter: L_ALTTAXAMTn
-
setAltTaxAmt
Sets the line item alternate tax amount- Parameters:
altTaxAmt- StringMaps to Payflow Parameter: L_ALTTAXAMTn
-
getAltTaxId
Gets the line item alternate tax id- Returns:
- altTaxId
Maps to Payflow Parameter: L_ALTTAXIDn
-
setAltTaxId
Sets the line item alternate tax id- Parameters:
altTaxId- StringMaps to Payflow Parameter: L_ALTTAXIDn
-
getAltTaxRate
Gets the line item alternate tax rate- Returns:
- altTaxRate
Maps to Payflow Parameter: L_ALTTAXRATEn
-
setAltTaxRate
Sets the line item alternate tax rate- Parameters:
altTaxRate- StringMaps to Payflow Parameter: L_ALTTAXRATEn
-
getCarrierServiceLevelCode
Gets the line item carrier service level code- Returns:
- carrierServiceLevelCode
Maps to Payflow Parameter: L_CARRIERSERVICELEVELCODEn
-
setCarrierServiceLevelCode
Sets the line item carrier service level code- Parameters:
carrierServiceLevelCode- StringMaps to Payflow Parameter: L_CARRIERSERVICELEVELCODEn
-
getExtAmt
Gets the line item extended item amount.- Returns:
- extAmt
Maps to Payflow Parameter: L_EXTAMTn
-
setExtAmt
Sets the line item extended item amount.- Parameters:
extAmt- StringMaps to Payflow Parameter: L_EXTAMTn
-
getItemNumber
Gets the Line item number.- Returns:
- itemNumber
Maps to Payflow Parameter: L_xxxxn
-
setItemNumber
Sets the Line item number.- Parameters:
itemNumber- StringMaps to Payflow Parameter: L_xxxxn
-
generateRequest
protected void generateRequest(int Index) -
getContext
-
setContext
-
getRequestBuffer
Gets the Requestbuffer used for creating the actual request string.- Returns:
- mRequestBuffer StringBuffer
-
setRequestBuffer
sets the StringBuffer to hold the request string.- Parameters:
value- StringBuffer
-
generateRequest
protected void generateRequest()
-