paypalnvp.fields
Class PaymentItem

java.lang.Object
  extended by paypalnvp.fields.PaymentItem
All Implemented Interfaces:
java.io.Serializable, RequestFields

public final class PaymentItem
extends java.lang.Object
implements RequestFields

Payment Details Item Type Fields. You have to set amount for at leas one item. Otherwise the payment will be rejected by paypal, because order will be 0.00

See Also:
Serialized Form

Constructor Summary
PaymentItem()
           
 
Method Summary
 java.util.Map<java.lang.String,java.lang.String> getNVPRequest()
          Creates and returns part of the nvp (name value pair) request containing request values
 void setAmount(java.lang.String amount)
          Cost of item.
 void setDescription(java.lang.String description)
          Item description.
 void setHeight(int value, java.lang.String unit)
          Item height corresponds to the height of the item.
 void setItemNumber(java.lang.String itemNumber)
          Item number.
 void setLength(int value, java.lang.String unit)
          Item length corresponds to the length of the item.
 void setName(java.lang.String name)
          Item name.
 void setQuantity(int quantity)
          Item quantity.
 void setTaxAmount(java.lang.String amount)
          Item sales tax.
 void setWeight(int value, java.lang.String unit)
          Item weight corresponds to the weight of the item.
 void setWidth(int value, java.lang.String unit)
          Item width corresponds to the width of the item.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PaymentItem

public PaymentItem()
Method Detail

setName

public void setName(java.lang.String name)
             throws java.lang.IllegalArgumentException
Item name. Character length and limitations: 127 single-byte characters

Parameters:
name -
Throws:
java.lang.IllegalArgumentException

setDescription

public void setDescription(java.lang.String description)
                    throws java.lang.IllegalArgumentException
Item description. Character length and limitations: 127 single-byte characters

Parameters:
description -
Throws:
java.lang.IllegalArgumentException

setAmount

public void setAmount(java.lang.String amount)
               throws java.lang.IllegalArgumentException
Cost of item. Set amount to 0 if the transaction does not include a one-time purchase; for example, when you set up a billing agreement for a recurring payment that is not immediately charged.

Parameters:
amount - Character length and limitations: Must not exceed $10,000 USD in any currency. No currency symbol. Regardless of currency, decimal separator must be a period (.). Equivalent to nine characters maximum for USD.
Throws:
java.lang.IllegalArgumentException

setItemNumber

public void setItemNumber(java.lang.String itemNumber)
                   throws java.lang.IllegalArgumentException
Item number. Character length and limitations: 127 single-byte characters

Parameters:
itemNumber -
Throws:
java.lang.IllegalArgumentException

setQuantity

public void setQuantity(int quantity)
                 throws java.lang.IllegalArgumentException
Item quantity. Character length and limitations: Any positive integer

Parameters:
quantity -
Throws:
java.lang.IllegalArgumentException

setTaxAmount

public void setTaxAmount(java.lang.String amount)
                  throws java.lang.IllegalArgumentException
Item sales tax. Note: Character length and limitations: Must not exceed $10,000 USD in any currency. No currency symbol. Regardless of currency, decimal separator must be a period (.). Equivalent to nine characters maximum for USD.

Parameters:
amount -
Throws:
java.lang.IllegalArgumentException

setWeight

public void setWeight(int value,
                      java.lang.String unit)
               throws java.lang.IllegalArgumentException
Item weight corresponds to the weight of the item. You can pass this data to the shipping carrier as is without having to make an additional database query.

Parameters:
value - any positive integer
unit -
Throws:
java.lang.IllegalArgumentException

setLength

public void setLength(int value,
                      java.lang.String unit)
               throws java.lang.IllegalArgumentException
Item length corresponds to the length of the item. You can pass this data to the shipping carrier as is without having to make an additional database query.

Parameters:
value - any positive integer
unit -
Throws:
java.lang.IllegalArgumentException

setWidth

public void setWidth(int value,
                     java.lang.String unit)
              throws java.lang.IllegalArgumentException
Item width corresponds to the width of the item. You can pass this data to the shipping carrier as is without having to make an additional database query.

Parameters:
value - any positive integer
unit -
Throws:
java.lang.IllegalArgumentException

setHeight

public void setHeight(int value,
                      java.lang.String unit)
               throws java.lang.IllegalArgumentException
Item height corresponds to the height of the item. You can pass this data to the shipping carrier as is without having to make an additional database query. Character length and limitations: Any positive integer

Parameters:
value - any positive integer
unit -
Throws:
java.lang.IllegalArgumentException

getNVPRequest

public java.util.Map<java.lang.String,java.lang.String> getNVPRequest()
Description copied from interface: RequestFields
Creates and returns part of the nvp (name value pair) request containing request values

Specified by:
getNVPRequest in interface RequestFields
Returns:
part of the nvp request as a Map

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object