com.paypal.api.payments
Class Sale

java.lang.Object
  extended by com.paypal.api.payments.Sale

public class Sale
extends Object


Constructor Summary
Sale()
          Default Constructor
Sale(Amount amount, String state, String parentPayment)
          Parameterized Constructor
 
Method Summary
static Sale get(APIContext apiContext, String saleId)
          Obtain the Sale transaction resource for the given identifier.
static Sale get(String accessToken, String saleId)
          Obtain the Sale transaction resource for the given identifier.
 Amount getAmount()
          Getter for amount
 String getClearingTime()
          Getter for clearingTime
 String getCreateTime()
          Getter for createTime
 String getId()
          Getter for id
static String getLastRequest()
          Returns the last request sent to the Service
static String getLastResponse()
          Returns the last response returned by the Service
 List<Links> getLinks()
          Getter for links
 String getParentPayment()
          Getter for parentPayment
 String getPaymentMode()
          Getter for paymentMode
 String getProtectionEligibility()
          Getter for protectionEligibility
 String getProtectionEligibilityType()
          Getter for protectionEligibilityType
 String getReasonCode()
          Getter for reasonCode
 String getState()
          Getter for state
 String getUpdateTime()
          Getter for updateTime
static OAuthTokenCredential initConfig(File file)
          Initialize using a File(Properties file)
static OAuthTokenCredential initConfig(InputStream is)
          Initialize using InputStream(of a Properties file)
static OAuthTokenCredential initConfig(Properties properties)
          Initialize using Properties
 Refund refund(APIContext apiContext, Refund refund)
          Creates (and processes) a new Refund Transaction added as a related resource.
 Refund refund(String accessToken, Refund refund)
          Creates (and processes) a new Refund Transaction added as a related resource.
 Sale setAmount(Amount amount)
          Setter for amount
 Sale setClearingTime(String clearingTime)
          Setter for clearingTime
 Sale setCreateTime(String createTime)
          Setter for createTime
 Sale setId(String id)
          Setter for id
 Sale setLinks(List<Links> links)
          Setter for links
 Sale setParentPayment(String parentPayment)
          Setter for parentPayment
 Sale setPaymentMode(String paymentMode)
          Setter for paymentMode
 Sale setProtectionEligibility(String protectionEligibility)
          Setter for protectionEligibility
 Sale setProtectionEligibilityType(String protectionEligibilityType)
          Setter for protectionEligibilityType
 Sale setReasonCode(String reasonCode)
          Setter for reasonCode
 Sale setState(String state)
          Setter for state
 Sale setUpdateTime(String updateTime)
          Setter for updateTime
 String toJSON()
          Returns a JSON string corresponding to object state
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Sale

public Sale()
Default Constructor


Sale

public Sale(Amount amount,
            String state,
            String parentPayment)
Parameterized Constructor

Method Detail

getLastRequest

public static String getLastRequest()
Returns the last request sent to the Service

Returns:
Last request sent to the server

getLastResponse

public static String getLastResponse()
Returns the last response returned by the Service

Returns:
Last response got from the Service

initConfig

public static OAuthTokenCredential initConfig(InputStream is)
                                       throws PayPalRESTException
Initialize using InputStream(of a Properties file)

Parameters:
is - InputStream
Returns:
OAuthTokenCredential instance using client ID and client secret loaded from configuration.
Throws:
PayPalRESTException

initConfig

public static OAuthTokenCredential initConfig(File file)
                                       throws PayPalRESTException
Initialize using a File(Properties file)

Parameters:
file - File object of a properties entity
Returns:
OAuthTokenCredential instance using client ID and client secret loaded from configuration.
Throws:
PayPalRESTException

initConfig

public static OAuthTokenCredential initConfig(Properties properties)
Initialize using Properties

Parameters:
properties - Properties object
Returns:
OAuthTokenCredential instance using client ID and client secret loaded from configuration.

setId

public Sale setId(String id)
Setter for id


getId

public String getId()
Getter for id


setCreateTime

public Sale setCreateTime(String createTime)
Setter for createTime


getCreateTime

public String getCreateTime()
Getter for createTime


setUpdateTime

public Sale setUpdateTime(String updateTime)
Setter for updateTime


getUpdateTime

public String getUpdateTime()
Getter for updateTime


setAmount

public Sale setAmount(Amount amount)
Setter for amount


getAmount

public Amount getAmount()
Getter for amount


setPaymentMode

public Sale setPaymentMode(String paymentMode)
Setter for paymentMode


getPaymentMode

public String getPaymentMode()
Getter for paymentMode


setState

public Sale setState(String state)
Setter for state


getState

public String getState()
Getter for state


setReasonCode

public Sale setReasonCode(String reasonCode)
Setter for reasonCode


getReasonCode

public String getReasonCode()
Getter for reasonCode


setProtectionEligibility

public Sale setProtectionEligibility(String protectionEligibility)
Setter for protectionEligibility


getProtectionEligibility

public String getProtectionEligibility()
Getter for protectionEligibility


setProtectionEligibilityType

public Sale setProtectionEligibilityType(String protectionEligibilityType)
Setter for protectionEligibilityType


getProtectionEligibilityType

public String getProtectionEligibilityType()
Getter for protectionEligibilityType


setClearingTime

public Sale setClearingTime(String clearingTime)
Setter for clearingTime


getClearingTime

public String getClearingTime()
Getter for clearingTime


setParentPayment

public Sale setParentPayment(String parentPayment)
Setter for parentPayment


getParentPayment

public String getParentPayment()
Getter for parentPayment


setLinks

public Sale setLinks(List<Links> links)
Setter for links


getLinks

public List<Links> getLinks()
Getter for links


get

public static Sale get(String accessToken,
                       String saleId)
                throws PayPalRESTException
Obtain the Sale transaction resource for the given identifier.

Parameters:
accessToken - Access Token used for the API call.
saleId - String
Returns:
Sale
Throws:
PayPalRESTException

get

public static Sale get(APIContext apiContext,
                       String saleId)
                throws PayPalRESTException
Obtain the Sale transaction resource for the given identifier.

Parameters:
apiContext - APIContext used for the API call.
saleId - String
Returns:
Sale
Throws:
PayPalRESTException

refund

public Refund refund(String accessToken,
                     Refund refund)
              throws PayPalRESTException
Creates (and processes) a new Refund Transaction added as a related resource.

Parameters:
accessToken - Access Token used for the API call.
refund - Refund
Returns:
Refund
Throws:
PayPalRESTException

refund

public Refund refund(APIContext apiContext,
                     Refund refund)
              throws PayPalRESTException
Creates (and processes) a new Refund Transaction added as a related resource.

Parameters:
apiContext - APIContext used for the API call.
refund - Refund
Returns:
Refund
Throws:
PayPalRESTException

toJSON

public String toJSON()
Returns a JSON string corresponding to object state

Returns:
JSON representation

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2015. All Rights Reserved.