Issue in Brief
SuiteScript error while creating Payment record from invoice using suitelet.
Error Code: CC_PROCESSOR_NOT_FOUND
Message: A suitable credit card processing profile not found for this transaction.
Script type: Suitelet.
Purpose of the script: A payment needs to created from an Invoice.
Gateway Service provider: Payflow Pro

Script
/**
* @NApiVersion 2.x
* @NScriptType suitelet
* @NModuleScope SameAccount
*/
define([‘N/record’],function(record){
varisCreditCard = true;
functiononRequest(context)
{
try {
varstatus = createPayment(941042,117719);
log.error(‘status’,status)
}catch(err)
{
log.debug(‘error@Onrequest’,err)
}
}
functioncreatePayment(invoiceId, cardId) {
try {
varcardIdInt = parseInt(cardId)
varvalidCard = !isNaN(cardIdInt);
if (isCreditCard) {
if (validCard) {
varpaymentRecord = record.transform({
fromType:record.Type.INVOICE,
fromId:invoiceId,
toType:record.Type.CUSTOMER_PAYMENT,
isDynamic:true,
});
// paymentRecord.setValue({ fieldId: “ccprocessoraccount”, value: 126 });
// paymentRecord.setValue({fieldId: “creditcardprocessor”});
log.error(‘getTest’, paymentRecord.getValue({fieldId:”creditcardprocessor”}));
paymentRecord.setValue({fieldId:”creditcard”, value:cardIdInt});
paymentRecord.setValue({fieldId:”payment”, value:0.01 });
paymentRecord.setValue({fieldId:”account”, value:126});
varpaymentRecordId = paymentRecord.save();
log.debug(‘paymentRecordId’,paymentRecordId);
//var paymentRecordId = 123;
return {
isSuccess:true,
paymentId:paymentRecordId
};
}
} else {
return {
isSuccess:true,
paymentId:null
};
}
} catch (e) {
log.debug(“@createPayment”, e);
log.error(“@createPayment”, e);
}
}
return {
onRequest:onRequest
}
})
Assumptions and findings
We noticed that in upcoming Netsuite 2020.2 release. Netsuite is planning to forcefully introduce the”USE STRICT RULES FOR THE SELECTION OF PAYMENT PROCESSING PROFILES”. One of our clients reported an issue in Suitelet context while checking the ‘USE STRICT RULES FOR THE SELECTION OF PAYMENT PROCESSING PROFILES’ checkbox. We investigated and reached the following findings.
- It is working from UI Context in all cases.
- It is returning the “CC_PROCESSOR_NOT_FOUND” in suitelet when the checkbox is enabled.
- No issues while working with suitelet when the preference checkbox is unchecked.
The subsidiary configured in Payment processing profile.
Could you please help us to fix it?
mercedes_brokenrubik
I’m probably stating the obvious, but it looks like none of the existing payment processing profiles support this combo: selected payment method (this is automatically sourced when you set the credit card), currency and subsidiary. I would try to log the values of the Payment Method subtab right before saving the record just to see what’s in there. Also, try to “force” (setValue) of the Payment Method or Processor and see what happens. Good luck!