public class WePayApi extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
WePayApi.DataProviderImpl
For unit testing.
|
static class |
WePayApi.Scope
Scope fields
Passed into Wepay::getAuthorizationUri as array
https://stage.wepay.com/developer/reference/permissions
|
| Modifier and Type | Field and Description |
|---|---|
static com.fasterxml.jackson.databind.ObjectMapper |
MAPPER |
| Constructor and Description |
|---|
WePayApi(WePayKey key) |
WePayApi(WePayKey key,
DataProvider provider)
For unit testing.
|
| Modifier and Type | Method and Description |
|---|---|
<T> T |
execute(String token,
WePayRequest<T> req)
Make API calls against authenticated user.
|
String |
getAuthorizationUri(List<WePayApi.Scope> scopes,
String redirectUri,
String state)
Generate URI used during oAuth authorization
Redirect your user to this URI where they can grant your application
permission to make API calls
|
String |
getAuthorizationUri(List<WePayApi.Scope> scopes,
String redirectUri,
String state,
String userName,
String userEmail)
Generate URI used during oAuth authorization
Redirect your user to this URI where they can grant your application
permission to make API calls
|
Token |
getToken(String code,
String redirectUrl)
Exchange a temporary access code for a (semi-)permanent access token
|
public WePayApi(WePayKey key)
public WePayApi(WePayKey key, DataProvider provider)
public String getAuthorizationUri(List<WePayApi.Scope> scopes, String redirectUri, String state)
scopes - List of scope fields for which your application wants accessredirectUri - Where user goes after logging in at WePay (domain must match application settings)state - The opaque value the client application uses to maintain state.public String getAuthorizationUri(List<WePayApi.Scope> scopes, String redirectUri, String state, String userName, String userEmail)
scopes - List of scope fields for which your application wants accessredirectUri - Where user goes after logging in at WePay (domain must match application settings)userName - user_name,user_email which will be pre-filled on login form, state to be returned in querystring of redirect_uripublic Token getToken(String code, String redirectUrl) throws IOException, WePayException
code - 'code' field from query string passed to your redirect_uri pageredirectUrl - Where user went after logging in at WePay (must match value from getAuthorizationUri)IOExceptionWePayExceptionpublic <T> T execute(String token, WePayRequest<T> req) throws IOException, WePayException
IOExceptionWePayExceptionCopyright © 2014. All Rights Reserved.