com.paypal.api.payments
Class CreditCard

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

public class CreditCard
extends Object


Constructor Summary
CreditCard()
          Default Constructor
CreditCard(String number, String type, int expireMonth, int expireYear)
          Parameterized Constructor
 
Method Summary
 CreditCard create(APIContext apiContext)
          Creates a new Credit Card Resource (aka Tokenize).
 CreditCard create(String accessToken)
          Creates a new Credit Card Resource (aka Tokenize).
 void delete(APIContext apiContext)
          Delete the Credit Card resource for the given identifier.
 void delete(String accessToken)
          Delete the Credit Card resource for the given identifier.
static CreditCard get(APIContext apiContext, String creditCardId)
          Obtain the Credit Card resource for the given identifier.
static CreditCard get(String accessToken, String creditCardId)
          Obtain the Credit Card resource for the given identifier.
 Address getBillingAddress()
          Getter for billingAddress
 int getCvv2()
          Getter for cvv2
 int getExpireMonth()
          Getter for expireMonth
 int getExpireYear()
          Getter for expireYear
 String getExternalCustomerId()
          Getter for externalCustomerId
 String getFirstName()
          Getter for firstName
 String getId()
          Getter for id
 String getLastName()
          Getter for lastName
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 getNumber()
          Getter for number
 String getState()
          Getter for state
 String getType()
          Getter for type
 String getValidUntil()
          Getter for validUntil
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 CreditCardHistory list(APIContext apiContext, Map<String,String> containerMap)
          Retrieves a list of Credit Card resources.
static CreditCardHistory list(String accessToken, Map<String,String> containerMap)
          Retrieves a list of Credit Card resources.
 CreditCard setBillingAddress(Address billingAddress)
          Setter for billingAddress
 CreditCard setCvv2(int cvv2)
          Setter for cvv2
 CreditCard setExpireMonth(int expireMonth)
          Setter for expireMonth
 CreditCard setExpireYear(int expireYear)
          Setter for expireYear
 CreditCard setExternalCustomerId(String externalCustomerId)
          Setter for externalCustomerId
 CreditCard setFirstName(String firstName)
          Setter for firstName
 CreditCard setId(String id)
          Setter for id
 CreditCard setLastName(String lastName)
          Setter for lastName
 CreditCard setLinks(List<Links> links)
          Setter for links
 CreditCard setNumber(String number)
          Setter for number
 CreditCard setState(String state)
          Setter for state
 CreditCard setType(String type)
          Setter for type
 CreditCard setValidUntil(String validUntil)
          Setter for validUntil
 String toJSON()
          Returns a JSON string corresponding to object state
 String toString()
           
 CreditCard update(APIContext apiContext)
          Update information in a previously saved card.
 CreditCard update(String accessToken)
          Update information in a previously saved card.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CreditCard

public CreditCard()
Default Constructor


CreditCard

public CreditCard(String number,
                  String type,
                  int expireMonth,
                  int expireYear)
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 CreditCard setId(String id)
Setter for id


getId

public String getId()
Getter for id


setNumber

public CreditCard setNumber(String number)
Setter for number


getNumber

public String getNumber()
Getter for number


setType

public CreditCard setType(String type)
Setter for type


getType

public String getType()
Getter for type


setExpireMonth

public CreditCard setExpireMonth(int expireMonth)
Setter for expireMonth


getExpireMonth

public int getExpireMonth()
Getter for expireMonth


setExpireYear

public CreditCard setExpireYear(int expireYear)
Setter for expireYear


getExpireYear

public int getExpireYear()
Getter for expireYear


setCvv2

public CreditCard setCvv2(int cvv2)
Setter for cvv2


getCvv2

public int getCvv2()
Getter for cvv2


setFirstName

public CreditCard setFirstName(String firstName)
Setter for firstName


getFirstName

public String getFirstName()
Getter for firstName


setLastName

public CreditCard setLastName(String lastName)
Setter for lastName


getLastName

public String getLastName()
Getter for lastName


setBillingAddress

public CreditCard setBillingAddress(Address billingAddress)
Setter for billingAddress


getBillingAddress

public Address getBillingAddress()
Getter for billingAddress


setExternalCustomerId

public CreditCard setExternalCustomerId(String externalCustomerId)
Setter for externalCustomerId


getExternalCustomerId

public String getExternalCustomerId()
Getter for externalCustomerId


setState

public CreditCard setState(String state)
Setter for state


getState

public String getState()
Getter for state


setValidUntil

public CreditCard setValidUntil(String validUntil)
Setter for validUntil


getValidUntil

public String getValidUntil()
Getter for validUntil


setLinks

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


getLinks

public List<Links> getLinks()
Getter for links


create

public CreditCard create(String accessToken)
                  throws PayPalRESTException
Creates a new Credit Card Resource (aka Tokenize).

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

create

public CreditCard create(APIContext apiContext)
                  throws PayPalRESTException
Creates a new Credit Card Resource (aka Tokenize).

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

get

public static CreditCard get(String accessToken,
                             String creditCardId)
                      throws PayPalRESTException
Obtain the Credit Card resource for the given identifier.

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

get

public static CreditCard get(APIContext apiContext,
                             String creditCardId)
                      throws PayPalRESTException
Obtain the Credit Card resource for the given identifier.

Parameters:
apiContext - APIContext used for the API call.
creditCardId - String
Returns:
CreditCard
Throws:
PayPalRESTException

delete

public void delete(String accessToken)
            throws PayPalRESTException
Delete the Credit Card resource for the given identifier.

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

delete

public void delete(APIContext apiContext)
            throws PayPalRESTException
Delete the Credit Card resource for the given identifier.

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

update

public CreditCard update(String accessToken)
                  throws PayPalRESTException
Update information in a previously saved card. Only the modified fields need to be passed in the request.

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

update

public CreditCard update(APIContext apiContext)
                  throws PayPalRESTException
Update information in a previously saved card. Only the modified fields need to be passed in the request.

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

list

public static CreditCardHistory list(String accessToken,
                                     Map<String,String> containerMap)
                              throws PayPalRESTException
Retrieves a list of Credit Card resources.

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

list

public static CreditCardHistory list(APIContext apiContext,
                                     Map<String,String> containerMap)
                              throws PayPalRESTException
Retrieves a list of Credit Card resources.

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