mangopay4-nodejs-sdk
Version:
Mangopay Node.js SDK
66 lines (56 loc) • 2.01 kB
JavaScript
const Service = require('../service');
const IdentityVerification = require('../models/IdentityVerification');
const Psc = require('../models/Psc');
const IdentityVerifications = Service.extend({
/**
* Start an identity verification session and get a link for the hosted experience
*/
create: function(userId, identityVerification, callback, options) {
options = this._api._getOptions(callback, options, {
data: identityVerification,
dataClass: IdentityVerification,
path: {
userId: userId
}
});
return this._api.method('identity_verification_create', callback, options);
},
/**
* See the status and basic details of an identity verification session
*/
get: function(identityVerificationId, callback, options) {
options = this._api._getOptions(callback, options, {
dataClass: IdentityVerification,
path: {
id: identityVerificationId
}
});
return this._api.method('identity_verification_get', callback, options);
},
/**
* Get all IdentityVerifications for a user
*/
getAll: function(userId, callback, options) {
options = this._api._getOptions(callback, options, {
path: {
userId: userId
}
});
return this._api.method('identity_verification_get_all', callback, options);
},
/**
* Request the retry of a PSC session
*/
retryPsc: function(identityVerificationId, pscId, details, callback, options) {
options = this._api._getOptions(callback, options, {
data: details,
dataClass: Psc,
path: {
identityVerificationId: identityVerificationId,
pscId: pscId
}
});
return this._api.method('identity_verification_retry_psc', callback, options);
},
});
module.exports = IdentityVerifications;