Dhananjay Donthula
11/19/2019, 10:03 AMcustomerRec.setCurrentSublistValue({
sublistId: 'creditcards',
fieldId: 'cardstate',
value: "4"
});
NElliott
11/19/2019, 10:30 AMDhananjay Donthula
11/19/2019, 10:41 AMDhananjay Donthula
11/19/2019, 10:41 AMDhananjay Donthula
11/19/2019, 10:41 AMNElliott
11/19/2019, 10:42 AMNElliott
11/19/2019, 10:44 AMDhananjay Donthula
11/19/2019, 10:55 AMcustomerRec.insertLine({
sublistId: 'creditcards',
line: 0
});
customerRec.setCurrentSublistValue({
sublistId: 'creditcards',
fieldId: 'ccnumber',
value: options.params.ccNumber.replace(/\s+/g, '')
});
log.debug("Customer sublist fields ", customerRec.getSublistFields({ sublistId: 'creditcards' }));
customerRec.setCurrentSublistValue({
sublistId: 'creditcards',
fieldId: 'paymentmethod',
value: options.params.cardtypenum
});
customerRec.setCurrentSublistValue({
sublistId: 'creditcards',
fieldId: 'cardState',
value: "4"
});
log.debug("cc exp month/year", (options.params.expDate1 + '/' + options.params.expDate2));
var ccExpireDate = format.parse({ type: format.Type.MMYYDATE, value: (options.params.expDate1 + '/' + options.params.expDate2) });
log.debug("cc exp date", ccExpireDate);
customerRec.setCurrentSublistValue({
sublistId: 'creditcards',
fieldId: 'ccexpiredate',
value: ccExpireDate
});
customerRec.setCurrentSublistValue({
sublistId: 'creditcards',
fieldId: 'ccname',
value: options.params.nameoncc
});
customerRec.setCurrentSublistValue({
sublistId: 'creditcards',
fieldId: 'ccdefault',
value: true
});
customerRec.commitLine({
sublistId: 'creditcards'
});
log.debug("params", options.params);
customerRec.selectNewLine({
sublistId: 'addressbook'
});
var addressSubrecord = customerRec.getCurrentSublistSubrecord({
sublistId: 'addressbook',
fieldId: 'addressbookaddress'
});
addressSubrecord.setValue({
fieldId: 'country',
value: options.params.country
});
addressSubrecord.setValue({
fieldId: 'state',
value: options.params.state
});
addressSubrecord.setValue({
fieldId: 'zip',
value: options.params.zip
});
addressSubrecord.setValue({
fieldId: 'addr1',
value: options.params.billingAddress
});
customerRec.commitLine({
sublistId: 'addressbook'
});
return customerRec.save();
}
Dhananjay Donthula
11/19/2019, 11:58 AMSalman Afzal
11/19/2019, 1:10 PMDhananjay Donthula
11/19/2019, 1:32 PMkarlenigma
11/19/2019, 2:24 PMkarlenigma
11/19/2019, 2:25 PMDhananjay Donthula
11/19/2019, 2:48 PMDhananjay Donthula
11/19/2019, 3:13 PMSalman Afzal
11/20/2019, 6:51 AMSalman Afzal
11/20/2019, 6:53 AMNElliott
11/20/2019, 8:40 AM