concretecms-community-store / community_store_mollie

Adds the Mollie payment gateway to Community Store
MIT License
0 stars 3 forks source link

Error installing Package #3

Closed Mesign closed 4 years ago

Mesign commented 4 years ago

I get an error installing the Package: Class 'Concrete\Package\CommunityStoreMollie\Config' not found

On refresh the package seems to be installed. But when entering (copy/paste) the test API key from Mollie I get the following:

Invalid API key: ''. An API key must start with 'test_' or 'live_' and must be at least 30 characters long.

I cleared cache, refeshed database entities, reinstalled plugin. Unfortunately no change.

Both on 8.5.2 as 8.5.4

# concrete5 Version
Core Version - 8.5.4
Version Installed - 8.5.4
Database Version - 20200609145307

# Database Information
Version: 10.0.38-MariaDB
SQL Mode: 

# concrete5 Packages
Abandoned Cart (0.0.9), Automatic Email Obfuscator (2.0.1), Block Builder (1.2.1), Community Store (2.2.7), Community Store Product Attribute (0.5), Community Store Table Rate shipping (2.0), Community Store Toolbar Buttons (1.0), Community Store Weight Tiered Shipping (2.0), Core Translation Updater (0.1.1), Infotown Table (1.0.0), Login Block (2.0.0), Login Page Background (0.9.1), Mollie payment method (1.0.0), Open Graph Tags Lite (2.1.3)

# concrete5 Overrides
blocks/image_slider/templates/sliderhome/view.php, blocks/image_slider/templates/sliderhome/view.css, blocks/image_slider/templates/sliderhome, blocks/image_slider/templates/slidervvp/view.php, blocks/image_slider/templates/slidervvp/view.css, blocks/image_slider/templates/slidervvp, blocks/image_slider/templates, blocks/image_slider, blocks/autonav/templates/subnav/view.php, blocks/autonav/templates/subnav/view.js, blocks/autonav/templates/subnav/view.css, blocks/autonav/templates/subnav, blocks/autonav/templates/nav/view.php, blocks/autonav/templates/nav/view.js, blocks/autonav/templates/nav/view.css, blocks/autonav/templates/nav, blocks/autonav/templates/breadcrumb.php, blocks/autonav/templates, blocks/autonav, blocks/community_product/templates/custom/view.php, blocks/community_product/templates/custom, blocks/community_product/templates, blocks/community_product, blocks/community_product_list/templates/custom/view.php, blocks/community_product_list/templates/custom, blocks/community_product_list/templates, blocks/community_product_list, blocks/cssimage/config-bb.json, blocks/cssimage/icon.png, blocks/cssimage/scrapbook.php, blocks/cssimage/composer.php, blocks/cssimage/controller.php, blocks/cssimage/view.php, blocks/cssimage/db.xml, blocks/cssimage/css_files/form.css, blocks/cssimage/css_files, blocks/cssimage/add.php, blocks/cssimage/edit.php, blocks/cssimage/form.php, blocks/cssimage, blocks/usplist/config-bb.json, blocks/usplist/icon.png, blocks/usplist/scrapbook.php, blocks/usplist/composer.php, blocks/usplist/controller.php, blocks/usplist/view.php, blocks/usplist/db.xml, blocks/usplist/css_files/form.css, blocks/usplist/css_files, blocks/usplist/add.php, blocks/usplist/edit.php, blocks/usplist/form.php, blocks/usplist/auto.js, blocks/usplist, blocks/buttonalgemeen/config-bb.json, blocks/buttonalgemeen/icon.png, blocks/buttonalgemeen/scrapbook.php, blocks/buttonalgemeen/composer.php, blocks/buttonalgemeen/controller.php, blocks/buttonalgemeen/view.php, blocks/buttonalgemeen/db.xml, blocks/buttonalgemeen/css_files/form.css, blocks/buttonalgemeen/css_files, blocks/buttonalgemeen/add.php, blocks/buttonalgemeen/edit.php, blocks/buttonalgemeen/form.php, blocks/buttonalgemeen/auto.js, blocks/buttonalgemeen, themes/XXXXX/css/normalize.css, themes/XXXXX/css/bootstrap-theme.css, themes/XXXXX/css/bootstrap-theme.css.map, themes/XXXXX/css/bootstrap-theme.min.css, themes/XXXXX/css/bootstrap.css, themes/XXXXX/css/bootstrap.css.map, themes/XXXXX/css/bootstrap.min.css, themes/XXXXX/css/desktop.css, themes/XXXXX/css/desktopgroot.css, themes/XXXXX/css/mobiel.css, themes/XXXXX/css/style.css, themes/XXXXX/css/tablet.css, themes/XXXXX/css/typography.css, themes/XXXXX/css/editmode.css, themes/XXXXX/css/owl.carousel.min.css, themes/XXXXX/css/owl.theme.default.min.css, themes/XXXXX/css/jquery-2.2.4.min.js, themes/XXXXX/css/owl.carousel.js, themes/XXXXX/css/owl.carousel.min.js, themes/XXXXX/css/owl.carousel.settings.js, themes/XXXXX/css/owl.carousel.settings.min.js, themes/XXXXX/css/tiny-slider.css, themes/XXXXX/css/style-custom.css, themes/XXXXX/css/aanpassingen.zip, themes/XXXXX/css, themes/XXXXX/categorie.php, themes/XXXXX/default.php, themes/XXXXX/elements/footer.php, themes/XXXXX/elements/header.php, themes/XXXXX/elements/nav.php, themes/XXXXX/elements/breadcrumbs.php, themes/XXXXX/elements/sidebar_agenda.php, themes/XXXXX/elements/sidebar_projecten.php, themes/XXXXX/elements/sidebar_algemeen.php, themes/XXXXX/elements/projectnav.php, themes/XXXXX/elements, themes/XXXXX/description.txt, themes/XXXXX/fonts/glyphicons-halflings-regular.woff2, themes/XXXXX/fonts/glyphicons-halflings-regular.woff, themes/XXXXX/fonts/glyphicons-halflings-regular.ttf, themes/XXXXX/fonts/glyphicons-halflings-regular.svg, themes/XXXXX/fonts/glyphicons-halflings-regular.eot, themes/XXXXX/fonts, themes/XXXXX/images/5hoek.svg, themes/XXXXX/images/slider.jpg, themes/XXXXX/images/facebook.svg, themes/XXXXX/images/keyboard_arrow_down.svg, themes/XXXXX/images/instagram.svg, themes/XXXXX/images/XXXXX.jpg, themes/XXXXX/images/XXXXX.jpg, themes/XXXXX/images/XXXXX.svg, themes/XXXXX/images/XXXXX-icons.svg, themes/XXXXX/images, themes/XXXXX/js/bootstrap.js, themes/XXXXX/js/bootstrap.min.js, themes/XXXXX/js/jquery.matchHeight.js, themes/XXXXX/js/scrolltotop.js, themes/XXXXX/js/setheight.js, themes/XXXXX/js/jarallax.min.js, themes/XXXXX/js/jarallax-element.min.js, themes/XXXXX/js/jarallax-video.min.js, themes/XXXXX/js/owl.carousel.min.js, themes/XXXXX/js/owl.carousel.settings.js, themes/XXXXX/js/owl.carousel.js, themes/XXXXX/js/owl.carousel.settings.min.js, themes/XXXXX/js/tiny-slider.js, themes/XXXXX/js/nav.settings.js, themes/XXXXX/js, themes/XXXXX/page_theme.php, themes/XXXXX/page.php, themes/XXXXX/product.php, themes/XXXXX/thumbnail.png, themes/XXXXX/view.php, themes/XXXXX

