Mollie payment help! 1.5.9


#1

Who can help me? I’ve set up mollie payments but I am getting this error:

An uncaught Exception was encountered
Type: Omnipay\Common\Exception\InvalidRequestException

Message: The transactionReference parameter is required

Filename: /home/kevinpt324/domains/Domain.nl/public_html/facturatie/vendor/omnipay/mollie/src/Message/CompletePurchaseRequest.php

Line Number: 26

Backtrace:

File: /home/kevinpt324/domains/Domain.nl/public_html/facturatie/vendor/omnipay/common/src/Omnipay/Common/Message/AbstractRequest.php
Line: 610
Function: getData

File: /home/kevinpt324/domains/Domain.nl/public_html/facturatie/application/modules/guest/controllers/Payment_handler.php
Line: 281
Function: send

File: /home/kevinpt324/domains/Domain.nl/public_html/facturatie/application/modules/guest/controllers/Payment_handler.php
Line: 226
Function: payment_validate

File: /home/kevinpt324/domains/Domain.nl/public_html/facturatie/index.php
Line: 325
Function: require_once

#2

i haven’t been using mollie with invoiceplane but using the omnipay class for other projects… so this might not be a solution, it’s rather an information or help to pinpoint the problem…

omnipay / mollie is acting in two different steps…

initialize a payment with gateway mollie

// code bla bla
    $response = $gateway->purchase(
        [
            "amount" => $cart->total(),
            "currency" => "EUR",
// the metadata field is actually a good way to pass informations accross mollie, so you can validate and update your database accordingly ... in this case i pass the payment unique id, which will be called to update later on...
            "metadata" => array($payment->uid()),
            "description" => $site->title().' Bezahlung',
            'notifyUrl' => $page->children()->first()->url(),
            "returnUrl" => $page->parent()->url()
        ]
    )->send();
    if ($response->isRedirect()) {
        // Redirect to offsite payment gateway
        $response->redirect();
    }

because mollie is a payment page where the user is redirected to, there’s nothing happening here… when a payment has successfully paid it mollie will send a response back to your server (if i remember correct it is done via a $_POST[‘id’] - which is actually also the transactionReference)

your servers endpoint will catch this parameter and validate the payment which is usually done like this:

// some more things
        $response = $gateway->fetchTransaction(
            [
                'transactionReference' => $_POST['id'],
// I am not sure if it was post or get though
            ]
        )->send();    
        if($response->isPaid()) {
 // mark invoice as paid
}

usually you also deliver informations about the invoice, such as invoice id to either search and update accoringly in the database

(please note this exact code is not working for you)


#3

Hmm thanks but i cant do alot with that. :frowning: does anyone have the solution for this?


#4

well as the transaction reference is the callback from mollie, did you test it against the sandbox?
do you actually see access within mollie? they have a tracking tool where you can see all calls so if there is none, maybe your api keys are not correct?


#5

Yeah i see them


#6

But thats version 1.5.10 and i’am on 1.5.9 but it says that there are no updates


#7

Did you already solve your Mollie payment issue. I’m working with Mollie payyments for more than a year now without any problem, but in 1.5.9 it does not work out of the box.
If you still need help, please let me know and i would be glad to sent you the updated files and info.


#8

@Benny54 please submit those changes in a github branch, so we can integrate it in the new version of invoiceplane


#9

@UnderDog I’m sorry i’m not familiar with Github but I would rather send you the files that i use for Mollie payment via e-mail.


#10

Hi Can you post the updated file also here?

I’m also using mollie but it doesn’t work. 1.5.9


#11

Sorry for my late response. It is not a good idea to put the files and info in this forum but if you could send me an e-mail i would be glad te send you the information to get Mollie working in 1.5.9.


#12

Hi Benny,

No worries I appreciated you can assist me with this problem.
I send you right away my email.