new module:ApiClient()
This class subject to change without prior notice, Please dont use this class directly.
Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an application to use this class directly - the *Api and model classes provide the public API for the service. The contents of this file should be regarded as internal but are documented for completeness.Classes
-
handlers/AddFundingAccountHandler
-
handlers/CancelPaymentAuthorizationHandler
-
handlers/CreateCustomerHandler
-
handlers/CreatePaymentAuthorizationHandler
-
handlers/CreatePaymentHandler
-
handlers/CreateRecurringPaymentSetupHandler
-
handlers/CreateRefundHandler
-
handlers/DeleteFundingAccountHandler
-
handlers/DeletePaymentHandler
-
handlers/DeletePaymentSetupHandler
-
handlers/DeleteRecordPaymentHandler
-
handlers/GetCustomerAccountHandler
-
handlers/GetCustomerHandler
-
handlers/GetFundingAccountHandler
-
handlers/GetPaymentHandler
-
handlers/GetPaymentSetupHandler
-
handlers/GetRefundHandler
-
handlers/RecordPaymentHandler
-
handlers/RenewCustomerAccountHandler
-
handlers/ReplaceFundingAccountHandler
-
handlers/RetrieveCustomerAccountsHandler
-
handlers/RetrieveCustomerAccountsPageHandler
-
handlers/RetrieveCustomersHandler
-
handlers/RetrieveCustomersPageHandler
-
handlers/RetrieveFeePaymentHandler
-
handlers/RetrieveFundingAccountsHandler
-
handlers/RetrieveFundingAccountsPageHandler
-
handlers/RetrievePaymentSetupsHandler
-
handlers/RetrievePaymentsHandler
-
handlers/RetrieveRefundsHandler
-
handlers/SimplePaymentHandler
-
handlers/UpdateCustomerHandler
-
handlers/UpdateFundingAccountHandler
-
handlers/UpdatePaymentHandler
-
handlers/UpdatePaymentSetupHandler
Members
-
static, readonly CollectionFormatEnum :String
-
Enumeration of collection format separator strategies.
Properties:
Name Type Description CSVString Comma-separated values. Value:
csvSSVString Space-separated values. Value:
ssvTSVString Tab-separated values. Value:
tsvPIPESString Pipe(|)-separated values. Value:
pipesMULTIString Native array. Value:
multi -
static instance :module:ApiClient
-
The default API client implementation.
-
authentications :Array.<String>
-
The authentication methods to be included for all API calls.
-
basePath :String
-
The base URL against which to resolve every API call's (relative) path.
- Default Value:
- https://api.orbipay.com/payments/v1
-
cache :Boolean
-
If set to false an additional timestamp parameter is added to all API GET calls to prevent browser caching
- Default Value:
- true
-
defaultHeaders :Array.<String>
-
The default HTTP headers to be included for all API calls.
- Default Value:
- {}
-
enableCookies
-
If set to true, the client will save the cookies from each server response, and return them in the next request.
- Default Value:
- false
-
timeout :Number
-
The default HTTP timeout for all API calls.
- Default Value:
- 60
Methods
-
static constructFromObject(data, obj)
-
Constructs a new map or array model from REST data.
Parameters:
Name Type Description dataObject | Array The REST data.
objObject | Array The target object or array.
-
static convertToType(data, type)
-
Converts a value to the specified type.
Parameters:
Name Type Description dataString | Object The data to convert, as a string or object.
typeString | Array.<String> | Object.<String, Object> | function The type to return. Pass a string for simple types or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: all properties on
datawill be converted to this type.Returns:
-An instance of the specified type or null or undefined if data is null or undefined.
-
static parseDate(str) → {Date}
-
Parses an ISO-8601 string representation of a date value.
Parameters:
Name Type Description strString The date value as a string.
Returns:
Date -The parsed date object.
-
applyAuthToRequest(request, authNames)
-
Applies authentication headers to the request.
Parameters:
Name Type Description requestObject The request object created by a
superagent()call.authNamesArray.<String> An array of authentication method names.
-
buildCollectionParam(param, collectionFormat) → {String|Array}
-
Builds a string representation of an array-type actual parameter, according to the given collection format.
Parameters:
Name Type Description paramArray An array parameter.
collectionFormatmodule:ApiClient.CollectionFormatEnum The array element separator strategy.
Returns:
String | Array -A string representation of the supplied collection, using the specified delimiter. Returns
paramas is ifcollectionFormatismulti. -
buildUrl(path, pathParams) → {String}
-
Builds full URL by appending the given path to the base URL and replacing path parameter place-holders with parameter values. NOTE: query parameters are not handled here.
Parameters:
Name Type Description pathString The path to append to the base URL.
pathParamsObject The parameter values to append.
Returns:
String -The encoded path with parameter values substituted.
-
callApi(path, httpMethod, pathParams, queryParams, collectionQueryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, returnType, callback) → {Object}
-
Invokes the REST service using the supplied settings and parameters.
Parameters:
Name Type Description pathString The base URL to invoke.
httpMethodString The HTTP method to use.
pathParamsObject.<String, String> A map of path parameters and their values.
queryParamsObject.<String, Object> A map of query parameters and their values.
collectionQueryParamsObject.<String, Object> A map of collection query parameters and their values.
headerParamsObject.<String, Object> A map of header parameters and their values.
formParamsObject.<String, Object> A map of form parameters and their values.
bodyParamObject The value to pass as the request body.
authNamesArray.<String> An array of authentication type names.
contentTypesArray.<String> An array of request MIME types.
acceptsArray.<String> An array of acceptable response MIME types.
returnTypeString | Array | ObjectFunction The required type to return; can be a string for simple types or the constructor for a complex type.
callbackmodule:ApiClient~callApiCallback The callback function.
Returns:
Object -The SuperAgent request object.
-
deserialize(response, returnType)
-
Deserializes an HTTP response body into a value of the specified type.
Parameters:
Name Type Description responseObject A SuperAgent response object.
returnTypeString | Array.<String> | Object.<String, Object> | function The type to return. Pass a string for simple types or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: all properties on
datawill be converted to this type.Returns:
-A value of the specified type.
-
isFileParam(param) → {Boolean}
-
Checks whether the given parameter value represents file-like content.
Parameters:
Name Type Description paramThe parameter to check.
Returns:
Boolean -trueifparamrepresents a file. -
isJsonMime(contentType) → {Boolean}
-
Checks whether the given content type represents JSON.
JSON content type examples:- application/json
- application/json; charset=UTF8
- APPLICATION/JSON
Parameters:
Name Type Description contentTypeString The MIME content type to check.
Returns:
Boolean -trueifcontentTyperepresents JSON, otherwisefalse. -
jsonPreferredMime(contentTypes) → {String}
-
Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first.
Parameters:
Name Type Description contentTypesArray.<String> Returns:
String -The chosen content type, preferring JSON.
-
normalizeParams(params) → {Object.<String, Object>}
-
Normalizes parameter values:
- remove nils
- keep files and arrays
- format to string with `paramToString` for other cases
Parameters:
Name Type Description paramsObject.<String, Object> The parameters as object properties.
Returns:
Object.<String, Object> -normalized parameters.
-
paramToString(param) → {String}
-
Returns a string representation for an actual parameter.
Parameters:
Name Type Description paramThe actual parameter.
Returns:
String -The string representation of
param.
Type Definitions
-
callApiCallback(error, data, response)
-
Callback function to receive the result of the operation.
Parameters:
Name Type Description errorString Error message, if any.
dataThe data returned by the service call.
responseString The complete HTTP response.