com.paypal.api.payments
Class Order

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

public class Order
extends Object


Constructor Summary
Order()
          Default Constructor
Order(String id, Amount amount, String state)
          Parameterized Constructor
 
Method Summary
 Authorization authorize(APIContext apiContext)
          Creates an authorization on an order
 Authorization authorize(String accessToken)
          Creates an authorization on an order
 Capture capture(APIContext apiContext, Capture capture)
          Creates (and processes) a new Capture Transaction added as a related resource.
 Capture capture(String accessToken, Capture capture)
          Creates (and processes) a new Capture Transaction added as a related resource.
 Order doVoid(APIContext apiContext)
          Voids (cancels) an Order.
 Order doVoid(String accessToken)
          Voids (cancels) an Order.
static Order get(APIContext apiContext, String orderId)
          Obtain the Order resource for the given identifier.
static Order get(String accessToken, String orderId)
          Obtain the Order resource for the given identifier.
 Amount getAmount()
          Getter for amount
 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
 String getPaymentMode()
          Getter for paymentMode
 String getProtectionEligibility()
          Getter for protectionEligibility
 String getProtectionEligibilityType()
          Getter for protectionEligibilityType
 String getPurchaseUnitReferenceId()
          Getter for purchaseUnitReferenceId
 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
 Order setAmount(Amount amount)
          Setter for amount
 Order setCreateTime(String createTime)
          Setter for createTime
 Order setId(String id)
          Setter for id
 Order setPaymentMode(String paymentMode)
          Setter for paymentMode
 Order setProtectionEligibility(String protectionEligibility)
          Setter for protectionEligibility
 Order setProtectionEligibilityType(String protectionEligibilityType)
          Setter for protectionEligibilityType
 Order setPurchaseUnitReferenceId(String purchaseUnitReferenceId)
          Setter for purchaseUnitReferenceId
 Order setState(String state)
          Setter for state
 Order 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

Order

public Order()
Default Constructor


Order

public Order(String id,
             Amount amount,
             String state)
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 Order setId(String id)
Setter for id


getId

public String getId()
Getter for id


setPurchaseUnitReferenceId

public Order setPurchaseUnitReferenceId(String purchaseUnitReferenceId)
Setter for purchaseUnitReferenceId


getPurchaseUnitReferenceId

public String getPurchaseUnitReferenceId()
Getter for purchaseUnitReferenceId


setCreateTime

public Order setCreateTime(String createTime)
Setter for createTime


getCreateTime

public String getCreateTime()
Getter for createTime


setUpdateTime

public Order setUpdateTime(String updateTime)
Setter for updateTime


getUpdateTime

public String getUpdateTime()
Getter for updateTime


setAmount

public Order setAmount(Amount amount)
Setter for amount


getAmount

public Amount getAmount()
Getter for amount


setPaymentMode

public Order setPaymentMode(String paymentMode)
Setter for paymentMode


getPaymentMode

public String getPaymentMode()
Getter for paymentMode


setState

public Order setState(String state)
Setter for state


getState

public String getState()
Getter for state


setProtectionEligibility

public Order setProtectionEligibility(String protectionEligibility)
Setter for protectionEligibility


getProtectionEligibility

public String getProtectionEligibility()
Getter for protectionEligibility


setProtectionEligibilityType

public Order setProtectionEligibilityType(String protectionEligibilityType)
Setter for protectionEligibilityType


getProtectionEligibilityType

public String getProtectionEligibilityType()
Getter for protectionEligibilityType


get

public static Order get(String accessToken,
                        String orderId)
                 throws PayPalRESTException
Obtain the Order resource for the given identifier.

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

get

public static Order get(APIContext apiContext,
                        String orderId)
                 throws PayPalRESTException
Obtain the Order resource for the given identifier.

Parameters:
apiContext - APIContext used for the API call.
orderId - String
Returns:
Order
Throws:
PayPalRESTException

capture

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

Parameters:
accessToken - Access Token used for the API call.
capture - Capture
Returns:
Capture
Throws:
PayPalRESTException

capture

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

Parameters:
apiContext - APIContext used for the API call.
capture - Capture
Returns:
Capture
Throws:
PayPalRESTException

doVoid

public Order doVoid(String accessToken)
             throws PayPalRESTException
Voids (cancels) an Order.

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

doVoid

public Order doVoid(APIContext apiContext)
             throws PayPalRESTException
Voids (cancels) an Order.

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

authorize

public Authorization authorize(String accessToken)
                        throws PayPalRESTException
Creates an authorization on an order

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

authorize

public Authorization authorize(APIContext apiContext)
                        throws PayPalRESTException
Creates an authorization on an order

Parameters:
apiContext - APIContext used for the API call.
Returns:
Authorization
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.