paypalnvp.request
Class SetExpressCheckout

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

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

Instance is used for SetExpressCheckout request. This request initiates an Express Checkout transaction.

See Also:
Serialized Form

Nested Class Summary
static class SetExpressCheckout.ChannelType
          Type of channel
static class SetExpressCheckout.LandingPage
          Type of PayPal page to display
static class SetExpressCheckout.LocalCode
          Locale of pages displayed by PayPal during Express Checkout.
static class SetExpressCheckout.SolutionType
          Type of checkout flow
 
Constructor Summary
SetExpressCheckout(Payment payment, java.lang.String returnUrl, java.lang.String cancelUrl)
          PayPal recommends that the returnUrl be the final review page on which the customer confirms the order and payment or billing agreement.
 
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 setAddress(Address address)
          Sets address fields
 void setAddressOverride(boolean rOverride)
          Indicates that the PayPal pages should display the shipping address set by you in this SetExpressCheckout request, not the shipping address on file with PayPal for this customer.
 void setAllowNote(boolean allowNote)
          Indicates that the customer may enter a note to the merchant on the PayPal page during checkout.
 void setBackgroundColor(java.lang.String hexColor)
          Sets the background color for the header of the payment page.
 void setBankTxPendingUrl(java.lang.String url)
          The URL on the merchant site to transfer to after a bank transfer payment.
 void setBillingAgreement(BillingAgreement[] agreements)
          Sets billing agreement (recurring payments etc.).
 void setBorderColor(java.lang.String hexColor)
          Sets the border color around the header of the payment page.
 void setBuyerDetails(BuyerDetails buyer)
          Sets buyer details
 void setCallback(java.lang.String callback)
          URL to which the callback request from PayPal is sent.
 void setCallbackTimeout(int timeout)
          An override for you to request more or less time to be able to process the callback request and respond.
 void setChannelType(SetExpressCheckout.ChannelType channelType)
          Type of channel: Merchant: non-auction seller eBayItem: eBay auction
 void setEmail(java.lang.String email)
          Email address of the buyer as entered during checkout.
 void setGiroCancelUrl(java.lang.String url)
          The URL on the merchant site to redirect to after a unsuccessful giropay payment.
 void setGiroPaySuccessUrl(java.lang.String url)
          The URL on the merchant site to redirect to after a successful giropay payment.
 void setImage(java.lang.String imgUrl)
          URL for the image you want to appear at the top left of the payment page.
 void setLandingPage(SetExpressCheckout.LandingPage landingPage)
          Type of PayPal page to display: Billing: non-PayPal account Login: PayPal account login
 void setLocalCode(SetExpressCheckout.LocalCode localCode)
          Locale of pages displayed by PayPal during Express Checkout.
 void setMaxAmount(java.lang.String maxAmount)
          The expected maximum total amount of the complete order, including shipping cost and tax charges.
 void setNoShipping(boolean noShipping)
          Indicates that on the PayPal pages, no shipping address fields should be displayed whatsoever.
 void setNVPResponse(java.util.Map<java.lang.String,java.lang.String> nvpResponse)
          Setter for nvp (name value pair) response
 void setPageStyle(java.lang.String pageStyle)
          Sets the Custom Payment Page Style for payment pages associated with this button/link.
 void setPayFlowColor(java.lang.String hexColor)
          Sets the background color for the payment page.
 void setPaymentAction(PaymentAction paymentAction)
          How you want to obtain payment: Sale indicates that this is a final sale for which you are requesting payment.
 void setRequireConfirmedShipping(boolean required)
          Indicates that you require that the customer’s shipping address on file with PayPal be a confirmed address.
 void setShippingAddress(ShipToAddress address)
           
 void setShippingOptions(ShippingOptions[] options)
          Sets shipping options
 void setSolutionType(SetExpressCheckout.SolutionType solutionType)
          Type of checkout flow: Sole: Express Checkout for auctions Mark: Normal Express Checkout
 void setToken(java.lang.String token)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SetExpressCheckout

