paypalnvp.fields
Class Payment

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

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

Payment Details Type Fields. For simple paymets use constructor with amount field. If you want to set tax, or more options, use Constructor that takes PaymentItem array.

See Also:
Serialized Form

Constructor Summary
Payment(PaymentItem[] items)
          Create Payment from supplied items.
Payment(java.lang.String amount)
          You are adviced to use Payment(PaymentItem[] itmes) contructor, where you can specify all items individually, add individual descriptions, recurring payments etc.
Payment(java.lang.String amount, EbayPaymentItem[] items)
          Create Payment from supplied ebay items.
 
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 setAllowedPaymentMethod(java.lang.String method)
          The payment method type.
 void setButtonSource(java.lang.String source)
          An identification code for use by third-party applications to identify transactions.
 void setCurrency(Currency currency)
          A three-character currency code.
 void setCustomField(java.lang.String field)
          A free-form field for your own use.
 void setDescription(java.lang.String description)
          Description of items the customer is purchasing.
 void setHandlingAmount(java.lang.String amount)
          Total handling costs for this order.
 void setInsuranceAmount(java.lang.String amount)
          Total shipping insurance costs for this order.
 void setInsuranceAmount(java.lang.String amount, boolean insuranceOption)
          Total shipping insurance costs for this order.
 void setInvoiceNumber(java.lang.String invoiceNumber)
          Your own invoice or tracking number.
 void setNote(java.lang.String note)
          Note to the seller.
 void setNotifyUrl(java.lang.String url)
          Your URL for receiving Instant Payment Notification (IPN) about this transaction.
 void setShippingAmount(java.lang.String amount)
          Total shipping costs for this order.
 void setShippingDiscount(java.lang.String discount)
          Shipping discount for this order, specified as a negative number.
 void setTransactionId(java.lang.String transactionId)
          Transaction identification number of the transaction that was created.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Payment

public Payment(java.lang.String amount)
        throws java.lang.IllegalArgumentException
You are adviced to use Payment(PaymentItem[] itmes) contructor, where you can specify all items individually, add individual descriptions, recurring payments etc.

Parameters:
amount - Limitations: Must not exceed $10,000 USD in any currency. No currency symbol. Must have two decimal places, decimal separator must be a period (.), and no thousands separator.
Throws:
java.lang.IllegalArgumentException

Payment

public Payment(PaymentItem[] items)
        throws java.lang.IllegalArgumentException
Create Payment from supplied items. Amount is calculated automatically.

Parameters:
items -
Throws:
java.lang.IllegalArgumentException

Payment

public Payment(java.lang.String amount,
               EbayPaymentItem[] items)
        throws java.lang.IllegalArgumentException
Create Payment from supplied ebay items. Amount has to be set, because ebay items do not have amount field. 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 - Set this field 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. Limitations: Must not exceed $10,000 USD in any currency. No currency symbol. Must have two decimal places, decimal separator must be a period (.), and no thousands separator.
amount -
items -
Throws:
java.lang.IllegalArgumentException
Method Detail

setCurrency

public void setCurrency(Currency currency)
A three-character currency code. Default: USD

Parameters:
currency -

setShippingAmount

public void setShippingAmount(java.lang.String amount)
                       throws java.lang.IllegalArgumentException
Total shipping costs for this order. 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

setInsuranceAmount

public void setInsuranceAmount(java.lang.String amount)
                        throws java.lang.IllegalArgumentException
Total shipping insurance costs for this order. The value must be a non-negative currency amount or null if insurance options are offered. 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

setInsuranceAmount

public void setInsuranceAmount(java.lang.String amount,
                               boolean insuranceOption)
                        throws java.lang.IllegalArgumentException
Total shipping insurance costs for this order. The value must be a non-negative currency amount or null if insurance options are offered. 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. Insurance option displays drop-down on the PayPal Review page.

Parameters:
amount -
insuranceOption - If true, the Insurance drop-down on the PayPal Review page displays the string ‘Yes’ and the insurance amount.
Throws:
java.lang.IllegalArgumentException

setShippingDiscount

public void setShippingDiscount(java.lang.String discount)
                         throws java.lang.IllegalArgumentException
Shipping discount for this order, specified as a negative number. 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:
discount -
Throws:
java.lang.IllegalArgumentException

setHandlingAmount

public void setHandlingAmount(java.lang.String amount)
                       throws java.lang.IllegalArgumentException
Total handling costs for this order. 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

setDescription

public void setDescription(java.lang.String description)
                    throws java.lang.IllegalArgumentException
Description of items the customer is purchasing. Character length and limitations: 127 single-byte alphanumeric characters

Parameters:
description -
Throws:
java.lang.IllegalArgumentException

setCustomField

public void setCustomField(java.lang.String field)
                    throws java.lang.IllegalArgumentException
A free-form field for your own use. Character length and limitations: 256 single-byte alphanumeric characters

Parameters:
field -
Throws:
java.lang.IllegalArgumentException

setInvoiceNumber

public void setInvoiceNumber(java.lang.String invoiceNumber)
                      throws java.lang.IllegalArgumentException
Your own invoice or tracking number. Character length and limitations: 127 single-byte alphanumeric characters

Parameters:
invoiceNumber -
Throws:
java.lang.IllegalArgumentException

setButtonSource

public void setButtonSource(java.lang.String source)
                     throws java.lang.IllegalArgumentException
An identification code for use by third-party applications to identify transactions. Character length and limitations: 32 single-byte alphanumeric characters

Parameters:
source -
Throws:
java.lang.IllegalArgumentException

setNotifyUrl

public void setNotifyUrl(java.lang.String url)
                  throws java.lang.IllegalArgumentException
Your URL for receiving Instant Payment Notification (IPN) about this transaction. If you do not specify this value in the request, the notification URL from your Merchant Profile is used, if one exists. Important: The notify URL only applies to DoExpressCheckoutPayment. This value is ignored when set in SetExpressCheckout or GetExpressCheckoutDetails . Character length and limitations: 2,048 single-byte alphanumeric characters

Parameters:
url -
Throws:
java.lang.IllegalArgumentException

setNote

public void setNote(java.lang.String note)
             throws java.lang.IllegalArgumentException
Note to the seller. Character length and limitations: 255 single-byte characters

Parameters:
note -
Throws:
java.lang.IllegalArgumentException

setTransactionId

public void setTransactionId(java.lang.String transactionId)
Transaction identification number of the transaction that was created.

Parameters:
transactionId -

setAllowedPaymentMethod

public void setAllowedPaymentMethod(java.lang.String method)
The payment method type. Specify the value InstantPaymentOnly.

Parameters:
method -

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