IP 1.5.3 Mollie payment error


#1

hello,

i’am currently test with payments with mollie. every time when i try to pay i get the following error

using version 1.5.3

An uncaught Exception was encountered

Type: Omnipay\Common\Exception\InvalidRequestException

Message: The transactionReference parameter is required

Filename: /home/stefan/domains/(domain)/private_html/vendor/omnipay/mollie/src/Message/CompletePurchaseRequest.php

Line Number: 26

Backtrace:

File: /home/stefan/domains/(domain)/private_html/vendor/omnipay/common/src/Omnipay/Common/Message/AbstractRequest.php
Line: 610
Function: getData

File: /home/stefan/domains/(domain)/private_html/application/modules/guest/controllers/Payment_handler.php
Line: 244
Function: send

File: /home/stefan/domains/(domain)/private_html/application/modules/guest/controllers/Payment_handler.php
Line: 198
Function: payment_validate

File: /home/stefan/domains/(domain)/private_html/index.php
Line: 327
Function: require_once

#2

bump, anyone?


#3

Mollie has changed its API.
You need to update Omnipay:


#4

how do i update? overwrite the mollie folder in the omnipay folder? that didn’t work.


#5

I will update the files as soon as possible.


#6

Hi Kovah, Any update on this topic? I have experienced the same issue.

Great work though! :smile:
Thanks!


#7

Unfortunately the Mollie payment package was not updated by the original author by now. We have to wait for the fix to arrive.


#8

we’re a couple of weeks further - any updates?


#9

No, still no update for the payment driver.


#10

Hey all,
I’m the maintainer of Omnipay. What you get is an error because you’re not providing the transactionReference to the completePurchaseRequest. This is not an issue with Omnipay or Mollie, but with the integration.

You should receive a transactionReference in your fetchPurchaseResponse (see https://github.com/thephpleague/omnipay-mollie/blob/a8534c97464c4be59db15a3e48f8f3b3634b7a8b/src/Message/FetchTransactionResponse.php#L101-L109)

You can store that in the database/session/whatever and use it in your completePurchaseCall, together with the other parameters.


#11

Good day all, I “fixed” this by modifying ;
application/modules/guest/controllers/Payment_handler.php

In the section $request = array( (line 75)

Add :

			'issuer' => '',
			'description' => 'Factuurnummer 000' . $invoice->invoice_number,

Then , it works.

But. it will always report succesfull transaction (and add the payment in invoiceplane), even if it’s cancelled at Mollie.

Is this because I do something wrong with the Issuer ? Or still a problem with the TransAction reference

Edit : This only works in Mollie Test mode I Think.
I Remember now and also modified TransAction reference to ;

$params[‘transactionReference’] = ‘Nothing’;

So now I understand why it’s always succesfull.

Will try to figure out how to set the correct transaction reference because like barry said that is the actual problem


#12

Hi guys,

I still have the same problem even when I read and done all above writen.
Anyone a solution for this?
Thanks


#13

It has been quiet over here. Did someone find a solution?


#14

Yes and one extra quiet some time, I guess we have to look for another invoice script.
Had the same problem with mbstring and did never found a solution.
too bad…


#15

See https://development.invoiceplane.com/browse/IP-612


#16

Thanks Kovah!

But like I said before, it does not work…


#17

try application/modules/guest/controllers/Payment_handler.php
add after line 96 ($response = $gateway->purchase($request)->send())
$data = $this->session->userdata($invoice->invoice_url_key . '_online_payment');
$data['transactionReference'] = $response->getTransactionReference();
$this->session->set_userdata($invoice->invoice_url_key . '_online_payment', $data);

(edit: changed code because it could break other payment methods)


#18

https://gist.github.com/laemol/73ecd809ef31812b779f37f4beeef008


#19

Just tested with the modifications of laemol against the Mollie test environment (test API key).
When i cancel the payment in the test environment the invoice gets the status PAID where it should not change the Invoice status.
Any clue???


#20

Quick solution to prevent paid status on return/cancel is to wrap the return statement on line 268 in an if statement, followed by a return false.
if ($response->isPaid()) { return true; } return false;
It would be even better to use the Mollie webhook to update the status. The cancelUrl (line 85) that is used and the payment_cancel (line 274) don’t do anything in this case.