Simplify Node.js API Docs

API Docs for:
Show:

Refund Class

Defined in: simplify.js:1964

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
)

Defined in simplify.js:1964

Parameters:

  • appKeys Object

    Object containing the public & private API keys

Item Index

Methods

Methods

create

(
  • params
  • callback
)

Defined in simplify.js:1990

Function to create a Refund object.

Parameters:

  • params Object

    A 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 Function

    A 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
)

Defined in simplify.js:2051

Function to retrieve a Refund object from the API.

Parameters:

  • id String

    The ID of the Refund to retrieve

  • callback Function

    A 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
)

Defined in simplify.js:2022

Function to retrieve a list Refund objects.

Parameters:

  • params Object

    A map of parameters in which to define the Refund list from.

    Valid parameters include:

    • filter :
      filter.idFilter by the refund Id
      filter.textFilter by the refund description text
      filter.replayIdFilter by the compoundReplayId
      filter.authCodeFilter by the authorization code (Not authorization ID)
      filter.amountFilter by the refund amount (in the smallest unit of your currency)
      filter.dateCreatedMinFilter by the minimum created date you are searching for - Date in UTC millis
      filter.dateCreatedMaxFilter by the maximum created date you are searching for - Date in UTC millis
      filter.depositFilter by the deposit id
      filter.qYou 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'
                                                    }
                                                }
  • callback Function

    A 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.