Start line:  
End line:  

Snippet Preview

Snippet HTML Code

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

Identifier of the order transaction.
 
 	private String id;

Identifier to the purchase unit associated with this object
 
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 collected.
 
 	private Amount amount;

specifies payment mode of the transaction
 
 	private String paymentMode;

State of the order transaction.
 
 	private String state;

Protection Eligibility of the Payer
 
Protection Eligibility Type of the Payer
 
Reason code for the transaction state being Pending. This field will replace pending_reason field eventually
 
 	private String reasonCode;

Fraud Management Filter (FMF) details applied for the payment that could result in accept/deny/pending action.
 
 	private FmfDetails fmfDetails;


Default Constructor
 
 	public Order() {
 	}

Parameterized Constructor
 
 	public Order(String idAmount amountString state) {
 		this. = id;
 		this. = amount;
 		this. = state;
 	}


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

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


Setter for purchaseUnitReferenceId
	public Order setPurchaseUnitReferenceId(String purchaseUnitReferenceId) {
		this. = purchaseUnitReferenceId;
		return this;
	}

Getter for purchaseUnitReferenceId
	}


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

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


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

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


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

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


Setter for paymentMode
	public Order setPaymentMode(String paymentMode) {
		this. = paymentMode;
		return this;
	}

Getter for paymentMode
	public String getPaymentMode() {
		return this.;
	}


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

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


Setter for protectionEligibility
	public Order setProtectionEligibility(String protectionEligibility) {
		this. = protectionEligibility;
		return this;
	}

Getter for protectionEligibility
	}


Setter for protectionEligibilityType
	public Order setProtectionEligibilityType(String protectionEligibilityType) {
		this. = protectionEligibilityType;
		return this;
	}

Getter for protectionEligibilityType
	}
	public String getReasonCode() {
		return ;
	}
	public Order setReasonCode(String reasonCode) {
		this. = reasonCode;
		return this;
	}
		return ;
	}
	public Order setFmfDetails(FmfDetails fmfDetails) {
		this. = fmfDetails;
		return this;
	}


Obtain the Order resource for the given identifier.

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

Obtain the Order resource for the given identifier.

Parameters:
apiContext com.paypal.base.rest.APIContext used for the API call.
orderId String
Returns:
Order
Throws:
com.paypal.base.rest.PayPalRESTException
	public static Order get(APIContext apiContextString orderIdthrows 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 (orderId == null) {
			throw new IllegalArgumentException("orderId cannot be null");
		}
		Object[] parameters = new Object[] {orderId};
		String pattern = "v1/payments/orders/{0}";
		String resourcePath = RESTUtil.formatURIPath(patternparameters);
		String payLoad = "";
		return configureAndExecute(apiContext.resourcePathpayLoadOrder.class);
	}


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

Parameters:
accessToken Access Token used for the API call.
capture Capture
Returns:
Capture
Throws:
com.paypal.base.rest.PayPalRESTException
	public Capture capture(String accessTokenCapture capturethrows PayPalRESTException {
		APIContext apiContext = new APIContext(accessToken);
		return capture(apiContextcapture);
	}

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

Parameters:
apiContext com.paypal.base.rest.APIContext used for the API call.
capture Capture
Returns:
Capture
Throws:
com.paypal.base.rest.PayPalRESTException
	public Capture capture(APIContext apiContextCapture capturethrows 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 (capture == null) {
			throw new IllegalArgumentException("capture cannot be null");
		}
		Object[] parameters = new Object[] {this.getId()};
		String pattern = "v1/payments/orders/{0}/capture";
		String resourcePath = RESTUtil.formatURIPath(patternparameters);
		String payLoad = capture.toJSON();
		return configureAndExecute(apiContext.resourcePathpayLoadCapture.class);
	}


Voids (cancels) an Order.

Parameters:
accessToken Access Token used for the API call.
Returns:
Order
Throws:
com.paypal.base.rest.PayPalRESTException
	public Order doVoid(String accessTokenthrows PayPalRESTException {
		APIContext apiContext = new APIContext(accessToken);
		return doVoid(apiContext);
	}

Voids (cancels) an Order.

Parameters:
apiContext com.paypal.base.rest.APIContext used for the API call.
Returns:
Order
Throws:
com.paypal.base.rest.PayPalRESTException
	public Order doVoid(APIContext apiContextthrows 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");
		}
		Object[] parameters = new Object[] {this.getId()};
		String pattern = "v1/payments/orders/{0}/do-void";
		String resourcePath = RESTUtil.formatURIPath(patternparameters);
		String payLoad = "";
		return configureAndExecute(apiContext.resourcePathpayLoadOrder.class);
	}


Creates an authorization on an order

Parameters:
accessToken Access Token used for the API call.
Returns:
Authorization
Throws:
com.paypal.base.rest.PayPalRESTException
	public Authorization authorize(String accessTokenthrows PayPalRESTException {
		APIContext apiContext = new APIContext(accessToken);
		return authorize(apiContext);
	}

Creates an authorization on an order

Parameters:
apiContext com.paypal.base.rest.APIContext used for the API call.
Returns:
Authorization
Throws:
com.paypal.base.rest.PayPalRESTException
	public Authorization authorize(APIContext apiContextthrows 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");
		}
		Object[] parameters = new Object[] {this.getId()};
		String pattern = "v1/payments/orders/{0}/authorize";
		String resourcePath = RESTUtil.formatURIPath(patternparameters);
		String payLoad = this.toJSON();
		return configureAndExecute(apiContext.resourcePathpayLoadAuthorization.class);
	}
New to GrepCode? Check out our FAQ X