1

I'm trying to integrate Mollie in the sylius payumbundle via the omnipay bridge. This is what my configuration looks like:

sylius_payment:
    gateways:
        mollie: Mollie
payum:
    contexts:
        mollie:
            omnipay_onsite:
                type: Mollie
                options:
                    apiKey: test_...

it works fine, however after the payment procedure Mollie redirects back and I get the following error:

The transactionReference parameter is required

Did somebody succeed in integrating sylius with Mollie?

Maarten
  • 11
  • 3

1 Answers1

1

It seems like the OffsiteCaptureAction from the OmnipayBridge is not compatible with the Omnipay/Mollie gateway.

The following part from OffsiteCaptureAction.php is incompatible:

if (false == $details['returnUrl'] && $request->getToken()) {
    $details['returnUrl'] = $request->getToken()->getTargetUrl();
}

If you replace the incompatible part with the following lines of code, it works:

if (false == $details['returnUrl'] && $request->getToken()) {
    $details['returnUrl'] = $request->getToken()->getAfterUrl();
}

if (false == $details['notifyUrl'] && $request->getToken()) {
    $details['notifyUrl'] = $request->getToken()->getTargetUrl();
}

The Mollie gateway uses the notifyUrl as webhook to confirm the payments. This is the most important part of the payment. After it used the webhook/notifyUrl in the background, the customer will be redirected to the returnUrl/AfterUrl. The original piece of code was missing the notifyUrl, and was redirecting the customer to the payment confirmation URL.

It is possible that these changes are not compatible with other gateways. I only use Mollie so it is not a big problem for me.

I have made a fork for the 0.14 branch: https://github.com/goemaere/OmnipayBridge/blob/0.14/src/Action/OffsiteCaptureAction.php#L43-L49

deltab
  • 2,498
  • 23
  • 28
Slash
  • 61
  • 4