compucorp / uk.co.compucorp.membershipextras

Membership Extras for CiviCRM
Other
5 stars 8 forks source link

Trouble installing Membership Extras #296

Closed janforth closed 3 years ago

janforth commented 3 years ago

I am experiencing a problem when installing your Membership Extras extension. My first try ended in a not rememberable error saying that some „financial account key“ (or so) was missing. Any new attempt of installation the extension leads to the following error:

Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred. DB Error: already exists

However, it seems that the exentsion has installed itself in parts. In the scheduled job section I can find the "Renew offline auto-renewal memberships (Daily)“-job

janforth commented 3 years ago

I tried it again on a clean CiviCRM installation and the same error occurred:

Bildschirmfoto 2020-10-06 um 07 52 40
omarabuhussein commented 3 years ago

hi @janforth

Thanks for reporting this.

This extension is generally developed and tested with "Drupal" CiviCRM installations, so we don't have a support for Wordpress yet, so even if it get installed there is no guranturee that the rest of the functionatly will work as expexted.

But anyway regarding the installation error, the same error is appearntly was report here too : https://github.com/compucorp/uk.co.compucorp.membershipextras/issues/228

and it seems that it is coming from here : https://github.com/compucorp/uk.co.compucorp.membershipextras/blob/master/CRM/MembershipExtras/Upgrader.php#L51-L54

we are defining a new payment processor in our extension without defining its "financial account" which is a mandatory field for payment processor, and tbh it is weird that it only happen on wordpress installations, but in need to be fixed nonetheless, which I might do probably not in the next release but the one after.

But if you are looking for a quick solution for the time being (but a bit technical), you can change this code here after downling the extension but before installing it https://github.com/compucorp/uk.co.compucorp.membershipextras/blob/084641fd87a2cf13f273e4092f6fccf98e3e5eae/CRM/MembershipExtras/PaymentProcessor/OfflineRecurringContribution.php#L85

from this :

  private function getCommonCreationParameters() {
    return [
      'domain_id' => CRM_Core_Config::domainID(),
      'sequential' => 1,
      'name' => self::NAME,
      'payment_processor_type_id' => ManualRecurringPaymentProcessorType::NAME,
      'is_active' => '1',
      'is_default' => '0',
      'class_name' => 'Payment_Manual',
      'is_recur' => '1',
      'payment_instrument_id' => 'EFT',
    ];

to this

  private function getCommonCreationParameters() {
    return [
      'domain_id' => CRM_Core_Config::domainID(),
      'sequential' => 1,
      'name' => self::NAME,
      'financial_account_id' => 'Payment Processor Account',
      'payment_processor_type_id' => ManualRecurringPaymentProcessorType::NAME,
      'is_active' => '1',
      'is_default' => '0',
      'class_name' => 'Payment_Manual',
      'is_recur' => '1',
      'payment_instrument_id' => 'EFT',
    ];

the change I did above is this line

'financial_account_id' => 'Payment Processor Account',

which sets the "financial account" to Payment Processor Account.

but it need to be done on a fresh installation not a one that you already tried to install the extension on.

janforth commented 3 years ago

Hi @omarabuhussein,

Thank you very much for your assistance. However, I am afraid we are only half-way there:

Bildschirmfoto 2020-10-07 um 07 23 25

Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred. 'Payment Processor Account' is not a valid option for field financial_account_id

Do you have an idea what we else could try? What can be the right value for the financial_account_id'?

Best, Jan

omarabuhussein commented 3 years ago

@janforth

can you go to this page http://your-site-url/civicrm/admin/financial/financialAccount?reset=1 (of course replace your-site-url with your actual site url) and see if it show any thing, all the available financial accounts are there, here is an example from my local setup :

2020-10-07 12_31_32-Financial Accounts _ me4test6

but It seems to me that you installed the site above without any sample data from CiviCRM so there is a good chance that you won't find any, and if that is the case then it is an indication that you still have many things to configure on your site related to accounting (like creating financial types, configuring taxes/vat if any ..etc) before trying to install the extension or otherwise you might run into more errors in the future.

janforth commented 3 years ago

@omarabuhussein

I have financial accounts present:

BiFo

So, that cannot be the issue...

omarabuhussein commented 3 years ago

@janforth

ah! it seems like you use Civi in German, I would look into this list and find any financial account that is equivalent to "Payment Processor Account" , which seems to me from a quick look at the language files is "Zahlungsdienstleister Konto", and change the line above again to use it.

janforth commented 3 years ago

Hey @omarabuhussein, this one has fixed it! 🎉🎉 Thank you very much for your assistance! Best, Jan