cybersource-api
Version:
Module for connect with CyberSource by soap methods.
16 lines (14 loc) • 368 B
JavaScript
let setNames = (Data,fullName) => {
let fullNameSplited = fullName.split(' ');
if(fullNameSplited.length == 2){
Data.firstName = fullNameSplited[0]
Data.lastName = fullNameSplited[1]
}else if(fullNameSplited.length >= 3){
Data.firstName = fullNameSplited[0]
Data.lastName = fullNameSplited[2]
}
return Data
}
module.exports = {
setNames
}