paypalnvp.request
Class RefundTransaction

java.lang.Object
  extended by paypalnvp.request.RefundTransaction
All Implemented Interfaces:
java.io.Serializable, Request

public final class RefundTransaction
extends java.lang.Object
implements Request

RefundTransaction Request Message

See Also:
Serialized Form

Method Summary
static RefundTransaction getFullRefund(java.lang.String transactionId)
          Transaction id cannot be longer than 17 characters and cannot be null, if it is, exception is thrown.
 java.util.Map<java.lang.String,java.lang.String> getNVPRequest()
          Creates and returns part of the nvp (name value pair) request containing request values
 java.util.Map<java.lang.String,java.lang.String> getNVPResponse()
          Return response from paypal.
static RefundTransaction getOtherRefund(java.lang.String transactionId)
          Transaction id cannot be longer than 17 characters and cannot be null, if it is, exception is thrown.
static RefundTransaction getOtherRefund(java.lang.String transactionId, java.lang.String amount)
          Transaction id and amount has to be valid, otherwise exception is thrown.
static RefundTransaction getPartialRefund(java.lang.String transactionId, java.lang.String amount)
          Transaction id and amount has to be valid, otherwise exception is thrown.
 void setNote(java.lang.String note)
          Custom memo about the refund.
 void setNVPResponse(java.util.Map<java.lang.String,java.lang.String> nvpResponse)
          Setter for nvp (name value pair) response
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getFullRefund

public static RefundTransaction getFullRefund(java.lang.String transactionId)
                                       throws java.lang.IllegalArgumentException
Transaction id cannot be longer than 17 characters and cannot be null, if it is, exception is thrown.

Parameters:
transactionId - Unique identifier of a transaction. Character length and limitations: 17 single-byte alphanumeric characters.
Returns:
RefundTransaction where type is set to Full.
Throws:
java.lang.IllegalArgumentException

getPartialRefund

public static RefundTransaction getPartialRefund(java.lang.String transactionId,
                                                 java.lang.String amount)
                                          throws java.lang.IllegalArgumentException
Transaction id and amount has to be valid, otherwise exception is thrown.

Parameters:
transactionId - Unique identifier of a transaction. Character length and limitations: 17 single-byte alphanumeric characters.
amount - Amount to reauthorize. Limitations: Value is a positive number which cannot exceed $10,000 USD in any currency. No currency symbol. Must have two decimal places, decimal separator must be a period (.).
Returns:
RefundTransaction where type is set tu Partial.
Throws:
java.lang.IllegalArgumentException

getOtherRefund

public static RefundTransaction getOtherRefund(java.lang.String transactionId)
                                        throws java.lang.IllegalArgumentException
Transaction id cannot be longer than 17 characters and cannot be null, if it is, exception is thrown.

Parameters:
transactionId - Unique identifier of a transaction. Character length and limitations: 17 single-byte alphanumeric characters.
Returns:
RefundTransaction where type is set to Other.
Throws:
java.lang.IllegalArgumentException

getOtherRefund

public static RefundTransaction getOtherRefund(java.lang.String transactionId,
                                               java.lang.String amount)
                                        throws java.lang.IllegalArgumentException
Transaction id and amount has to be valid, otherwise exception is thrown.

Parameters:
transactionId - Unique identifier of a transaction. Character length and limitations: 17 single-byte alphanumeric characters.
amount - Amount to reauthorize. Limitations: Value is a positive number which cannot exceed $10,000 USD in any currency. No currency symbol. Must have two decimal places, decimal separator must be a period (.).
Returns:
RefundTransaction where type is set tu Other.
Throws:
java.lang.IllegalArgumentException

setNote

public void setNote(java.lang.String note)
             throws java.lang.IllegalArgumentException
Custom memo about the refund.

Parameters:
note - Character length and limitations: 255 single-byte alphanumeric characters.
Throws:
java.lang.IllegalArgumentException

getNVPRequest

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

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

setNVPResponse

public void setNVPResponse(java.util.Map<java.lang.String,java.lang.String> nvpResponse)
Description copied from interface: Request
Setter for nvp (name value pair) response

Specified by:
setNVPResponse in interface Request

getNVPResponse

public java.util.Map<java.lang.String,java.lang.String> getNVPResponse()
Description copied from interface: Request
Return response from paypal. If response is not set/received returns empty Map.

Specified by:
getNVPResponse in interface Request
Returns:
response from paypal as a Map

toString

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