Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.paypal.api.payments;
  import java.util.List;
 import java.io.File;
 
 public class CreditCard extends Resource {


  
 	private String id;

  
 	private String validUntil;

  
 	private String state;

  
 	private String payerId;

  
 	private String type;

  
 	private String number;

  
 	private String expireMonth;

  
 	private String expireYear;

  
 	private String cvv2;

  
 	private String firstName;

  
 	private String lastName;

  
 	private Address billingAddress;

  
 	private List<Linklinks;

Returns the last request sent to the Service

Returns:
Last request sent to the server
 
 	public static String getLastRequest() {
 		return PayPalResource.getLastRequest();
 	}

Returns the last response returned by the Service

Returns:
Last response got from the Service
	public static String getLastResponse() {
		return PayPalResource.getLastResponse();
	}

Initialize using InputStream(of a Properties file)

Parameters:
is InputStream
Throws:
com.paypal.core.rest.PayPalRESTException
	public static void initConfig(InputStream isthrows PayPalRESTException {
		PayPalResource.initConfig(is);
	}

Initialize using a File(Properties file)

Parameters:
file File object of a properties entity
Throws:
com.paypal.core.rest.PayPalRESTException
	public static void initConfig(File filethrows PayPalRESTException {
		PayPalResource.initConfig(file);
	}

Initialize using Properties

Parameters:
properties Properties object
	public static void initConfig(Properties properties) {
		PayPalResource.initConfig(properties);
	}


Constructor
	public CreditCard() {
	}	

Getter for id
	public String getId() {
		return ;
	}

Setter for id;
	public void setId(String id) {
		this. = id;
	}
Getter for validUntil
	public String getValidUntil() {
		return ;
	}

Setter for validUntil;
	public void setValidUntil(String validUntil) {
		this. = validUntil;
	}
Getter for state
	public String getState() {
		return ;
	}

Setter for state;
	public void setState(String state) {
		this. = state;
	}
Getter for payerId
	public String getPayerId() {
		return ;
	}

Setter for payerId;
	public void setPayerId(String payerId) {
		this. = payerId;
	}
Getter for type
	public String getType() {
		return ;
	}

Setter for type;
	public void setType(String type) {
		this. = type;
	}
Getter for number
	public String getNumber() {
		return ;
	}

Setter for number;
	public void setNumber(String number) {
		this. = number;
	}
Getter for expireMonth
	public String getExpireMonth() {
		return ;
	}

Setter for expireMonth;
	public void setExpireMonth(String expireMonth) {
		this. = expireMonth;
	}
Getter for expireYear
	public String getExpireYear() {
		return ;
	}

Setter for expireYear;
	public void setExpireYear(String expireYear) {
		this. = expireYear;
	}
Getter for cvv2
	public String getCvv2() {
		return ;
	}

Setter for cvv2;
	public void setCvv2(String cvv2) {
		this. = cvv2;
	}
Getter for firstName
	public String getFirstName() {
		return ;
	}

Setter for firstName;
	public void setFirstName(String firstName) {
		this. = firstName;
	}
Getter for lastName
	public String getLastName() {
		return ;
	}

Setter for lastName;
	public void setLastName(String lastName) {
		this. = lastName;
	}
Getter for billingAddress
	}

Setter for billingAddress;
	public void setBillingAddress(Address billingAddress) {
		this. = billingAddress;
	}
Getter for links
	public List<LinkgetLinks() {
		return ;
	}

Setter for links;
	public void setLinks(List<Linklinks) {
		this. = links;
	}




Create call for CreditCard.

Parameters:
accessToken AccessToken used for the API call
Returns:
CreditCard
HttpMethod:
POST
URIpath:
v1/vault/credit-card
	public CreditCard create(String accessTokenthrows PayPalRESTException {
		APIContext apiContext = new APIContext(accessToken);
		return create(apiContext);
	}

Create call for CreditCard.

Parameters:
apiContext APIContext used for the API call
Returns:
CreditCard
HttpMethod:
POST
URIpath:
v1/vault/credit-card
	public CreditCard create(APIContext apiContextthrows PayPalRESTException {
		String resourcePath = "v1/vault/credit-card";
		String payLoad = this.toJSON();	
		return PayPalResource.configureAndExecute(apiContext.resourcePathpayLoadCreditCard.class);
	}

Get call for CreditCard.

Parameters:
accessToken AccessToken used for the API call
creditCardId
Returns:
CreditCard
HttpMethod:
GET
URIpath:
v1/vault/credit-card/:creditCardId
	public static CreditCard get(String accessTokenString creditCardIdthrows PayPalRESTException {
		if ((creditCardId == null) || (creditCardId.length() <= 0)) {
			throw new IllegalArgumentException("creditCardId cannot be null or empty");
		}
		String pattern = "v1/vault/credit-card/{0}";
		Object[] parameters = new Object[] {  creditCardId };
		String resourcePath = RESTUtil.formatURIPath(patternparameters);
		String payLoad = "";
		return PayPalResource.configureAndExecute(accessToken.resourcePathpayLoadCreditCard.class);
	}

Returns a JSON string corresponding to object state

Returns:
JSON representation
	public String toJSON() {
		return JSONFormatter.toJSON(this);
	}
	public String toString() {
		return toJSON();
	}
New to GrepCode? Check out our FAQ X