Magento Forum

Page 1 of 2
1.4 :: Potential problem for customers who register during checkout. 
 
future500
Member
 
Avatar
Total Posts:  41
Joined:  2008-11-05
Netherlands
 

Upgrade to 1.4 adds automatic login for new customers during checkout.

The checkout procedure now features an automatic login, that adds the current cart/quote to any existing carts/quotes the customer might have already had. The problem is, with NEW customers there is no existing information and a clean quote is made with the ordered items, shipping and billing addresses - BUT: disregarding the payment information.

Some people might experience problems with payment plugins. The problem we experienced is that the amounts are recalculated without VAT or shipping and then sent to the payment provider. This provides a mismatch in order amount and paid amount.

I filed a bug report with additional information: Issue #20827
http://www.magentocommerce.com/bug-tracking/issue?issue=8462

 
Magento Community Magento Community
Magento Community
Magento Community
 
JS
Member
 
Total Posts:  44
Joined:  2008-03-08
 

Hi,

i can confirm the bug you described here with paypal standard
“Some people might experience problems with payment plugins. The problem we experienced is that the amounts are recalculated without VAT or shipping and then sent to the payment provider. This provides a mismatch in order amount and paid amount. “

Filed a bug report #20832

JS

 
Magento Community Magento Community
Magento Community
Magento Community
 
future500
Member
 
Avatar
Total Posts:  41
Joined:  2008-11-05
Netherlands
 

Excellent, that justifies quote a few hours of sleeplessness and hairpulling. I maintain the Cardgate payment gateway plugin and I’ve been tracing these seemingly random wrong amounts since thursday.. It was only when we realised the creation of a new account triggered it I could hunt this bug down. Many thanks to the folks at Cardgate.com for the hours of free support!

There is a workaround I posted in the bugreport, but I assume Varien wil solve this in the next update.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Anton Makarenko
Magento Team
 
Avatar
Total Posts:  184
Joined:  2008-05-13
Los Angeles, CA
 

I wish everyone reported such useful bugreports. Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Anton Makarenko
Magento Team
 
Avatar
Total Posts:  184
Joined:  2008-05-13
Los Angeles, CA
 

Both described issues are caused by usage of the quote after placing the order, while the order object can be used to get payment information, customer info etc. In Magento 1.3.x the quote was kind of “static”: from request to request it retained all data it had (PayPal Standard was relying on this logic as well).

In 1.4.x there was new totals model introduced: more different totals, more calculations. Eventually the quote got “dynamic” totals, that are kept only in memory, after collecting totals. Thus, on the “redirect” request these values are not accessible.

