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;
  import java.util.Map;
  
 
 public class Payout extends PayPalResource {

The original batch header as provided by the payment sender.
 
An array of payout items (that is, a set of individual payouts).
 
 	private List<PayoutItemitems;

 
 	private List<Linkslinks;


Default Constructor
 
 	public Payout() {
 	}

Parameterized Constructor
 
 	public Payout(PayoutSenderBatchHeader senderBatchHeader,
 			List<PayoutItemitems) {
 		this. = senderBatchHeader;
 		this. = items;
 	}

Setter for senderBatchHeader
 
 	public Payout setSenderBatchHeader(PayoutSenderBatchHeader senderBatchHeader) {
 		this. = senderBatchHeader;
 		return this;
 	}

Getter for senderBatchHeader
 
 		return this.;
 	}

Setter for items
 
 	public Payout setItems(List<PayoutItemitems) {
 		this. = items;
 		return this;
 	}

Getter for items
 
 	public List<PayoutItemgetItems() {
 		return this.;
 	}

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

Getter for links
 
 	public List<LinksgetLinks() {
 		return this.;
 	}

You can submit a payout with a synchronous API call, which immediately returns the results of a PayPal payment.

Parameters:
accessToken Access Token used for the API call.
Returns:
PayoutBatch
Throws:
com.paypal.base.rest.PayPalRESTException
	public PayoutBatch createSynchronous(String accessTokenthrows PayPalRESTException {
		APIContext apiContext = new APIContext(accessToken);
		Map<StringStringparameters = new HashMap<StringString>();
		parameters.put("sync_mode""true");
		return create(apiContextparameters);
	}

You can submit a payout with a synchronous API call, which immediately returns the results of a PayPal payment.

Parameters:
apiContext com.paypal.base.rest.APIContext used for the API call.
parameters Map<String, String>
Returns:
PayoutBatch
Throws:
com.paypal.base.rest.PayPalRESTException
		Map<StringStringparameters = new HashMap<StringString>();
		parameters.put("sync_mode""true");
		return create(apiContextparameters);
	}

Create a payout batch resource by passing a sender_batch_header and an items array to the request URI. The sender_batch_header contains payout parameters that describe the handling of a batch resource while the items array conatins payout items.

Parameters:
accessToken Access Token used for the API call.
parameters Map<String, String>
Returns:
PayoutBatch
Throws:
com.paypal.base.rest.PayPalRESTException
	public PayoutBatch create(String accessTokenMap<StringStringparametersthrows PayPalRESTException {
		APIContext apiContext = new APIContext(accessToken);
		return create(apiContextparameters);
	}

Create a payout batch resource by passing a sender_batch_header and an items array to the request URI. The sender_batch_header contains payout parameters that describe the handling of a batch resource while the items array conatins payout items.

Parameters:
apiContext com.paypal.base.rest.APIContext used for the API call.
parameters Map<String, String>
Returns:
PayoutBatch
Throws:
com.paypal.base.rest.PayPalRESTException
	public PayoutBatch create(APIContext apiContextMap<StringStringparametersthrows PayPalRESTException {
		if (apiContext == null) {
			throw new IllegalArgumentException("APIContext cannot be null");
		}
		if (apiContext.getAccessToken() == null
				|| apiContext.getAccessToken().trim().length() <= 0) {
					"AccessToken cannot be null or empty");
		}
		if (parameters == null) {
			parameters = new HashMap<StringString>();
		}
		Object[] parametersObj = new Object[] {parameters};
		if (apiContext.getHTTPHeaders() == null) {
			apiContext.setHTTPHeaders(new HashMap<StringString>());
		}
		apiContext.setSdkVersion(new SDKVersionImpl());
		String pattern = "v1/payments/payouts?sync_mode={0}";
		String resourcePath = RESTUtil.formatURIPath(patternparametersObj);
		String payLoad = this.toJSON();
		return configureAndExecute(apiContext.,
				resourcePathpayLoadPayoutBatch.class);
	}

Obtain the status of a specific batch resource by passing the payout batch ID to the request URI. You can issue this call multiple times to get the current status.

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

Obtain the status of a specific batch resource by passing the payout batch ID to the request URI. You can issue this call multiple times to get the current status.

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