0

I'm working to an extension that needs to push to an external service every order and refund that happens on the shop. One of the needed infos it needs to pass is the payment date - and for the life of me I can't find it, neither in the payment class nor in the order class: https://www.magentoextensions.org/documentation/class_magento_1_1_sales_1_1_model_1_1_order_1_1_payment.html https://www.magentoextensions.org/documentation/interface_magento_1_1_sales_1_1_api_1_1_data_1_1_order_interface.html

Does someone know how to retrieve this information? Shippings and Orders have the getCreatedAt() method, but I don't find it for Payments, nor do I find anything similar, though it occurs to me as a basic info that should be available.

Thanks everyone!

EDIT: here the column names of the table sales_order_payment

mysql> select * from sales_order_payment; +-----------+-----------+------------------------+-------------------+-----------------+------------------+-----------------+------------------------+-------------------------+-----------------------------+----------------------+-----------------+-------------+-------------------+---------------------+------------------------+-------------------+----------------------+----------------+----------------------+------------------+-----------------+--------------+------------------+------------------+---------+-----------------------+------------------+------------------------+-------------+-----------+-----------------------+-------------+------------------------------+-------------------+---------------------+---------------+---------------+----------+---------+-----------+-------------+-----------+-----------------------+----------------+-------------------+------------------------+-------------+---------------------+---------------+---------------+-------------+----------------+-----------------------------------------+ | entity_id | parent_id | base_shipping_captured | shipping_captured | amount_refunded | base_amount_paid | amount_canceled | base_amount_authorized | base_amount_paid_online | base_amount_refunded_online | base_shipping_amount | shipping_amount | amount_paid | amount_authorized | base_amount_ordered | base_shipping_refunded | shipping_refunded | base_amount_refunded | amount_ordered | base_amount_canceled | quote_payment_id | additional_data | cc_exp_month | cc_ss_start_year | echeck_bank_name | method | cc_debug_request_body | cc_secure_verify | protection_eligibility | cc_approval | cc_last_4 | cc_status_description | echeck_type | cc_debug_response_serialized | cc_ss_start_month | echeck_account_type | last_trans_id | cc_cid_status | cc_owner | cc_type | po_number | cc_exp_year | cc_status | echeck_routing_number | account_status | anet_trans_method | cc_debug_response_body | cc_ss_issue | echeck_account_name | cc_avs_status | cc_number_enc | cc_trans_id | address_status | additional_information

0

One idea is to check if you can take the 'created_at' from the sales_payment_transaction table as reference.

4
  • Hi Diana, thanks for your answer - apparently there's no created_at field in that table. May 11 at 16:54
  • hmmm, that's weird. can you please tell me which Magento version and edition are you using? May 12 at 8:01
  • Magento CLI dev-2.4-develop. Cloned from GitHub less than a month ago. May 12 at 13:53
  • Wait, I made a mistake: sales_payment_transaction is completely empty (Empty set). I pasted above sales_order_payment 's columns. May 12 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.