Unfortunately for the Cardgate payment module, it has to be re-designed to use the order and its satellite objects instead of quote. And the compatibility issue in PayPal Standard will be fixed, of course. (track the issue #20832 )

 
Magento Community Magento Community
Magento Community
Magento Community
 
future500
Member
 
Avatar
Total Posts:  41
Joined:  2008-11-05
Netherlands
 

Hi Anton,

Thanks for the reply and explanation. I would love to discuss this just a little more in-depth as some things don’t add up (in my head);

The quote remains perfectly intact when checking out as guest or using a logged in user. It is only on creation of a new user that this becomes a problem - specifically because the merge() function does not copy the “sales_flat_quote_payment” record, while it does copy the billing and shipping addresses. How does this have anything to do with dynamic quote totals?

We have extended the “sales_flat_quote_payment” table with extra columns to capture information from the customer during checkout. Have form objects named after your payment-module automatically saves this info in the database - but this information is never transferred to the “order” object - it stays in the quote. How do you propose I should modify the cardgate plugin to retrieve the extra information?

[assuming I should have an event observer to act when the quote is converted to an order, what evens are there to hook into...?]

Thanks in advance for any more time you spend helping me out with this..
(that would highly motivate me to keep writing extended bug reports)

Kind regards,

Ramon

 
Magento Community Magento Community
Magento Community
Magento Community
 
Anton Makarenko
Magento Team
 
Avatar
Total Posts:  184
Joined:  2008-05-13
Los Angeles, CA
 

Ramon, thanks for the reply.

future500 - 23 February 2010 12:14 AM

The quote remains perfectly intact when checking out as guest or using a logged in user. It is only on creation of a new user that this becomes a problem - specifically because the merge() function does not copy the “sales_flat_quote_payment” record, while it does copy the billing and shipping addresses. How does this have anything to do with dynamic quote totals?

You’re right, it has nothing to totals (the totals issue caused related issue #20832). The quote_payment object is one per quote and is supposed to be used during checkout only. It was never intended for usage somehow after order placement and/or quote merging. When the order is placed, the sales/quote_payment is converted into sales/order_payment. Thus you can use the latter object instead to get payment information.

future500 - 23 February 2010 12:14 AM

We have extended the “sales_flat_quote_payment” table with extra columns to capture information from the customer during checkout. Have form objects named after your payment-module automatically saves this info in the database - but this information is never transferred to the “order” object - it stays in the quote. How do you propose I should modify the cardgate plugin to retrieve the extra information?

Instead of adding columns to the sales_flat_quote_payment, try just utilize the “additional_information” column, that stores data as a serialized array. It is in both quote_payment and order_payment objecs, with appropriate setters/getters, see:
Mage_Payment_Model_Info::setAdditionalInformation()
Mage_Payment_Model_Info::getAdditionalInformation()
Mage_Payment_Model_Info::unsAdditionalInformation()
Mage_Payment_Model_Info::hasAdditionalInformation()

The additional_information works just fine for storing various payment data without mixing it with payment metadata (quote_id, created_at, updated_at etc) without headache how to store it and transfer between conversions from quote to order.

The Cardgate module can load the order, get the payment object by $order->getPayment() and get additional information using $order->getPayment()->getAdditionalInformation(’key’);

It is available in Magento 1.4.x
As examples, take a look at:
Mage_Paypal_Model_Express_Checkout::PAYMENT_INFO_TRANSPORT_TOKEN
Mage_Paypal_Model_Info::exportFromPayment()

 
Magento Community Magento Community
Magento Community
Magento Community
 
future500
Member
 
Avatar
Total Posts:  41
Joined:  2008-11-05
Netherlands
 

Hi Anton,

Thanks for the excellent answer. It’s taking me a little longer to reply because It is very busy at the moment, but I hugely appreciate your help.

I do, however, have another question:
I now have a plugin that works for 1.3.x, installable as F500_Cardgate. I would like to leave this intact, because there are quite a few people still on 1.3.2.4.

How can I update my plugin in such a way that only users with 1.4.x will receive the new version (the additional_information column does not exist pre-1.4)? Does the updater look at the compatibility field?

(it looks to me as if the magentoconnect plugin repository is only meant for upward development and not branching etc)

 
Magento Community Magento Community
Magento Community
Magento Community
 
phlux0r
Member
 
Avatar
Total Posts:  73
Joined:  2008-03-09
Auckland, New Zealand
 

@future500 why don’t you just create another Extension entry for your Cardgate module for M v1.4.x and leave the existing one for M 1.3.2.4

 
Magento Community Magento Community
Magento Community
Magento Community
 
Anton Makarenko
Magento Team
 
Avatar
Total Posts:  184
Joined:  2008-05-13
Los Angeles, CA
 

Hi Ramon.

future500 - 25 February 2010 11:51 AM

(the additional_information column does not exist pre-1.4)? Does the updater look at the compatibility field?

It was introduced in late beta versions of 1.4. Each module is responsible for updating its fields (as well each module is responsible for littering sales_flat_quote_payment with its columns). For PayPal we did this upgrade:
http://svn.magentocommerce.com/source/branches/1.4/app/code/core/Mage/Paypal/sql/paypal_setup/mysql4-upgrade-0.7.3-0.7.4.php
It moved data from columns into the serialized additional_information. If you write similar upgrade, make sure to not overwrite additional_information, that may already exist with other payment information.

 
Magento Community Magento Community
Magento Community
Magento Community
 
future500
Member
 
Avatar
Total Posts:  41
Joined:  2008-11-05
Netherlands
 

@phlux0r

That’s the obvious solution ofcorse, but I was just curious if there is in fact a mechanism in place that we don’t know about.
Creating a new plugin will give additional overhead I was hoping to avoid grin

 
Magento Community Magento Community
Magento Community
Magento Community
 
Kaptan
Jr. Member
 
Total Posts:  13
Joined:  2007-12-23
 

@future500
I’m very interested in your update for the CardGate module for Magento 1.4. I want to implement it on a brand new shop that runs on M 1.4.
Please let me know if you need a tester, or perhaps assistance with coding.

 
Magento Community Magento Community
Magento Community
Magento Community
 
future500
Member
 
Avatar
Total Posts:  41
Joined:  2008-11-05
Netherlands
 

Anton, thanks again for your assitance in this matter. I have removed my “clutter” from sales_flat_quote_payment wink and I am utilizing the new additional_information table.

@Kaptan If you are stil interested in helping out, there is a new plugin in beta state:
magento-community/F500_CardgateX

It conflicts with the ‘old’ plugin so if you have already installed that and the installer fails I could send you the zipfile. Any feedback would be usefull…

Regards,

Ramon

 
Magento Community Magento Community
Magento Community
Magento Community
 
Anton Makarenko
Magento Team
 
Avatar
Total Posts:  184
Joined:  2008-05-13
Los Angeles, CA
 
future500 - 01 March 2010 06:03 AM

It conflicts with the ‘old’ plugin so if you have already installed that and the installer fails I could send you the zipfile.

Can you put it somewhere for direct download? I’d review the SQL-upgrade.

 
Magento Community Magento Community
Magento Community
Magento Community
 
future500
Member
 
Avatar
Total Posts:  41
Joined:  2008-11-05
Netherlands
 

Honestly? There is no SQL upgrade included, I decided agains it.

The new columns where added a week before we encountered the 1.4 incompatibility; only to provide data to the payment gateway on redirect. I had postponed adding attributes (columns) to anything for as long as I could - and I am glad in 1.4 we can go back to utilizing what’s already there smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Anton Makarenko
Magento Team
 
Avatar
Total Posts:  184
Joined:  2008-05-13
Los Angeles, CA
 

Oh, that’s good. Less headache.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2