Closed (fixed)
Project:
Commerce Balance
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
4 Dec 2020 at 17:38 UTC
Updated:
11 Jan 2021 at 14:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
amateescu commentedHere's the code we implemented for a client, as a patch against the 7.x-1.x branch.
It contains the extra field (implemented as a computed field) on the Order entity type like the 7.x, and a few additional goodies:
- an additional computed field on the User entity type, which provides a list of orders assigned to that user that have a positive balance
- a custom formatter for the user's
commerce_balancefield above- a payment gateway which allows customers to complete the checkout process without creating a Payment entity for their order
I'd be happy to help maintain this module going forward, if you're looking for co-maintainers.
Comment #3
vensiresI have no reason to deny help when it’s so kindly proposed. I just added you as a maintainer. So... welcome! :-)
I’m not sure I would add the payment gateway in this module though.
Comment #4
amateescu commentedThanks for the swift reply and approval! :)
The reason for including the payment gateway in here is that we (various folks at Centarro) encountered the use-case of allowing a checkout to be completed without an immediate payment at least 3 times, and each time it was solved with the same custom code (an "empty" payment gateway) and surrounded with the other bits of functionality provided by the patch above, mainly the computed "user balance" field.
It's surely very easy to keep that payment gateway as project-specific code, but, on the other hand, there is no other code/module either in Commerce Core or Contrib that provides a gateway which doesn't create a payment entity during checkout.
Let me know if you agree with the above and I'll get started on the 8.x-1.x branch :)
Comment #5
vensiresI would say that this extra functionality should go in a different (sub)module but considering that if it goes in there it will most possibly get hidden and nobody will ever enable it, I would rather have it anyway.
Just to make this completely clear, you use this payment gateway like a D8 version of Commerce No Payment?
Comment #6
amateescu commentedYes, exactly!
Comment #7
vensiresGo on with it then, exactly as you have planned it :) We 'll just have to update the project page of the module.
Comment #8
amateescu commentedCool, I went ahead and started the D8/9 work in a semver 2.x branch, as instructed in https://www.drupal.org/node/3108648.
I also updated the project title and removed the "Field" part, since we're providing more than one extra field now.
I still need to update the project page to mentioned the new features provided in the 2.x branch.
Comment #9
vensiresWow, you 're blazingly fast ;) Have a happy new year and I'll be watching your progress 😉
Comment #10
amateescu commentedThanks, I hope you have a great new year as well!