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(com.paypal.core.rest.APIContext apiContext)
          Creates a new Credit Card Resource (aka Tokenize).
 CreditCard create(String accessToken)
          Creates a new Credit Card Resource (aka Tokenize).
 void delete(com.paypal.core.rest.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(com.paypal.core.rest.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
 String getCvv2()
          Getter for cvv2
 int getExpireMonth()
          Getter for expireMonth
 int getExpireYear()
          Getter for expireYear
 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 getPayerId()
          Getter for payerId
 String getState()
          Getter for state
 String getType()
          Getter for type
 String getValidUntil()
          Getter for validUntil
static void initConfig(File file)
          Initialize using a File(Properties file)
static void initConfig(InputStream is)
          Initialize using InputStream(of a Properties file)
static void initConfig(Properties properties)
          Initialize using Properties
 CreditCard setBillingAddress(Address billingAddress)
          Setter for billingAddress
 CreditCard setCvv2(String cvv2)
          Setter for cvv2
 CreditCard setExpireMonth(int expireMonth)
          Setter for expireMonth
 CreditCard setExpireYear(int expireYear)
          Setter for expireYear
 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 setPayerId(String payerId)
          Setter for payerId
 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()
           
 
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 void initConfig(InputStream is)
                       throws com.paypal.core.rest.PayPalRESTException
Initialize using InputStream(of a Properties file)

Parameters:
is - InputStream
Throws:
com.paypal.core.rest.PayPalRESTException

initConfig

public static void initConfig(File file)
                       throws com.paypal.core.rest.PayPalRESTException
Initialize using a File(Properties file)

Parameters:
file - File object of a properties entity
Throws:
com.paypal.core.rest.PayPalRESTException

initConfig

public static void initConfig(Properties properties)
Initialize using Properties

Parameters:
properties - Properties object

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(String cvv2)
Setter for cvv2


getCvv2

public String 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


setPayerId

public CreditCard setPayerId(String payerId)
Setter for payerId


getPayerId

public String getPayerId()
Getter for payerId


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 com.paypal.core.rest.PayPalRESTException
Creates a new Credit Card Resource (aka Tokenize).

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

create

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

Parameters:
apiContext - APIContext used for the API call.
Returns:
CreditCard
Throws:
com.paypal.core.rest.PayPalRESTException

get

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

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

get

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

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

delete

public void delete(String accessToken)
            throws com.paypal.core.rest.PayPalRESTException
Delete the Credit Card resource for the given identifier. Returns 204 No Content when the card is deleted successfully.

Parameters:
accessToken - Access Token used for the API call.
Throws:
com.paypal.core.rest.PayPalRESTException

delete

public void delete(com.paypal.core.rest.APIContext apiContext)
            throws com.paypal.core.rest.PayPalRESTException
Delete the Credit Card resource for the given identifier. Returns 204 No Content when the card is deleted successfully.

Parameters:
apiContext - APIContext used for the API call.
Throws:
com.paypal.core.rest.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 © 2013. All Rights Reserved.