Saggy
Total Posts: 121
Joined: 2009-02-03
Hi Guys,
Is there a simple way to save additional data against the payment or order which can be extracted during order export?
I want to save payment gateway response. Here is the data which I need to save -:
- AuthCode
- PayerAuthRequestID
- AuthResult
- EFTSN
N.B. - I don’t want to save in the debug table as protx or cybersource does.
Any help would be appreciated. Thanks in advance.
Cheers
S
Posted: April 28 2009
| top
Saggy
Total Posts: 121
Joined: 2009-02-03
Don’t worry guys. I found the answer. Thanks anyways
Posted: April 29 2009
| top
| # 1
gizmocreative
Total Posts: 6
Joined: 2009-01-16
Hi @Saggy,
Would you be so kind as to post a reference to your answer you found? I’d like to know the same…
Thanks,
Daniel
Posted: May 11 2009
| top
| # 2
Saggy
Total Posts: 121
Joined: 2009-02-03
gizmocreative - 11 May 2009 12:03 PM
Hi @Saggy,
Would you be so kind as to post a reference to your answer you found? I’d like to know the same…
Thanks,
Daniel
Hi Dan,
Here is the code to save additional data against payment array of order-:
$sAdditionalData = $this -> result ; //here you can save any string $order = Mage :: getModel ( 'sales/order' ); $order -> loadByIncrementId ( $this -> getOrderId ()); $payment = $order -> getPayment (); $payment -> setAdditionalData ( $sAdditionalData ) -> save ();
Here is the code to extract addtional data from payment array of order-:
$order = Mage :: getModel ( 'sales/order' ); $order -> loadByIncrementId ( $this -> getOrderId ()); $payment = $order -> getPayment (); $additonalData = $payment -> getData ( 'additional_data' )
Hope this will help.
Posted: May 12 2009
| top
| # 3
kiatng
Total Posts: 874
Joined: 2008-09-03
Kuala Lumpur, Malaysia
@Saggy
Thanks a lot for the code. After hours of trying different ways and deadends and messing with the DB table, this works:
$order -> setAdditionalData ( $sAdditionalData )-> save ();
This does not work:
$order -> setData ( 'additional_data' , $sAdditionalData ); //data will be lost outside execution scope $order -> save (); //runtime error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'additional_data' in 'field list'
Hope this will help others.
Posted: June 4 2009
| top
| # 4
Saggy
Total Posts: 121
Joined: 2009-02-03
No worries, I am glad it helped you.
Cheers
S
Posted: June 10 2009
| top
| # 5
writemcodeboy
Total Posts: 33
Joined: 2009-09-18
Hey Guys—to what DB table/column does setAdditionalData() save it too?
I cant find it anywhere and can not verify that I have it working.
Thank you!
Signature
writemcodeboy
Posted: September 29 2009
| top
| # 6
Saggy
Total Posts: 121
Joined: 2009-02-03
Hi Onionlips,
It should be there in order text table. You need to make sure that you have selected the tick box to show all rows (if using sqlyog).
Cheers
S
Posted: September 30 2009
| top
| # 7
writemcodeboy
Total Posts: 33
Joined: 2009-09-18
@Saggy. Thank you for the direction!
Using:
$payment->setAdditionalData(serialize($myAdditionalArray));
I found it:
TABLE: sales_order_entity_text
COLUMN: value
Signature
writemcodeboy
Posted: October 13 2009
| top
| # 8
Reager
Total Posts: 20
Joined: 2009-10-22
Hi.
Im new to Magento and I would like to know how to get this working. In which file should/could this be used?
BR
D
Posted: November 3 2009
| top
| # 9
KhurramAziz
Total Posts: 2
Joined: 2010-03-30
Hi all
Has anyone dealt with a problem to make Magento substract the inventory from stock not after order placement but after successfull paypal payment?
This is an imporatnt feature for stores which sell hand made and one-off products. Sometimes a visitor goes through the checkout process just for testing or playing around and will not make payment but the product goes sold out anyway.
I would be grateful for any tips on the topic.
Take care
BLACKBULL_316
Total Posts: 35
Joined: 2010-04-20
India
Hi I am newbie to magento..Please provide a step by step to perform the funtionality(ave additional data against payment array of order-: ).
where to use all these code means which fiel??
gardenxl
Total Posts: 2
Joined: 2012-01-06
Could a bit more of a hint be provided here? I need to store the same information but have no idea which file(s) to edit to achieve this.
kiatng
Total Posts: 874
Joined: 2008-09-03
Kuala Lumpur, Malaysia
The code will work in any file. So it depends on when and where the info is available. For example, you can setup an observer on the payment module and put the code there or you can write your own payment module and when the payment gateway returns some info, you can use the codes to store the info.