ggez-banking-sdk
Version:
A Node.js package to handle GGEZ Banking API endpoints, Simplify the process of managing CRUD operations with this efficient and easy-to-use package.
77 lines (76 loc) • 2.29 kB
JavaScript
import { ResetSecurityType } from "../../../constant";
const fillResetPasswordData = (data) => {
const resetUserSecurityData = {
info: {
type: ResetSecurityType.Reset_Password,
},
reset_security_data: {
reset_password: {
current_password: data.currentPassword,
new_password: data.newPassword,
},
},
authentication: [
{
type: data.authenticationType,
code: data.code,
},
],
};
return resetUserSecurityData;
};
const fillResetSecurityCodeData = (data) => {
const resetUserSecurityData = {
info: {
type: ResetSecurityType.Reset_Security_Code,
},
reset_security_data: {
reset_security_code: {
current_password: data.currentPassword,
new_security_code: data.userSecurityCode,
},
},
authentication: [
{
type: data.authenticationType,
code: data.code,
},
],
};
return resetUserSecurityData;
};
const fillResetSecurityQuestionsData = (data) => {
const resetUserSecurityData = {
info: {
type: ResetSecurityType.Reset_Security_Questions,
},
reset_security_data: {
reset_security_questions: {
current_password: data.currentPassword,
secret_question_1: data.questionOne,
secret_answer_1: data.questionOneAnswer,
secret_question_2: data.questionTwo,
secret_answer_2: data.questionTwoAnswer,
},
},
authentication: [
{
type: data.authenticationType,
code: data.code,
},
],
};
return resetUserSecurityData;
};
const fillValidateSecurityCodeData = (data) => {
const validateUserSecurityData = {
info: {
type: data.type,
},
validate_data: {
security_code: data.securityCode,
},
};
return validateUserSecurityData;
};
export { fillResetPasswordData, fillResetSecurityCodeData, fillResetSecurityQuestionsData, fillValidateSecurityCodeData, };