All files / lib/resources kycLink.js

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33                                                                 
/**
 * @name KycLink LInk
 * @description This module exposes functions
 *              related to the `/kyc_link` path.
 *
 * @module kycLink
 */
 
import routes from '../routes'
import request from '../request'
 
 
/**
  * `POST /recipients/:recipient_id/kyc_link`
  *
  * Creates a kyc link based on an recipientId.
  *
  * @param {Object} opts An options params which
  *                      is usually already bound
  *                      by `connect` functions.
  * @param {String} data An object containing
  *                      the form data
  * @returns {Promise} Resolves to the result of
  *                    the request or to an error.
*/
const create = (opts, body) =>
  request.post(opts, routes.kycLink.create(body.recipientId), body)
 
 
export default {
  create,
}