If the Order number is not equal with the order id, the transaction is not saved in the Drupal.

Comments

cslevy created an issue. See original summary.

cslevy’s picture

StatusFileSize
new1.56 KB

Patch which fixes the issue, for Commerce Quickpay

cslevy’s picture

Status: Active » Needs review
xen’s picture

You need to come up with a better explanation. If it didn't work in general, I'm sure it would have been noted before now.

Why is it not saved?

cslevy’s picture

The callback url is generated from this $order_number. See quickpay.transactions.inc line 187.

After you return from quickpay the commerce_quickpay_quickpay_callback function is called, where you try to load the commerce order by this order_number.

If the order_number == order_id then this will load the order and will add a transaction to the order. If these values are not equal the order will not be loaded.
See the implementation of commerce_quickpay_quickpay_callback in commerce_quickpay.module

If you don't customize the order number and you use the standard implementation where order_number = order_id then you won't have this problem. I needed custom order_numbers so I encountered this problem.

xen’s picture

Aaah. That's indeed a bug, but that's too much code to fix it.

I assume that all the code apart from changing the order_number here: http://cgit.drupalcode.org/quickpay/tree/modules/commerce_quickpay/comme...
to order_id, was added in order to ensure that QuickPay gets the order_number instead of order_id?

So instead I'll suggest dropping your changes, and instead change:
http://cgit.drupalcode.org/quickpay/tree/modules/commerce_quickpay/comme...
to use commerce_order_load_by_number() instead, which makes it a one line fix.

Mind trying that?

cslevy’s picture

StatusFileSize
new1.67 KB

Too mutch or not...

I created another patch like you suggested, but the truth it that I had to modify in more lines in order to make this to work, and also to have suggestive variables.

Check the attached patch.

  • Xen committed 5ec1632 on 7.x-1.x authored by cslevy
    Issue #2674808 by cslevy: Commerce Quickpay Transaction not saved
    
xen’s picture

Status: Needs review » Fixed

Good catch on the other load and the renaming of variables, thanks. Committed.

1.12 release coming up shortly.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.