Showing results for 
Search instead for 
Did you mean: 

How to export Payment Information for each order?

How to export Payment Information for each order?

for example How can I export Payment Information for last 2 months orders? if I export orders it shows everything but the most important part the "Payment Information!!" clients have an email for their account but they might use another to pay with paypal.  I need to know their last 4 digits of credit card to confirm am refunding to the exact order and to have everything organized.


How something so simple is not standard? export orders> ok  you all the order information in csv but not the payment method.... nice.


Help how can this be done?




Re: How to export Payment Information for each order?

you can create a MySQL Query and save/export the information in CSV  

SELECT so.entity_id, 
       Json_extract(sop.additional_information, '$.paypal_payer_email') AS 
FROM   sales_order AS so 
       JOIN sales_order_payment AS sop 
         ON so.entity_id = sop.parent_id 
WHERE  so.created_at >= Date(Now()) - INTERVAL 2 month 
       AND sop.method = "paypal_express" 

here you can add or modify additional keys that are available in additional_information for payment. 


also, you can create a button on the order grid and a controller in which you can export a CSV file with these fields.