public SetExpressCheckout(Payment payment,
                          java.lang.String returnUrl,
                          java.lang.String cancelUrl)
                   throws java.lang.IllegalArgumentException
PayPal recommends that the returnUrl be the final review page on which the customer confirms the order and payment or billing agreement. PayPal recommends that the cancelUrl be the original page on which the customer chose to pay with PayPal or establish a billing agreement.

Parameters:
payment -
returnUrl - URL to which the customer’s browser is returned after choosing to pay with PayPal. Maximum 2048 characters.
cancelUrl - URL to which the customer is returned if he does not approve the use of PayPal to pay you. Maximum 2048 characters.
Throws:
java.lang.IllegalArgumentException
Method Detail

setToken

public void setToken(java.lang.String token)
              throws java.lang.IllegalArgumentException
Parameters:
token - A timestamp token
Throws:
java.lang.IllegalArgumentException

setMaxAmount

public void setMaxAmount(java.lang.String maxAmount)
                  throws java.lang.IllegalArgumentException
The expected maximum total amount of the complete order, including shipping cost and tax charges. If the transaction does not include a one-time purchase, this field is ignored. 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.

Parameters:
maxAmount - number with exactly two decimal places
Throws:
java.lang.IllegalArgumentException

setCallback

public void setCallback(java.lang.String callback)
                 throws java.lang.IllegalArgumentException
URL to which the callback request from PayPal is sent. It must start with HTTPS for production integration. It can start with HTTPS or HTTP for sandbox testing.

Parameters:
callback - max 1024 characters
Throws:
java.lang.IllegalArgumentException

setCallbackTimeout

public void setCallbackTimeout(int timeout)
An override for you to request more or less time to be able to process the callback request and respond. The acceptable range for the override is 1 to 6 seconds.

Parameters:
timeout - integer has to be between 1 - 6

setRequireConfirmedShipping

public void setRequireConfirmedShipping(boolean required)
Indicates that you require that the customer’s shipping address on file with PayPal be a confirmed address. Setting this field overrides the setting you have specified in your Merchant Account Profile.

Parameters:
required - if true than confirmed address is required

setNoShipping

public void setNoShipping(boolean noShipping)
Indicates that on the PayPal pages, no shipping address fields should be displayed whatsoever.

Parameters:
noShipping - if true, no address fields will be displayed

setAllowNote

public void setAllowNote(boolean allowNote)
Indicates that the customer may enter a note to the merchant on the PayPal page during checkout. The note is returned in the GetExpressCheckoutDetails response and the DoExpressCheckoutPayment response.

Parameters:
allowNote - if true, note can be entered by customer

setAddressOverride

public void setAddressOverride(boolean rOverride)
Indicates that the PayPal pages should display the shipping address set by you in this SetExpressCheckout request, not the shipping address on file with PayPal for this customer. Displaying the PayPal street address on file does not allow the customer to edit that address. Set address using setAddress(ShipToAddress address) method

Parameters:
rOverride - if true set address will be used

setLocalCode

public void setLocalCode(SetExpressCheckout.LocalCode localCode)
Locale of pages displayed by PayPal during Express Checkout.

Parameters:
localCode -

setPageStyle

public void setPageStyle(java.lang.String pageStyle)
                  throws java.lang.IllegalArgumentException
Sets the Custom Payment Page Style for payment pages associated with this button/link. This value corresponds to the HTML variable page_style for customizing payment pages. The value is the same as the Page Style Name you chose when adding or editing the page style from the Profile subtab of the My Account tab of your PayPal account. Character length and limitations: 30 single-byte alphabetic characters

Parameters:
pageStyle -
Throws:
java.lang.IllegalArgumentException

setImage

public void setImage(java.lang.String imgUrl)
              throws java.lang.IllegalArgumentException
URL for the image you want to appear at the top left of the payment page. The image has a maximum size of 750 pixels wide by 90 pixels high. PayPal recommends that you provide an image that is stored on a secure (https) server. If you do not specify an image, the business name is displayed. Character length and limit: 127 single-byte alphanumeric characters

