Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.paypal.api.payments;
  
  import java.util.HashMap;
  import java.util.List;
  
 
 public class Capture  extends PayPalResource {

Identifier of the Capture transaction.
 
 	private String id;

Time the resource was created in UTC ISO8601 format.
 
 	private String createTime;

Time the resource was last updated in UTC ISO8601 format.
 
 	private String updateTime;

Amount being captured. If no amount is specified, amount is used from the authorization being captured. If amount is same as the amount that's authorized for, the state of the authorization changes to captured. If not, the state of the authorization changes to partially_captured. Alternatively, you could indicate a final capture by seting the is_final_capture flag to true.
 
 	private Amount amount;

whether this is a final capture for the given authorization or not. If it's final, all the remaining funds held by the authorization, will be released in the funding instrument.
 
 	private Boolean isFinalCapture;

State of the capture transaction.
 
 	private String state;

ID of the Payment resource that this transaction is based on.
 
 	private String parentPayment;

Transaction fee applicable for this payment.
 
 	private Currency transactionFee;

 
 	private List<Linkslinks;

Default Constructor
 
 	public Capture() {
 	}

Parameterized Constructor
 
 	public Capture(Amount amount) {
 		this. = amount;
 	}


Setter for id
 
 	public Capture setId(String id) {
 		this. = id;
 		return this;
 	}

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


Setter for createTime
 
 	public Capture setCreateTime(String createTime) {
 		this. = createTime;
 		return this;
 	}

Getter for createTime
	public String getCreateTime() {
		return this.;
	}


Setter for updateTime
	public Capture setUpdateTime(String updateTime) {
		this. = updateTime;
		return this;
	}

Getter for updateTime
	public String getUpdateTime() {
		return this.;
	}


Setter for amount
	public Capture setAmount(Amount amount) {
		this. = amount;
		return this;
	}

Getter for amount
	public Amount getAmount() {
		return this.;
	}


Setter for isFinalCapture
	public Capture setIsFinalCapture(Boolean isFinalCapture) {
		this. = isFinalCapture;
		return this;
	}

Getter for isFinalCapture
		return this.;
	}


Setter for state
	public Capture setState(String state) {
		this. = state;
		return this;
	}

Getter for state
	public String getState() {
		return this.;
	}


Setter for parentPayment
	public Capture setParentPayment(String parentPayment) {
		this. = parentPayment;
		return this;
	}

Getter for parentPayment
		return this.;
	}


Setter for links
	public Capture setLinks(List<Linkslinks) {
		this. = links;
		return this;
	}

Getter for links
	public List<LinksgetLinks() {
		return this.;
	}
	}
	public Capture setTransactionFee(Currency transactionFee) {
		this. = transactionFee;
		return this;
	}


Obtain the Capture transaction resource for the given identifier.

Parameters:
accessToken Access Token used for the API call.
captureId String
Returns:
Capture
Throws:
com.paypal.base.rest.PayPalRESTException
	public static Capture get(String accessTokenString captureIdthrows PayPalRESTException {
		APIContext apiContext = new APIContext(accessToken);
		return get(apiContextcaptureId);
	}

Obtain the Capture transaction resource for the given identifier.

Parameters:
apiContext com.paypal.base.rest.APIContext used for the API call.
captureId String
Returns:
Capture
Throws:
com.paypal.base.rest.PayPalRESTException
	public static Capture get(APIContext apiContextString captureIdthrows PayPalRESTException {
		if (apiContext == null) {
			throw new IllegalArgumentException("APIContext cannot be null");
		}
		if (apiContext.getAccessToken() == null || apiContext.getAccessToken().trim().length() <= 0) {
			throw new IllegalArgumentException("AccessToken cannot be null or empty");
		}
		if (apiContext.getHTTPHeaders() == null) {
			apiContext.setHTTPHeaders(new HashMap<StringString>());
		}
		apiContext.setSdkVersion(new SDKVersionImpl());
		if (captureId == null) {
			throw new IllegalArgumentException("captureId cannot be null");
		}
		Object[] parameters = new Object[] {captureId};
		String pattern = "v1/payments/capture/{0}";
		String resourcePath = RESTUtil.formatURIPath(patternparameters);
		String payLoad = "";
		return configureAndExecute(apiContext.resourcePathpayLoadCapture.class);
	}


Creates (and processes) a new Refund Transaction added as a related resource.

Parameters:
accessToken Access Token used for the API call.
refund Refund
Returns:
Refund
Throws:
com.paypal.base.rest.PayPalRESTException
	public Refund refund(String accessTokenRefund refundthrows PayPalRESTException {
		APIContext apiContext = new APIContext(accessToken);
		return refund(apiContextrefund);
	}

Creates (and processes) a new Refund Transaction added as a related resource.

Parameters:
apiContext com.paypal.base.rest.APIContext used for the API call.
refund Refund
Returns:
Refund
Throws:
com.paypal.base.rest.PayPalRESTException
	public Refund refund(APIContext apiContextRefund refundthrows PayPalRESTException {
		if (apiContext == null) {
			throw new IllegalArgumentException("APIContext cannot be null");
		}
		if (apiContext.getAccessToken() == null || apiContext.getAccessToken().trim().length() <= 0) {
			throw new IllegalArgumentException("AccessToken cannot be null or empty");
		}
		if (apiContext.getHTTPHeaders() == null) {
			apiContext.setHTTPHeaders(new HashMap<StringString>());
		}
		apiContext.setSdkVersion(new SDKVersionImpl());
		if (this.getId() == null) {
			throw new IllegalArgumentException("Id cannot be null");
		}
		if (refund == null) {
			throw new IllegalArgumentException("refund cannot be null");
		}
		Object[] parameters = new Object[] {this.getId()};
		String pattern = "v1/payments/capture/{0}/refund";
		String resourcePath = RESTUtil.formatURIPath(patternparameters);
		String payLoad = refund.toJSON();
		return configureAndExecute(apiContext.resourcePathpayLoadRefund.class);
	}
New to GrepCode? Check out our FAQ X