Project60 / org.project60.sepa

SEPA direct debit integration with civicrm
19 stars 46 forks source link

Some "User deprecated function" errors like: CRM_Sepa_DAO_SEPACreditor needs to be regenerated. Missing getEntityTitle method #638

Closed tobiberlin closed 2 years ago

tobiberlin commented 2 years ago

I wrote a custom script which receives the submissions from a donation form (webform) of a seperated Drupal project and stores the data in our CiviCRM installation. The script creates a contact if none exists and then it created the SEPA mandate. Whenever the contact is saved I get the above error message. I think this issue appeared just after I updated to the current master version. Some other warnings I receive:

bjendres commented 2 years ago

Thanks for reporting @tobiberlin. Which CiviSEPA version is this referring to? And which CiviCRM version?

See also #615

tobiberlin commented 2 years ago

CiviCRM 5.50.2, SEPA 1.7-dev

bjendres commented 2 years ago

@tobiberlin could you try again with master?

bjendres commented 2 years ago

@tobiberlin could you try again with master?

...in a test environment, obviously

tobiberlin commented 2 years ago

The above warnings not appear anymore with the new dev version (master branch).

As with the changes in the dev version of this extension some new problems appear I write it down here... if it's better for you I can open a new issue;

Now I've got another problem: with my code the Sepa mandate is not created anymore. I get some confusing error messages. First is:

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).

The second is:

FRST mandate for creditor ID [] disabled, i.e. no valid payment instrument set.

Did something change in the dev version regarding the creation of the Sepa mandate? I user API3 for that:

    $sepaMandateData = [
      'contact_id' => $contactId,
      'type' => $this->isOnetimeDonation($webformSubmission) ? 'OOFF' : 'RCUR',
      'iban' => $webformSubmission->payment_sepa_iban,
      'amount' => $this->getRealDonationAmount($webformSubmission),
      'financial_type_id' => $this->isOnetimeDonation($webformSubmission) ? CiviCRMFieldsAndIds::DONATION_PARLAMENTWATCH : CiviCRMFieldsAndIds::RECURRING_DONATION,
      'creation_date' => date('YmdHis', $webformSubmission->webform_submission_created),
    ];

    $result = civicrm_api3('SepaMandate', 'createfull', $sepaMandateData);
bjendres commented 2 years ago

Are you sure you have configured a (non-test) creditor, and set it as default creditor?

tobiberlin commented 2 years ago

oh, I'm sorry... we currently implement your SEPA extension in our dev environment... after re-importing the production database into my local database I forgot to create the creditor but tested with the dev code. I did not test it yet but this should be the problem for sure. Thank you.

bjendres commented 2 years ago

Great.

@tobiberlin Maybe you could create a new ticket proposing to provide a proper error message, pointing people this problem.

jensschuppe commented 1 year ago

I guess this is fixed.