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