# concrete5 Cache Settings
Block Cache - Off
Overrides Cache - Off
Full Page Caching - Off
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache/2

# Server API
fpm-fcgi

# PHP Version
7.2.27

# PHP Extensions
bcmath, calendar, cgi-fcgi, Core, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imagick, intl, json, libxml, mbstring, mysqli, mysqlnd, openssl, pcre, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, session, SimpleXML, soap, sockets, sodium, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, xsl, Zend OPcache, zip, zlib

# PHP Settings
max_execution_time - 300
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1500
memory_limit - 128M
post_max_size - 64M
upload_max_filesize - 64M
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5
opcache.max_accelerated_files - 4000
opcache.max_file_size - 0
opcache.max_wasted_percentage - 5
Mesuva commented 4 years ago

This fix should address the failing install: https://github.com/concrete5-community-store/community_store_mollie/commit/cd6e51d0f9c1d7aa153005b61df8633d83f8388b

and this one I believe should fix the issue with the invalid key: https://github.com/concrete5-community-store/community_store_mollie/commit/0292134adc3d06c10d00b73747196e40d7f883fb

With those in place, I was able to put in a real Mollie test key, and have payment methods start to list under: /index.php/dashboard/store/settings/paymollie

Mesign commented 4 years ago

Thank you! Seems to work. Both site I work on are now in dev- / testmode. When I have trouble going live I will post the results here.

Mesign commented 4 years ago

I started testing. When I make a test payment it gives me an error "Het formulier is verlopen, probeer het opnieuw." (The form has expired, try again). If I go on an set the transaction to succesfull I get directed back to the checkout form. Screenshot: https://ibb.co/PhS06Dz

In the store reports I don't see any transactions succesfull or failed.

