com.google.checkout.orderprocessing
Class SendBuyerMessageRequest

java.lang.Object
  extended by com.google.checkout.AbstractCheckoutRequest
      extended by com.google.checkout.orderprocessing.AbstractOrderProcessingRequest
          extended by com.google.checkout.orderprocessing.SendBuyerMessageRequest

public class SendBuyerMessageRequest
extends AbstractOrderProcessingRequest

This class contains methods that construct <send-buyer-message> API requests.

Author:
Charles Dang (cdang@google.com)

Field Summary
static java.lang.String MESSAGE_ERROR_STRING
           
static int MESSAGE_STRING_LIMIT
           
 
Fields inherited from class com.google.checkout.AbstractCheckoutRequest
merchantInfo
 
Constructor Summary
SendBuyerMessageRequest(MerchantInfo merchantInfo)
          Constructor which takes an instance of MerchantInfo.
SendBuyerMessageRequest(MerchantInfo merchantInfo, java.lang.String googleOrderNumber, java.lang.String message)
          Constructor which takes an instance of MerchantInfo, Google order number and message.
SendBuyerMessageRequest(MerchantInfo merchantInfo, java.lang.String googleOrderNumber, java.lang.String message, boolean sendEmail)
          Constructor which takes an instance of MerchantInfo, Google order number, message and SendEmail flag.
 
Method Summary
 java.lang.String getMessage()
          Return the message which is to be sent to the buyer.
 boolean isSendEmail()
          True if an email is to be sent to the buyer.
 boolean isWithinMessageStringLimits(java.lang.String message)
          Determine whether the message is within the string length limits.
 void setMessage(java.lang.String message)
          Set the message which is to be sent to the customer.
 void setSendEmail(boolean sendEmail)
          Sets the flag which will determine whether an email is sent to the buyer.
 
Methods inherited from class com.google.checkout.orderprocessing.AbstractOrderProcessingRequest
getGoogleOrderNo, getGoogleOrderNumber, setGoogleOrderNo, setGoogleOrderNumber
 
Methods inherited from class com.google.checkout.AbstractCheckoutRequest
getDocument, getPostUrl, getRoot, getXml, getXmlPretty, send
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MESSAGE_STRING_LIMIT

public static final int MESSAGE_STRING_LIMIT
See Also:
Constant Field Values

MESSAGE_ERROR_STRING

public static final java.lang.String MESSAGE_ERROR_STRING
See Also:
Constant Field Values
Constructor Detail

SendBuyerMessageRequest

public SendBuyerMessageRequest(MerchantInfo merchantInfo)
Constructor which takes an instance of MerchantInfo.

Parameters:
merchantInfo - The merchant's information

SendBuyerMessageRequest

public SendBuyerMessageRequest(MerchantInfo merchantInfo,
                               java.lang.String googleOrderNumber,
                               java.lang.String message)
Constructor which takes an instance of MerchantInfo, Google order number and message.

Parameters:
merchantInfo - The merchant's information.
googleOrderNumber - The Google order number
message - The message to send to the buyer.

SendBuyerMessageRequest

public SendBuyerMessageRequest(MerchantInfo merchantInfo,
                               java.lang.String googleOrderNumber,
                               java.lang.String message,
                               boolean sendEmail)
Constructor which takes an instance of MerchantInfo, Google order number, message and SendEmail flag.

Parameters:
merchantInfo - The merchant's information.
googleOrderNumber - The Google order number.
message - The message to send the buyer.
sendEmail - Whether to send an email to buyer.
Method Detail

isWithinMessageStringLimits

public boolean isWithinMessageStringLimits(java.lang.String message)
Determine whether the message is within the string length limits.

Returns:
True or false.

getMessage

public java.lang.String getMessage()
Return the message which is to be sent to the buyer. This is the value of the <message> tag.

Returns:
The message to send to the buyer.

isSendEmail

public boolean isSendEmail()
True if an email is to be sent to the buyer. This is the value of the <send-email> tag.

Returns:
The boolean value.

setMessage

public void setMessage(java.lang.String message)
Set the message which is to be sent to the customer. This is the value of the <message> tag. Message will be truncated if it exceeds the message string limit. See SendBuyerMessageRequest.MESSAGE_STRING_LIMIT.

Parameters:
message - The message to send to the buyer.
Throws:
CheckoutException - if message is null.

setSendEmail

public void setSendEmail(boolean sendEmail)
Sets the flag which will determine whether an email is sent to the buyer. This is the value of the <send-email> tag.

Parameters:
sendEmail - True if an email is to be sent to the buyer; otherwise false.