Hi Xen

First of all, thanks for a great module.

I've found a small error when getting the callback from Quickpay. The MD5 check is according to the Quickpay API (http://doc.quickpay.dk/paymentwindow/technicalspecification.html) missing a field - splitpayment - which makes Drupal return a 403 error since it cannot load the transaction.

I've added the field to the array and tested the code, which works like a charm. The change is attached in the patch-file.

Best regards

Henrik

CommentFileSizeAuthor
quickpay.patch458 bytesthorn

Comments

xen’s picture

While the documentation agree with you, I can't reproduce this. Which is one thing.

The other thing is that I'd suspect that a bug this basic should render the module useless, which makes the usage statistic of 50 installations pretty odd.

As it works for me, I'm a bit reluctant to add this patch without further investigation.

Is it UC or Commerce, or neither? Are you fiddling with split payments? Any other debugging information?

thorn’s picture

Hi Xen

We are using Drupal Commerce. Drupal, Drupal Commerce is updated to the newest versions. The debugging information is pretty basic. The md5 checksum is wrong, which makes Drupal trigger the following piece of code in quickpay.transaction.inc

  if (md5($md5_string . $this->secret) != $_POST['md5check']) {
    watchdog('quickpay', 'Transaction callback md5 didn\'t verify. MD5 calculated: @md5 Data: @data',
      array('@data' => print_r($_POST, TRUE), '@md5' => md5($md5_string . $this->secret)), WATCHDOG_ERROR);
    return NULL;
  }

We are working with split payments, which might be the reason for us having the error. I can't say. The effect is that the payment is registered by Quickpay but no information is logged in Drupal. It also makes it impossible to capture transactions from Drupal.

I would gladly reproduce the issue once more and do a payment, which will fail. However, before doing these changes and taking down our site. I would be glad if you could supply me with what information you would like to have.

xen’s picture

Status: Active » Closed (fixed)

Aah, then it all starts to make sense.

I figure that the reason that the bug doesn't have any bearing on regular installations without split payment, is that quickpay doesn't send the splitpayment option at all, making the MD5 check pass anyway.

I've committed the patch to HEAD.