Invoice payment option not working

freeSbee

Hi Ruud

Thank you for the quick fix!
I have just released a new version of Bakery that contains the upgraded version of Molliev2 payment plugin v1.1. Download it from the Bakery Website:
http://www.bakery-shop.ch/#download

Regards Christoph

Broem

@ Ruud, was using 1.7 (verified that).

Great you did find the issue, i'm going to download the latest version and upload the files again and test it.

Ruud

I found the problem  :-(

It is actually a problem of the Molliev2 plugin.
The "Ik betaal via Mollie" button is generated in it's own form construct. (I guess because it was done that way in older Bakery versions)
This breaks the main form for other payment plugins.
The order of the payment methods in the website depends if it goes wrong or not. So sometimes it will work and sometimes it fails.

I fixed the plugin and put the new version on my website.
https://www.dev4me.nl/modules-snippets/opensource/bakery-betaal-plugin-voor-mollie/

Download > Unpack > Overwrite the existing molliev2 files.
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

Ruud

Could it be you are using the wrong Mollie plugin? There are two versions (for bakery 1.6.x and bakery 1.7.x)

In the info.php located in /modules/bakery/payment_methods/molliev2/ it should say:
$requires_bakery_module = '1.7';
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

Broem

Output:


DEBUG:
Array
(
    [summary] => true
    [agree] => yes
    [cust_msg] =>
    [payment_method] => molliev2
    [setting_continue_url] => http://www.broodjesservicepeelenmaas.nl/pages/broodjes/broodje.php
)



Molliev2 is an addon developed by Dev4Me as additional Dutch payment method (iDeal), also on this forum. I have 3 payment methods active, Invoice, MollieV2 and CoD (Cash on Delivery)

freeSbee

OK, the html looks fine ...

Now we have to check the $_POST array. Please add some debug code to the file bakery/view_summary.php right after the comment at line 63:
// Put payment method selected by user into session var

Add this code and upload the file to the server:
echo '<pre>';
echo 'DEBUG:<br>';
print_r($_POST);
echo '</pre>';


Then again go to the Bakery checkout until you reach "(3) Summary". You should get a debug message similar to the following:
DEBUG:
Array
(
    [summary] => true
    [agree] => yes
    [cust_msg] =>
    [payment_method] => Array
        (
            [invoice] => Ik betaal na ontvangst van de factuur
        )

)


Broem

The code i get is the following:

<input type="submit" name="payment_method[invoice]" class="mod_bakery_bt_pay_invoice_f" value="Ik betaal na ontvangst van de factuur" onclick="javascript: return checkTaC()">

freeSbee

Hi Broem

Make a purchase and go to the "(2) Terms & Conditions and Payment Method" page of the Bakery checkout process. Check the HTML code of the "Charge to my Account" button. It should be something like:

<input type="submit" name="payment_method[invoice]" class="mod_bakery_bt_pay_invoice_f" value="Charge to my Account" onclick="javascript: return checkTaC()">

Please post your code if you are not sure that it is proper.

Regards Christoph

Broem

Hi Christoph,

Thank you for the response. I did check all the things you noticed and these seem to be correct (as you said). But still i get a warning about the array that the payment method can not be found.

Thank you.

freeSbee

Hi Broem

First make sure the payment method has been installed on the server. Go to the bakery/payment_methods/invoice directory and check if it contains 5 files and a language directory.

If true go to the Bakery backend  >  Payment methods. This will reload all available payment methods. Then use phpMyAdmin to check if the payment method makes part of the mod_bakery_payment_methods table. Amongst other fields the "directory" field should be "invoice", the "name" field should be "Invoice" and the "version" field should be "0.3".

Regards Christoph

Broem

I did install the Bakery Shop (latest version) and running WB 2.8.3. Now i'm having some issues with the Invoice Payment option. When I select this option (I also have the COD (pay by delivery) and a Mollie plugin) i get some warnings and it wont let me pay. The COD payment option is working fine, just as the Mollie payment.

When i Select the Invoice option and I would get an overview of the Customer Detailers and Item List i first get an error on the View_Summary.php file. (Below):
Warning: array_keys() expects parameter 1 to be array, string given in /home/user/public_html/modules/bakery/view_summary.php on line 65

Also i get some other errors, it can not find the DIR name for the INVOICE method (referring to bakery/payment_method//languages/EN.php) so it misses the payment name. I'm not sure what file should send this to the view_summary or where it gets it, but i think something is going wrong here.