com.paypal.api.payments
Class Plan

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

public class Plan
extends Object


Constructor Summary
Plan()
          Default Constructor
Plan(String name, String description, String type)
          Parameterized Constructor
 
Method Summary
 Plan create(APIContext apiContext)
          Create a new billing plan by passing the details for the plan, including the plan name, description, and type, to the request URI.
 Plan create(String accessToken)
          Create a new billing plan by passing the details for the plan, including the plan name, description, and type, to the request URI.
static Plan get(APIContext apiContext, String planId)
          Retrieve the details for a particular billing plan by passing the billing plan ID to the request URI.
static Plan get(String accessToken, String planId)
          Retrieve the details for a particular billing plan by passing the billing plan ID to the request URI.
 String getCreateTime()
          Getter for createTime
 String getDescription()
          Getter for description
 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
 MerchantPreferences getMerchantPreferences()
          Getter for merchantPreferences
 String getName()
          Getter for name
 List<PaymentDefinition> getPaymentDefinitions()
          Getter for paymentDefinitions
 String getState()
          Getter for state
 List<Terms> getTerms()
          Getter for terms
 String getType()
          Getter for type
 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
static PlanList list(APIContext apiContext, Map<String,String> containerMap)
          List billing plans according to optional query string parameters specified.
static PlanList list(String accessToken, Map<String,String> containerMap)
          List billing plans according to optional query string parameters specified.
 Plan setCreateTime(String createTime)
          Setter for createTime
 Plan setDescription(String description)
          Setter for description
 Plan setId(String id)
          Setter for id
 Plan setLinks(List<Links> links)
          Setter for links
 Plan setMerchantPreferences(MerchantPreferences merchantPreferences)
          Setter for merchantPreferences
 Plan setName(String name)
          Setter for name
 Plan setPaymentDefinitions(List<PaymentDefinition> paymentDefinitions)
          Setter for paymentDefinitions
 Plan setState(String state)
          Setter for state
 Plan setTerms(List<Terms> terms)
          Setter for terms
 Plan setType(String type)
          Setter for type
 Plan setUpdateTime(String updateTime)
          Setter for updateTime
 String toJSON()
          Returns a JSON string corresponding to object state
 String toString()
           
 void update(APIContext apiContext, List<Patch> patchRequest)
          Replace specific fields within a billing plan by passing the ID of the billing plan to the request URI.
 void update(String accessToken, List<Patch> patchRequest)
          Replace specific fields within a billing plan by passing the ID of the billing plan to the request URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Plan

public Plan()
Default Constructor


Plan

public Plan(String name,
            String description,
            String type)
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 Plan setId(String id)
Setter for id


getId

public String getId()
Getter for id


setName

public Plan setName(String name)
Setter for name


getName

public String getName()
Getter for name


setDescription

public Plan setDescription(String description)
Setter for description


getDescription

public String getDescription()
Getter for description


setType

public Plan setType(String type)
Setter for type


getType

public String getType()
Getter for type


setState

public Plan setState(String state)
Setter for state


getState

public String getState()
Getter for state


setCreateTime

public Plan setCreateTime(String createTime)
Setter for createTime


getCreateTime

public String getCreateTime()
Getter for createTime


setUpdateTime

public Plan setUpdateTime(String updateTime)
Setter for updateTime


getUpdateTime

public String getUpdateTime()
Getter for updateTime


setPaymentDefinitions

public Plan setPaymentDefinitions(List<PaymentDefinition> paymentDefinitions)
Setter for paymentDefinitions


getPaymentDefinitions

public List<PaymentDefinition> getPaymentDefinitions()
Getter for paymentDefinitions


setTerms

public Plan setTerms(List<Terms> terms)
Setter for terms


getTerms

public List<Terms> getTerms()
Getter for terms


setMerchantPreferences

public Plan setMerchantPreferences(MerchantPreferences merchantPreferences)
Setter for merchantPreferences


getMerchantPreferences

public MerchantPreferences getMerchantPreferences()
Getter for merchantPreferences


setLinks

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


getLinks

public List<Links> getLinks()
Getter for links


get

public static Plan get(String accessToken,
                       String planId)
                throws PayPalRESTException
Retrieve the details for a particular billing plan by passing the billing plan ID to the request URI.

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

get

public static Plan get(APIContext apiContext,
                       String planId)
                throws PayPalRESTException
Retrieve the details for a particular billing plan by passing the billing plan ID to the request URI.

Parameters:
apiContext - APIContext used for the API call.
planId - String
Returns:
Plan
Throws:
PayPalRESTException

create

public Plan create(String accessToken)
            throws PayPalRESTException
Create a new billing plan by passing the details for the plan, including the plan name, description, and type, to the request URI.

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

create

public Plan create(APIContext apiContext)
            throws PayPalRESTException
Create a new billing plan by passing the details for the plan, including the plan name, description, and type, to the request URI.

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

update

public void update(String accessToken,
                   List<Patch> patchRequest)
            throws PayPalRESTException
Replace specific fields within a billing plan by passing the ID of the billing plan to the request URI. In addition, pass a patch object in the request JSON that specifies the operation to perform, field to update, and new value for each update.

Parameters:
accessToken - Access Token used for the API call.
patchRequest - PatchRequest
Throws:
PayPalRESTException

update

public void update(APIContext apiContext,
                   List<Patch> patchRequest)
            throws PayPalRESTException
Replace specific fields within a billing plan by passing the ID of the billing plan to the request URI. In addition, pass a patch object in the request JSON that specifies the operation to perform, field to update, and new value for each update.

Parameters:
apiContext - APIContext used for the API call.
patchRequest - PatchRequest
Throws:
PayPalRESTException

list

public static PlanList list(String accessToken,
                            Map<String,String> containerMap)
                     throws PayPalRESTException
List billing plans according to optional query string parameters specified.

Parameters:
accessToken - Access Token used for the API call.
containerMap - Map
Returns:
PlanList
Throws:
PayPalRESTException

list

public static PlanList list(APIContext apiContext,
                            Map<String,String> containerMap)
                     throws PayPalRESTException
List billing plans according to optional query string parameters specified.

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