ssossossosso

Forums

Covering OroCommerce topics, B2B eCommerce trends, community updates and company announcements.

This topic contains 4 replies, has 2 voices, and was last updated by  Tyler 1 month ago.

  • Creator
    Topic
  • #4659

    Tyler
    Participant

    Hi !
    How to get the payment status of an order ?

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #4742

    Dmitriy Pasechnik
    Participant

    Hello Tyler.

    If you want to see payment status of an order via web interface – then you can see it in product`s view page (e.g. /admin/order/view/1, or Admin -> sales -> orders -> view order -> ‘Payment status’ in ‘general’ section)

    Or, if you want to get it in code, then you should use
    \Oro\Bundle\PaymentBundle\Provider\PaymentStatusProvider::getPaymentStatus($order)
    method

    #4744

    Tyler
    Participant

    Hi Dmitriy,

    Yes I know this method 🙂
    But with this method I have to loop on each orders to know the payment status.
    Or there is another way to search my orders by payment status into the code ?

    I want to explose as API my all order by payment status like a search.
    I want to request my order like orderByPaymentStatus($status), then the code return the orders with the status given.
    Is it possible ?
    I saw the table payement_status doesnt have relation with others tables, but the entity_class is referer.
    Have I to make a custom request between both tables ?
    Like

    • This reply was modified 1 month ago by  Tyler.
    #4746

    Dmitriy Pasechnik
    Participant

    Yes, you have to make custom query. But it would be better to do DQL query instead of SQL (to get array of ‘Order’ entities instead of array of … arrays :))
    Something like this:

    #4754

    Tyler
    Participant

    Haha, of course.
    I made a Subquery and It works.

    Sorry, I was sure we could not use the joins without a foreign key…
    I will try your solution know 🙂

    Thx.

    • This reply was modified 1 month ago by  Tyler.
Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.