Forums › Forums › OroCommerce › How to offer partial payments
This topic contains 10 replies, has 2 voices, and was last updated by Mauro Chojrin 4 years, 11 months ago.
Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.
- CreatorTopic
- February 4, 2019 at 10:13 am #38065
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!
- CreatorTopic
- AuthorReplies
- February 4, 2019 at 10:45 am #38067
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.
February 4, 2019 at 11:07 am #38068Thanks 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?
February 4, 2019 at 12:21 pm #38069February 4, 2019 at 12:22 pm #38070> 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.February 19, 2019 at 8:21 am #38181Hi 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
February 19, 2019 at 8:35 am #38184I’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
February 19, 2019 at 9:24 am #38186Ok 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?
March 1, 2019 at 11:14 am #38258Hi:
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!
March 5, 2019 at 1:10 pm #38271– 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.
April 12, 2019 at 7:52 am #38529That’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.
- AuthorReplies
The forum ‘OroCommerce’ is closed to new topics and replies.