OroCommerce Forums

Covering OroCommerce topics, including community updates and company announcements.

Forums OroCommerce How to offer partial payments

This topic contains 10 replies, has 2 voices, and was last updated by  Mauro Chojrin 6 months, 1 week ago.

  • Creator
    Topic
  • #38065

    Mauro Chojrin
    Participant

    Hi:

    I need to implement a slightly more complex payment workflow than usual. Clients should be able to pay for their orders through multiple payment instances (And I should know which ones are fully paid and which are not).

    I guess it should work a little like “Net 30” (In the sense that the products will be delivered before the purchase is actually paid).

    Any suggestion as to how to go about it?

    Thanks!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Author
    Replies
  • #38067
    Michael
    Michael
    Keymaster

    Hi Mauro,

    OroCommerce supports multiple payment transactions per order.

    You can take a look at any existing payment method to see how they work with payment transactions in general. Your payment method will most likely create an initial payment transaction to record the fact, that the payment is pending, and then each subquent payment will add additional transactions for the actual payments until the order is paid in full.

    Here is how the order payment statuses are calculated based on those multiple payment transactions – https://github.com/oroinc/orocommerce/blob/3.1.1/src/Oro/Bundle/PaymentBundle/Provider/PaymentStatusProvider.php#L53-L78, hopefully it will give you a good idea what kind of payment transactions and when your payment method should create.

    #38068

    Mauro Chojrin
    Participant

    Thanks Michael, that’s great!

    I see you’re pointing me to branch 3.1… is this feature a recent addition? I’m currently on 1.6.

    Following up on this: how can an admin user record a new payment for an existing order?

    #38069
    Michael
    Michael
    Keymaster
    #38070
    Michael
    Michael
    Keymaster

    > how can an admin user record a new payment for an existing order?

    It depends on how you want them to do it.
    You may implement an “action” (button) for the payment transactions grid on the order view page.

    #38181

    Mauro Chojrin
    Participant

    Hi Michael:

    Thanks for your suggestions. I’m going through the documentation on payment methods right now :)

    In the meantime, can you give a little more detail on how to implement such an “action”?

    Thanks

    #38184

    Mauro Chojrin
    Participant

    I’m taking the conversation from here to this thread.

    From what I understood from what Yehven commented, I should create my own class that implements Oro\Bundle\PaymentBundle\Provider\PaymentStatusProviderInterface into a bundle of my own, is this correct?

    Let’s say I have that class created (Which will look very much like Oro\Bundle\PaymentBundle\Provider\PaymentStatusProviderCode here).

    How would I connect this class to the payment method? In fact, I don’t have any payment methods… the only way to pay for the purchases at the moment is with Cash On Delivery (A payment term).

    Thanks

    #38186

    Mauro Chojrin
    Participant

    Ok so I created a new workflow for this and it seems to be what I want to do but I’m not entirely sure what entity I should be using…

    When I chose “Magento Order” nothing seemed to happen, but when I changed it to “Order” I could see the labels of the transitions I created.

    The way I see it, it should be a really simple workflow:

    – Show every order which is not fully paid
    – On click of “Add payment” show a popup to enter the amount being paid
    – Create a new payment transaction with it
    – If payment = order total mark order as fully paid.

    Am I going in the right direction?

    #38258

    Mauro Chojrin
    Participant

    Hi:

    I don’t know why this thread was marked as solved (Perhaps I did it by mistake) but I definitely could use some help over here :p

    Thanks!

    #38271
    Michael
    Michael
    Keymaster

    – Show every order which is not fully paid
    – On click of “Add payment” show a popup to enter the amount being paid
    – Create a new payment transaction with it
    – If payment = order total mark order as fully paid.

    Am I going in the right direction?

    Yes, it looks like the right way to go.

    #38529

    Mauro Chojrin
    Participant

    That’s exactly what I ended up doing (Haven’t finished the part about changing the payment status yet).

    For anyone interested in doing anything like this, what you want to look at is creating custom actions.

    There’s a particularly interesting thread about this here as well.

Viewing 10 replies - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.

You will be redirected to [title]. Would you like to continue?

Yes No