Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.paypal.api.payments;
 
 import java.io.File;
 import java.util.Map;
public class FuturePayment extends Payment {
		Properties properties = new Properties();
		properties.load(new FileReader(new File(".",
				"src/main/resources/sdk_config.properties")));
		return properties;
	}

Creates a future payment using either authorization code or refresh token with correlation ID.
https://developer.paypal.com/webapps/developer/docs/integration/mobile/make-future-payment/

Parameters:
authorizationCode an authorization code
accessToken an access token
correlationId paypal application correlation ID
Returns:
a Payment object
Throws:
com.paypal.base.rest.PayPalRESTException
java.io.IOException thrown when config file cannot be read properly
java.io.FileNotFoundException thrown when config file does not exist
	public Payment create(String accessTokenString correlationIdthrows PayPalRESTExceptionFileNotFoundExceptionIOException {
		if (correlationId == null || correlationId.equals("")) {
			throw new IllegalArgumentException("correlation ID cannot be null or empty");
		}
		APIContext apiContext = new APIContext(accessToken);
		apiContext.setHTTPHeaders(new HashMap<StringString>());
		apiContext.getHTTPHeaders().put("PAYPAL-CLIENT-METADATA-ID"correlationId);
		return this.create(apiContext);
	}
		Map<StringStringconfigurationMap = new HashMap<StringString>();
	    configurationMap.put(.params.getClientID());
	    configurationMap.put(.params.getClientSecret());
	    configurationMap.put("response_type""token");
		APIContext apiContext = new APIContext();
		apiContext.setConfigurationMap(configurationMap);
	    params.setRedirectURI("urn:ietf:wg:oauth:2.0:oob");
		Tokeninfo info = Tokeninfo.createFromAuthorizationCodeForFpp(apiContextparams);
		return info;
	}
		Map<StringStringconfigurationMap = new HashMap<StringString>();
		APIContext apiContext = new APIContext();
		apiContext.setConfigurationMap(configurationMap);
		info = info.createFromRefreshToken(apiContextparams);
		return info;
	}
		ClientCredentials credentials = new ClientCredentials();
		Properties properties = getCredential();
		credentials.setClientID(properties.getProperty(.));
		return credentials;
	}
New to GrepCode? Check out our FAQ X