In the concrete5 logs I see the following: Exception Occurred: /home/xxxxxx/domains/xxxxxx/private_html/packages/community_store_mollie/src/Mollie/Order/Transaction.php:132 Argument 1 passed to Concrete\Package\CommunityStoreMollie\Src\Mollie\Order\Transaction::getByMolliePaymentID() must be of the type integer, string given, called in /home/xxxxxx/domains/xxxxxx/private_html/packages/community_store_mollie/src/CommunityStore/Payment/Methods/Mollie/MolliePaymentMethod.php on line 88 (0)

Additional information : I moved my entire site/shop from 'domain.ext/test/' to 'domain.ext/' (cleared all cache). Don't know If that could be a problem somewhere.

Mesuva commented 4 years ago

Interesting, I was putting through test orders successfully when I tested this previously.

You said it was working previously? Did it only start with this error after moving the domain?

Mesign commented 4 years ago

Just thought it worked because I got the payment pop-up. Did not notice the form error.

I just tested it on a second webshop in production (without any moving of documents and on a other domain) and I get the same result.

Mesuva commented 4 years ago

Looking at the code, I think this might be a PHP version related issue.

On this line here: https://github.com/concrete5-community-store/community_store_mollie/blob/master/src/CommunityStore/Payment/Methods/Mollie/MolliePaymentMethod.php#L86

Try changing it to: $molliePaymentID = (int)$_POST['id'];

Mesign commented 4 years ago

Thank you for your time and suggestion. Unfortunately there is no change.

Mesuva commented 4 years ago

Perhaps try these changes instead: https://github.com/concrete5-community-store/community_store_mollie/commit/c5157bc6c99a10a84bab8016ecc9856cc8510b3a

Mesign commented 4 years ago

Changed the code, cleared cache, refreshed entities added a new product to test. But no change.

Mesuva commented 4 years ago

Are you getting that same error in the logs?

Mesign commented 4 years ago

First error: Exception Occurred: /home/xxxxxx/domains/xxxxxx/private_html/packages/community_store_mollie/src/Mollie/Order/Transaction.php:132 Argument 1 passed to Concrete\Package\CommunityStoreMollie\Src\Mollie\Order\Transaction::getByMolliePaymentID() must be of the type integer, string given, called in /home/xxxxxx/domains/xxxxxx/private_html/packages/community_store_mollie/src/CommunityStore/Payment/Methods/Mollie/MolliePaymentMethod.php on line 88 (0)

Error now: Exception Occurred: /home/xxxxxx/domains/xxxxxx/private_html/packages/community_store_mollie/src/Mollie/Order/Transaction.php:136 Return value of Concrete\Package\CommunityStoreMollie\Src\Mollie\Order\Transaction::getByMolliePaymentID() must be an instance of Concrete\Package\CommunityStoreMollie\Src\Mollie\Order\Transaction, null returned (0)

Mesuva commented 4 years ago

That error suggests that you've still got the word self on this line here: https://github.com/concrete5-community-store/community_store_mollie/commit/c5157bc6c99a10a84bab8016ecc9856cc8510b3a#diff-7a46eacccadded7246fc75cd4792c367L183

(however, I don't know why it's not returning a transaction)

I didn't build this gateway, I'm wondering if @Jozzeh can help explain why this might be happening.

Jozzeh commented 4 years ago

A huge update was done by @wardhache and he knows the ins and outs of the module now much better than me.
We've been in contact and he'll have a look asap.

(I've pivoted my career more to the frontend, which is why I haven't been very active here.)

Mesuva commented 4 years ago

@Jozzeh Great, I'd appreciate the help here from @wardhache, as there may be something obvious we're overlooking, and I've only casually tested this. He may also want to revert my last commit!

I did actually spot you shifted more to the frontend, I was taking a look at your site earlier. Would be great to keep in touch, my work is still very broad, but I'm trying to do more these days with Javascript myself (vuejs in particular). I'd be interested to hear your thoughts on AdonisJS for example.

Mesign commented 4 years ago

Hi @wardhache, great to hear that you want to look into this problem. Any idea when you have some time to check this out? I have 2 clients waiting for a fix so would be really grateful if this problem could be solved.

Could this have something to do with the PHP version (now running on 7.2.27) if so, I could ask the host to change the PHP version.

wardhache commented 4 years ago

I did a Pull Request #4 provided with the description of all the changes!

wardhache commented 4 years ago

To provide some further information. All errors that you stumbled upon were not because of problems on your side. I separated the commits so you can check out all the solutions for the problems you were facing.

I would like to apologise for the wait, it took me some time to figure it out and I had some other ongoing urgent matters.

Thanks for your patience and I hope you can make those 2 clients very happy!

Mesign commented 4 years ago

@wardhache No need for apologies! I'm really thankful for your time and this plugin.

I downloaded the master and installed it. I got an error. (Created a pull request for the fix). I could make a (test)payment so it works. @Mesuva also thank you again for your time aswell. Would like to donate some cup of coffee to you guys.