The Profile Factory Interface
The profile factory interface creates profile objects that are initialized correctly.
There is only one profile factory and it can always be found at jancy.profileFactory.
Methods
profileFactory.addBuyer(profile, buyer)
profile(object) a profile object created byprofileFactory.create()buyer(string) the ID of the buyer
Adds a buyer to the given profile.
buyer will be normalized to be lowercase and duplicates will be ignored.
profileFactory.addCard(profile, data)
profile(object) a profile object created byprofileFactory.create()data(object)number(string) the credit card numbercvv(string) the CVV of the credit cardexpDate(string) optional expiration date of the cardlabel(string) optional the label to assign to the cardaddress(string) optional address line associated with the cardaddress2(string) optional address line 2 associated with the cardcity(string) optional city associated with the cardstate(string) optional state associated with the cardzip(string) optional zip code associated with the cardnote(string) optional an optional note to associate with the card
expDateformat isMM/YY.
Adds a credit card to the given profile.
profileFactory.addProxy(profile, proxy)
profile(object) a profile object created byprofileFactory.create()proxy(object) a proxy object created byproxyFactory.createSync()
Adds a proxy to the given profile.
profileFactory.addSite(profile, data)
profile(object) a profile object created byprofileFactory.create()data(object)site(stringorRegExp object)isPattern(boolean)fields([object])
Adds a site record to the given profile. See the example project for example usage.
fields should be an array of objects where each object should have the following properties.
field(string) should bepassword,smscode,emailcode, orothercoderesolver(string) the name of the resolver to runresolverArgs([string]) array of arguments to be passed to the resolver when it’s called
Set
isPatterntofalsewhensiteis astringrepresenting a registered site (eg. “ticketmaster” and “axs”). Otherwise setisPatterntotrueandsiteto a constructedRegExp objectthat will be used to match the URL in the tab against when deciding to run the resolvers associated with the givenfields.
profileFactory.create(data)
data(object)providerId(string) value passed in to theprovider.loadProfiles()methodgroupName(string) the group to assign this profile toprofileName(string) the name of the profileemail(string) the email associated with the profilename(string) optionaladress(string) optionaladdress2(string) optionalcity(string) optionalstate(string) optionalzip(string) optionalphoneNumber(string) optionalsmsNumber(string) optionalpasscodes([string]) optional-  
persistCookies(booleannull) optional dob(string) optionalnotes(string) optionalfree1(string) optionalfree2(string) optionalfree3(string) optionalfree4(string) optionalfree5(string) optionalfree6(string) optionalfree7(string) optionalfree8(string) optionalfree9(string) optionalfree10(string) optionalurl(string) optionaltabColor(string) optionaltimezone(string) optional-  
persistSessions(booleannull) optional 
Returns a profile object suitable for additional calls to other profile factory methods and profileRegistry.addProfile().