-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Labels
Milestone
Description
Follow up ticket for #638
When a new SEPA mandate is created but there is no default creditor set for the project there is no proper message what causes the process to fail.
For example:
$sepaMandateData = [
'contact_id' => $contactId,
'type' => 'OOFF',
'iban' => $iban,
'amount' => $amount,
'financial_type_id' => $financialTypeId,
'creation_date' => $date),
];
$result = civicrm_api3('SepaMandate', 'createfull', $sepaMandateData);
leads under these circumstances to a PHP warning in logs:
Warning: Undefined array key "creditor_id" in civicrm_api3_sepa_mandate_createfull() (line 81 of sites\default\files\civicrm\ext\org.project60.sepa\api\v3\SepaMandate.php).
and to an exception message:
FRST mandate for creditor ID [] disabled, i.e. no valid payment instrument set.
What solves the problem is to define a default creditor but these errors/warnings give not a proper hint for that.
bjendres