Parameters:
imgUrl -
Throws:
java.lang.IllegalArgumentException

setBorderColor

public void setBorderColor(java.lang.String hexColor)
                    throws java.lang.IllegalArgumentException
Sets the border color around the header of the payment page. The border is a 2-pixel perimeter around the header space, which is 750 pixels wide by 90 pixels high. By default, the color is black. Character length and limitation: Six character HTML hexadecimal color code in ASCII

Parameters:
hexColor -
Throws:
java.lang.IllegalArgumentException

setBackgroundColor

public void setBackgroundColor(java.lang.String hexColor)
                        throws java.lang.IllegalArgumentException
Sets the background color for the header of the payment page. By default, the color is white. Character length and limitation: Six character HTML hexadecimal color code in ASCII

Parameters:
hexColor -
Throws:
java.lang.IllegalArgumentException

setPayFlowColor

public void setPayFlowColor(java.lang.String hexColor)
                     throws java.lang.IllegalArgumentException
Sets the background color for the payment page. By default, the color is white. Character length and limitation: Six character HTML hexadecimal color code in ASCII

Parameters:
hexColor -
Throws:
java.lang.IllegalArgumentException

setPaymentAction

public void setPaymentAction(PaymentAction paymentAction)
How you want to obtain payment: If the transaction does not include a one-time purchase, this field is ignored. Note: You cannot set this value to Sale in SetExpressCheckout request and then change this value to Authorization or Order on the final API DoExpressCheckoutPayment request. If the value is set to Authorization or Order in SetExpressCheckout, the value may be set to Sale or the same value (either Authorization or Order) in DoExpressCheckoutPayment.

Parameters:
paymentAction -

setEmail

public void setEmail(java.lang.String email)
              throws java.lang.IllegalArgumentException
Email address of the buyer as entered during checkout. PayPal uses this value to pre-fill the PayPal membership sign-up portion of the PayPal login page. Character length and limit: 127 single-byte alphanumeric characters

Parameters:
email -
Throws:
java.lang.IllegalArgumentException

setSolutionType

public void setSolutionType(SetExpressCheckout.SolutionType solutionType)
Type of checkout flow:

Parameters:
solutionType -

setLandingPage

public void setLandingPage(SetExpressCheckout.LandingPage landingPage)
Type of PayPal page to display:

Parameters:
landingPage -

setChannelType

public void setChannelType(SetExpressCheckout.ChannelType channelType)
Type of channel:

Parameters:
channelType -

setGiroPaySuccessUrl

public void setGiroPaySuccessUrl(java.lang.String url)
The URL on the merchant site to redirect to after a successful giropay payment. Use this field only if you are using giropay or bank transfer payment methods in Germany.

Parameters:
url -

setGiroCancelUrl

public void setGiroCancelUrl(java.lang.String url)
The URL on the merchant site to redirect to after a unsuccessful giropay payment. Use this field only if you are using giropay or bank transfer payment methods in Germany.

Parameters:
url -

setBankTxPendingUrl

public void setBankTxPendingUrl(java.lang.String url)
The URL on the merchant site to transfer to after a bank transfer payment. Use this field only if you are using giropay or bank transfer payment methods in Germany.

Parameters:
url -

setAddress

public void setAddress(Address address)
Sets address fields

Parameters:
address -

setShippingOptions

public void setShippingOptions(ShippingOptions[] options)
Sets shipping options

Parameters:
options -

setBillingAgreement

public void setBillingAgreement(BillingAgreement[] agreements)
Sets billing agreement (recurring payments etc.). Maximum allowed billing agreements is 10

Parameters:
agreements -

setBuyerDetails

public void setBuyerDetails(BuyerDetails buyer)
Sets buyer details

Parameters:
buyer -

setShippingAddress

public void setShippingAddress(ShipToAddress address)
Parameters:
address - shipping address

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