Open tobiberlin opened 1 year ago
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.
@tobiberlin Could you confirm that https://github.com/Project60/org.project60.sepa/commit/523670d49270002f1e2f48f782da0c0514ed7b7f works for you?
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:
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.