Methods
(static) _getBodyOrUndefined(response) → {Object}
Returns the body of the response if not missing, otherwise undefined
Parameters:
Name | Type | Description |
---|---|---|
response |
Object
|
Returns:
- Type:
-
Object
(static) _getErrorFromResponse(response) → {undefined}
Returns the appropriate NewtonError based on the status code of a response
Parameters:
Name | Type | Description |
---|---|---|
response |
Object
|
Returns:
- Type:
-
undefined
(static) _hasErrorCode(response, errorCode) → {Boolean}
Returns whether a response was returned with a given status code
Parameters:
Name | Type | Description |
---|---|---|
response |
Object
|
|
errorCode |
Number
|
Returns:
- Type:
-
Boolean
(private, static) getAuthHeader(method, url, bodyString, queryString, timestamp) → {String}
Returns an Authorization Header for iPawn identifier
Parameters:
Name | Type | Description |
---|---|---|
method |
String
|
|
url |
String
|
|
bodyString |
String
|
|
queryString |
String
|
|
timestamp |
Number
|
Returns:
- Type:
-
String
(private, static) getIpawnHash(url, method, bodyString, queryString, timestamp) → {String}
Returns a hash message authentication code for the HmacSHA1 algorithm.
Parameters:
Name | Type | Description |
---|---|---|
url |
String
|
|
method |
String
|
|
bodyString |
String
|
|
queryString |
String
|
|
timestamp |
Number
|
Returns:
- Type:
-
String
(private, static) getQueryString(obj) → {String}
Returns an URI encoded querystring from an object
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object
|
Returns:
- Type:
-
String
(static) is2xx(response) → {Boolean}
Returns whether a request returned an OK status
Parameters:
Name | Type | Description |
---|---|---|
response |
Object
|
Returns:
- Type:
-
Boolean
(private, static) makeJSONP(url, queryString) → {undefined}
Sends a JSONP request with given querystring
Parameters:
Name | Type | Description |
---|---|---|
url |
String
|
|
queryString |
String
|
Returns:
- Type:
-
undefined
(private, static) makePostWithXHR(url, body, headers, callback) → {undefined}
Sends an XHR POST request with given parameters
Parameters:
Name | Type | Description |
---|---|---|
url |
String
|
|
body |
Object
|
|
headers |
Array
|
|
callback |
HttpRequestCallback
|
Returns:
- Type:
-
undefined
(static) makeSignedRequest(url, content, callback) → {undefined}
Sends a signed request with given content
Parameters:
Name | Type | Description |
---|---|---|
url |
String
|
|
content |
Object
|
|
callback |
HttpRequestCallback
|
Returns:
- Type:
-
undefined
(static) makeUnsignedRequest(url, content, callback) → {undefined}
Sends an unsigned signed request with given content
Parameters:
Name | Type | Description |
---|---|---|
url |
String
|
|
content |
Object
|
|
callback |
HttpRequestCallback
|
Returns:
- Type:
-
undefined
(static) setLogViewInfo(logViewInfo)
Sets the logView info object to be used when Auth API is called
Parameters:
Name | Type | Description |
---|---|---|
logViewInfo |
Object
|
(static) setupInstance(identifier, secret, urls, iPawnConfig) → {undefined}
Sets secret, identifier and client/auth end domains
Parameters:
Name | Type | Description |
---|---|---|
identifier |
String
|
|
secret |
String
|
|
urls |
Object
|
|
iPawnConfig |
Object
|
contains whiteLabel {String} and isInternational {Boolean} (both or none of them) |
Returns:
- Type:
-
undefined