paypalnvp.request
Class DoCapture

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

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

Capture an authorized payment.

See Also:
Serialized Form

Constructor Summary
DoCapture(java.lang.String authorizationId, java.lang.String amount, boolean completeType)
          Returns DoCapture instance if arguments are valid, otherwise an exception is thrown.
 
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
 java.util.Map<java.lang.String,java.lang.String> getNVPResponse()
          Return response from paypal.
 void setCurrency(Currency currency)
          Sets currency code.
 void setInvoicNumber(java.lang.String invoiceNumber)
          Your invoice number or other identification number that is displayed to the merchant and customer in his transaction history.
 void setNote(java.lang.String note)
          An informational note about this settlement that is displayed to the payer in email and in his transaction history.
 void setNVPResponse(java.util.Map<java.lang.String,java.lang.String> nvpResponse)
          Setter for nvp (name value pair) response
 void setSoftDescriptor(java.lang.String softDescriptor)
          The soft descriptor is a per transaction description of the payment that is passed to the consumer's credit card statement.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DoCapture

public DoCapture(java.lang.String authorizationId,
                 java.lang.String amount,
                 boolean completeType)
          throws java.lang.IllegalArgumentException
Returns DoCapture instance if arguments are valid, otherwise an exception is thrown.

Parameters:
authorizationId - The authorization identification number of the payment you want to capture. This is the transaction id returned from DoExpressCheckoutPayment or DoDirectPayment. Character length and limits: 19 single-byte characters maximum.
amount - Amount to capture. 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 (.).
completeType - Complete indicates that this the last capture you intend to make. The value NotComplete indicates that you intend to make additional captures. NOTE: If Complete, any remaining amount of the original authorized transaction is automatically voided and all remaining open authorizations are voided.
Throws:
java.lang.IllegalArgumentException
Method Detail

setCurrency

public void setCurrency(Currency currency)
Sets currency code.

Parameters:
currency - Default is USD.

setInvoicNumber

public void setInvoicNumber(java.lang.String invoiceNumber)
                     throws java.lang.IllegalArgumentException
Your invoice number or other identification number that is displayed to the merchant and customer in his transaction history. NOTE: This value on DoCapture will overwrite a value previously set on DoAuthorization. NOTE: The value is recorded only if the authorization you are capturing is an order authorization, not a basic authorization.

Parameters:
invoiceNumber - Character length and limits: 127 single-byte alphanumeric characters.
Throws:
java.lang.IllegalArgumentException

setNote

public void setNote(java.lang.String note)
             throws java.lang.IllegalArgumentException
An informational note about this settlement that is displayed to the payer in email and in his transaction history.

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

setSoftDescriptor

public void setSoftDescriptor(java.lang.String softDescriptor)
                       throws java.lang.IllegalArgumentException
The soft descriptor is a per transaction description of the payment that is passed to the consumer's credit card statement. If a value for the soft descriptor field is provided, the full descriptor displayed on the customer's statement has the following format: <PP * | PAYPAL *><Merchant descriptor as set in the Payment Receiving Preferences><1 space><soft descriptor> The soft descriptor does not include the phone number, which can be toggled between the merchant's customer service number and PayPal's customer service number.

Parameters:
softDescriptor - can contain only the following characters: Alphanumeric characters, - (dash), * (asterisk), . (period), {space}. The maximum length of the total soft descriptor is 22 characters. Of this, either 4 or 8 characters are used by the PayPal prefix shown in the data format. Thus, the maximum length of the soft descriptor passed in the API request is:22 - len(<PP * | PAYPAL *>) - len(<Descriptor set in Payment Receiving Preferences> + 1) For example, assume the following conditions:
  • The PayPal prefix toggle is set to PAYPAL * in PayPal’s admin tools.
  • The merchant descriptor set in the Payment Receiving Preferences is set to EBAY.
  • The soft descriptor is passed in as JanesFlowerGifts LLC.
The resulting descriptor string on the credit card would be: PAYPAL *EBAY JanesFlow
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