Refund Class
This is a Simplify domain object. In order to get access to a domain object, a client needs to be created. The client is then used to invoke the different methods e.g.
var client = Simplify.getClient({
publicKey: 'YOUR_PUBLIC_API_KEY',
privateKey: 'YOUR_PRIVATE_API_KEY'
});
client.refund.METHOD_NAME(params, function(error, data){
if(error){
// handle the error
}
// Awesome...no error, handle the data
});
Constructor
Refund
-
appKeys
Parameters:
-
appKeys
ObjectObject containing the public & private API keys
Methods
create
-
params
-
callback
Function to create a Refund object.
Parameters:
-
params
ObjectA map of parameters in which to create the Refund from.
Valid parameters include:- amount : Amount of the refund in the smallest unit of your currency. Example: 100 = $1.00 (REQUIRED)
- payment : ID of the payment for the refund
- reason : Reason for the refund
- reference : Custom reference field to be used with outside systems.
- replayId : An identifier that can be sent to uniquely identify a refund request to facilitate retries due to I/O related issues. This identifier must be unique for your account (sandbox or live) across all of your refunds. If supplied, we will check for a refund on your account that matches this identifier. If found we will return an identical response to that of the original request. [max length: 50, min length: 1]
- statementDescription.name : Merchant name. (REQUIRED)
- statementDescription.phoneNumber : Merchant contact phone number.
NOTE: Any parameters with a sub-parameter (e.g. param.subParam) need to be nested when passed as an argument in e.g.{ param: { subParam1: 'value', subParam2: 'value' } }
-
callback
FunctionA function to handle success/error responses from the API.
The function takes 2 parameters, the first is an error object. This is null if no error occurs. The second parameter is the response data. This is null if an error occurs.
find
-
id
-
callback
Function to retrieve a Refund object from the API.
Parameters:
-
id
StringThe ID of the Refund to retrieve
-
callback
FunctionA function to handle success/error responses from the API.
The function takes 2 parameters, the first is an error object. This is null if no error occurs. The second parameter is the response data. This is null if an error occurs.
list
-
params
-
callback
Function to retrieve a list Refund objects.
Parameters:
-
params
ObjectA map of parameters in which to define the Refund list from.
Valid parameters include:- filter :
filter.id Filter by the refund Id filter.text Filter by the refund description text filter.replayId Filter by the compoundReplayId filter.authCode Filter by the authorization code (Not authorization ID) filter.amount Filter by the refund amount (in the smallest unit of your currency) filter.dateCreatedMin Filter by the minimum created date you are searching for - Date in UTC millis filter.dateCreatedMax Filter by the maximum created date you are searching for - Date in UTC millis filter.deposit Filter by the deposit id filter.q You can use this to filter by the Id, the authCode or the amount of the refund
*Use dateCreatedMin with dateCreatedMax in the same filter if you want to search between two created dates - max : Allows up to a max of 50 list items to return. [min value: 0, max value: 50, default: 20]
- offset : Used in paging of the list. This is the start offset of the page. [min value: 0, default: 0]
- sorting : Allows for ascending or descending sorting of the list. The value maps properties to the sort direction (either 'asc' for ascending or 'desc' for descending).
Sortable properties are:- id
- amount
- description
- dateCreated
- paymentDate
NOTE: Any parameters with a sub-parameter (e.g. param.subParam) need to be nested when passed as an argument in e.g.{ param: { subParam1: 'value', subParam2: 'value' } }
- filter :
-
callback
FunctionA function to handle success/error responses from the API.
The function takes 2 parameters, the first is an error object. This is null if no error occurs. The second parameter is the response data. This is null if an error occurs.